Commit 197fe737 authored by Christian Willms's avatar Christian Willms
Browse files

basic test for unicodes

parent fba44421
<test:a1> <test:value> "\u0048\u0065\u006C\u006C\u006F foo"^^<xsd:string> .
......@@ -7,6 +7,7 @@ import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import com.sun.org.apache.xerces.internal.util.SynchronizedSymbolTable;
import org.junit.Assert;
import org.junit.Test;
......@@ -190,7 +191,8 @@ public class TupleStoreTest {
TupleStore objectToTest = new TupleStore(1,1);
objectToTest.readTuples(getTestResource("ReadTest", "testAtoms.nt"));
assertEquals("Expected 10 atoms but was " + objectToTest.getAllTuples().size(), 10, objectToTest.getAllTuples().size());
assertEquals("Expected 10 tuples but was " + objectToTest.getAllTuples().size(),
10, objectToTest.getAllTuples().size());
String[][] expected = {
{ "\"foo\"^^<xsd:string>" },
{ "\"fo\\o\"^^<xsd:string>" },
......@@ -208,6 +210,21 @@ public class TupleStoreTest {
checkResult(expected, bt, "?o");
}
@Test
public void testUnicodeHandling() throws IOException, WrongFormatException, QueryParseException {
TupleStore objectToTest = new TupleStore(1,1);
objectToTest.readTuples(getTestResource("ReadTest", "testUnicodes.nt"));
assertEquals("expected 10 tuples but was " + objectToTest.getAllTuples().size(),
1, objectToTest.getAllTuples().size());
String[][] expected = {
{"\"Hello foo\"^^<xsd:string>"}
};
Query q = new Query(objectToTest);
BindingTable bt = q.query("SELECT ?o WHERE ?s <test:value> ?o");
checkResult(expected, bt, "?o");
}
@Test
public void testinternalizeTuple1() {
TupleStore objectfortest = new TupleStore(4, 2);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment