You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commonsrdf.apache.org by wi...@apache.org on 2015/03/27 19:15:20 UTC

[22/50] [abbrv] incubator-commonsrdf git commit: with:colon now only checks that ntriplesString is not invalid. It's allowed to bail out early with an IllegalArgumentException.

with:colon now only checks that ntriplesString is not invalid.
It's allowed to bail out early with an IllegalArgumentException.

Project: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/commit/804bbd67
Tree: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/tree/804bbd67
Diff: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/diff/804bbd67

Branch: refs/heads/master
Commit: 804bbd67379bbd34bb4f190b5b76308bb55599dc
Parents: d2a7bf0
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Mon Jan 26 10:27:23 2015 +0000
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Mon Jan 26 10:27:23 2015 +0000

----------------------------------------------------------------------
 .../commonsrdf/api/AbstractRDFTermFactoryTest.java     | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/804bbd67/api/src/test/java/com/github/commonsrdf/api/AbstractRDFTermFactoryTest.java
----------------------------------------------------------------------
diff --git a/api/src/test/java/com/github/commonsrdf/api/AbstractRDFTermFactoryTest.java b/api/src/test/java/com/github/commonsrdf/api/AbstractRDFTermFactoryTest.java
index a4215c9..d73dffe 100644
--- a/api/src/test/java/com/github/commonsrdf/api/AbstractRDFTermFactoryTest.java
+++ b/api/src/test/java/com/github/commonsrdf/api/AbstractRDFTermFactoryTest.java
@@ -337,15 +337,22 @@ public abstract class AbstractRDFTermFactoryTest {
 		factory = createFactory();
 	}
 
-	@Test(expected = Exception.class)
-	public void invalidBlankNode() throws Exception {
+	@Test
+	public void possiblyInvalidBlankNode() throws Exception {		
+		BlankNode withColon;
 		try {
-			factory.createBlankNode("with:colon").ntriplesString();
+			withColon = factory.createBlankNode("with:colon");
 		} catch (UnsupportedOperationException ex) {
 			Assume.assumeNoException("createBlankNode(String) not supported",
 					ex);
 			return;
+		} catch (IllegalArgumentException ex){			
+			// Good!
+			return;
 		}
+		// Factory allows :colon, which is OK as long as it's not causing an
+		// invalid ntriplesString
+		assertFalse(withColon.ntriplesString().contains("with:colon"));		
 	}
 
 	@Test(expected = IllegalArgumentException.class)