Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Christian Willms
hfc
Commits
197fe737
Commit
197fe737
authored
May 08, 2018
by
Christian Willms
Browse files
basic test for unicodes
parent
fba44421
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/test/data/ReadTest/testUnicodes.nt
0 → 100644
View file @
197fe737
<test:a1> <test:value> "\u0048\u0065\u006C\u006C\u006F foo"^^<xsd:string> .
src/test/java/de/dfki/lt/hfc/TupleStoreTest.java
View file @
197fe737
...
...
@@ -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
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment