jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cla...@apache.org
Subject svn commit: r1555482 [2/6] - in /jena/Experimental/new-test: ./ src/test/java/ src/test/java/com/hp/hpl/jena/graph/ src/test/java/com/hp/hpl/jena/graph/compose/ src/test/java/com/hp/hpl/jena/graph/impl/ src/test/java/com/hp/hpl/jena/mem/ src/test/java/...
Date Sun, 05 Jan 2014 11:28:05 GMT
Modified: jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/graph/impl/FileGraphMakerTest.java
URL: http://svn.apache.org/viewvc/jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/graph/impl/FileGraphMakerTest.java?rev=1555482&r1=1555481&r2=1555482&view=diff
==============================================================================
--- jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/graph/impl/FileGraphMakerTest.java (original)
+++ jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/graph/impl/FileGraphMakerTest.java Sun Jan  5 11:28:03 2014
@@ -23,11 +23,11 @@ import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.List;
 
-import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.xenei.junit.contract.Contract;
 import org.xenei.junit.contract.ContractImpl;
 import org.xenei.junit.contract.ContractSuite;
+import org.xenei.junit.contract.ContractTest;
 
 import static org.junit.Assert.*;
 import static com.hp.hpl.jena.testing_framework.GraphHelper.*;
@@ -75,7 +75,7 @@ public class FileGraphMakerTest {
 		return producer;
 	}
 
-	@Test
+	@ContractTest
 	public void testToFilename() {
 		assertEquals("plain", FileGraphMaker.toFilename("plain"));
 		assertEquals("with_Sslash", FileGraphMaker.toFilename("with/slash"));
@@ -88,7 +88,7 @@ public class FileGraphMakerTest {
 				FileGraphMaker.toFilename("with/a:mixture_..."));
 	}
 
-	@Test
+	@ContractTest
 	public void testToGraphname() {
 		assertEquals("plain", FileGraphMaker.toGraphname("plain"));
 		assertEquals("with/slash", FileGraphMaker.toGraphname("with_Sslash"));
@@ -101,7 +101,7 @@ public class FileGraphMakerTest {
 				FileGraphMaker.toGraphname("with_Stwo_Sslashes"));
 	}
 
