Skip to content

Commit 65591dc

Browse files
committed
fix #202--test was failing with maven (though not with eclipse). The problem is the test needed to be explicit about charset.
1 parent 12ecdfd commit 65591dc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/test/java/com/marklogic/client/test/HandleAccessorTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.io.StringReader;
2323
import java.net.URISyntaxException;
2424
import java.net.URL;
25+
import java.nio.charset.Charset;
2526

2627
import org.junit.Test;
2728

@@ -37,10 +38,11 @@ public void testContentAsString() throws URISyntaxException, IOException {
3738
// I'm purposely using a string with a non-ascii character to test
3839
// charset issues
3940
String hola = "¡Hola!";
41+
System.out.println("Default Java Charset: " + Charset.defaultCharset());
4042
assertEquals("String content mismatch", hola,
4143
HandleAccessor.contentAsString(new StringHandle(hola)));
4244
assertEquals("byte[] content mismatch", hola,
43-
HandleAccessor.contentAsString(new BytesHandle(hola.getBytes())));
45+
HandleAccessor.contentAsString(new BytesHandle(hola.getBytes("UTF-8"))));
4446
URL filePath = this.getClass().getClassLoader().getResource("hola.txt");
4547
assertEquals("Reader content mismatch", hola,
4648
HandleAccessor.contentAsString(new ReaderHandle(new StringReader(hola))));

0 commit comments

Comments
 (0)