You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by rv...@apache.org on 2014/09/10 17:10:41 UTC
svn commit: r1624023 -
/jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/thrift/TestThriftTerm.java
Author: rvesse
Date: Wed Sep 10 15:10:41 2014
New Revision: 1624023
URL: http://svn.apache.org/r1624023
Log:
Further tests for ThriftConvert
Modified:
jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/thrift/TestThriftTerm.java
Modified: jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/thrift/TestThriftTerm.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/thrift/TestThriftTerm.java?rev=1624023&r1=1624022&r2=1624023&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/thrift/TestThriftTerm.java (original)
+++ jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/thrift/TestThriftTerm.java Wed Sep 10 15:10:41 2014
@@ -222,8 +222,10 @@ public class TestThriftTerm extends Base
private RDF_Term testTerm(Node node, PrefixMap pmap, boolean asValue) {
RDF_Term rt = ThriftConvert.convert(node, pmap, asValue) ;
assertTrue(rt.isSet()) ;
-
- if ( node.isURI() ) {
+
+ if ( node == null) {
+ assertTrue(rt.isSetUndefined());
+ } else if ( node.isURI() ) {
assertTrue(rt.isSetIri() || rt.isSetPrefixName() ) ;
if ( rt.isSetIri() ) {
RDF_IRI iri = rt.getIri() ;
@@ -240,8 +242,7 @@ public class TestThriftTerm extends Base
// Nothing specific to check.
// And not reversible.
return rt ;
- }
- else if ( node.isLiteral() ) {
+ } else if ( node.isLiteral() ) {
assertTrue(rt.isSetLiteral()) ;
RDF_Literal lit = rt.getLiteral() ;
assertTrue(lit.isSetLex()) ;
@@ -279,5 +280,17 @@ public class TestThriftTerm extends Base
Node n = ThriftConvert.convert(rt) ;
assertNull(n) ;
}
+
+ @Test public void round_trip_01() {
+ testTerm(null, null, false);
+ }
+
+ @Test public void round_trip_02() {
+ testTerm(Node.ANY, null, false);
+ }
+
+ @Test public void round_trip_03() {
+ testTerm(NodeFactory.createVariable("x"), null, false);
+ }
}