-	@Test
+	@ContractTest
 	public void testDetectsExistingFiles() {
 		File scratch = FileUtils
 				.getScratchDirectory("jena-test-FileGraphMaker-already");
@@ -118,7 +118,7 @@ public class FileGraphMakerTest {
 		gA.delete();
 	}
 
-	@Test
+	@ContractTest
 	public void testDeletesFilesOfClosedMaker() {
 		File scratch = FileUtils
 				.getScratchDirectory("jena-test-FileGraphMaker-forgets");
@@ -131,7 +131,7 @@ public class FileGraphMakerTest {
 				new File(scratch, "empty").exists());
 	}
 
-	@Test
+	@ContractTest
 	public void testForgetsClosedGraphs() {
 		File scratch = FileUtils
 				.getScratchDirectory("jena-test-FileGraphMaker-forgets");
@@ -141,7 +141,7 @@ public class FileGraphMakerTest {
 		m.close();
 	}
 
-	@Test
+	@ContractTest
 	public void testDoesntReusedClosedGraphs() {
 		File scratch = FileUtils
 				.getScratchDirectory("jena-test-FileGraphMaker-noReuse");

Modified: jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/graph/impl/FileGraphSuite.java
URL: http://svn.apache.org/viewvc/jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/graph/impl/FileGraphSuite.java?rev=1555482&r1=1555481&r2=1555482&view=diff
==============================================================================
--- jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/graph/impl/FileGraphSuite.java (original)
+++ jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/graph/impl/FileGraphSuite.java Sun Jan  5 11:28:03 2014
@@ -267,4 +267,4 @@ package com.hp.hpl.jena.graph.impl;
 //		}
 //	}
 //
-//}
+// }

Modified: jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/graph/impl/FileGraphTest.java
URL: http://svn.apache.org/viewvc/jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/graph/impl/FileGraphTest.java?rev=1555482&r1=1555481&r2=1555482&view=diff
==============================================================================
--- jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/graph/impl/FileGraphTest.java (original)
+++ jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/graph/impl/FileGraphTest.java Sun Jan  5 11:28:03 2014
@@ -1,22 +1,24 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.hp.hpl.jena.graph.impl;
+///*
+// * Licensed to the Apache Software Foundation (ASF) under one
+// * or more contributor license agreements.  See the NOTICE file
+// * distributed with this work for additional information
+// * regarding copyright ownership.  The ASF licenses this file
+// * to you under the Apache License, Version 2.0 (the
+// * "License"); you may not use this file except in compliance
+// * with the License.  You may obtain a copy of the License at
+// *
+// *     http://www.apache.org/licenses/LICENSE-2.0
+// *
+// * Unless required by applicable law or agreed to in writing, software
+// * distributed under the License is distributed on an "AS IS" BASIS,
+// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// * See the License for the specific language governing permissions and
+// * limitations under the License.
+// */
+//
+//package com.hp.hpl.jena.graph.impl;
+//
+//import java.io.File;
 //
 //import org.junit.runner.RunWith;
 //import org.xenei.junit.contract.ContractImpl;
@@ -25,6 +27,10 @@ package com.hp.hpl.jena.graph.impl;
 //
 //import org.xenei.junit.contract.IProducer;
 //
+//import com.hp.hpl.jena.graph.Graph;
+//import com.hp.hpl.jena.testing_framework.AbstractGraphProducer;
+//import com.hp.hpl.jena.util.FileUtils;
+//
 ///**
 // * Test FileGraph by seeing if we can make some file graphs and then read them
 // * back.
@@ -33,7 +39,7 @@ package com.hp.hpl.jena.graph.impl;
 //@ContractImpl(FileGraph.class)
 //public class FileGraphTest {
 //
-//	protected IProducer<FileGraph> graphProducer = new FileGraphSuite.GraphProducer();
+//	protected IProducer<FileGraph> graphProducer = new GraphProducer();
 //
 //	@Inject
 //	public IProducer<FileGraph> getGraphProducer() {
@@ -41,145 +47,182 @@ package com.hp.hpl.jena.graph.impl;
 //	}
 //
 //	
-//	 // TODO want a wider variety of cases, now we've discovered how to
-//	 abstract.
-//	 public static TestSuite suite() {
-//	 TestSuite result = new TestSuite(FileGraphTestSuite.class);
-//	 result.addTest(new Case("x /R y", "xxxA", ".rdf"));
-//	 result.addTest(new Case("x /R y", "xxxB", ".n3"));
-//	 result.addTest(new Case("x /R y", "xxxC", ".nt"));
-//	 result.addTest(new Case("x /R y; p /R q", "xxxD", ".rdf"));
-//	 result.addTest(new Case("x /R y; p /R q", "xxxE", ".n3"));
-//	 result.addTest(new Case("x /R y; p /R q", "xxxF", ".nt"));
-//	 result.addTest(new Case("http://domain/S ftp:ftp/P O", "xxxG", ".rdf"));
-//	 result.addTest(new Case("http://domain/S ftp:ftp/P O", "xxxH", ".nt"));
-//	 result.addTest(new Case("http://domain/S ftp:ftp/P O", "xxxI", ".n3"));
-//	 return result;
-//	 }
-//	
-//	 public void testPlausibleGraphname() {
-//	 assertTrue(FileGraph.isPlausibleGraphName("agnessi.rdf"));
-//	 assertTrue(FileGraph.isPlausibleGraphName("parabola.nt"));
-//	 assertTrue(FileGraph.isPlausibleGraphName("hyperbola.n3"));
-//	 assertTrue(FileGraph.isPlausibleGraphName("chris.dollin.n3"));
-//	 assertTrue(FileGraph.isPlausibleGraphName("hedgehog.spine.end.rdf"));
-//	 }
-//	
-//	 public void testisPlausibleUppercaseGraphname() {
-//	 assertTrue(FileGraph.isPlausibleGraphName("LOUDER.RDF"));
-//	 assertTrue(FileGraph.isPlausibleGraphName("BRIDGE.NT"));
-//	 assertTrue(FileGraph.isPlausibleGraphName("NOTN2.N3"));
-//	 assertTrue(FileGraph.isPlausibleGraphName("chris.dollin.N3"));
-//	 assertTrue(FileGraph.isPlausibleGraphName("hedgehog.spine.end.RDF"));
-//	 }
-//	
-//	 public void testImPlausibleGraphName() {
-//	 assertFalse(FileGraph.isPlausibleGraphName("undecorated"));
-//	 assertFalse(FileGraph.isPlausibleGraphName("danger.exe"));
-//	 assertFalse(FileGraph.isPlausibleGraphName("pretty.jpg"));
-//	 assertFalse(FileGraph.isPlausibleGraphName("FileGraph.java"));
-//	 assertFalse(FileGraph.isPlausibleGraphName("infix.rdf.c"));
-//	 }
-//	
-//	 public void testTransactionCommit() {
-//	 Graph initial = graphWithTxn("initial hasValue 42; also hasURI hello");
-//	 Graph extra = graphWithTxn("extra hasValue 17; also hasURI world");
-//	 File foo = FileUtils.tempFileName("fileGraph", ".nt");
-//	
-//	 Graph g = new FileGraph(foo, true, true);
-//	 GraphUtil.addInto(g, initial);
-//	 g.getTransactionHandler().begin();
-//	 GraphUtil.addInto(g, extra);
-//	 g.getTransactionHandler().commit();
-//	 Graph union = graphWithTxn("");
-//	 GraphUtil.addInto(union, initial);
-//	 GraphUtil.addInto(union, extra);
-//	 assertIsomorphic(union, g);
-//	 Model inFile = ModelFactory.createDefaultModel();
-//	 inFile.read("file:///" + foo, "N-TRIPLES");
-//	 assertIsomorphic(union, inFile.getGraph());
-//	 }
-//	
-//	 public void testTransactionAbort() {
-//	 Graph initial = graphWithTxn("initial hasValue 42; also hasURI hello");
-//	 Graph extra = graphWithTxn("extra hasValue 17; also hasURI world");
-//	 File foo = FileUtils.tempFileName("fileGraph", ".n3");
-//	 Graph g = new FileGraph(foo, true, true);
-//	 GraphUtil.addInto(g, initial);
-//	 g.getTransactionHandler().begin();
-//	 GraphUtil.addInto(g, extra);
-//	 g.getTransactionHandler().abort();
-//	 assertIsomorphic(initial, g);
-//	 }
-//	
-//	 public void testTransactionCommitThenAbort() {
-//	 Graph initial = graphWithTxn("Foo pings B; B pings C");
-//	 Graph extra = graphWithTxn("C pingedBy B; fileGraph rdf:type Graph");
-//	 File foo = FileUtils.tempFileName("fileGraph", ".nt");
-//	 Graph g = new FileGraph(foo, true, true);
-//	 g.getTransactionHandler().begin();
-//	 GraphUtil.addInto(g, initial);
-//	 g.getTransactionHandler().commit();
-//	 g.getTransactionHandler().begin();
-//	 GraphUtil.addInto(g, extra);
-//	 g.getTransactionHandler().abort();
-//	 assertIsomorphic(initial, g);
-//	 Model inFile = ModelFactory.createDefaultModel();
-//	 inFile.read("file:///" + foo, "N-TRIPLES");
-//	 assertIsomorphic(initial, inFile.getGraph());
-//	 }
-//	
-//	 public void testClosingNotifys() {
-//	 final List<File> history = new ArrayList<File>();
-//	 FileGraph.NotifyOnClose n = new FileGraph.NotifyOnClose() {
-//	 @Override
-//	 public void notifyClosed(File f) {
-//	 history.add(f);
-//	 }
-//	 };
-//	 File file = FileUtils.tempFileName("fileGraph", ".nt");
-//	 Graph g = new FileGraph(n, file, true, true);
-//	 assertEquals(new ArrayList<File>(), history);
-//	 g.close();
-//	 assertEquals(oneElementList(file), history);
-//	 }
-//	
-//	 protected List<Object> oneElementList(Object x) {
-//	 List<Object> result = new ArrayList<Object>();
-//	 result.add(x);
-//	 return result;
-//	 }
-//	
-//	 /**
-//	 * Test that the graph encoded as the test-string content can be written
-//	 out
-//	 * to a temporary file generated from the prefix and suffix, and then read
-//	 * back correctly. The temporary files are marked as delete-on-exit to try
-//	 * and avoid cluttering the user's filespace ...
-//	 */
-//	 private static class Case extends FileGraphTestSuite {
-//	 String content;
-//	 String prefix;
-//	 String suffix;
-//	
-//	 Case(String content, String prefix, String suffix) {
-//	 super("Case: " + content + " in " + prefix + "*" + suffix);
-//	 this.content = content;
-//	 this.prefix = prefix;
-//	 this.suffix = suffix;
-//	 }
-//	
-//	 @Override
-//	 public void runTest() {
-//	 File foo = FileUtils.tempFileName(prefix, suffix);
-//	 Graph original = graphWithTxn(content);
-//	 Graph g = new FileGraph(foo, true, true);
-//	 GraphUtil.addInto(g, original);
-//	 g.close();
-//	 Graph g2 = new FileGraph(foo, false, true);
-//	 assertIsomorphic(original, g2);
-//	 g2.close();
-//	 }
-//	 }
-//
-//}
+////	 // TODO want a wider variety of cases, now we've discovered how to
+////	 abstract.
+////	 public static TestSuite suite() {
+////	 TestSuite result = new TestSuite(FileGraphTestSuite.class);
+////	 result.addTest(new Case("x /R y", "xxxA", ".rdf"));
+////	 result.addTest(new Case("x /R y", "xxxB", ".n3"));
+////	 result.addTest(new Case("x /R y", "xxxC", ".nt"));
+////	 result.addTest(new Case("x /R y; p /R q", "xxxD", ".rdf"));
+////	 result.addTest(new Case("x /R y; p /R q", "xxxE", ".n3"));
+////	 result.addTest(new Case("x /R y; p /R q", "xxxF", ".nt"));
+////	 result.addTest(new Case("http://domain/S ftp:ftp/P O", "xxxG", ".rdf"));
+////	 result.addTest(new Case("http://domain/S ftp:ftp/P O", "xxxH", ".nt"));
+////	 result.addTest(new Case("http://domain/S ftp:ftp/P O", "xxxI", ".n3"));
+////	 return result;
+////	 }
+////	
+////	 public void testPlausibleGraphname() {
+////	 assertTrue(FileGraph.isPlausibleGraphName("agnessi.rdf"));
+////	 assertTrue(FileGraph.isPlausibleGraphName("parabola.nt"));
+////	 assertTrue(FileGraph.isPlausibleGraphName("hyperbola.n3"));
+////	 assertTrue(FileGraph.isPlausibleGraphName("chris.dollin.n3"));
+////	 assertTrue(FileGraph.isPlausibleGraphName("hedgehog.spine.end.rdf"));
+////	 }
+////	
+////	 public void testisPlausibleUppercaseGraphname() {
+////	 assertTrue(FileGraph.isPlausibleGraphName("LOUDER.RDF"));
+////	 assertTrue(FileGraph.isPlausibleGraphName("BRIDGE.NT"));
+////	 assertTrue(FileGraph.isPlausibleGraphName("NOTN2.N3"));
+////	 assertTrue(FileGraph.isPlausibleGraphName("chris.dollin.N3"));
+////	 assertTrue(FileGraph.isPlausibleGraphName("hedgehog.spine.end.RDF"));
+////	 }
+////	
+////	 public void testImPlausibleGraphName() {
+////	 assertFalse(FileGraph.isPlausibleGraphName("undecorated"));
+////	 assertFalse(FileGraph.isPlausibleGraphName("danger.exe"));
+////	 assertFalse(FileGraph.isPlausibleGraphName("pretty.jpg"));
+////	 assertFalse(FileGraph.isPlausibleGraphName("FileGraph.java"));
+////	 assertFalse(FileGraph.isPlausibleGraphName("infix.rdf.c"));
+////	 }
+////	
+////	 public void testTransactionCommit() {
+////	 Graph initial = graphWithTxn("initial hasValue 42; also hasURI hello");
+////	 Graph extra = graphWithTxn("extra hasValue 17; also hasURI world");
+////	 File foo = FileUtils.tempFileName("fileGraph", ".nt");
+////	
+////	 Graph g = new FileGraph(foo, true, true);
+////	 GraphUtil.addInto(g, initial);
+////	 g.getTransactionHandler().begin();
+////	 GraphUtil.addInto(g, extra);
+////	 g.getTransactionHandler().commit();
+////	 Graph union = graphWithTxn("");
+////	 GraphUtil.addInto(union, initial);
+////	 GraphUtil.addInto(union, extra);
+////	 assertIsomorphic(union, g);
+////	 Model inFile = ModelFactory.createDefaultModel();
+////	 inFile.read("file:///" + foo, "N-TRIPLES");
+////	 assertIsomorphic(union, inFile.getGraph());
+////	 }
+////	
+////	 public void testTransactionAbort() {
+////	 Graph initial = graphWithTxn("initial hasValue 42; also hasURI hello");
+////	 Graph extra = graphWithTxn("extra hasValue 17; also hasURI world");
+////	 File foo = FileUtils.tempFileName("fileGraph", ".n3");
+////	 Graph g = new FileGraph(foo, true, true);
+////	 GraphUtil.addInto(g, initial);
+////	 g.getTransactionHandler().begin();
+////	 GraphUtil.addInto(g, extra);
+////	 g.getTransactionHandler().abort();
+////	 assertIsomorphic(initial, g);
+////	 }
+////	
+////	 public void testTransactionCommitThenAbort() {
+////	 Graph initial = graphWithTxn("Foo pings B; B pings C");
+////	 Graph extra = graphWithTxn("C pingedBy B; fileGraph rdf:type Graph");
+////	 File foo = FileUtils.tempFileName("fileGraph", ".nt");
+////	 Graph g = new FileGraph(foo, true, true);
+////	 g.getTransactionHandler().begin();
+////	 GraphUtil.addInto(g, initial);
+////	 g.getTransactionHandler().commit();
+////	 g.getTransactionHandler().begin();
+////	 GraphUtil.addInto(g, extra);
+////	 g.getTransactionHandler().abort();
+////	 assertIsomorphic(initial, g);
+////	 Model inFile = ModelFactory.createDefaultModel();
+////	 inFile.read("file:///" + foo, "N-TRIPLES");
+////	 assertIsomorphic(initial, inFile.getGraph());
+////	 }
+////	
+////	 public void testClosingNotifys() {
+////	 final List<File> history = new ArrayList<File>();
+////	 FileGraph.NotifyOnClose n = new FileGraph.NotifyOnClose() {
+////	 @Override
+////	 public void notifyClosed(File f) {
+////	 history.add(f);
+////	 }
+////	 };
+////	 File file = FileUtils.tempFileName("fileGraph", ".nt");
+////	 Graph g = new FileGraph(n, file, true, true);
+////	 assertEquals(new ArrayList<File>(), history);
+////	 g.close();
+////	 assertEquals(oneElementList(file), history);
+////	 }
+////	
+////	 protected List<Object> oneElementList(Object x) {
+////	 List<Object> result = new ArrayList<Object>();
+////	 result.add(x);
+////	 return result;
+////	 }
+////	
+////	 /**
+////	 * Test that the graph encoded as the test-string content can be written
+////	 out
+////	 * to a temporary file generated from the prefix and suffix, and then read
+////	 * back correctly. The temporary files are marked as delete-on-exit to try
+////	 * and avoid cluttering the user's filespace ...
+////	 */
+////	 private static class Case extends FileGraphTestSuite {
+////	 String content;
+////	 String prefix;
+////	 String suffix;
+////	
+////	 Case(String content, String prefix, String suffix) {
+////	 super("Case: " + content + " in " + prefix + "*" + suffix);
+////	 this.content = content;
+////	 this.prefix = prefix;
+////	 this.suffix = suffix;
+////	 }
+////	
+////	 @Override
+////	 public void runTest() {
+////	 File foo = FileUtils.tempFileName(prefix, suffix);
+////	 Graph original = graphWithTxn(content);
+////	 Graph g = new FileGraph(foo, true, true);
+////	 GraphUtil.addInto(g, original);
+////	 g.close();
+////	 Graph g2 = new FileGraph(foo, false, true);
+////	 assertIsomorphic(original, g2);
+////	 g2.close();
+////	 }
+////	 }
+//
+//	 
+//	 public static class GraphProducer extends AbstractGraphProducer<FileGraph> {
+//			private String suffix = ".nt";
+//			private String prefix = "tfg";
+//			private boolean strict = true;
+//	
+//			public void setSuffix(String suffix) {
+//				this.suffix = suffix;
+//			}
+//	
+//			public void setPrefix(String prefix) {
+//				this.prefix = prefix;
+//			}
+//	
+//			public void setStrict(boolean strict) {
+//				this.strict = strict;
+//			}
+//	
+//			@Override
+//			protected void afterClose(Graph g) {
+//				((FileGraph) g).name.delete();
+//			}
+//	
+//			@Override
+//			protected FileGraph createNewGraph() {
+//				File foo = FileUtils.tempFileName(prefix, suffix);
+//				return new FileGraph(foo, true, strict);
+//			}
+//	
+//			final public FileGraph newGraph(FileGraph.NotifyOnClose notifyOnClose) {
+//				File foo = FileUtils.tempFileName(prefix, suffix);
+//				FileGraph retval = new FileGraph(notifyOnClose, foo, true, strict);
+//				graphList.add(retval);
+//				return retval;
+//			}
+//	
+//		}
+// }

Modified: jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/graph/impl/TripleStoreContractTest.java
URL: http://svn.apache.org/viewvc/jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/graph/impl/TripleStoreContractTest.java?rev=1555482&r1=1555481&r2=1555482&view=diff
==============================================================================
--- jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/graph/impl/TripleStoreContractTest.java (original)
+++ jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/graph/impl/TripleStoreContractTest.java Sun Jan  5 11:28:03 2014
@@ -20,9 +20,8 @@ package com.hp.hpl.jena.graph.impl;
 
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
 import org.xenei.junit.contract.Contract;
+import org.xenei.junit.contract.ContractTest;
 
 import static org.junit.Assert.*;
 
@@ -36,10 +35,10 @@ import org.xenei.junit.contract.IProduce
 /**
  * AbstractTestTripleStore - post-hoc tests for TripleStores.
  */
-@Ignore
+
 @Contract(TripleStore.class)
 public class TripleStoreContractTest<T extends TripleStore> extends
-		ContractTemplate<T> {
+		ContractTemplate<IProducer<T>> {
 
 	protected TripleStore store;
 
@@ -79,12 +78,12 @@ public class TripleStoreContractTest<T e
 		getProducer().cleanUp();
 	}
 
-	@Test
+	@ContractTest
 	public void testEmpty() {
 		testEmpty(store);
 	}
 
-	@Test
+	@ContractTest
 	public void testAddOne() {
 		store.add(triple("x P y"));
 		assertEquals(false, store.isEmpty());
@@ -96,20 +95,20 @@ public class TripleStoreContractTest<T e
 				iteratorToSet(store.find(triple("?? ?? ??"))));
 	}
 
-	@Test
+	@ContractTest
 	public void testListSubjects() {
 		someStatements(store);
 		assertEquals(nodeSet("a x _z r q"), iteratorToSet(store.listSubjects()));
 	}
 
-	@Test
+	@ContractTest
 	public void testListObjects() {
 		someStatements(store);
 		assertEquals(nodeSet("b y i _j _t 17"),
 				iteratorToSet(store.listObjects()));
 	}
 
-	@Test
+	@ContractTest
 	public void testContains() {
 		someStatements(store);
 		assertEquals(true, store.contains(triple("a P b")));
@@ -126,7 +125,7 @@ public class TripleStoreContractTest<T e
 		assertEquals(false, store.contains(triple("_a P x")));
 	}
 
-	@Test
+	@ContractTest
 	public void testFind() {
 		someStatements(store);
 		assertEquals(tripleSet(""),
@@ -143,7 +142,7 @@ public class TripleStoreContractTest<T e
 				iteratorToSet(store.find(triple("?? ?? 17"))));
 	}
 
-	@Test
+	@ContractTest
 	public void testRemove() {
 		store.add(triple("nothing before ace"));
 		store.add(triple("ace before king"));

Modified: jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/graph/impl/WrappedGraphSuite.java
URL: http://svn.apache.org/viewvc/jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/graph/impl/WrappedGraphSuite.java?rev=1555482&r1=1555481&r2=1555482&view=diff
==============================================================================
--- jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/graph/impl/WrappedGraphSuite.java (original)
+++ jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/graph/impl/WrappedGraphSuite.java Sun Jan  5 11:28:03 2014
@@ -45,4 +45,4 @@ package com.hp.hpl.jena.graph.impl;
 //		return producer;
 //	}
 //
-//}
+// }

Modified: jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/graph/impl/WrappedGraphTest.java
URL: http://svn.apache.org/viewvc/jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/graph/impl/WrappedGraphTest.java?rev=1555482&r1=1555481&r2=1555482&view=diff
==============================================================================
--- jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/graph/impl/WrappedGraphTest.java (original)
+++ jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/graph/impl/WrappedGraphTest.java Sun Jan  5 11:28:03 2014
@@ -24,18 +24,17 @@ package com.hp.hpl.jena.graph.impl;
  */
 
 import static com.hp.hpl.jena.testing_framework.GraphHelper.*;
-import org.junit.Test;
+
 import org.junit.runner.RunWith;
 import org.xenei.junit.contract.Contract;
 import org.xenei.junit.contract.ContractImpl;
 import org.xenei.junit.contract.ContractSuite;
+import org.xenei.junit.contract.ContractTest;
 
 import com.hp.hpl.jena.graph.Factory;
 import com.hp.hpl.jena.graph.Graph;
 import com.hp.hpl.jena.graph.impl.WrappedGraph;
-import com.hp.hpl.jena.sparql.graph.GraphFactory;
 import com.hp.hpl.jena.testing_framework.AbstractGraphProducer;
-
 import org.xenei.junit.contract.IProducer;
 
 @RunWith(ContractSuite.class)
@@ -46,9 +45,20 @@ public class WrappedGraphTest {
 
 	public WrappedGraphTest() {
 		graphProducer = new AbstractGraphProducer<WrappedGraph>() {
+
 			@Override
 			public WrappedGraph createNewGraph() {
-				return new WrappedGraph(GraphFactory.createGraphMem());
+				return new WrappedGraph(memGraph());
+			}
+
+			@Override
+			public Graph[] getDependsOn(Graph g) {
+				return null;
+			}
+
+			@Override
+			public Graph[] getNotDependsOn(Graph g) {
+				return new Graph[] { memGraph() };
 			}
 		};
 	}
@@ -67,7 +77,7 @@ public class WrappedGraphTest {
 	 * underlying graph. Really want something using mock classes. Will think
 	 * about it.
 	 */
-	@Test
+	@ContractTest
 	public void testWrappedSame() {
 		Graph m = Factory.createGraphMem();
 		Graph w = new WrappedGraph(m);

Modified: jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/mem/BunchMapContractTest.java
URL: http://svn.apache.org/viewvc/jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/mem/BunchMapContractTest.java?rev=1555482&r1=1555481&r2=1555482&view=diff
==============================================================================
--- jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/mem/BunchMapContractTest.java (original)
+++ jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/mem/BunchMapContractTest.java Sun Jan  5 11:28:03 2014
@@ -26,9 +26,8 @@ import java.util.List;
 
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
 import org.xenei.junit.contract.Contract;
+import org.xenei.junit.contract.ContractTest;
 
 import org.xenei.junit.contract.IProducer;
 import com.hp.hpl.jena.util.iterator.ExtendedIterator;
@@ -36,7 +35,6 @@ import com.hp.hpl.jena.util.iterator.Ext
 /**
  * Test triple bunch implementations - NOT YET FINISHED
  */
-@Ignore
 @Contract(BunchMap.class)
 public class BunchMapContractTest {
 	private BunchMap map;
@@ -78,7 +76,7 @@ public class BunchMapContractTest {
 		getBunchMapProducer().cleanUp();
 	}
 
-	@Test
+	@ContractTest
 	public void testClear() {
 		for (int i = 0; i < 5; i++) {
 			map.put(i, mock(TripleBunch.class));
@@ -89,7 +87,7 @@ public class BunchMapContractTest {
 		assertEquals(0, map.size());
 	}
 
-	@Test
+	@ContractTest
 	public void testSize() {
 		assertEquals(0, map.size());
 		for (int i = 0; i < 5; i++) {
@@ -98,7 +96,7 @@ public class BunchMapContractTest {
 		}
 	}
 
-	@Test
+	@ContractTest
 	public void testGet() {
 		List<TripleBunch> lst = new ArrayList<TripleBunch>();
 		for (int i = 0; i < 5; i++) {
@@ -111,7 +109,7 @@ public class BunchMapContractTest {
 		}
 	}
 
-	@Test
+	@ContractTest
 	public void testPut() {
 		List<TripleBunch> lst = new ArrayList<TripleBunch>();
 		for (int i = 0; i < 5; i++) {
@@ -127,7 +125,7 @@ public class BunchMapContractTest {
 		}
 	}
 
-	@Test
+	@ContractTest
 	public void testRemove() {
 		List<TripleBunch> lst = new ArrayList<TripleBunch>();
 		for (int i = 0; i < 5; i++) {
@@ -161,7 +159,7 @@ public class BunchMapContractTest {
 
 	}
 
-	@Test
+	@ContractTest
 	public void testKeyIterator() {
 		List<Integer> lst = new ArrayList<Integer>();
 		for (int i = 0; i < 5; i++) {

Modified: jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/mem/GraphMemSuite.java
URL: http://svn.apache.org/viewvc/jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/mem/GraphMemSuite.java?rev=1555482&r1=1555481&r2=1555482&view=diff
==============================================================================
--- jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/mem/GraphMemSuite.java (original)
+++ jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/mem/GraphMemSuite.java Sun Jan  5 11:28:03 2014
@@ -16,6 +16,7 @@
     limitations under the License.
  */
 package com.hp.hpl.jena.mem;
+
 //
 //import org.junit.runner.RunWith;
 //import org.xenei.junit.contract.ContractImpl;
@@ -43,4 +44,4 @@ package com.hp.hpl.jena.mem;
 //		return producer;
 //	}
 //
-//}
+// }

Modified: jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/mem/GraphMemTest.java
URL: http://svn.apache.org/viewvc/jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/mem/GraphMemTest.java?rev=1555482&r1=1555481&r2=1555482&view=diff
==============================================================================
--- jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/mem/GraphMemTest.java (original)
+++ jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/mem/GraphMemTest.java Sun Jan  5 11:28:03 2014
@@ -22,11 +22,11 @@ import static org.junit.Assert.*;
 
 import java.util.Iterator;
 
-import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.xenei.junit.contract.Contract.Inject;
 import org.xenei.junit.contract.ContractImpl;
 import org.xenei.junit.contract.ContractSuite;
+import org.xenei.junit.contract.ContractTest;
 
 import com.hp.hpl.jena.graph.Graph;
 import com.hp.hpl.jena.graph.GraphStatisticsHandler;
@@ -50,6 +50,16 @@ public class GraphMemTest {
 			return new GraphMem();
 		}
 
+		@Override
+		public Graph[] getDependsOn(Graph g) {
+			return null;
+		}
+
+		@Override
+		public Graph[] getNotDependsOn(Graph g) {
+			return new Graph[] { memGraph() };
+		}
+
 	};
 
 	@Inject
@@ -57,14 +67,14 @@ public class GraphMemTest {
 		return graphProducer;
 	}
 
-	@Test
+	@ContractTest
 	public void testHasStatistics() {
 		GraphStatisticsHandler h = graphProducer.newInstance()
 				.getStatisticsHandler();
 		assertNotNull(h);
 	}
 
-	@Test
+	@ContractTest
 	public void testContainsConcreteDoesntUseFind() {
 		Graph g = new GraphMemWithoutFind();
 		graphAdd(g, "x P y; a Q b");
@@ -81,7 +91,7 @@ public class GraphMemTest {
 		}
 	}
 
-	@Test
+	@ContractTest
 	public void testUnnecessaryMatches() {
 		Node special = new Node_URI("eg:foo") {
 			@Override

Modified: jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/mem/TripleBunchContractTest.java
URL: http://svn.apache.org/viewvc/jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/mem/TripleBunchContractTest.java?rev=1555482&r1=1555481&r2=1555482&view=diff
==============================================================================
--- jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/mem/TripleBunchContractTest.java (original)
+++ jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/mem/TripleBunchContractTest.java Sun Jan  5 11:28:03 2014
@@ -29,9 +29,8 @@ import java.util.Set;
 
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
 import org.xenei.junit.contract.Contract;
+import org.xenei.junit.contract.ContractTest;
 
 import com.hp.hpl.jena.graph.Triple;
 import org.xenei.junit.contract.IProducer;
@@ -41,7 +40,6 @@ import com.hp.hpl.jena.util.iterator.Ext
 /**
  * Test triple bunch implementations - NOT YET FINISHED
  */
-@Ignore
 @Contract(TripleBunch.class)
 public class TripleBunchContractTest {
 	private IProducer<? extends TripleBunch> producer;
@@ -90,7 +88,7 @@ public class TripleBunchContractTest {
 		getTripleBunchProducer().cleanUp();
 	}
 
-	@Test
+	@ContractTest
 	public void testEmptyBunch() {
 		assertEquals(0, testingBunch.size());
 		assertFalse(testingBunch.contains(tripleSPO));
@@ -98,7 +96,7 @@ public class TripleBunchContractTest {
 		assertFalse(testingBunch.iterator().hasNext());
 	}
 
-	@Test
+	@ContractTest
 	public void testAddElement() {
 		testingBunch.add(tripleSPO);
 		assertEquals(1, testingBunch.size());
@@ -106,7 +104,7 @@ public class TripleBunchContractTest {
 		assertEquals(listOf(tripleSPO), iteratorToList(testingBunch.iterator()));
 	}
 
-	@Test
+	@ContractTest
 	public void testAddElements() {
 		testingBunch.add(tripleSPO);
 		testingBunch.add(tripleXQY);
@@ -117,7 +115,7 @@ public class TripleBunchContractTest {
 				iteratorToSet(testingBunch.iterator()));
 	}
 
-	@Test
+	@ContractTest
 	public void testRemoveOnlyElement() {
 		testingBunch.add(tripleSPO);
 		testingBunch.remove(tripleSPO);
@@ -126,7 +124,7 @@ public class TripleBunchContractTest {
 		assertFalse(testingBunch.iterator().hasNext());
 	}
 
-	@Test
+	@ContractTest
 	public void testRemoveFirstOfTwo() {
 		testingBunch.add(tripleSPO);
 		testingBunch.add(tripleXQY);
@@ -137,7 +135,7 @@ public class TripleBunchContractTest {
 		assertEquals(listOf(tripleXQY), iteratorToList(testingBunch.iterator()));
 	}
 
-	@Test
+	@ContractTest
 	public void testTableGrows() {
 		testingBunch.add(tripleSPO);
 		testingBunch.add(tripleXQY);
@@ -145,7 +143,7 @@ public class TripleBunchContractTest {
 		testingBunch.add(triple("c J d"));
 	}
 
-	@Test
+	@ContractTest
 	public void testIterator() {
 		testingBunch.add(triple("a P b"));
 		testingBunch.add(triple("c Q d"));
@@ -154,7 +152,7 @@ public class TripleBunchContractTest {
 				.toSet());
 	}
 
-	@Test
+	@ContractTest
 	public void testIteratorRemoveOneItem() {
 		testingBunch.add(triple("a P b"));
 		testingBunch.add(triple("c Q d"));
@@ -166,7 +164,7 @@ public class TripleBunchContractTest {
 		assertEquals(tripleSet("a P b; e R f"), testingBunch.iterator().toSet());
 	}
 
-	@Test
+	@ContractTest
 	public void testIteratorRemoveAlltems() {
 		testingBunch.add(triple("a P b"));
 		testingBunch.add(triple("c Q d"));

Modified: jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/n3/IRIResolverTest.java
URL: http://svn.apache.org/viewvc/jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/n3/IRIResolverTest.java?rev=1555482&r1=1555481&r2=1555482&view=diff
==============================================================================
--- jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/n3/IRIResolverTest.java (original)
+++ jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/n3/IRIResolverTest.java Sun Jan  5 11:28:03 2014
@@ -25,381 +25,509 @@ import org.junit.Test;
 import com.hp.hpl.jena.n3.IRIResolver;
 import com.hp.hpl.jena.n3.JenaURIException;
 
-public class IRIResolverTest
-{
-    
-    @Test
-    public void testBase1()
-    {
-    	IRIResolver resolver = new IRIResolver();
-        assertNotNull(resolver.getBaseIRI()) ;
-        String base = resolver.getBaseIRI() ;
-        assertTrue(base.indexOf(':') > 0 ) ; 
-    }
-    
-    @Test
-    public void testBase2()
-    {
-        IRIResolver resolver = new IRIResolver("x") ;
-        assertNotNull(resolver.getBaseIRI()) ;
-        // Active when IRI library integrated - currently the resolver takes a raw base string.
-//        String base = resolver.getBaseIRI() ;
-//        assertTrue(base.indexOf(':') > 0 ) ; 
-    }
-
-    @Test
-    public void testBase3()
-    {
-        String b = IRIResolver.resolveGlobal("x") ;
-        IRIResolver resolver = new IRIResolver(b) ;
-        assertNotNull(resolver.getBaseIRI()) ;
-        String base = resolver.getBaseIRI() ;
-        assertTrue(base.indexOf(':') > 0 ) ; 
-    }
-    
-    @Test
-    public void testBadBase1() {
-    	execException("%G",JenaURIException.class);
-    }
-    @Test
-    public void testBadBase2() {
-    	execException("/%G",JenaURIException.class);
-    }
-    @Test
-    public void testBadBase3() {
-    	execException("file:/%/",JenaURIException.class);
-    }
-    @Test
-    public void testBadBase4() {
-    	execException("http://example.org/%",JenaURIException.class);
-    }
-
-    @Test
-    public void testBadChoice1() {
-    	chooseException("%G",JenaURIException.class);
-    }
-    @Test
-    public void testBadChoice2() {
-    	chooseException("/%G",JenaURIException.class);
-    }
-    @Test
-    public void testBadChoice3() {
-    	chooseException("file:/%/",JenaURIException.class);
-    }
-    @Test
-    public void testChoice1() {
-    	IRIResolver.chooseBaseURI("file:a") ;
-    }
-    @Test
-    public void testChoice2() {
-    	IRIResolver.chooseBaseURI("file:a") ;
-    }
-    // ---- Basic
-    
-    @Test
-    public void testURI_1()   { execTest("", "http://example.org/", "http://example.org/"); }
-    @Test
-    public void testURI_2()   { execTest("", "http://example.org/xyz_2007", "http://example.org/xyz_2007"); }
-    @Test
-    public void testURI_3()   { execTest("", "http://example.org/xyz 2007", "http://example.org/xyz 2007"); }
-    @Test
-    public void testURI_4()   { execTest("", "http://example.org/xyz__2007", "http://example.org/xyz__2007"); }
-    @Test
-    public void testURI_5()   { execTest("", "http://example.org/xyz__abc", "http://example.org/xyz__abc"); }
-    
-    // ---- Relative URIs
-    
-    @Test
-    public void testURI_relX_1()  { execTest("x", "http://example.org/ns", "http://example.org/x"); }
-
-    @Test
-    public void testURI_relX_2()  { execTest("x", "http://example.org/", "http://example.org/x"); }
-    
-    @Test
-    public void testURI2_relHashX_1()  { execTest("#x", "http://example.org/ns", "http://example.org/ns#x"); }
-    
-    @Test
-    public void testURI2_relHashX_2()  { execTest("#x", "http://example.org/ns/", "http://example.org/ns/#x"); }
-
-    @Test
-    public void testURI_blank_1()  { execTest("", "http://example.org/ns", "http://example.org/ns") ; }
-
-    @Test
-    public void testURI_blank_2()  { execTest("", "http://example.org/ns/", "http://example.org/ns/") ; }
-
-    @Test
-    public void testURI_hash_1()  { execTest("#", "http://example.org/ns", "http://example.org/ns#") ; }
-
-    @Test
-    public void testURI_hash_2()  { execTest("#", "http://example.org/ns/", "http://example.org/ns/#") ; }
-
-    @Test
-    public void testBaseHash_1() { execTest("x", "http://example.org/ns#", "http://example.org/x") ; }
-
-    @Test
-    public void testBaseHash_2() { execTest("x", "http://example.org#", "http://example.org/x") ; }
-    
-    @Test
-    public void testBaseHash_3() { execTest("#", "base:x", "base:x#") ; }
-
-//    // Java5: exception
-//    // Java6 & GNUclasspath: correctly get "base:#"
-//    public void testBaseHash_4() { execTest("#", "base:", "base:#") ; }
-
-    @Test
-    public void testScheme_1() { execTest("x", "base:", "base:x") ; }
-
-    @Test
-    public void testScheme_2() { execTest("/x", "base:", "base:/x") ; }
-
-    @Test
-    public void testScheme_3() { execTestMatch("x", "file:", "^file:///.*/x$") ; }
-    
-    @Test
-    public void testScheme_4() { execTestMatch("file:x", null, "^file:///.*/x$") ; }
-    
-//    public void testURI_file_1()  { execTestMatch("file:x", "http://example.org/ns", "^file:///.*/x$") ; }
-
-    @Test
-    public void testURI_file_2()  { execTest("x", "file:///A/B/C", "file:///A/B/x") ; }
-
-    @Test
-    public void testURI_file_3()  { execTest("x", "file:///A/B/", "file:///A/B/x") ; }
-
-
-    // ---- Absolute URIs are left alone 
-    
-    @Test
-    public void testURI_abs_1()   { execTest("http://host/x", "http://example.org/ns", "http://host/x") ; }
-    
-    @Test
-    public void testURI_abs_2()   { execTest("file:///x", "http://example.org/ns", "file:///x") ; }
-
-    @Test
-    public void testURI_abs_3()   { execTest("tag:foo", "http://example.org/ns", "tag:foo") ; }
-
-    @Test
-    public void testURI_abs_4()   { execTest("tag:/foo", "http://example.org/ns", "tag:/foo") ; }
-
-    @Test
-    public void testURI_abs_5()   { execTest("tag:/foo/", "http://example.org/ns", "tag:/foo/") ; }
-
-    @Test
-    public void testURI_abs_6()   { execTest("scheme99:/foo/", "http://example.org/ns", "scheme99:/foo/") ; }
-    
-    // Null base
-    
-    @Test
-    public void testURI_nullBase_1()   { execTest("scheme99:/foo/", null, "scheme99:/foo/") ; }
-    
-    // resolved against current directory
-    @Test
-    public void testURI_nullBase_2()   { execTestMatch("foo", null, ".*/foo") ; }
-
-    // ---- Hierarchical URIs
-
-    @Test
-    public void testHierURI_1()   { execTest("../foo", "file:///dir/file", "file:///foo") ; }
-
-    @Test
-    public void testHierURI_2()   { execTest("../foo", "http://host/dir/file.html", "http://host/foo") ; }
-    
-    @Test
-    public void testHierURI_3()   { execTest("../foo", "http://host/dir/", "http://host/foo") ; }
-
-    @Test
-    public void testHierURI_4()   { execTest("../foo", "http://host/", "http://host/foo") ; }
-    
-    @Test
-    public void testHierURI_5()   { execTest("../foo", "http://host/xyz", "http://host/foo") ; }
-    
-    @Test
-    public void testHierURI_6()   { execTest(".", "http://host/xyz", "http://host/") ; }
-
-    @Test
-    public void testHierURI_7()   { execTest(".", "http://host/xyz/", "http://host/xyz/") ; }
-    
-    @Test
-    public void testHierURI_8()   { execTest(".", "http://host/", "http://host/") ; }
-    
-    @Test
-    public void testHierURI_9()   { execTest(".", "file:///dir/file", "file:///dir/") ; }
-    // ---- File URIs
-    
-    @Test
-    public void testFileURI_1()   { execFileTest("file:///foo", "file:///foo") ; }
-
-    @Test
-    public void testFileURI_2()   { execFileTest("file://foo", "file://foo") ; }
-
-    @Test
-    public void testFileURI_3()   { execFileTest("file:/foo", "file:///foo") ; }
-
-    
- // Bad.
-    @Test
-    public void testBad_1()   { execException("%G", "http://example.org/", JenaURIException.class); }
-    @Test
-    public void testBad_2()   { execException("foo", "http://example.org/%HH", JenaURIException.class); }
-    @Test
-    public void testBad_3()   { execException("bar", "http://example.org/%3", JenaURIException.class); }
-    
-    
-    @Test
-    public void testBaseEmpty() { execTestMatch("x", "", "^file:///.*/x$") ; }
-
-    // Resolved against current directory.
-    @Test
-    public void testBaseNull() { execTestMatch("x", null, ".*/x" ) ; }
-
-    @Test
-    public void testRelBase_1() {execTestMatch("x", "ns", ".*/x" );  }
-    
-    @Test
-    public void testRelBase_2() { execTestMatch("x", "/ns", ".*/x" ); }
-
-    // ---- Opaque
-    
-    @Test
-    public void testURI_opaque_1()  { execTest("#x", "tag:A", "tag:A#x") ; }
-
-    @Test
-    public void testURI_opaque_2()  { execTest("#x", "urn:x-jena:A", "urn:x-jena:A#x") ; }
-    
-//    public void testURI_opaque_3()  { execException("#x", "urn:x-jena:A", RelativeURIException.class) ; }
-
-    // ---- Opaque file URLs
-    
-    // Should these be errors? Yes.
-    //public void testURI_file_4()  { execTest("x", "file:A", "file:Ax") ; }
-    @Test
-    public void testURI_file_4()  {  execTestMatch("x", "file:A","^file:///.*/x") ;}
-    
-    @Test
-    public void testURI_file_5()  { execTestMatch("#x", "file:A","^file:///.*/A#x") ; }
-    //public void testURI_file_5()  { execException("#x", "file:A", RelativeURIException.class) ; }
-    
-    //public void testURI_file_6()   { execTest("foo", "file:///xyz abc/", "file:///xyz abc/foo" ) ; }
-    
-    @Test
-    public void testURI_file_7()   { execTestMatch("file:foo", "file:xyz", "^file:///.*foo$") ; }
-
-    @Test
-    public void testURI_file_8()   { execTestMatch("file:foo", "file:a b", "^file:///.*foo$") ; }
-    
-    
-    // File URLs - test aren't exact as the depend where they are run.
-    
-    @Test
-    public void testFileURI_rel_1() { execTestFileRelURI("file:foo") ; }
-    
-    @Test
-    public void testFileURI_rel_2() { execTestFileRelURI("file:foo/bar") ; }
-    
-    @Test
-    public void testFileURI_rel_3() { execTestFileRelURI("file:foo/") ; }
-    
-    @Test
-    public void testFileURI_rel_4() { execTestFileRelURI("file:foo/bar/") ; }
-    
-
-    private void execTest(String u, String base, String result)
-    {
-        IRIResolver resolver = new IRIResolver(base) ;
-        String res = resolver.resolve(u) ;
-
-        if (result == null )
-        {
-            assertNull("("+u+","+base+") => <null> :: Got: "+res, res) ;
-            return ;
-        }
-        
-        assertNotNull("("+u+","+base+") => "+result+" :: Got: <null>", res) ;
-        assertTrue("("+u+","+base+") => "+result+" :: Got: "+res, res.equals(result)) ;
-    }
-    
-    // A test for resolved names that depend on where the tests are run.
-    private void execTestMatch(String u, String base, String resultPattern)
-    {
-        IRIResolver resolver = new IRIResolver(base) ;
-        String res = resolver.resolve(u) ;
-
-        if (resultPattern == null )
-        {
-            assertNull("("+u+","+base+") => <null> :: Got: "+res, res) ;
-            return ;
-        }
-        
-        boolean r = res.matches(resultPattern) ;
-        assertTrue("Does not match: "+res+" -- "+resultPattern, r) ;
-    }
-    
-    private void execFileTest(String fn1, String fn2)
-    {
-        String s = IRIResolver.resolveFileURL(fn1) ;
-        assertEquals(s,fn2) ;
-    }
-    
-    private void execTestFileRelURI(String fn)
-    {
-        String relName = fn.substring("file:".length()) ;
-        String s = IRIResolver.resolveFileURL(fn) ;
-        assertTrue("Lost relative name: ("+fn+"=>"+s+")", s.endsWith(relName) ) ;
-        assertTrue("Not absolute: ("+fn+"=>"+s+")", s.startsWith("file:///") ) ;
-    }
-    
-    private void execException(String u, String base, Class<?> ex)
-    {
-        String s = ex.getSimpleName() ;
-        try {
-            IRIResolver resolver = new IRIResolver(base) ;
-            String res = resolver.resolve(u) ;
-            if ( res == null )
-                fail("("+u+","+base+") => <null> :: Expected exception: " +s) ;
-            else
-                fail("("+u+","+base+") => "+res+" :: Expected exception: " +s) ;
-        } catch (Exception ex2)
-        {
-            // Shoudl test whether ex2 is a subclass of ex
-            assertEquals(ex, ex2.getClass()) ;
-        }
-    }
-    
-    private void execException(String base, Class<?> ex)
-    {
-        String s = ex.getSimpleName() ;
-        try {
-            new IRIResolver(base) ;
-                 fail("("+base+") => OK :: Expected exception: " +s) ;
-        } catch (Exception ex2)
-        {
-            // Shoudl test whether ex2 is a subclass of ex
-            assertEquals(ex, ex2.getClass()) ;
-        }
-    }
-
-    private void chooseException(String base, Class<?> ex)
-    {
-        String s = ex.getSimpleName() ;
-        try {
-            IRIResolver.chooseBaseURI(base) ;
-                 fail("("+base+") => OK :: Expected exception: " +s) ;
-        } catch (Exception ex2)
-        {
-            // Shoudl test whether ex2 is a subclass of ex
-            assertEquals(ex, ex2.getClass()) ;
-        }
-    }
-//    private void execTestGlobal(String u, String result)
-//    {
-//        String res = IRIResolver.resolveGlobal(u) ;
-//        if (result == null )
-//        {
-//            assertNull("("+u+") => <null> :: Got: "+res, res) ;
-//            return ;
-//        }
-//        
-//        assertNotNull("("+u+") => "+result+" :: Got: <null>", res) ;
-//        assertTrue("("+u+") => "+result+" :: Got: "+res, res.equals(result)) ;
-//    }
+public class IRIResolverTest {
+
+	@Test
+	public void testBase1() {
+		IRIResolver resolver = new IRIResolver();
+		assertNotNull(resolver.getBaseIRI());
+		String base = resolver.getBaseIRI();
+		assertTrue(base.indexOf(':') > 0);
+	}
+
+	@Test
+	public void testBase2() {
+		IRIResolver resolver = new IRIResolver("x");
+		assertNotNull(resolver.getBaseIRI());
+		// Active when IRI library integrated - currently the resolver takes a
+		// raw base string.
+		// String base = resolver.getBaseIRI() ;
+		// assertTrue(base.indexOf(':') > 0 ) ;
+	}
+
+	@Test
+	public void testBase3() {
+		String b = IRIResolver.resolveGlobal("x");
+		IRIResolver resolver = new IRIResolver(b);
+		assertNotNull(resolver.getBaseIRI());
+		String base = resolver.getBaseIRI();
+		assertTrue(base.indexOf(':') > 0);
+	}
+
+	@Test
+	public void testBadBase1() {
+		execException("%G", JenaURIException.class);
+	}
+
+	@Test
+	public void testBadBase2() {
+		execException("/%G", JenaURIException.class);
+	}
+
+	@Test
+	public void testBadBase3() {
+		execException("file:/%/", JenaURIException.class);
+	}
+
+	@Test
+	public void testBadBase4() {
+		execException("http://example.org/%", JenaURIException.class);
+	}
+
+	@Test
+	public void testBadChoice1() {
+		chooseException("%G", JenaURIException.class);
+	}
+
+	@Test
+	public void testBadChoice2() {
+		chooseException("/%G", JenaURIException.class);
+	}
+
+	@Test
+	public void testBadChoice3() {
+		chooseException("file:/%/", JenaURIException.class);
+	}
+
+	@Test
+	public void testChoice1() {
+		IRIResolver.chooseBaseURI("file:a");
+	}
+
+	@Test
+	public void testChoice2() {
+		IRIResolver.chooseBaseURI("file:a");
+	}
+
+	// ---- Basic
+
+	@Test
+	public void testURI_1() {
+		execTest("", "http://example.org/", "http://example.org/");
+	}
+
+	@Test
+	public void testURI_2() {
+		execTest("", "http://example.org/xyz_2007",
+				"http://example.org/xyz_2007");
+	}
+
+	@Test
+	public void testURI_3() {
+		execTest("", "http://example.org/xyz 2007",
+				"http://example.org/xyz 2007");
+	}
+
+	@Test
+	public void testURI_4() {
+		execTest("", "http://example.org/xyz__2007",
+				"http://example.org/xyz__2007");
+	}
+
+	@Test
+	public void testURI_5() {
+		execTest("", "http://example.org/xyz__abc",
+				"http://example.org/xyz__abc");
+	}
+
+	// ---- Relative URIs
+
+	@Test
+	public void testURI_relX_1() {
+		execTest("x", "http://example.org/ns", "http://example.org/x");
+	}
+
+	@Test
+	public void testURI_relX_2() {
+		execTest("x", "http://example.org/", "http://example.org/x");
+	}
+
+	@Test
+	public void testURI2_relHashX_1() {
+		execTest("#x", "http://example.org/ns", "http://example.org/ns#x");
+	}
+
+	@Test
+	public void testURI2_relHashX_2() {
+		execTest("#x", "http://example.org/ns/", "http://example.org/ns/#x");
+	}
+
+	@Test
+	public void testURI_blank_1() {
+		execTest("", "http://example.org/ns", "http://example.org/ns");
+	}
+
+	@Test
+	public void testURI_blank_2() {
+		execTest("", "http://example.org/ns/", "http://example.org/ns/");
+	}
+
+	@Test
+	public void testURI_hash_1() {
+		execTest("#", "http://example.org/ns", "http://example.org/ns#");
+	}
+
+	@Test
+	public void testURI_hash_2() {
+		execTest("#", "http://example.org/ns/", "http://example.org/ns/#");
+	}
+
+	@Test
+	public void testBaseHash_1() {
+		execTest("x", "http://example.org/ns#", "http://example.org/x");
+	}
+
+	@Test
+	public void testBaseHash_2() {
+		execTest("x", "http://example.org#", "http://example.org/x");
+	}
+
+	@Test
+	public void testBaseHash_3() {
+		execTest("#", "base:x", "base:x#");
+	}
+
+	// // Java5: exception
+	// // Java6 & GNUclasspath: correctly get "base:#"
+	// public void testBaseHash_4() { execTest("#", "base:", "base:#") ; }
+
+	@Test
+	public void testScheme_1() {
+		execTest("x", "base:", "base:x");
+	}
+
+	@Test
+	public void testScheme_2() {
+		execTest("/x", "base:", "base:/x");
+	}
+
+	@Test
+	public void testScheme_3() {
+		execTestMatch("x", "file:", "^file:///.*/x$");
+	}
+
+	@Test
+	public void testScheme_4() {
+		execTestMatch("file:x", null, "^file:///.*/x$");
+	}
+
+	// public void testURI_file_1() { execTestMatch("file:x",
+	// "http://example.org/ns", "^file:///.*/x$") ; }
+
+	@Test
+	public void testURI_file_2() {
+		execTest("x", "file:///A/B/C", "file:///A/B/x");
+	}
+
+	@Test
+	public void testURI_file_3() {
+		execTest("x", "file:///A/B/", "file:///A/B/x");
+	}
+
+	// ---- Absolute URIs are left alone
+
+	@Test
+	public void testURI_abs_1() {
+		execTest("http://host/x", "http://example.org/ns", "http://host/x");
+	}
+
+	@Test
+	public void testURI_abs_2() {
+		execTest("file:///x", "http://example.org/ns", "file:///x");
+	}
+
+	@Test
+	public void testURI_abs_3() {
+		execTest("tag:foo", "http://example.org/ns", "tag:foo");
+	}
+
+	@Test
+	public void testURI_abs_4() {
+		execTest("tag:/foo", "http://example.org/ns", "tag:/foo");
+	}
+
+	@Test
+	public void testURI_abs_5() {
+		execTest("tag:/foo/", "http://example.org/ns", "tag:/foo/");
+	}
+
+	@Test
+	public void testURI_abs_6() {
+		execTest("scheme99:/foo/", "http://example.org/ns", "scheme99:/foo/");
+	}
+
+	// Null base
+
+	@Test
+	public void testURI_nullBase_1() {
+		execTest("scheme99:/foo/", null, "scheme99:/foo/");
+	}
+
+	// resolved against current directory
+	@Test
+	public void testURI_nullBase_2() {
+		execTestMatch("foo", null, ".*/foo");
+	}
+
+	// ---- Hierarchical URIs
+
+	@Test
+	public void testHierURI_1() {
+		execTest("../foo", "file:///dir/file", "file:///foo");
+	}
+
+	@Test
+	public void testHierURI_2() {
+		execTest("../foo", "http://host/dir/file.html", "http://host/foo");
+	}
+
+	@Test
+	public void testHierURI_3() {
+		execTest("../foo", "http://host/dir/", "http://host/foo");
+	}
+
+	@Test
+	public void testHierURI_4() {
+		execTest("../foo", "http://host/", "http://host/foo");
+	}
+
+	@Test
+	public void testHierURI_5() {
+		execTest("../foo", "http://host/xyz", "http://host/foo");
+	}
+
+	@Test
+	public void testHierURI_6() {
+		execTest(".", "http://host/xyz", "http://host/");
+	}
+
+	@Test
+	public void testHierURI_7() {
+		execTest(".", "http://host/xyz/", "http://host/xyz/");
+	}
+
+	@Test
+	public void testHierURI_8() {
+		execTest(".", "http://host/", "http://host/");
+	}
+
+	@Test
+	public void testHierURI_9() {
+		execTest(".", "file:///dir/file", "file:///dir/");
+	}
+
+	// ---- File URIs
+
+	@Test
+	public void testFileURI_1() {
+		execFileTest("file:///foo", "file:///foo");
+	}
+
+	@Test
+	public void testFileURI_2() {
+		execFileTest("file://foo", "file://foo");
+	}
+
+	@Test
+	public void testFileURI_3() {
+		execFileTest("file:/foo", "file:///foo");
+	}
+
+	// Bad.
+	@Test
+	public void testBad_1() {
+		execException("%G", "http://example.org/", JenaURIException.class);
+	}
+
+	@Test
+	public void testBad_2() {
+		execException("foo", "http://example.org/%HH", JenaURIException.class);
+	}
+
+	@Test
+	public void testBad_3() {
+		execException("bar", "http://example.org/%3", JenaURIException.class);
+	}
+
+	@Test
+	public void testBaseEmpty() {
+		execTestMatch("x", "", "^file:///.*/x$");
+	}
+
+	// Resolved against current directory.
+	@Test
+	public void testBaseNull() {
+		execTestMatch("x", null, ".*/x");
+	}
+
+	@Test
+	public void testRelBase_1() {
+		execTestMatch("x", "ns", ".*/x");
+	}
+
+	@Test
+	public void testRelBase_2() {
+		execTestMatch("x", "/ns", ".*/x");
+	}
+
+	// ---- Opaque
+
+	@Test
+	public void testURI_opaque_1() {
+		execTest("#x", "tag:A", "tag:A#x");
+	}
+
+	@Test
+	public void testURI_opaque_2() {
+		execTest("#x", "urn:x-jena:A", "urn:x-jena:A#x");
+	}
+
+	// public void testURI_opaque_3() { execException("#x", "urn:x-jena:A",
+	// RelativeURIException.class) ; }
+
+	// ---- Opaque file URLs
+
+	// Should these be errors? Yes.
+	// public void testURI_file_4() { execTest("x", "file:A", "file:Ax") ; }
+	@Test
+	public void testURI_file_4() {
+		execTestMatch("x", "file:A", "^file:///.*/x");
+	}
+
+	@Test
+	public void testURI_file_5() {
+		execTestMatch("#x", "file:A", "^file:///.*/A#x");
+	}
+
+	// public void testURI_file_5() { execException("#x", "file:A",
+	// RelativeURIException.class) ; }
+
+	// public void testURI_file_6() { execTest("foo", "file:///xyz abc/",
+	// "file:///xyz abc/foo" ) ; }
+
+	@Test
+	public void testURI_file_7() {
+		execTestMatch("file:foo", "file:xyz", "^file:///.*foo$");
+	}
+
+	@Test
+	public void testURI_file_8() {
+		execTestMatch("file:foo", "file:a b", "^file:///.*foo$");
+	}
+
+	// File URLs - test aren't exact as the depend where they are run.
+
+	@Test
+	public void testFileURI_rel_1() {
+		execTestFileRelURI("file:foo");
+	}
+
+	@Test
+	public void testFileURI_rel_2() {
+		execTestFileRelURI("file:foo/bar");
+	}
+
+	@Test
+	public void testFileURI_rel_3() {
+		execTestFileRelURI("file:foo/");
+	}
+
+	@Test
+	public void testFileURI_rel_4() {
+		execTestFileRelURI("file:foo/bar/");
+	}
+
+	private void execTest(String u, String base, String result) {
+		IRIResolver resolver = new IRIResolver(base);
+		String res = resolver.resolve(u);
+
+		if (result == null) {
+			assertNull("(" + u + "," + base + ") => <null> :: Got: " + res, res);
+			return;
+		}
+
+		assertNotNull("(" + u + "," + base + ") => " + result
+				+ " :: Got: <null>", res);
+		assertTrue("(" + u + "," + base + ") => " + result + " :: Got: " + res,
+				res.equals(result));
+	}
+
+	// A test for resolved names that depend on where the tests are run.
+	private void execTestMatch(String u, String base, String resultPattern) {
+		IRIResolver resolver = new IRIResolver(base);
+		String res = resolver.resolve(u);
+
+		if (resultPattern == null) {
+			assertNull("(" + u + "," + base + ") => <null> :: Got: " + res, res);
+			return;
+		}
+
+		boolean r = res.matches(resultPattern);
+		assertTrue("Does not match: " + res + " -- " + resultPattern, r);
+	}
+
+	private void execFileTest(String fn1, String fn2) {
+		String s = IRIResolver.resolveFileURL(fn1);
+		assertEquals(s, fn2);
+	}
+
+	private void execTestFileRelURI(String fn) {
+		String relName = fn.substring("file:".length());
+		String s = IRIResolver.resolveFileURL(fn);
+		assertTrue("Lost relative name: (" + fn + "=>" + s + ")",
+				s.endsWith(relName));
+		assertTrue("Not absolute: (" + fn + "=>" + s + ")",
+				s.startsWith("file:///"));
+	}
+
+	private void execException(String u, String base, Class<?> ex) {
+		String s = ex.getSimpleName();
+		try {
+			IRIResolver resolver = new IRIResolver(base);
+			String res = resolver.resolve(u);
+			if (res == null)
+				fail("(" + u + "," + base
+						+ ") => <null> :: Expected exception: " + s);
+			else
+				fail("(" + u + "," + base + ") => " + res
+						+ " :: Expected exception: " + s);
+		} catch (Exception ex2) {
+			// Shoudl test whether ex2 is a subclass of ex
+			assertEquals(ex, ex2.getClass());
+		}
+	}
+
+	private void execException(String base, Class<?> ex) {
+		String s = ex.getSimpleName();
+		try {
+			new IRIResolver(base);
+			fail("(" + base + ") => OK :: Expected exception: " + s);
+		} catch (Exception ex2) {
+			// Shoudl test whether ex2 is a subclass of ex
+			assertEquals(ex, ex2.getClass());
+		}
+	}
+
+	private void chooseException(String base, Class<?> ex) {
+		String s = ex.getSimpleName();
+		try {
+			IRIResolver.chooseBaseURI(base);
+			fail("(" + base + ") => OK :: Expected exception: " + s);
+		} catch (Exception ex2) {
+			// Shoudl test whether ex2 is a subclass of ex
+			assertEquals(ex, ex2.getClass());
+		}
+	}
+	// private void execTestGlobal(String u, String result)
+	// {
+	// String res = IRIResolver.resolveGlobal(u) ;
+	// if (result == null )
+	// {
+	// assertNull("("+u+") => <null> :: Got: "+res, res) ;
+	// return ;
+	// }
+	//
+	// assertNotNull("("+u+") => "+result+" :: Got: <null>", res) ;
+	// assertTrue("("+u+") => "+result+" :: Got: "+res, res.equals(result)) ;
+	// }
 }

Modified: jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/n3/N3JenaWriterCommonTest.java
URL: http://svn.apache.org/viewvc/jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/n3/N3JenaWriterCommonTest.java?rev=1555482&r1=1555481&r2=1555482&view=diff
==============================================================================
--- jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/n3/N3JenaWriterCommonTest.java (original)
+++ jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/n3/N3JenaWriterCommonTest.java Sun Jan  5 11:28:03 2014
@@ -2,11 +2,14 @@ package com.hp.hpl.jena.n3;
 
 import static org.junit.Assert.*;
 
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
 import com.hp.hpl.jena.rdf.model.AbstractRDFWriterTest;
 import com.hp.hpl.jena.rdf.model.RDFWriter;
 
 public class N3JenaWriterCommonTest extends AbstractRDFWriterTest {
-	
+
 	public N3JenaWriterCommonTest() {
 	}
 
@@ -16,21 +19,31 @@ public class N3JenaWriterCommonTest exte
 	}
 
 	@Override
-	protected String getTestModelFacts()
-	{
+	protected String getTestModelFacts() {
 		return "a b c ; a b2 c ;";
 	}
-	
-	@Override	
-	protected void checkWriteResult( String s) {
-		assertTrue( s.indexOf("<eh:/b> <eh:/c>")>-1);
-		assertTrue( s.indexOf("<eh:/b2> <eh:/c>")>-1);
-		assertTrue( s.indexOf("<eh:/a>")>-1);
+
+	@Override
+	protected void checkWriteResult(String s) {
+		// <eh:/b> <eh:/c>
+		Pattern regex = Pattern.compile( "^\\s*<eh:/b>\\s+<eh:/c>\\s*[\\.;]\\s*$", Pattern.MULTILINE);
+		Matcher regexMatcher = regex.matcher( s );
+		assertTrue( "Missing <eh:/b> <eh:/c> "+s, regexMatcher.find());		
+
+		// <eh:/b2> <eh:/c>
+		regex = Pattern.compile( "^\\s*<eh:/b2>\\s+<eh:/c>\\s*[\\.;]\\s*$", Pattern.MULTILINE);
+		regexMatcher = regex.matcher( s );
+		assertTrue( "Missing <eh:/b2> <eh:/c> "+s, regexMatcher.find());		
+
+		// <eh:/a>
+		regex = Pattern.compile( "^\\s*<eh:/a>\\s*$", Pattern.MULTILINE);
+		regexMatcher = regex.matcher( s );
+		assertTrue( "Missing <eh:/a> "+s, regexMatcher.find());		
 	}
-	
+
 	@Override
 	protected String getFormat() {
 		return "N3";
 	}
-	
+
 }

Modified: jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/n3/N3JenaWriterPPTest.java
URL: http://svn.apache.org/viewvc/jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/n3/N3JenaWriterPPTest.java?rev=1555482&r1=1555481&r2=1555482&view=diff
==============================================================================
--- jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/n3/N3JenaWriterPPTest.java (original)
+++ jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/n3/N3JenaWriterPPTest.java Sun Jan  5 11:28:03 2014
@@ -2,9 +2,8 @@ package com.hp.hpl.jena.n3;
 
 import com.hp.hpl.jena.rdf.model.RDFWriter;
 
-
 public class N3JenaWriterPPTest extends N3JenaWriterCommonTest {
-	
+
 	public N3JenaWriterPPTest() {
 		// TODO Auto-generated constructor stub
 	}

Modified: jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/n3/N3JenaWriterParameterizedTest.java
URL: http://svn.apache.org/viewvc/jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/n3/N3JenaWriterParameterizedTest.java?rev=1555482&r1=1555481&r2=1555482&view=diff
==============================================================================
--- jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/n3/N3JenaWriterParameterizedTest.java (original)
+++ jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/n3/N3JenaWriterParameterizedTest.java Sun Jan  5 11:28:03 2014
@@ -25,82 +25,83 @@ import com.hp.hpl.jena.shared.JenaExcept
 import com.hp.hpl.jena.testing_framework.tuples.TupleItem;
 import com.hp.hpl.jena.testing_framework.tuples.TupleSet;
 
-@RunWith( value= Parameterized.class )
-public class N3JenaWriterParameterizedTest  {
-	
+@RunWith(value = Parameterized.class)
+public class N3JenaWriterParameterizedTest {
+
 	private static Class<?>[] clazzez = {
-		//N3JenaWriterPlain.class, 
-		//N3JenaWriterPP.class,
-		N3JenaWriter.class,
-		//N3JenaWriterTriples.class,
-		//N3TurtleJenaWriter.class
+	// N3JenaWriterPlain.class,
+	// N3JenaWriterPP.class,
+	N3JenaWriter.class,
+	// N3JenaWriterTriples.class,
+	// N3TurtleJenaWriter.class
 	};
-	
+
 	private RDFWriter rdfWriter;
 	private URL inputFile;
-	
-	public N3JenaWriterParameterizedTest(Class<?> writerClass, URL inputFile, String name ) throws InstantiationException, IllegalAccessException {
+
+	public N3JenaWriterParameterizedTest(Class<?> writerClass, URL inputFile,
+			String name) throws InstantiationException, IllegalAccessException {
 		rdfWriter = (RDFWriter) writerClass.newInstance();
 		this.inputFile = inputFile;
 	}
 
 	public static final String DEFAULT_BASE = "http://example.com/";
-	
+
 	@Test
-    public void testRoundtrip() throws Exception
-	{
+	public void testRoundtrip() throws Exception {
 		Model model = ModelFactory.createDefaultModel();
-		model.read( inputFile.openStream(), DEFAULT_BASE, "N3" );
-		
+		model.read(inputFile.openStream(), DEFAULT_BASE, "N3");
+
 		StringWriter writer = new StringWriter();
 		rdfWriter.write(model, writer, DEFAULT_BASE);
-		writer.close() ;
-		
-		StringReader r = new StringReader(writer.toString()) ;
-		Model model2 = ModelFactory.createDefaultModel() ;
-		model2.read(r, DEFAULT_BASE, "N3") ;
-		
-		assertTrue( "Models should be isomorphic", model.isIsomorphicWith(model2) );
-	}
+		writer.close();
 
+		StringReader r = new StringReader(writer.toString());
+		Model model2 = ModelFactory.createDefaultModel();
+		model2.read(r, DEFAULT_BASE, "N3");
 
-	@Parameters(name= "{index}: {2}")
+		assertTrue("Models should be isomorphic",
+				model.isIsomorphicWith(model2));
+	}
+
+	@Parameters(name = "{index}: {2}")
 	public static Collection<Object[]> data() throws Exception {
 		List<Object[]> retval = new ArrayList<Object[]>();
-		InputStream is = N3JenaWriterParameterizedTest.class.getResourceAsStream("n3-writer-tests");
-		TupleSet tests = null ;
-		
-		Reader r = new InputStreamReader(is) ;
-		tests = new TupleSet(r) ;
+		InputStream is = N3JenaWriterParameterizedTest.class
+				.getResourceAsStream("n3-writer-tests");
+		TupleSet tests = null;
+
+		Reader r = new InputStreamReader(is);
+		tests = new TupleSet(r);
 		List<URL> inputFiles = new ArrayList<URL>();
-	
-		for ( ; tests.hasNext() ; )
-		{
-			List<TupleItem> l = tests.next() ;
-			if ( l.size() != 2 )
-			{
-				throw new JenaException("Error in N3 test configuration file: n3-reader-tests: length of an entry is "+l.size()) ;
+
+		for (; tests.hasNext();) {
+			List<TupleItem> l = tests.next();
+			if (l.size() != 2) {
+				throw new JenaException(
+						"Error in N3 test configuration file: n3-reader-tests: length of an entry is "
+								+ l.size());
 			}
-			inputFiles.add( N3JenaWriterParameterizedTest.class.getResource( l.get(0).get()) );
+			inputFiles.add(N3JenaWriterParameterizedTest.class.getResource(l
+					.get(0).get()));
 		}
-		
-		for (Class<?> clz : clazzez)
-		{
-			
-			for (URL url : inputFiles )
-			{
-				File f = new File( url.getFile() );
-				String nm = String.format( "%s: %s", clz.getSimpleName(), f.getName());
-				retval.add( new Object[] {  clz, url, nm } );
+
+		for (Class<?> clz : clazzez) {
+
+			for (URL url : inputFiles) {
+				File f = new File(url.getFile());
+				String nm = String.format("%s: %s", clz.getSimpleName(),
+						f.getName());
+				retval.add(new Object[] { clz, url, nm });
 			}
 		}
 		return retval;
 	}
 
-//	addTest(new Test(testName, inputFile, resultsFile,
-//            N3JenaWriter.n3WriterPrettyPrinter)) ;
-//addTest(new Test(testName, inputFile, resultsFile,
-//            N3JenaWriter.n3WriterPlain)) ;
-//addTest(new Test(testName, inputFile, resultsFile,
-//            N3JenaWriter.n3WriterTriples)) ;
+	// addTest(new Test(testName, inputFile, resultsFile,
+	// N3JenaWriter.n3WriterPrettyPrinter)) ;
+	// addTest(new Test(testName, inputFile, resultsFile,
+	// N3JenaWriter.n3WriterPlain)) ;
+	// addTest(new Test(testName, inputFile, resultsFile,
+	// N3JenaWriter.n3WriterTriples)) ;
 }

Modified: jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/n3/N3JenaWriterPlainTest.java
URL: http://svn.apache.org/viewvc/jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/n3/N3JenaWriterPlainTest.java?rev=1555482&r1=1555481&r2=1555482&view=diff
==============================================================================
--- jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/n3/N3JenaWriterPlainTest.java (original)
+++ jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/n3/N3JenaWriterPlainTest.java Sun Jan  5 11:28:03 2014
@@ -2,9 +2,8 @@ package com.hp.hpl.jena.n3;
 
 import com.hp.hpl.jena.rdf.model.RDFWriter;
 
-
 public class N3JenaWriterPlainTest extends N3JenaWriterCommonTest {
-	
+
 	public N3JenaWriterPlainTest() {
 	}
 

Modified: jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/n3/N3JenaWriterTest.java
URL: http://svn.apache.org/viewvc/jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/n3/N3JenaWriterTest.java?rev=1555482&r1=1555481&r2=1555482&view=diff
==============================================================================
--- jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/n3/N3JenaWriterTest.java (original)
+++ jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/n3/N3JenaWriterTest.java Sun Jan  5 11:28:03 2014
@@ -2,9 +2,8 @@ package com.hp.hpl.jena.n3;
 
 import com.hp.hpl.jena.rdf.model.RDFWriter;
 
-
 public class N3JenaWriterTest extends N3JenaWriterCommonTest {
-	
+
 	public N3JenaWriterTest() {
 		// TODO Auto-generated constructor stub
 	}

Modified: jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/n3/N3JenaWriterTriplesTest.java
URL: http://svn.apache.org/viewvc/jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/n3/N3JenaWriterTriplesTest.java?rev=1555482&r1=1555481&r2=1555482&view=diff
==============================================================================
--- jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/n3/N3JenaWriterTriplesTest.java (original)
+++ jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/n3/N3JenaWriterTriplesTest.java Sun Jan  5 11:28:03 2014
@@ -2,11 +2,13 @@ package com.hp.hpl.jena.n3;
 
 import static org.junit.Assert.assertTrue;
 
-import com.hp.hpl.jena.rdf.model.RDFWriter;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
+import com.hp.hpl.jena.rdf.model.RDFWriter;
 
 public class N3JenaWriterTriplesTest extends N3JenaWriterCommonTest {
-	
+
 	public N3JenaWriterTriplesTest() {
 	}
 
@@ -14,11 +16,20 @@ public class N3JenaWriterTriplesTest ext
 	protected RDFWriter createWriter() {
 		return new N3JenaWriterTriples();
 	}
-	
-	@Override	
-	protected void checkWriteResult( String s) {
-		assertTrue( s.contains("<eh:/a>  <eh:/b2> <eh:/c>") );
-		assertTrue( s.contains("<eh:/a>  <eh:/b>  <eh:/c>") );;
+
+	@Override
+	protected void checkWriteResult(String s) {
+
+		// <eh:/a> <eh:/b> <eh:/c>
+		Pattern regex = Pattern.compile( "^\\s*<eh:/a>\\s+<eh:/b>\\s+<eh:/c>\\s*[\\.;]\\s*$", Pattern.MULTILINE);
+		Matcher regexMatcher = regex.matcher( s );
+		assertTrue( "Missing <eh:/b> <eh:/c> "+s, regexMatcher.find());		
+
+		// <eh/a> <eh:/b2> <eh:/c>
+		regex = Pattern.compile( "^\\s*<eh:/a>\\s+<eh:/b2>\\s+<eh:/c>\\s*[\\.;]\\s*$", Pattern.MULTILINE);
+		regexMatcher = regex.matcher( s );
+		assertTrue( "Missing <eh:/b2> <eh:/c> "+s, regexMatcher.find());		
+			
 	}
 
 }

Modified: jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/n3/N3TurtleJenaWriterTest.java
URL: http://svn.apache.org/viewvc/jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/n3/N3TurtleJenaWriterTest.java?rev=1555482&r1=1555481&r2=1555482&view=diff
==============================================================================
--- jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/n3/N3TurtleJenaWriterTest.java (original)
+++ jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/n3/N3TurtleJenaWriterTest.java Sun Jan  5 11:28:03 2014
@@ -2,9 +2,8 @@ package com.hp.hpl.jena.n3;
 
 import com.hp.hpl.jena.rdf.model.RDFWriter;
 
-
 public class N3TurtleJenaWriterTest extends N3JenaWriterCommonTest {
-	
+
 	public N3TurtleJenaWriterTest() {
 	}
 

Modified: jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/n3/turtle/TurtleParserTests.java
URL: http://svn.apache.org/viewvc/jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/n3/turtle/TurtleParserTests.java?rev=1555482&r1=1555481&r2=1555482&view=diff
==============================================================================
--- jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/n3/turtle/TurtleParserTests.java (original)
+++ jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/n3/turtle/TurtleParserTests.java Sun Jan  5 11:28:03 2014
@@ -28,309 +28,298 @@ import com.hp.hpl.jena.n3.turtle.TurtleE
 import com.hp.hpl.jena.n3.turtle.parser.ParseException;
 import com.hp.hpl.jena.n3.turtle.parser.TurtleParser;
 
-public class TurtleParserTests 
-{
+public class TurtleParserTests {
+
+	static public final String QUOTE3 = "\"\"\"";
+	static public boolean VERBOSE = false;
+
+	public TurtleParserTests() {
+	}
+
+	// ---- Debug testing
+	// runTest( "<thing> b:px.b:py [] . " ) ;
+	// if ( true ) return ;
+	// ---- Debug testing
+
+	// Make sure basic things, at least, parse.
+
+	// URIs, qnames, statements, prefixes
+
+	// End of statement (and whitespace)
 
-	static public final String QUOTE3 = "\"\"\"" ;
-	static public boolean VERBOSE = false ;
-	
-	public TurtleParserTests()
-	{
-	}
-	
-	
-        // ---- Debug testing
-        //runTest( "<thing> b:px.b:py [] . " ) ;
-        // if ( true ) return ;
-        // ---- Debug testing
-
-		// Make sure basic things, at least, parse.
-		
-		// URIs, qnames, statements, prefixes
-        
-        // End of statement (and whitespace)
-	
-	
 	@Test
 	public void testPrefix() {
-        runTest( "@prefix start: <somewhere>." ) ;
+		runTest("@prefix start: <somewhere>.");
 	}
-	
+
 	@Test
 	public void testXML() {
-        runTest( "<http://here/subj> <http://here/prep> <http://here/obj>." ) ;
+		runTest("<http://here/subj> <http://here/prep> <http://here/obj>.");
 	}
-	
+
 	@Test
-	public void testWhiteSpace()
-	{
-		runTest( "a:subj a:prop a:d ." ) ;
-        runTest( "a:subj a:prop a:d . " ) ;
-        runTest( "a:subj a:prop a:d." ) ;
-        runTest( "a:subj a:prop a:d. " ) ;
+	public void testWhiteSpace() {
+		runTest("a:subj a:prop a:d .");
+		runTest("a:subj a:prop a:d . ");
+		runTest("a:subj a:prop a:d.");
+		runTest("a:subj a:prop a:d. ");
 		// Whitespace, comments
-		runTest( "a:subj\ta:prop\ta:d.\t" ) ;
-		runTest( "       a:subj\ta:prop\ta:d.     " ) ;
-		runTest( "a:subj a:prop a:d.  " ) ;
+		runTest("a:subj\ta:prop\ta:d.\t");
+		runTest("       a:subj\ta:prop\ta:d.     ");
+		runTest("a:subj a:prop a:d.  ");
 	}
-	
+
 	@Test
-	public void testEmpty()
-	{
-		runTest("") ;
+	public void testEmpty() {
+		runTest("");
 	}
-	
+
 	@Test
-	public void testComment()
-	{
-		runTest( " #Comment" ) ;
-		runTest( "a:subj a:prop a:d.  # Comment" ) ;
-		runTest( "a:subj a:prop a:d.# Comment" ) ;
+	public void testComment() {
+		runTest(" #Comment");
+		runTest("a:subj a:prop a:d.  # Comment");
+		runTest("a:subj a:prop a:d.# Comment");
 	}
-	
+
 	@Test
-	public void testLiteralStrings()
-	{
+	public void testLiteralStrings() {
 		// Literal: strings
-		runTest( "a:subj a:prop 'string1'." ) ;
-		runTest( "a:subj a:prop \"string2\"." ) ;
-		runTest( "a:subj a:prop '''string3'''." ) ;
-		runTest( "a:subj a:prop "+QUOTE3+"string3"+QUOTE3+"." ) ;
-		
-        // Language tags
-        runTest( "a:subj a:prop 'text'@en ." ) ;
-	}	
+		runTest("a:subj a:prop 'string1'.");
+		runTest("a:subj a:prop \"string2\".");
+		runTest("a:subj a:prop '''string3'''.");
+		runTest("a:subj a:prop " + QUOTE3 + "string3" + QUOTE3 + ".");
+
+		// Language tags
+		runTest("a:subj a:prop 'text'@en .");
+	}
 
 	@Test
-	public void testLiteralDatatypes()
-	{
+	public void testLiteralDatatypes() {
 		// Literals: datatypes
-		runTest( "a:subj a:prop 'string1'^^x:dt." ) ;
-		runTest( "a:subj a:prop 'string1'^^<uriref>." ) ;
-		
-		runTest( "a:subj a:prop '123'^^xsd:integer ." ) ;
-        runTest( "a:subj a:prop '123'^^<uri> ." ) ;
-        runTest( "a:subj a:prop '<tag>text</tag>'^^rdf:XMLLiteral ." ) ;
-	}
-	
-	@Test
-	public void testLiteralNumbers()
-	{
-
-        // Literals: numbers.
-        runTest( "a: :p 2. ." ) ;
-        runTest( "a: :p +2. ." ) ;
-        runTest( "a: :p -2 ." ) ;
-        runTest( "a: :p 2e6." ) ;
-        runTest( "a: :p 2e-6." ) ;
-        runTest( "a: :p -2e-6." ) ;
-        runTest( "a: :p 2.0e-6." ) ;
-        runTest( "a: :p 2.0 ." ) ;
-        
-        runTest( "a:subj a:prop 123 ." ) ;
-        // runTest( "a:subj a:prop 123." ) ; Illegal N3
-        runTest( "a:subj a:prop 123.1 ." ) ;
-        runTest( "a:subj a:prop -123.1 ." ) ;
-        runTest( "a:subj a:prop 123.1e3 ." ) ;
-        runTest( "a:subj a:prop 123.1e-3 ." ) ;
-        runTest( "a:subj a:prop 123.1E3 ." ) ;
-        runTest( "a:subj a:prop 123.1E-3 ." ) ;
-	}    
-//		// The "unusual" cases
-//		runTest( "a:subj 'prop'^^<uriref> 'string'." ) ;
-//		runTest( "a:subj a:prop 'string1'^^'stringDT'." ) ;
-//
-//		runTest( "a:subj a:prop1 ?x ^^ x:dt." ) ;
-//		runTest( "a:subj a:prop2 ?x ^^ ?x." ) ;
+		runTest("a:subj a:prop 'string1'^^x:dt.");
+		runTest("a:subj a:prop 'string1'^^<uriref>.");
+
+		runTest("a:subj a:prop '123'^^xsd:integer .");
+		runTest("a:subj a:prop '123'^^<uri> .");
+		runTest("a:subj a:prop '<tag>text</tag>'^^rdf:XMLLiteral .");
+	}
+
+	@Test
+	public void testLiteralNumbers() {
+
+		// Literals: numbers.
+		runTest("a: :p 2. .");
+		runTest("a: :p +2. .");
+		runTest("a: :p -2 .");
+		runTest("a: :p 2e6.");
+		runTest("a: :p 2e-6.");
+		runTest("a: :p -2e-6.");
+		runTest("a: :p 2.0e-6.");
+		runTest("a: :p 2.0 .");
+
+		runTest("a:subj a:prop 123 .");
+		// runTest( "a:subj a:prop 123." ) ; Illegal N3
+		runTest("a:subj a:prop 123.1 .");
+		runTest("a:subj a:prop -123.1 .");
+		runTest("a:subj a:prop 123.1e3 .");
+		runTest("a:subj a:prop 123.1e-3 .");
+		runTest("a:subj a:prop 123.1E3 .");
+		runTest("a:subj a:prop 123.1E-3 .");
+	}
+
+	// // The "unusual" cases
+	// runTest( "a:subj 'prop'^^<uriref> 'string'." ) ;
+	// runTest( "a:subj a:prop 'string1'^^'stringDT'." ) ;
+	//
+	// runTest( "a:subj a:prop1 ?x ^^ x:dt." ) ;
+	// runTest( "a:subj a:prop2 ?x ^^ ?x." ) ;
 
 	@Test
-	public void testQuotesInStrings()
-	{
+	public void testQuotesInStrings() {
 
 		// Quotes in string
-		runTest( "a:subj a:prop \"\\'string2\\'\"." ) ;
-		runTest( "a:subj a:prop \"\\\"string2\\\"\"." ) ;
-		runTest( "a:subj a:prop '\\'string1\\'\'." ) ;
-		runTest( "a:subj a:prop '\\\"string1\\\"\'." ) ;
-		
-		runTest( "a:q21 a:prop "+QUOTE3+"start\"finish"+QUOTE3+"." ) ;
-		runTest( "a:q22 a:prop "+QUOTE3+"start\"\"finish"+QUOTE3+"." ) ;
-		runTest( "a:q2e3 a:prop "+QUOTE3+"start\\\"\\\"\\\"finish"+QUOTE3+"." ) ;
-		runTest( "a:q13 a:prop "+QUOTE3+"start'''finish"+QUOTE3+"." ) ;
-		
-		runTest( "a:q11 a:prop '''start'finish'''." ) ;
-		runTest( "a:q12 a:prop '''start''finish'''." ) ;
-		runTest( "a:q12 a:prop '''start\\'\\'\\'finish'''." ) ;
-		runTest( "a:q23 a:prop '''start\"\"\"finish'''." ) ;
-	}
-		// Keywords and syntactic sugar
-//		runTest( "this a:prop x:y ." ) ;
-//		runTest( "a:subj  a   x:y ." ) ;
-//		runTest( "a:subj  =   x:y ." ) ;
-//		runTest( "a:subj  =>  x:y ." ) ;
-//		runTest( "a:subj  <=  x:y ." ) ;
-//		// <=> is not legal : it would mean "implies and is implied by" 
-//        // runTest( "a:subj  <=> x:y ." ) ;
-//		runTest( "a:subj  >- x:y -> 'value' ." ) ;
-//		runTest( "a:subj  >- x:y -> 'value1', 'value2' ." ) ;
-       
+		runTest("a:subj a:prop \"\\'string2\\'\".");
+		runTest("a:subj a:prop \"\\\"string2\\\"\".");
+		runTest("a:subj a:prop '\\'string1\\'\'.");
+		runTest("a:subj a:prop '\\\"string1\\\"\'.");
+
+		runTest("a:q21 a:prop " + QUOTE3 + "start\"finish" + QUOTE3 + ".");
+		runTest("a:q22 a:prop " + QUOTE3 + "start\"\"finish" + QUOTE3 + ".");
+		runTest("a:q2e3 a:prop " + QUOTE3 + "start\\\"\\\"\\\"finish" + QUOTE3
+				+ ".");
+		runTest("a:q13 a:prop " + QUOTE3 + "start'''finish" + QUOTE3 + ".");
+
+		runTest("a:q11 a:prop '''start'finish'''.");
+		runTest("a:q12 a:prop '''start''finish'''.");
+		runTest("a:q12 a:prop '''start\\'\\'\\'finish'''.");
+		runTest("a:q23 a:prop '''start\"\"\"finish'''.");
+	}
+
+	// Keywords and syntactic sugar
+	// runTest( "this a:prop x:y ." ) ;
+	// runTest( "a:subj  a   x:y ." ) ;
+	// runTest( "a:subj  =   x:y ." ) ;
+	// runTest( "a:subj  =>  x:y ." ) ;
+	// runTest( "a:subj  <=  x:y ." ) ;
+	// // <=> is not legal : it would mean "implies and is implied by"
+	// // runTest( "a:subj  <=> x:y ." ) ;
+	// runTest( "a:subj  >- x:y -> 'value' ." ) ;
+	// runTest( "a:subj  >- x:y -> 'value1', 'value2' ." ) ;
+
 	@Test
-	public void testKeywordsInNonKeywordPosition()
-	{
+	public void testKeywordsInNonKeywordPosition() {
 		// Not keywords
-		runTest( "a:subj <a>  x:y ." ) ;
-		runTest( "<this>  a   x:y ." ) ;
-		runTest( "@prefix has: <uri>." ) ;
-		
-		runTest( "<>   a:prop  x:y ." ) ;
-		runTest( "<#>  a:prop  x:y ." ) ;
+		runTest("a:subj <a>  x:y .");
+		runTest("<this>  a   x:y .");
+		runTest("@prefix has: <uri>.");
+
+		runTest("<>   a:prop  x:y .");
+		runTest("<#>  a:prop  x:y .");
 	}
-	
+
 	@Test
-	public void testObjectLists()
-	{
+	public void testObjectLists() {
 		// Object lists
-		runTest( "a:subj a:prop a:d, a:e." ) ;
-		runTest( "a:subj a:prop a:d, '123'." ) ;
-		runTest( "a:subj a:prop '123', a:e." ) ;
-        //runTest( "a:subj a:prop '123', ." ) ;            // Null object list        
-        //runTest( "a:subj a:prop '123', '456', ." ) ;     // Null object list        
+		runTest("a:subj a:prop a:d, a:e.");
+		runTest("a:subj a:prop a:d, '123'.");
+		runTest("a:subj a:prop '123', a:e.");
+		// runTest( "a:subj a:prop '123', ." ) ; // Null object list
+		// runTest( "a:subj a:prop '123', '456', ." ) ; // Null object list
 	}
-	
-	
+
 	@Test
-	public void testPropertyLists()
-	{
+	public void testPropertyLists() {
 		// Property lists
-		runTest( "a:subj a:p1 a:v1 ;  a:p2 a:v2 ." ) ;
-    	runTest( "a:subj a:p1 a:v1, a:v2 ;  a:p2 a:v2 ; a:p3 'v4' ,'v5' ." ) ;
-        runTest( "a:subj a:p1 a:v1; ." ) ;                 // Null property list
-        runTest( "a:subj a:p1 a:v1; a:p2 a:v2; ." ) ;      // Null property list
-	}    
-	@Test
-	public void testAnonymousNodes()
-	{
-		runTest( "rdf: rdf:type :_." ) ;  
-		
+		runTest("a:subj a:p1 a:v1 ;  a:p2 a:v2 .");
+		runTest("a:subj a:p1 a:v1, a:v2 ;  a:p2 a:v2 ; a:p3 'v4' ,'v5' .");
+		runTest("a:subj a:p1 a:v1; ."); // Null property list
+		runTest("a:subj a:p1 a:v1; a:p2 a:v2; ."); // Null property list
+	}
+
+	@Test
+	public void testAnonymousNodes() {
+		runTest("rdf: rdf:type :_.");
+
 		// anon nodes
-		runTest( "[a:prop a:val]." ) ;
-		runTest( "[] a:prop a:val." ) ;
-		runTest( "[] a:prop []." ) ;
-	}
-		// formulae
-        // The final dot (statement terminator of outer statement) is necessary
-        // Inside formulae, it is not.
-//        runTest( "{:x :y :z} => {:x :y :z}." ) ;
-//        runTest( "{:x :y :z} => {:x :y :z . }." ) ;
-//        runTest( "{:x :y :z. } => {:x :y :z}." ) ;
-        
-		// Variables
-//		runTest( "?who ?knows ?what ." ) ;
-//		runTest(("{?who ?knows ?what} => {'somesort' 'of' 'logic'}." )) ;
-		
-		// Formulae do not need the trailing '.'
-//		runTest( "{ this a \"string2\". } => { this a 'string1'} ." ) ;
-		
-		// And they can have directives in.
-//		runTest( "{ @prefix : <a> } => { this a 'string1'} ." ) ;
-//		runTest( "{ @prefix : <a> . a:x <b> 'c'} => { this a 'string1'} ." ) ;
-		
+		runTest("[a:prop a:val].");
+		runTest("[] a:prop a:val.");
+		runTest("[] a:prop [].");
+	}
+
+	// formulae
+	// The final dot (statement terminator of outer statement) is necessary
+	// Inside formulae, it is not.
+	// runTest( "{:x :y :z} => {:x :y :z}." ) ;
+	// runTest( "{:x :y :z} => {:x :y :z . }." ) ;
+	// runTest( "{:x :y :z. } => {:x :y :z}." ) ;
+
+	// Variables
+	// runTest( "?who ?knows ?what ." ) ;
+	// runTest(("{?who ?knows ?what} => {'somesort' 'of' 'logic'}." )) ;
+
+	// Formulae do not need the trailing '.'
+	// runTest( "{ this a \"string2\". } => { this a 'string1'} ." ) ;
+
+	// And they can have directives in.
+	// runTest( "{ @prefix : <a> } => { this a 'string1'} ." ) ;
+	// runTest( "{ @prefix : <a> . a:x <b> 'c'} => { this a 'string1'} ." ) ;
+
 	@Test
-	public void testRDFCollections()
-	{
+	public void testRDFCollections() {
 		// RDF collections
-		//runTest( "() ." ) ;
-		runTest( "<here> <list> ()." ) ;
-		runTest( " ( a:i1 a:i2 a:i3 ) a rdf:List." ) ;
-	}	
-		// Paths
-//		runTest( ":x!:y <prop> []." ) ;
-//		runTest( ":x!:y!:z <prop> []." ) ;
-//		runTest( ":x^:y <prop> []." ) ;
-//		runTest( ":x^:y^:z <prop> []." ) ;
-//		runTest( "[] <prop> :x!:y^:z." ) ;
-//		runTest( "[] :x^:y!:z []." ) ;
-        
-        // Paths - using . (dot)
-//        runTest( ":x.:y <prop> []." ) ;
-//        runTest( ":x.:y.:z <prop> []." ) ;
-//        runTest( "[] <prop> :a.:c." ) ;
-//        runTest( "<thing>.:y  <prop> []." ) ;
-//        runTest( "x:x.<thing>.:y  <prop> []." ) ;
-//        runTest( "<thing>.:y^:z  <prop> []." ) ;
-//        runTest( ":y.<thing>.:z  <prop> []." ) ;
-//        runTest( "<thing> :px.:py.:pz [] . " ) ;
-//        runTest( "<thing> :px!:py!:pz [] . " ) ;
-		
-        // Paths and formulae
-//        runTest( "{ :a.:b.:c . }." ) ;
-//        runTest( "{ :a.:b.<c>.}." ) ;
-        
-		// Named things
-//		runTest( "_:anon :- [a:p a:v] ." ) ;
-//		runTest( "<uri> :- [a:p [ a:p a:v] ] ." ) ;		
-//		// Named list: Not supported by cwm (as of 2001, 2002, 2003/09) but needed for printing shared 
-//		runTest( "_:anon :- (\"1\") ." ) ;
-//		// Named formulae: Not supported by cwm (as of 2001, 2002, 2003/09)
-//		runTest( "_:anon :- { ?a ?b ?c } ." ) ;
-        
-        // Datatypes
-        
-        
-        // Numbers
-       
-
-
-        // Illegal in N-Triples
-        //runTest( "a:subj a:prop 'text'^^a:lang@en ." ) ;
-        //runTest( "a:subj a:prop 'text'@en^^a:lang ." ) ; // Can't have both
-        
-	@Test
-	public void testXMLLiteral()
-	{
-        // XML Literal
-        runTest( "a:subj a:prop '<tag>text</tag>'^^rdf:XMLLiteral ." ) ; // Can't have both
-//        runTest( "a:subj a:prop '<tag>text</tag>'^^rdf:XMLLiteral@fr ." ) ;
-	}
-        //runTest( "a:subj a:prop ?x^^xsd:integer ." ) ; // No varibales
-        //runTest( "a:subj a:prop '123'^^?x ." ) ;
-        //runTest( "a:subj a:prop ?x^^?y ." ) ;
-        
-	@Test
-	public void testUnicode()
-	{
-        // Unicode 00E9 is e-acute
-        // Unicode 03B1 is alpha
-        runTest( "a:subj a:prop '\u00E9'." ) ;
-        runTest( "a:subj a:prop '\u003B1'." ) ;
-        
-        runTest( "\u00E9:subj a:prop '\u00E9'." ) ;
-        runTest( "a:subj-\u00E9 a:prop '\u00E9'." ) ;
-        
-        runTest( "\u03B1:subj a:prop '\u03B1'." ) ;
-        runTest("a:subj-\u03B1 a:prop '\u03B1'.") ;
-	}
-	
-	
-    protected void runTest( String testString ) 
-	{
-        TurtleParser parser = new TurtleParser(new StringReader(testString)) ;
-        parser.setEventHandler(new TurtleEventNull()) ;
-        parser.getPrefixMapping().setNsPrefix("a", "http://host/a#") ;
-        parser.getPrefixMapping().setNsPrefix("x", "http://host/a#") ;
-        // Unicode 00E9 is e-acute
-        // Unicode 03B1 is alpha
-        parser.getPrefixMapping().setNsPrefix("\u00E9", "http://host/e-acute/") ;
-        parser.getPrefixMapping().setNsPrefix("\u03B1", "http://host/alpha/") ;
-        parser.getPrefixMapping().setNsPrefix("", "http://host/") ;
-        parser.getPrefixMapping().setNsPrefix("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#") ;
-        parser.getPrefixMapping().setNsPrefix("xsd", "http://www.w3.org/2001/XMLSchema#") ;
-        parser.setBaseURI("http://base/") ;
-        try {
-			parser.parse() ;
+		// runTest( "() ." ) ;
+		runTest("<here> <list> ().");
+		runTest(" ( a:i1 a:i2 a:i3 ) a rdf:List.");
+	}
+
+	// Paths
+	// runTest( ":x!:y <prop> []." ) ;
+	// runTest( ":x!:y!:z <prop> []." ) ;
+	// runTest( ":x^:y <prop> []." ) ;
+	// runTest( ":x^:y^:z <prop> []." ) ;
+	// runTest( "[] <prop> :x!:y^:z." ) ;
+	// runTest( "[] :x^:y!:z []." ) ;
+
+	// Paths - using . (dot)
+	// runTest( ":x.:y <prop> []." ) ;
+	// runTest( ":x.:y.:z <prop> []." ) ;
+	// runTest( "[] <prop> :a.:c." ) ;
+	// runTest( "<thing>.:y  <prop> []." ) ;
+	// runTest( "x:x.<thing>.:y  <prop> []." ) ;
+	// runTest( "<thing>.:y^:z  <prop> []." ) ;
+	// runTest( ":y.<thing>.:z  <prop> []." ) ;
+	// runTest( "<thing> :px.:py.:pz [] . " ) ;
+	// runTest( "<thing> :px!:py!:pz [] . " ) ;
+
+	// Paths and formulae
+	// runTest( "{ :a.:b.:c . }." ) ;
+	// runTest( "{ :a.:b.<c>.}." ) ;
+
+	// Named things
+	// runTest( "_:anon :- [a:p a:v] ." ) ;
+	// runTest( "<uri> :- [a:p [ a:p a:v] ] ." ) ;
+	// // Named list: Not supported by cwm (as of 2001, 2002, 2003/09) but
+	// needed for printing shared
+	// runTest( "_:anon :- (\"1\") ." ) ;
+	// // Named formulae: Not supported by cwm (as of 2001, 2002, 2003/09)
+	// runTest( "_:anon :- { ?a ?b ?c } ." ) ;
+
+	// Datatypes
+
+	// Numbers
+
+	// Illegal in N-Triples
+	// runTest( "a:subj a:prop 'text'^^a:lang@en ." ) ;
+	// runTest( "a:subj a:prop 'text'@en^^a:lang ." ) ; // Can't have both
+
+	@Test
+	public void testXMLLiteral() {
+		// XML Literal
+		runTest("a:subj a:prop '<tag>text</tag>'^^rdf:XMLLiteral ."); // Can't
+																		// have
+																		// both
+		// runTest( "a:subj a:prop '<tag>text</tag>'^^rdf:XMLLiteral@fr ." ) ;
+	}
+
+	// runTest( "a:subj a:prop ?x^^xsd:integer ." ) ; // No varibales
+	// runTest( "a:subj a:prop '123'^^?x ." ) ;
+	// runTest( "a:subj a:prop ?x^^?y ." ) ;
+
+	@Test
+	public void testUnicode() {
+		// Unicode 00E9 is e-acute
+		// Unicode 03B1 is alpha
+		runTest("a:subj a:prop '\u00E9'.");
+		runTest("a:subj a:prop '\u003B1'.");
+
+		runTest("\u00E9:subj a:prop '\u00E9'.");
+		runTest("a:subj-\u00E9 a:prop '\u00E9'.");
+
+		runTest("\u03B1:subj a:prop '\u03B1'.");
+		runTest("a:subj-\u03B1 a:prop '\u03B1'.");
+	}
+
+	protected void runTest(String testString) {
+		TurtleParser parser = new TurtleParser(new StringReader(testString));
+		parser.setEventHandler(new TurtleEventNull());
+		parser.getPrefixMapping().setNsPrefix("a", "http://host/a#");
+		parser.getPrefixMapping().setNsPrefix("x", "http://host/a#");
+		// Unicode 00E9 is e-acute
+		// Unicode 03B1 is alpha
+		parser.getPrefixMapping().setNsPrefix("\u00E9", "http://host/e-acute/");
+		parser.getPrefixMapping().setNsPrefix("\u03B1", "http://host/alpha/");
+		parser.getPrefixMapping().setNsPrefix("", "http://host/");
+		parser.getPrefixMapping().setNsPrefix("rdf",
+				"http://www.w3.org/1999/02/22-rdf-syntax-ns#");
+		parser.getPrefixMapping().setNsPrefix("xsd",
+				"http://www.w3.org/2001/XMLSchema#");
+		parser.setBaseURI("http://base/");
+		try {
+			parser.parse();
 		} catch (ParseException e) {
-			fail( String.format( "Error parsing: `%s` [%s]", testString, e.getMessage()));
+			fail(String.format("Error parsing: `%s` [%s]", testString,
+					e.getMessage()));
 		}
 	}
-	
+
 }



Mime
View raw message