jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ki...@apache.org
Subject [3/4] jena git commit: JENA-380 Migrate more classes to JUnit4 (WIP build breaks)
Date Tue, 21 Apr 2015 14:08:38 GMT
http://git-wip-us.apache.org/repos/asf/jena/blob/0a716585/jena-core/src/test/java/com/hp/hpl/jena/ontology/impl/TestOntClass.java
----------------------------------------------------------------------
diff --git a/jena-core/src/test/java/com/hp/hpl/jena/ontology/impl/TestOntClass.java b/jena-core/src/test/java/com/hp/hpl/jena/ontology/impl/TestOntClass.java
index f925893..ae354d6 100644
--- a/jena-core/src/test/java/com/hp/hpl/jena/ontology/impl/TestOntClass.java
+++ b/jena-core/src/test/java/com/hp/hpl/jena/ontology/impl/TestOntClass.java
@@ -23,6 +23,14 @@ package com.hp.hpl.jena.ontology.impl;
 
 // Imports
 ///////////////
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
 import com.hp.hpl.jena.ontology.*;
 import com.hp.hpl.jena.rdf.model.ModelFactory;
 import com.hp.hpl.jena.rdf.model.Resource;
@@ -54,13 +62,10 @@ public class TestOntClass
     // Constructors
     //////////////////////////////////
 
-    public TestOntClass( String name ) {
-        super( name );
-    }
-
     // External signature methods
     //////////////////////////////////
 
+    @Test
     public void testSuperClassNE() {
         OntModel m = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM );
         OntClass a = m.createClass( NS + "A" );
@@ -69,6 +74,7 @@ public class TestOntClass
         assertFalse( a.hasSuperClass() );
     }
 
+    @Test
     public void testSubClassNE() {
         OntModel m = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM );
         OntClass a = m.createClass( NS + "A" );
@@ -77,6 +83,7 @@ public class TestOntClass
         assertFalse( a.hasSubClass() );
     }
 
+    @Test
     public void testCreateIndividual() {
         OntModel m = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM );
         OntClass a = m.createClass( NS + "A" );
@@ -87,6 +94,7 @@ public class TestOntClass
         assertTrue( j.hasRDFType(a) );
     }
 
+    @Test
     public void testIsHierarchyRoot0() {
         OntModel m = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM );
         OntClass a = m.createClass( NS + "A" );
@@ -96,6 +104,7 @@ public class TestOntClass
         assertFalse( b.isHierarchyRoot() );
     }
 
+    @Test
     public void testIsHierarchyRoot1() {
         OntModel m = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM_RULE_INF );
         OntClass a = m.createClass( NS + "A" );
@@ -105,6 +114,7 @@ public class TestOntClass
         assertFalse( b.isHierarchyRoot() );
     }
 
+    @Test
     public void testIsHierarchyRoot2() {
         OntModel m = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM_RDFS_INF );
         OntClass a = m.createClass( NS + "A" );
@@ -114,6 +124,7 @@ public class TestOntClass
         assertFalse( b.isHierarchyRoot() );
     }
 
+    @Test
     public void testIsHierarchyRoot3() {
         OntModel m = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM_TRANS_INF );
         OntClass a = m.createClass( NS + "A" );
@@ -123,6 +134,7 @@ public class TestOntClass
         assertFalse( b.isHierarchyRoot() );
     }
 
+    @Test
     public void testIsHierarchyRoot4() {
         OntModel m = ModelFactory.createOntologyModel( OntModelSpec.OWL_DL_MEM );
         OntClass a = m.createClass( NS + "A" );
@@ -132,6 +144,7 @@ public class TestOntClass
         assertFalse( b.isHierarchyRoot() );
     }
 
+    @Test
     public void testIsHierarchyRoot5() {
         OntModel m = ModelFactory.createOntologyModel( OntModelSpec.OWL_LITE_MEM );
         OntClass a = m.createClass( NS + "A" );
@@ -141,6 +154,7 @@ public class TestOntClass
         assertFalse( b.isHierarchyRoot() );
     }
 
+    @Test
     public void testIsHierarchyRoot8() {
         OntModel m = ModelFactory.createOntologyModel( OntModelSpec.RDFS_MEM );
         OntClass a = m.createClass( NS + "A" );
@@ -150,6 +164,7 @@ public class TestOntClass
         assertFalse( b.isHierarchyRoot() );
     }
 
+    @Test
     public void testIsHierarchyRoot9() {
         OntModel m = ModelFactory.createOntologyModel( OntModelSpec.RDFS_MEM_RDFS_INF );
         OntClass a = m.createClass( NS + "A" );
@@ -159,6 +174,7 @@ public class TestOntClass
         assertFalse( b.isHierarchyRoot() );
     }
 
+    @Test
     public void testListSubClasses0() {
         // no inference
         OntModel m = createABCDEFModel( OntModelSpec.OWL_MEM );
@@ -168,12 +184,13 @@ public class TestOntClass
         OntClass d = m.getOntClass( NS + "D" );
         OntClass e = m.getOntClass( NS + "E" );
 
-        TestUtil.assertIteratorValues( this, a.listSubClasses(), new Object[] {b,c} );
-        TestUtil.assertIteratorValues( this, a.listSubClasses( false ), new Object[] {b,c} );
-        TestUtil.assertIteratorValues( this, a.listSubClasses( true ), new Object[] {b,c} );
-        TestUtil.assertIteratorValues( this, b.listSubClasses( true ), new Object[] {d,e} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", a.listSubClasses(), new Object[] {b,c} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", a.listSubClasses( false ), new Object[] {b,c} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", a.listSubClasses( true ), new Object[] {b,c} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", b.listSubClasses( true ), new Object[] {d,e} );
     }
 
+    @Test
     public void testListSubClasses1() {
         // rule inference
         OntModel m = createABCDEFModel( OntModelSpec.OWL_MEM_RULE_INF );
@@ -184,12 +201,13 @@ public class TestOntClass
         OntClass e = m.getOntClass( NS + "E" );
         OntClass f = m.getOntClass( NS + "F" );
 
-        TestUtil.assertIteratorValues( this, a.listSubClasses(), new Object[] {b,c,d,e,f} );
-        TestUtil.assertIteratorValues( this, a.listSubClasses( false ), new Object[] {b,c,d,e,f} );
-        TestUtil.assertIteratorValues( this, a.listSubClasses( true ), new Object[] {b,c} );
-        TestUtil.assertIteratorValues( this, b.listSubClasses( true ), new Object[] {d,e} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", a.listSubClasses(), new Object[] {b,c,d,e,f} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", a.listSubClasses( false ), new Object[] {b,c,d,e,f} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", a.listSubClasses( true ), new Object[] {b,c} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", b.listSubClasses( true ), new Object[] {d,e} );
     }
 
+    @Test
     public void testListSubClasses2() {
         // micro rule inference
         OntModel m = createABCDEFModel( OntModelSpec.OWL_MEM_MICRO_RULE_INF );
@@ -200,12 +218,13 @@ public class TestOntClass
         OntClass e = m.getOntClass( NS + "E" );
         OntClass f = m.getOntClass( NS + "F" );
 
-        TestUtil.assertIteratorValues( this, a.listSubClasses(), new Object[] {b,c,d,e,f,OWL.Nothing} );
-        TestUtil.assertIteratorValues( this, a.listSubClasses( false ), new Object[] {b,c,d,e,f,OWL.Nothing} );
-        TestUtil.assertIteratorValues( this, a.listSubClasses( true ), new Object[] {b,c} );
-        TestUtil.assertIteratorValues( this, b.listSubClasses( true ), new Object[] {d,e} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", a.listSubClasses(), new Object[] {b,c,d,e,f,OWL.Nothing} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", a.listSubClasses( false ), new Object[] {b,c,d,e,f,OWL.Nothing} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", a.listSubClasses( true ), new Object[] {b,c} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", b.listSubClasses( true ), new Object[] {d,e} );
     }
 
+    @Test
     public void testListSuperClasses0() {
         // no inference
         OntModel m = createABCDEFModel( OntModelSpec.OWL_MEM );
@@ -214,12 +233,13 @@ public class TestOntClass
         OntClass c = m.getOntClass( NS + "C" );
         OntClass e = m.getOntClass( NS + "E" );
 
-        TestUtil.assertIteratorValues( this, e.listSuperClasses(), new Object[] {b,c} );
-        TestUtil.assertIteratorValues( this, e.listSuperClasses( false ), new Object[] {b,c} );
-        TestUtil.assertIteratorValues( this, e.listSuperClasses( true ), new Object[] {b,c} );
-        TestUtil.assertIteratorValues( this, b.listSuperClasses( true ), new Object[] {a} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", e.listSuperClasses(), new Object[] {b,c} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", e.listSuperClasses( false ), new Object[] {b,c} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", e.listSuperClasses( true ), new Object[] {b,c} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", b.listSuperClasses( true ), new Object[] {a} );
     }
 
+    @Test
     public void testListSuperClasses1() {
         // rule inference
         OntModel m = createABCDEFModel( OntModelSpec.OWL_MEM_RULE_INF );
@@ -228,12 +248,13 @@ public class TestOntClass
         OntClass c = m.getOntClass( NS + "C" );
         OntClass e = m.getOntClass( NS + "E" );
 
-        TestUtil.assertIteratorValues( this, e.listSuperClasses(), new Object[] {b,c,a,RDFS.Resource,OWL.Thing} );
-        TestUtil.assertIteratorValues( this, e.listSuperClasses( false ), new Object[] {b,c,a,RDFS.Resource,OWL.Thing} );
-        TestUtil.assertIteratorValues( this, e.listSuperClasses( true ), new Object[] {b,c} );
-        TestUtil.assertIteratorValues( this, b.listSuperClasses( true ), new Object[] {a} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", e.listSuperClasses(), new Object[] {b,c,a,RDFS.Resource,OWL.Thing} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", e.listSuperClasses( false ), new Object[] {b,c,a,RDFS.Resource,OWL.Thing} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", e.listSuperClasses( true ), new Object[] {b,c} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", b.listSuperClasses( true ), new Object[] {a} );
     }
 
+    @Test
     public void testListSuperClasses2() {
         // micro rule inference
         OntModel m = createABCDEFModel( OntModelSpec.OWL_MEM_MICRO_RULE_INF);
@@ -242,12 +263,13 @@ public class TestOntClass
         OntClass c = m.getOntClass( NS + "C" );
         OntClass e = m.getOntClass( NS + "E" );
 
-        TestUtil.assertIteratorValues( this, e.listSuperClasses(), new Object[] {b,c,a,OWL.Thing} );
-        TestUtil.assertIteratorValues( this, e.listSuperClasses( false ), new Object[] {b,c,a,OWL.Thing} );
-        TestUtil.assertIteratorValues( this, e.listSuperClasses( true ), new Object[] {b,c} );
-        TestUtil.assertIteratorValues( this, b.listSuperClasses( true ), new Object[] {a} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", e.listSuperClasses(), new Object[] {b,c,a,OWL.Thing} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", e.listSuperClasses( false ), new Object[] {b,c,a,OWL.Thing} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", e.listSuperClasses( true ), new Object[] {b,c} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", b.listSuperClasses( true ), new Object[] {a} );
     }
 
+    @Test
     public void testListSuperClasses3() {
         OntModel m = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM);
         OntClass A = m.createClass( NS +"A");
@@ -258,11 +280,10 @@ public class TestOntClass
         B.addSuperClass(C);
         C.addSuperClass(B);
 
-        TestUtil.assertIteratorValues( this, A.listSuperClasses( true ), new Object[] {B,C} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", A.listSuperClasses( true ), new Object[] {B,C} );
     }
 
-
-
+    @Test
     public void testListInstances0() {
         // no inference
         OntModel m = createABCDEFModel( OntModelSpec.OWL_MEM );
@@ -272,13 +293,14 @@ public class TestOntClass
         Individual ia = a.createIndividual();
         Individual ib = b.createIndividual();
 
-        TestUtil.assertIteratorValues( this, a.listInstances(), new Object[] {ia} );
-        TestUtil.assertIteratorValues( this, b.listInstances(), new Object[] {ib} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", a.listInstances(), new Object[] {ia} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", b.listInstances(), new Object[] {ib} );
 
-        TestUtil.assertIteratorValues( this, a.listInstances(true), new Object[] {ia} );
-        TestUtil.assertIteratorValues( this, b.listInstances(true), new Object[] {ib} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", a.listInstances(true), new Object[] {ia} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", b.listInstances(true), new Object[] {ib} );
     }
 
+    @Test
     public void testListInstances1() {
         // no inference
         OntModel m = createABCDEFModel( OntModelSpec.OWL_MEM_RULE_INF );
@@ -294,13 +316,14 @@ public class TestOntClass
         Individual id = d.createIndividual(NS + "iD");
         Individual ie = e.createIndividual(NS + "iE");
 
-        TestUtil.assertIteratorValues( this, a.listInstances(), new Object[] {ia,ib,ic,id,ie} );
-        TestUtil.assertIteratorValues( this, b.listInstances(), new Object[] {ib,id,ie} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", a.listInstances(), new Object[] {ia,ib,ic,id,ie} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", b.listInstances(), new Object[] {ib,id,ie} );
 
-        TestUtil.assertIteratorValues( this, a.listInstances(true), new Object[] {ia} );
-        TestUtil.assertIteratorValues( this, b.listInstances(true), new Object[] {ib} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", a.listInstances(true), new Object[] {ia} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", b.listInstances(true), new Object[] {ib} );
     }
 
+    @Test
     public void testListInstances2() {
         // no inference
         OntModel m = createABCDEFModel( OntModelSpec.OWL_MEM_MICRO_RULE_INF );
@@ -316,13 +339,14 @@ public class TestOntClass
         Individual id = d.createIndividual(NS + "iD");
         Individual ie = e.createIndividual(NS + "iE");
 
-        TestUtil.assertIteratorValues( this, a.listInstances(), new Object[] {ia,ib,ic,id,ie} );
-        TestUtil.assertIteratorValues( this, b.listInstances(), new Object[] {ib,id,ie} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", a.listInstances(), new Object[] {ia,ib,ic,id,ie} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", b.listInstances(), new Object[] {ib,id,ie} );
 
-        TestUtil.assertIteratorValues( this, a.listInstances(true), new Object[] {ia} );
-        TestUtil.assertIteratorValues( this, b.listInstances(true), new Object[] {ib} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", a.listInstances(true), new Object[] {ia} );
+        TestUtil.assertIteratorValues( TestOntClass.class, "TestOntClass", b.listInstances(true), new Object[] {ib} );
     }
 
+    @Test
     public void testDropIndividual() {
         OntModel m = createABCDEFModel( OntModelSpec.OWL_MEM );
         OntClass a = m.getOntClass( NS + "A" );
@@ -352,6 +376,7 @@ public class TestOntClass
         assertFalse( ia.hasOntClass( b ) );
     }
 
+    @Test
     public void testDatatypeIsClassOwlFull() {
         OntModel m = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM );
         Resource c = m.createResource();
@@ -359,6 +384,7 @@ public class TestOntClass
         assertTrue( c.canAs( OntClass.class ));
     }
 
+    @Test
     public void testDatatypeIsClassOwlDL() {
         OntModel m = ModelFactory.createOntologyModel( OntModelSpec.OWL_DL_MEM );
         Resource c = m.createResource();
@@ -366,6 +392,7 @@ public class TestOntClass
         assertTrue( c.canAs( OntClass.class ));
     }
 
+    @Test
     public void testDatatypeIsClassOwlLite() {
         OntModel m = ModelFactory.createOntologyModel( OntModelSpec.OWL_LITE_MEM );
         Resource c = m.createResource();
@@ -373,6 +400,7 @@ public class TestOntClass
         assertTrue( c.canAs( OntClass.class ));
     }
 
+    @Test
     public void testDatatypeIsClassOwlRDFS() {
         OntModel m = ModelFactory.createOntologyModel( OntModelSpec.RDFS_MEM );
         Resource c = m.createResource();
@@ -380,6 +408,7 @@ public class TestOntClass
         assertTrue( c.canAs( OntClass.class ));
     }
 
+    @Test
     public void testOwlThingNothingClass() {
         OntModel m = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM );
 

http://git-wip-us.apache.org/repos/asf/jena/blob/0a716585/jena-core/src/test/java/com/hp/hpl/jena/ontology/impl/TestOntGraph.java
----------------------------------------------------------------------
diff --git a/jena-core/src/test/java/com/hp/hpl/jena/ontology/impl/TestOntGraph.java b/jena-core/src/test/java/com/hp/hpl/jena/ontology/impl/TestOntGraph.java
index a0ca379..db7146a 100644
--- a/jena-core/src/test/java/com/hp/hpl/jena/ontology/impl/TestOntGraph.java
+++ b/jena-core/src/test/java/com/hp/hpl/jena/ontology/impl/TestOntGraph.java
@@ -18,11 +18,9 @@
 
 package com.hp.hpl.jena.ontology.impl;
 
-import com.hp.hpl.jena.graph.*;
-import com.hp.hpl.jena.graph.test.*;
-import com.hp.hpl.jena.rdf.model.*;
-
-import junit.framework.*;
+import com.hp.hpl.jena.graph.Graph;
+import com.hp.hpl.jena.graph.test.AbstractTestGraph;
+import com.hp.hpl.jena.rdf.model.ModelFactory;
 
 /**
     Ensure that an OntGraph passes the graph tests. Clunky because it has to go
@@ -31,12 +29,7 @@ import junit.framework.*;
 
 public class TestOntGraph extends AbstractTestGraph
     {
-    public TestOntGraph( String name )
-        { super( name ); }
         
-    public static TestSuite suite()
-        { return new TestSuite( TestOntGraph.class ); }
-
     @Override
     public Graph getGraph()
         { return ModelFactory.createOntologyModel().getGraph(); }

http://git-wip-us.apache.org/repos/asf/jena/blob/0a716585/jena-core/src/test/java/com/hp/hpl/jena/ontology/impl/TestOntModel.java
----------------------------------------------------------------------
diff --git a/jena-core/src/test/java/com/hp/hpl/jena/ontology/impl/TestOntModel.java b/jena-core/src/test/java/com/hp/hpl/jena/ontology/impl/TestOntModel.java
index a243d31..b514414 100644
--- a/jena-core/src/test/java/com/hp/hpl/jena/ontology/impl/TestOntModel.java
+++ b/jena-core/src/test/java/com/hp/hpl/jena/ontology/impl/TestOntModel.java
@@ -23,9 +23,18 @@ package com.hp.hpl.jena.ontology.impl;
 
 // Imports
 ///////////////
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
 import java.io.*;
 import java.util.*;
 
+import org.junit.Before;
+import org.junit.Test;
+
 import com.hp.hpl.jena.graph.Graph;
 import com.hp.hpl.jena.ontology.*;
 import com.hp.hpl.jena.ontology.impl.OWLProfile.SupportsCheck ;
@@ -84,14 +93,10 @@ public class TestOntModel
     // Constructors
     //////////////////////////////////
 
-    public TestOntModel( String name ) {
-        super( name );
-    }
-
     // External signature methods
     //////////////////////////////////
 
-    @Override
+    @Before
     public void setUp() {
         // ensure the ont doc manager is in a consistent state
         OntDocumentManager.getInstance().reset( true );
@@ -99,6 +104,7 @@ public class TestOntModel
 
 
     /** Test writing the base model to an output stream */
+    @Test
     public void testWriteOutputStream() {
         OntModel m = ModelFactory.createOntologyModel();
 
@@ -137,6 +143,7 @@ public class TestOntModel
         assertTrue( "InputStream write/read cycle failed (2)", mIn2.isIsomorphicWith( m.getBaseModel() ) );
     }
 
+    @Test
     public void testGetBaseModelPrefixes() {
         OntModel om = ModelFactory.createOntologyModel();
         om.setNsPrefix( "bill", "http://bill.and.ben/flowerpot#" );
@@ -148,6 +155,7 @@ public class TestOntModel
      * The default namespace pefix of a non-base-model should not manifest as
      * the default namespace prefix of the base model or the Ont model.
      */
+    @Test
     public void testPolyadicPrefixMapping() {
         final String IMPORTED_NAMESPACE = "http://imported#";
         final String LOCAL_NAMESPACE = "http://local#";
@@ -159,6 +167,7 @@ public class TestOntModel
         assertNull( ontModel.getNsURIPrefix( IMPORTED_NAMESPACE ) );
     }
 
+    @Test
     public void testWritesPrefixes() {
         OntModel om = ModelFactory.createOntologyModel();
         om.setNsPrefix( "spoo", "http://spoo.spoo.com/spoo#" );
@@ -172,6 +181,7 @@ public class TestOntModel
     }
 
     /** Test writing the base model to an output stream */
+    @Test
     public void testWriteWriter() {
         OntModel m = ModelFactory.createOntologyModel();
 
@@ -209,6 +219,7 @@ public class TestOntModel
         assertTrue( "Writer write/read cycle failed (2)", mIn2.isIsomorphicWith( m.getBaseModel() ) );
     }
 
+    @Test
     public void testGetOntology() {
         OntModel m = ModelFactory.createOntologyModel();
         Resource r = m.getResource( NS + "r" );
@@ -219,7 +230,7 @@ public class TestOntModel
         assertNull( "result of get r", m.getOntology( NS+"r"));
     }
 
-
+    @Test
     public void testGetIndividual() {
         OntModel m = ModelFactory.createOntologyModel();
         OntClass c = m.createClass( NS +"c" );
@@ -231,6 +242,7 @@ public class TestOntModel
     }
 
     /** User requested: allow null arguments when creating individuals */
+    @Test
     public void testCreateIndividual() {
         OntModel m = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM );
         Resource i0 = m.createIndividual( OWL.Thing );
@@ -248,6 +260,7 @@ public class TestOntModel
         assertNotNull( i5 );
     }
 
+    @Test
     public void testGetOntProperty() {
         OntModel m = ModelFactory.createOntologyModel();
         Resource r = m.getResource( NS + "r" );
@@ -258,7 +271,7 @@ public class TestOntModel
         assertNull( "result of get r", m.getOntProperty( NS+"r"));
     }
 
-
+    @Test
     public void testGetObjectProperty() {
         OntModel m = ModelFactory.createOntologyModel();
         Resource r = m.getResource( NS + "r" );
@@ -269,7 +282,7 @@ public class TestOntModel
         assertNull( "result of get r", m.getObjectProperty( NS+"r"));
     }
 
-
+    @Test
     public void testGetTransitiveProperty() {
         OntModel m = ModelFactory.createOntologyModel();
         Resource r = m.getResource( NS + "r" );
@@ -280,7 +293,7 @@ public class TestOntModel
         assertNull( "result of get r", m.getTransitiveProperty( NS+"r"));
     }
 
-
+    @Test
     public void testGetSymmetricProperty() {
         OntModel m = ModelFactory.createOntologyModel();
         Resource r = m.getResource( NS + "r" );
@@ -291,7 +304,7 @@ public class TestOntModel
         assertNull( "result of get r", m.getSymmetricProperty( NS+"r"));
     }
 
-
+    @Test
     public void testGetInverseFunctionalProperty() {
         OntModel m = ModelFactory.createOntologyModel();
         Resource r = m.getResource( NS + "r" );
@@ -302,7 +315,7 @@ public class TestOntModel
         assertNull( "result of get r", m.getInverseFunctionalProperty( NS+"r"));
     }
 
-
+    @Test
     public void testGetDatatypeProperty() {
         OntModel m = ModelFactory.createOntologyModel();
         Resource r = m.getResource( NS + "r" );
@@ -313,7 +326,7 @@ public class TestOntModel
         assertNull( "result of get r", m.getDatatypeProperty( NS+"r"));
     }
 
-
+    @Test
     public void testGetAnnotationProperty() {
         OntModel m = ModelFactory.createOntologyModel();
         Resource r = m.getResource( NS + "r" );
@@ -324,6 +337,7 @@ public class TestOntModel
         assertNull( "result of get r", m.getAnnotationProperty( NS+"r"));
     }
 
+    @Test
     public void testGetOntResource() {
         OntModel m = ModelFactory.createOntologyModel();
         OntResource r0 = m.getOntResource( NS + "a" );
@@ -340,6 +354,7 @@ public class TestOntModel
         assertInstanceOf( OntResource.class, r3 );
     }
 
+    @Test
     public void testGetOntClass() {
         OntModel m = ModelFactory.createOntologyModel();
         Resource r = m.getResource( NS + "r" );
@@ -351,7 +366,7 @@ public class TestOntModel
         assertNull( "result of get r", m.getOntClass( NS+"r"));
     }
 
-
+    @Test
     public void testGetComplementClass() {
         OntModel m = ModelFactory.createOntologyModel();
         OntClass c = m.createClass( NS +"c" );
@@ -363,7 +378,7 @@ public class TestOntModel
         assertNull( "result of get r", m.getComplementClass( NS+"r"));
     }
 
-
+    @Test
     public void testGetEnumeratedClass() {
         OntModel m = ModelFactory.createOntologyModel();
         RDFList l = m.createList();
@@ -375,7 +390,7 @@ public class TestOntModel
         assertNull( "result of get r", m.getEnumeratedClass( NS+"r"));
     }
 
-
+    @Test
     public void testGetUnionClass() {
         OntModel m = ModelFactory.createOntologyModel();
         RDFList l = m.createList();
@@ -387,7 +402,7 @@ public class TestOntModel
         assertNull( "result of get r", m.getUnionClass( NS+"r"));
     }
 
-
+    @Test
     public void testGetIntersectionClass() {
         OntModel m = ModelFactory.createOntologyModel();
         RDFList l = m.createList();
@@ -399,7 +414,7 @@ public class TestOntModel
         assertNull( "result of get r", m.getIntersectionClass( NS+"r"));
     }
 
-
+    @Test
     public void testGetRestriction() {
         OntModel m = ModelFactory.createOntologyModel();
         Property p = m.createProperty( NS + "p" );
@@ -411,7 +426,7 @@ public class TestOntModel
         assertNull( "result of get r", m.getRestriction( NS+"r"));
     }
 
-
+    @Test
     public void testGetHasValueRestriction() {
         OntModel m = ModelFactory.createOntologyModel();
         Property p = m.createProperty( NS + "p" );
@@ -424,7 +439,7 @@ public class TestOntModel
         assertNull( "result of get r", m.getHasValueRestriction( NS+"r"));
     }
 
-
+    @Test
     public void testGetSomeValuesFromRestriction() {
         OntModel m = ModelFactory.createOntologyModel();
         Property p = m.createProperty( NS + "p" );
@@ -437,7 +452,7 @@ public class TestOntModel
         assertNull( "result of get r", m.getSomeValuesFromRestriction( NS+"r"));
     }
 
-
+    @Test
     public void testGetAllValuesFromRestriction() {
         OntModel m = ModelFactory.createOntologyModel();
         Property p = m.createProperty( NS + "p" );
@@ -450,7 +465,7 @@ public class TestOntModel
         assertNull( "result of get r", m.getAllValuesFromRestriction( NS+"r"));
     }
 
-
+    @Test
     public void testGetCardinalityRestriction() {
         OntModel m = ModelFactory.createOntologyModel();
         Property p = m.createProperty( NS + "p" );
@@ -462,7 +477,7 @@ public class TestOntModel
         assertNull( "result of get r", m.getCardinalityRestriction( NS+"r"));
     }
 
-
+    @Test
     public void testGetMinCardinalityRestriction() {
         OntModel m = ModelFactory.createOntologyModel();
         Property p = m.createProperty( NS + "p" );
@@ -474,7 +489,7 @@ public class TestOntModel
         assertNull( "result of get r", m.getMinCardinalityRestriction( NS+"r"));
     }
 
-
+    @Test
     public void testGetMaxCardinalityRestriction() {
         OntModel m = ModelFactory.createOntologyModel();
         Property p = m.createProperty( NS + "p" );
@@ -486,6 +501,7 @@ public class TestOntModel
         assertNull( "result of get r", m.getMaxCardinalityRestriction( NS+"r"));
     }
 
+    @Test
     public void testGetSubgraphs() {
         OntModel m = ModelFactory.createOntologyModel();
         m.read( "file:testing/ontology/testImport6/a.owl" );
@@ -496,7 +512,7 @@ public class TestOntModel
         assertEquals( "n subgraphs should be ", 3, subs.size() );
     }
 
-
+    @Test
     public void testListImportURIs() {
         OntModel m = ModelFactory.createOntologyModel();
         m.read( "file:testing/ontology/testImport6/a.owl" );
@@ -516,7 +532,7 @@ public class TestOntModel
     }
 
     /** Some tests for listing properties. See also {@link TestListSyntaxCategories} */
-
+    @Test
     public void testListOntProperties0() {
         OntModel m = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM );
         ObjectProperty op = m.createObjectProperty( NS + "op" );
@@ -535,6 +551,7 @@ public class TestOntModel
         assertTrue( iteratorContains( m.listOntProperties(), rdfp ) );
     }
 
+    @Test
     public void testListOntProperties1() {
         OntModel m = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM_MICRO_RULE_INF);
         ObjectProperty op = m.createObjectProperty( NS + "op" );
@@ -553,6 +570,7 @@ public class TestOntModel
         assertTrue( iteratorContains( m.listOntProperties(), rdfp ) );
     }
 
+    @Test
     public void testListOntProperties2() {
         OntModelSpec owlDLReasoner = new OntModelSpec( OntModelSpec.OWL_DL_MEM );
         owlDLReasoner.setReasoner( OntModelSpec.OWL_MEM_MICRO_RULE_INF.getReasoner() );
@@ -573,7 +591,7 @@ public class TestOntModel
         assertTrue( iteratorContains( m.listOntProperties(), rdfp ) );
     }
 
-
+    @Test
     public void testListAllOntProperties0() {
         OntModel m = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM );
         ObjectProperty op = m.createObjectProperty( NS + "op" );
@@ -592,6 +610,7 @@ public class TestOntModel
         assertTrue( iteratorContains( m.listAllOntProperties(), rdfp ) );
     }
 
+    @Test
     public void testListObjectProperties0() {
         OntModel m = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM );
         ObjectProperty op = m.createObjectProperty( NS + "op" );
@@ -610,6 +629,7 @@ public class TestOntModel
         assertFalse( iteratorContains( m.listObjectProperties(), rdfp ) );
     }
 
+    @Test
     public void testListDatatypeProperties0() {
         OntModel m = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM );
         ObjectProperty op = m.createObjectProperty( NS + "op" );
@@ -628,6 +648,7 @@ public class TestOntModel
         assertFalse( iteratorContains( m.listDatatypeProperties(), rdfp ) );
     }
 
+    @Test
     public void testListAnnotationProperties0() {
         OntModel m = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM );
         ObjectProperty op = m.createObjectProperty( NS + "op" );
@@ -646,6 +667,7 @@ public class TestOntModel
         assertFalse( iteratorContains( m.listAnnotationProperties(), rdfp ) );
     }
 
+    @Test
     public void testListSubModels0() {
         OntModel m = ModelFactory.createOntologyModel();
         m.read( "file:testing/ontology/testImport6/a.owl" );
@@ -669,6 +691,7 @@ public class TestOntModel
         assertEquals( "Wrong number of sub-model imports", 0, nImports );
     }
 
+    @Test
     public void testListSubModels1() {
         OntModel m = ModelFactory.createOntologyModel();
         m.read( "file:testing/ontology/testImport6/a.owl" );
@@ -691,6 +714,7 @@ public class TestOntModel
         assertEquals( "Wrong number of sub-model imports", 2, nImports );
     }
 
+    @Test
     public void testGetImportedModel() {
         OntModel m = ModelFactory.createOntologyModel();
         m.read( "file:testing/ontology/testImport6/a.owl" );
@@ -713,6 +737,7 @@ public class TestOntModel
      * Test that the supports checks that are defined in the OWL full profile are not
      * missing in the DL and Lite profiles, unless by design.
      * Not strictly a model test, but it has to go somewhere */
+    @Test
     public void testProfiles() {
         List<Class<?>> notInDL = Arrays.asList( new Class<?>[] {} );
         List<Class<?>> notInLite = Arrays.asList( new Class<?>[] {DataRange.class, HasValueRestriction.class} );
@@ -739,6 +764,7 @@ public class TestOntModel
     <p>
         <b>Yet</b>.
     */
+    @Test
     public void testBulkAddWorks()
         {
         OntModel om1= ModelFactory.createOntologyModel();
@@ -746,6 +772,7 @@ public class TestOntModel
         om1.add( om2 );
         }
 
+    @Test
     public void testRead() {
         String base0 = "http://example.com/test0";
         String ns0 = base0 + "#";
@@ -767,6 +794,7 @@ public class TestOntModel
         assertNotNull( "Should be a class ns1:A", m.getOntClass( ns1 + "A" ) );
     }
 
+    @Test
     public void testListDataRange() {
         String base = "http://jena.hpl.hp.com/test#";
         String doc =
@@ -802,8 +830,7 @@ public class TestOntModel
         assertFalse( "Should no more DataRange", i.hasNext() );
     }
 
-
-
+    @Test
     public void testListHierarchyRoots0() {
         OntModel m = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM );
         assertFalse( m.listHierarchyRootClasses().hasNext() );
@@ -811,6 +838,7 @@ public class TestOntModel
         assertFalse( m.listHierarchyRootClasses().hasNext() );
     }
 
+    @Test
     public void testListHierarchyRoots1() {
         String doc =
                   "@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. "
@@ -825,11 +853,11 @@ public class TestOntModel
         m.read( new StringReader(doc), NS, "N3" );
 
         OntClass a = m.getOntClass(NS+"A");
-        TestUtil.assertIteratorValues( this, m.listHierarchyRootClasses(),
+        TestUtil.assertIteratorValues( TestOntModel.class, "TestOntModel", m.listHierarchyRootClasses(),
                                        new Object[] {a} );
     }
 
-
+    @Test
     public void testListHierarchyRoots2() {
         String doc =
                   "@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. "
@@ -844,11 +872,11 @@ public class TestOntModel
         m.read( new StringReader(doc), NS, "N3" );
 
         OntClass a = m.getOntClass(NS+"A");
-        TestUtil.assertIteratorValues( this, m.listHierarchyRootClasses(),
+        TestUtil.assertIteratorValues( TestOntModel.class, "TestOntModel", m.listHierarchyRootClasses(),
                                        new Object[] {a} );
     }
 
-
+    @Test
     public void testListHierarchyRoots3() {
         String doc =
                   "@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. "
@@ -864,10 +892,11 @@ public class TestOntModel
         m.read( new StringReader(doc), NS, "N3" );
 
         OntClass a = m.getOntClass(NS+"A");
-        TestUtil.assertIteratorValues( this, m.listHierarchyRootClasses(),
+        TestUtil.assertIteratorValues( TestOntModel.class, "TestOntModel", m.listHierarchyRootClasses(),
                                        new Object[] {a} );
     }
 
+    @Test
     public void testListHierarchyRoots4() {
         String doc =
                   "@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. "
@@ -885,11 +914,12 @@ public class TestOntModel
 
         OntClass a = m.getOntClass(NS+"A");
         OntClass c = m.getOntClass(NS+"C");
-        TestUtil.assertIteratorValues( this, m.listHierarchyRootClasses(),
+        TestUtil.assertIteratorValues( TestOntModel.class, "TestOntModel", m.listHierarchyRootClasses(),
                                        new Object[] {a,c} );
     }
 
     /* Auto-loading of imports is off by default */
+    @Test
     public void testLoadImports0() {
         OntModel m = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM );
         Resource a = m.getResource( "file:testing/ontology/testImport3/a.owl" );
@@ -910,8 +940,8 @@ public class TestOntModel
         assertTrue( "b should be imported", m.hasLoadedImport( "file:testing/ontology/testImport3/b.owl" ) );
     }
 
-
     /* Auto-loading of imports = on */
+    @Test
     public void testLoadImports1() {
         OntModel m = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM );
         Resource a = m.getResource( "file:testing/ontology/testImport3/a.owl" );
@@ -935,6 +965,7 @@ public class TestOntModel
     }
 
     /** Test that resources are attached to the right sub-models when importing */
+    @Test
     public void testLoadImports2() {
         OntModel ontModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM, null);
         ontModel.read("file:testing/ontology/testImport8/a.owl");
@@ -954,6 +985,7 @@ public class TestOntModel
     }
 
     /** Test getting conclusions after loading imports */
+    @Test
     public void testAddImports0() {
         OntModel base = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM );
 
@@ -976,6 +1008,7 @@ public class TestOntModel
         assertTrue( a.hasSubClass( b ) );
     }
 
+    @Test
     public void testAddImports1() {
         String ns = "http://jena.hpl.hp.com/2003/03/testont";
         OntModel base = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM );
@@ -1002,6 +1035,7 @@ public class TestOntModel
     /**
      * AddSubModel variant 2: base = no inf, import = no inf
      */
+    @Test
     public void testaddSubModel0() {
         OntModel m0 = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM );
         OntModel m1 = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM );
@@ -1020,6 +1054,7 @@ public class TestOntModel
     /**
      * AddSubModel variant 2: base = inf, import = no inf
      */
+    @Test
     public void testaddSubModel1() {
         OntDocumentManager.getInstance().setProcessImports( false );
         OntDocumentManager.getInstance().addAltEntry( "http://www.w3.org/TR/2003/CR-owl-guide-20030818/wine",
@@ -1042,6 +1077,7 @@ public class TestOntModel
     /**
      * Variant 3: base = no inf, import = inf
      */
+    @Test
     public void testaddSubModel3() {
         OntModel m0 = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM );
         OntModel m1 = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM_RDFS_INF );
@@ -1060,6 +1096,7 @@ public class TestOntModel
     /**
      * Variant 4: base = inf, import = inf
      */
+    @Test
     public void testaddSubModel4() {
         OntModel m0 = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM_RDFS_INF );
         OntModel m1 = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM_RDFS_INF );
@@ -1076,6 +1113,7 @@ public class TestOntModel
     }
 
     /** Remove a sub model (imported model) */
+    @Test
     public void testremoveSubModel0() {
         OntModel m = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM, null );
         m.read( "file:testing/ontology/testImport3/a.owl" );
@@ -1092,6 +1130,7 @@ public class TestOntModel
 
     /** Getting the deductions model of an OntModel
      * see also {@link TestBugs#testOntModelGetDeductions()}
+     * FIXME: test seems to be working again 
      * <p>ijd: Feb 6th, 2008 - this test has been disabled for
      * the time being, since it is not correct as written. However,
      * I'm not removing or changing it just yet, since it is showing up

http://git-wip-us.apache.org/repos/asf/jena/blob/0a716585/jena-core/src/test/java/com/hp/hpl/jena/ontology/impl/TestOntModelSpec.java
----------------------------------------------------------------------
diff --git a/jena-core/src/test/java/com/hp/hpl/jena/ontology/impl/TestOntModelSpec.java b/jena-core/src/test/java/com/hp/hpl/jena/ontology/impl/TestOntModelSpec.java
index 1ea24cb..8f3df56 100644
--- a/jena-core/src/test/java/com/hp/hpl/jena/ontology/impl/TestOntModelSpec.java
+++ b/jena-core/src/test/java/com/hp/hpl/jena/ontology/impl/TestOntModelSpec.java
@@ -18,14 +18,17 @@
 
 package com.hp.hpl.jena.ontology.impl;
 
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
 import com.hp.hpl.jena.ontology.OntModelSpec;
 import com.hp.hpl.jena.rdf.model.test.ModelTestBase;
 
 public class TestOntModelSpec extends ModelTestBase
     {
-    public TestOntModelSpec( String name )
-        { super( name ); }
 
+    @Test
     public void testEqualityAndDifference()
         {
         testEqualityAndDifference( OntModelSpec.OWL_MEM );
@@ -52,11 +55,13 @@ public class TestOntModelSpec extends ModelTestBase
         assertEquals( os, new OntModelSpec( os ) );
         }
     
+    @Test
     public void testAssembleRoot()
         {
         // TODO OntModelSpec.assemble( Resource root )
         }
     
+    @Test
     public void testAssembleModel()
         {
         // TODO OntModelSpec.assemble( Model model )

http://git-wip-us.apache.org/repos/asf/jena/blob/0a716585/jena-core/src/test/java/com/hp/hpl/jena/ontology/impl/TestPackage.java
----------------------------------------------------------------------
diff --git a/jena-core/src/test/java/com/hp/hpl/jena/ontology/impl/TestPackage.java b/jena-core/src/test/java/com/hp/hpl/jena/ontology/impl/TestPackage.java
index b3d670f..4704bc8 100644
--- a/jena-core/src/test/java/com/hp/hpl/jena/ontology/impl/TestPackage.java
+++ b/jena-core/src/test/java/com/hp/hpl/jena/ontology/impl/TestPackage.java
@@ -18,44 +18,34 @@
 
 package com.hp.hpl.jena.ontology.impl;
 
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
 
-import junit.framework.*;
 
 /**
     Collected test suite for the .ontology.impl package.
 */
-
-public class TestPackage extends TestSuite {
-
-    static public TestSuite suite() {
-        return new TestPackage();
-    }
-
-    /** Creates new TestPackage */
-    private TestPackage() {
-        super("ontology.impl");
-        addTest( "TestOntGraph", TestOntGraph.suite() );
-        addTest( "TestResource", TestResource.suite() );
-        addTest( "TestAxioms", TestAxioms.suite() );
-        addTest( "TestClassExpression", TestClassExpression.suite() );
-        addTest( "TestOntDocumentManager", TestOntDocumentManager.suite() );
-        addTest( "TestOntology", TestOntology.suite() );
-        addTest( "TestProperty", TestProperty.suite() );
-        addTest( "TestListSyntaxCategories", TestListSyntaxCategories.suite() );
-        addTest( "TestCreate", TestCreate.suite() );
-        addTest( "TestIndividual", TestIndividual.suite() );
-        addTest( "TestAllDifferent", TestAllDifferent.suite() );
-        addTestSuite( TestOntModelSpec.class );
-        addTest( new TestSuite( TestOntReasoning.class  ) );
-        addTest( new TestSuite( TestOntModel.class ) );
-        addTest( new TestSuite( TestOntClass.class ));
-        addTest( new TestSuite( TestFrameView.class ));
-        addTest( new TestSuite( TestOntTools.class ));
-    }
-
-    private void addTest(String name, TestSuite tc) {
-        tc.setName(name);
-        addTest(tc);
-    }
+@RunWith(Suite.class)
+@SuiteClasses({
+    TestOntGraph.class,
+    TestResource.class,
+    TestAxioms.class,
+    TestClassExpression.class,
+    TestOntDocumentManager.class,
+    TestOntology.class,
+    TestProperty.class,
+    TestListSyntaxCategories.class,
+    TestCreate.class,
+    TestIndividual.class,
+    TestAllDifferent.class,
+    TestOntModelSpec.class,
+    TestOntReasoning.class,
+    TestOntModel.class,
+    TestOntClass.class,
+    TestFrameView.class,
+    TestOntTools.class
+})
+public class TestPackage  {
 
 }

http://git-wip-us.apache.org/repos/asf/jena/blob/0a716585/jena-core/src/test/java/com/hp/hpl/jena/rdf/model/test/AbstractContainerMethods.java
----------------------------------------------------------------------
diff --git a/jena-core/src/test/java/com/hp/hpl/jena/rdf/model/test/AbstractContainerMethods.java b/jena-core/src/test/java/com/hp/hpl/jena/rdf/model/test/AbstractContainerMethods.java
index 7ece627..1b3e15b 100644
--- a/jena-core/src/test/java/com/hp/hpl/jena/rdf/model/test/AbstractContainerMethods.java
+++ b/jena-core/src/test/java/com/hp/hpl/jena/rdf/model/test/AbstractContainerMethods.java
@@ -18,37 +18,36 @@
 
 package com.hp.hpl.jena.rdf.model.test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Before;
+import org.junit.Test;
+
 import com.hp.hpl.jena.rdf.model.Container;
 import com.hp.hpl.jena.rdf.model.Literal;
 import com.hp.hpl.jena.rdf.model.NodeIterator;
 import com.hp.hpl.jena.rdf.model.Resource;
-import com.hp.hpl.jena.rdf.model.test.helpers.TestingModelFactory;
 import com.hp.hpl.jena.vocabulary.RDF;
 
-import org.junit.Assert;
-
 public abstract class AbstractContainerMethods extends AbstractModelTestBase
 {
 
 	protected Resource resource;
 
-	public AbstractContainerMethods( final TestingModelFactory modelFactory,
-			final String name )
-	{
-		super(modelFactory, name);
-	}
-
 	protected abstract Container createContainer();
 
 	protected abstract Resource getContainerType();
 
-	@Override
+	@Before
 	public void setUp() throws Exception
 	{
 		super.setUp();
 		resource = model.createResource();
 	}
 
+	@Test
 	public void testContainerOfIntegers()
 	{
 		final int num = 10;
@@ -57,15 +56,16 @@ public abstract class AbstractContainerMethods extends AbstractModelTestBase
 		{
 			c.add(i);
 		}
-		Assert.assertEquals(num, c.size());
+		assertEquals(num, c.size());
 		final NodeIterator it = c.iterator();
 		for (int i = 0; i < num; i += 1)
 		{
-			Assert.assertEquals(i, ((Literal) it.nextNode()).getInt());
+			assertEquals(i, ((Literal) it.nextNode()).getInt());
 		}
-		Assert.assertFalse(it.hasNext());
+		assertFalse(it.hasNext());
 	}
 
+	@Test
 	public void testContainerOfIntegersRemovingA()
 	{
 		final boolean[] retain = { true, true, true, false, false, false,
@@ -73,6 +73,7 @@ public abstract class AbstractContainerMethods extends AbstractModelTestBase
 		testContainerOfIntegersWithRemoving(retain);
 	}
 
+	@Test
 	public void testContainerOfIntegersRemovingB()
 	{
 		final boolean[] retain = { false, true, true, false, false, false,
@@ -80,6 +81,7 @@ public abstract class AbstractContainerMethods extends AbstractModelTestBase
 		testContainerOfIntegersWithRemoving(retain);
 	}
 
+	@Test
 	public void testContainerOfIntegersRemovingC()
 	{
 		final boolean[] retain = { false, false, false, false, false, false,
@@ -109,30 +111,32 @@ public abstract class AbstractContainerMethods extends AbstractModelTestBase
 		while (s.hasNext())
 		{
 			final int v = ((Literal) s.nextNode()).getInt();
-			Assert.assertFalse(found[v]);
+			assertFalse(found[v]);
 			found[v] = true;
 		}
 		for (int i = 0; i < num; i += 1)
 		{
-			Assert.assertEquals("element " + i, retain[i], found[i]);
+			assertEquals("element " + i, retain[i], found[i]);
 		}
 	}
 
+	@Test
 	public void testEmptyContainer()
 	{
 		final Container c = createContainer();
-		Assert.assertTrue(model.contains(c, RDF.type, getContainerType()));
-		Assert.assertEquals(0, c.size());
-		Assert.assertFalse(c.contains(AbstractModelTestBase.tvBoolean));
-		Assert.assertFalse(c.contains(AbstractModelTestBase.tvByte));
-		Assert.assertFalse(c.contains(AbstractModelTestBase.tvShort));
-		Assert.assertFalse(c.contains(AbstractModelTestBase.tvInt));
-		Assert.assertFalse(c.contains(AbstractModelTestBase.tvLong));
-		Assert.assertFalse(c.contains(AbstractModelTestBase.tvChar));
-		Assert.assertFalse(c.contains(AbstractModelTestBase.tvFloat));
-		Assert.assertFalse(c.contains(AbstractModelTestBase.tvString));
+		assertTrue(model.contains(c, RDF.type, getContainerType()));
+		assertEquals(0, c.size());
+		assertFalse(c.contains(AbstractModelTestBase.tvBoolean));
+		assertFalse(c.contains(AbstractModelTestBase.tvByte));
+		assertFalse(c.contains(AbstractModelTestBase.tvShort));
+		assertFalse(c.contains(AbstractModelTestBase.tvInt));
+		assertFalse(c.contains(AbstractModelTestBase.tvLong));
+		assertFalse(c.contains(AbstractModelTestBase.tvChar));
+		assertFalse(c.contains(AbstractModelTestBase.tvFloat));
+		assertFalse(c.contains(AbstractModelTestBase.tvString));
 	}
 
+	@Test
 	public void testFillingContainer()
 	{
 		final Container c = createContainer();
@@ -140,28 +144,28 @@ public abstract class AbstractContainerMethods extends AbstractModelTestBase
 		final Literal tvLiteral = model.createLiteral("test 12 string 2");
 		// Resource tvResObj = model.createResource( new ResTestObjF() );
 		c.add(AbstractModelTestBase.tvBoolean);
-		Assert.assertTrue(c.contains(AbstractModelTestBase.tvBoolean));
+		assertTrue(c.contains(AbstractModelTestBase.tvBoolean));
 		c.add(AbstractModelTestBase.tvByte);
-		Assert.assertTrue(c.contains(AbstractModelTestBase.tvByte));
+		assertTrue(c.contains(AbstractModelTestBase.tvByte));
 		c.add(AbstractModelTestBase.tvShort);
-		Assert.assertTrue(c.contains(AbstractModelTestBase.tvShort));
+		assertTrue(c.contains(AbstractModelTestBase.tvShort));
 		c.add(AbstractModelTestBase.tvInt);
-		Assert.assertTrue(c.contains(AbstractModelTestBase.tvInt));
+		assertTrue(c.contains(AbstractModelTestBase.tvInt));
 		c.add(AbstractModelTestBase.tvLong);
-		Assert.assertTrue(c.contains(AbstractModelTestBase.tvLong));
+		assertTrue(c.contains(AbstractModelTestBase.tvLong));
 		c.add(AbstractModelTestBase.tvChar);
-		Assert.assertTrue(c.contains(AbstractModelTestBase.tvChar));
+		assertTrue(c.contains(AbstractModelTestBase.tvChar));
 		c.add(AbstractModelTestBase.tvFloat);
-		Assert.assertTrue(c.contains(AbstractModelTestBase.tvFloat));
+		assertTrue(c.contains(AbstractModelTestBase.tvFloat));
 		c.add(AbstractModelTestBase.tvString);
-		Assert.assertTrue(c.contains(AbstractModelTestBase.tvString));
+		assertTrue(c.contains(AbstractModelTestBase.tvString));
 		c.add(AbstractModelTestBase.tvString, lang);
-		Assert.assertTrue(c.contains(AbstractModelTestBase.tvString, lang));
+		assertTrue(c.contains(AbstractModelTestBase.tvString, lang));
 		c.add(tvLiteral);
-		Assert.assertTrue(c.contains(tvLiteral));
+		assertTrue(c.contains(tvLiteral));
 		// c.add( tvResObj ); assertTrue( c.contains( tvResObj ) );
 		c.add(AbstractModelTestBase.tvLitObj);
-		Assert.assertTrue(c.contains(AbstractModelTestBase.tvLitObj));
-		Assert.assertEquals(11, c.size());
+		assertTrue(c.contains(AbstractModelTestBase.tvLitObj));
+		assertEquals(11, c.size());
 	}
 }

http://git-wip-us.apache.org/repos/asf/jena/blob/0a716585/jena-core/src/test/java/com/hp/hpl/jena/rdf/model/test/AbstractModelTestBase.java
----------------------------------------------------------------------
diff --git a/jena-core/src/test/java/com/hp/hpl/jena/rdf/model/test/AbstractModelTestBase.java b/jena-core/src/test/java/com/hp/hpl/jena/rdf/model/test/AbstractModelTestBase.java
index 3f2c6e4..e8f6b1f 100644
--- a/jena-core/src/test/java/com/hp/hpl/jena/rdf/model/test/AbstractModelTestBase.java
+++ b/jena-core/src/test/java/com/hp/hpl/jena/rdf/model/test/AbstractModelTestBase.java
@@ -18,15 +18,16 @@
 
 package com.hp.hpl.jena.rdf.model.test;
 
-import java.io.FileNotFoundException ;
-import java.io.InputStream ;
-import java.net.URISyntaxException ;
-import java.net.URL ;
+import java.io.FileNotFoundException;
+import java.io.InputStream;
+import java.net.URISyntaxException;
+import java.net.URL;
 
-import junit.framework.TestCase ;
+import org.junit.After;
+import org.junit.Before;
 
-import com.hp.hpl.jena.rdf.model.Model ;
-import com.hp.hpl.jena.rdf.model.test.helpers.TestingModelFactory ;
+import com.hp.hpl.jena.rdf.model.Model;
+import com.hp.hpl.jena.rdf.model.test.helpers.TestingModelFactory;
 
 /**
  * Base for all test cases.
@@ -36,7 +37,7 @@ import com.hp.hpl.jena.rdf.model.test.helpers.TestingModelFactory ;
  * 
  * createModel will create a model using the TestingModelFactory methods.
  */
-public abstract class AbstractModelTestBase extends TestCase
+public abstract class AbstractModelTestBase
 {
 	protected static String getFileName( final String fn )
    	{
@@ -115,15 +116,20 @@ public abstract class AbstractModelTestBase extends TestCase
 	protected Model model;
 
 	protected TestingModelFactory modelFactory;
-
-	public AbstractModelTestBase( final TestingModelFactory modelFactory,
-			final String name )
-	{
-		super(name);
-		this.modelFactory = modelFactory;
+	
+	public AbstractModelTestBase() {
+	    this.modelFactory = new PlainModelFactory();
 	}
 
-	/**
+	public TestingModelFactory getModelFactory() {
+        return modelFactory;
+    }
+
+    public void setModelFactory(TestingModelFactory modelFactory) {
+        this.modelFactory = modelFactory;
+    }
+
+    /**
 	 * Create a new model.
 	 * 
 	 * @return A new model from the modelFactory.
@@ -149,7 +155,7 @@ public abstract class AbstractModelTestBase extends TestCase
 	/**
 	 * sets the model instance variable
 	 */
-	@Override
+	@Before
 	public void setUp() throws Exception
 	{
 		model = createModel();
@@ -158,7 +164,7 @@ public abstract class AbstractModelTestBase extends TestCase
 	/**
 	 * Closes the model instance variable and shuts it down.
 	 */
-	@Override
+	@After
 	public void tearDown() throws Exception
 	{
 		model.close();

http://git-wip-us.apache.org/repos/asf/jena/blob/0a716585/jena-core/src/test/java/com/hp/hpl/jena/rdf/model/test/AbstractTestModel.java
----------------------------------------------------------------------
diff --git a/jena-core/src/test/java/com/hp/hpl/jena/rdf/model/test/AbstractTestModel.java b/jena-core/src/test/java/com/hp/hpl/jena/rdf/model/test/AbstractTestModel.java
index 9358044..42dd73c 100644
--- a/jena-core/src/test/java/com/hp/hpl/jena/rdf/model/test/AbstractTestModel.java
+++ b/jena-core/src/test/java/com/hp/hpl/jena/rdf/model/test/AbstractTestModel.java
@@ -18,29 +18,47 @@
 
 package com.hp.hpl.jena.rdf.model.test;
 
-import com.hp.hpl.jena.rdf.model.*;
-import com.hp.hpl.jena.rdf.model.impl.ModelCom;
-import com.hp.hpl.jena.shared.*;
-import com.hp.hpl.jena.graph.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.hp.hpl.jena.graph.Node;
+import com.hp.hpl.jena.graph.Triple;
 import com.hp.hpl.jena.graph.test.NodeCreateUtils;
+import com.hp.hpl.jena.rdf.model.AnonId;
+import com.hp.hpl.jena.rdf.model.Literal;
+import com.hp.hpl.jena.rdf.model.Model;
+import com.hp.hpl.jena.rdf.model.ModelFactory;
+import com.hp.hpl.jena.rdf.model.Property;
+import com.hp.hpl.jena.rdf.model.RDFNode;
+import com.hp.hpl.jena.rdf.model.Resource;
+import com.hp.hpl.jena.rdf.model.Statement;
+import com.hp.hpl.jena.rdf.model.impl.ModelCom;
+import com.hp.hpl.jena.shared.Command;
 
 public abstract class AbstractTestModel extends ModelTestBase
     {
-    public AbstractTestModel( String name )
-        { super(name); }
 
     public abstract Model getModel();
     
     private Model model;
     
-    @Override
+    @Before
     public void setUp()
         { model = getModel(); }
         
-    @Override
+    @After
     public void tearDown()
         { model.close(); } 
        
+    @Test
     public void testTransactions()
         { 
         Command cmd = new Command() 
@@ -49,6 +67,7 @@ public abstract class AbstractTestModel extends ModelTestBase
         if (model.supportsTransactions()) model.executeInTransaction( cmd );
         }
         
+    @Test
     public void testCreateResourceFromNode()
         {
         RDFNode S = model.getRDFNode( NodeCreateUtils.create( "spoo:S" ) ); 
@@ -56,6 +75,7 @@ public abstract class AbstractTestModel extends ModelTestBase
         assertEquals( "spoo:S", ((Resource) S).getURI() );
         }
         
+    @Test
     public void testCreateLiteralFromNode()
         {
         RDFNode S = model.getRDFNode( NodeCreateUtils.create( "42" ) ); 
@@ -63,6 +83,7 @@ public abstract class AbstractTestModel extends ModelTestBase
         assertEquals( "42", ((Literal) S).getLexicalForm() );
         }    
             
+   @Test
    public void testCreateBlankFromNode()
         {
         RDFNode S = model.getRDFNode( NodeCreateUtils.create( "_Blank" ) ); 
@@ -70,6 +91,7 @@ public abstract class AbstractTestModel extends ModelTestBase
         assertEquals( new AnonId( "_Blank" ), ((Resource) S).getId() );
         }
         
+    @Test
     public void testIsEmpty()
         {
         Statement S1 = statement( model, "model rdf:type nonEmpty" );
@@ -85,6 +107,7 @@ public abstract class AbstractTestModel extends ModelTestBase
         assertTrue( model.isEmpty() );
         }
         
+    @Test
     public void testContainsResource()
         {
         modelAdd( model, "x R y; _a P _b" );
@@ -102,6 +125,7 @@ public abstract class AbstractTestModel extends ModelTestBase
         Test the new version of getProperty(), which delivers null for not-found
         properties.
     */
+    @Test
     public void testGetProperty()
         {
         modelAdd( model, "x P a; x P b; x R c" );
@@ -112,6 +136,7 @@ public abstract class AbstractTestModel extends ModelTestBase
         assertNull( x.getProperty( property( model, "noSuchPropertyHere" ) ) );
         }
     
+    @Test
     public void testToStatement()
         {
         Triple t = triple( "a P b" );
@@ -121,6 +146,7 @@ public abstract class AbstractTestModel extends ModelTestBase
         assertEquals( node( "b" ), s.getObject().asNode() );
         }
     
+    @Test
     public void testAsRDF()
         {
         testPresentAsRDFNode( node( "a" ), Resource.class );
@@ -135,6 +161,7 @@ public abstract class AbstractTestModel extends ModelTestBase
         assertInstanceOf( nodeClass, r );
         }
         
+    @Test
     public void testURINodeAsResource()
         {
         Node n = node( "a" );
@@ -142,6 +169,7 @@ public abstract class AbstractTestModel extends ModelTestBase
         assertSame( n, r.asNode() );
         }
         
+    @Test
     public void testLiteralNodeAsResourceFails()
         {
         try 
@@ -153,6 +181,7 @@ public abstract class AbstractTestModel extends ModelTestBase
             { pass(); }
         }
     
+    @Test
     public void testRemoveAll()
         {
         testRemoveAll( "" );
@@ -193,6 +222,7 @@ public abstract class AbstractTestModel extends ModelTestBase
  	mean emptyness isn't available. This is why we go round the houses and
  	test that expected ~= initialContent + addedStuff - removed - initialContent.
  	*/
+	@Test
 	public void testRemoveSPO()
 	    {
 	    ModelCom mc = (ModelCom) ModelFactory.createDefaultModel();
@@ -216,6 +246,7 @@ public abstract class AbstractTestModel extends ModelTestBase
             }
 	    }
 	
+	@Test
     public void testIsClosedDelegatedToGraph()
         {
         Model m = getModel();

http://git-wip-us.apache.org/repos/asf/jena/blob/0a716585/jena-core/src/test/java/com/hp/hpl/jena/rdf/model/test/AbstractTestPackage.java
----------------------------------------------------------------------
diff --git a/jena-core/src/test/java/com/hp/hpl/jena/rdf/model/test/AbstractTestPackage.java b/jena-core/src/test/java/com/hp/hpl/jena/rdf/model/test/AbstractTestPackage.java
deleted file mode 100644
index 9b1eb88..0000000
--- a/jena-core/src/test/java/com/hp/hpl/jena/rdf/model/test/AbstractTestPackage.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * 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.rdf.model.test;
-
-import com.hp.hpl.jena.rdf.model.test.helpers.TestingModelFactory;
-import com.hp.hpl.jena.shared.Lock;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-/**
- * Collected test suite for the .model package.
- * 
- * This is the base class for TestPackage implementations.
- * 
- * Model developers should extend this class to implement the package test
- * suite.
- * See TestPackage for example of usage.
- */
-
-public abstract class AbstractTestPackage extends TestSuite
-{
-
-	/**
-	 * Constructor.
-	 * 
-	 * @param suiteName
-	 *            The name for this TestPackage
-	 * @param modelFactory
-	 *            The TestingModelFactory that will be used to create models.
-	 * @throws SecurityException
-	 * @throws IllegalArgumentException
-	 * @throws NoSuchMethodException
-	 * @throws InstantiationException
-	 * @throws IllegalAccessException
-	 * @throws InvocationTargetException
-	 */
-	protected AbstractTestPackage( final String suiteName,
-			final TestingModelFactory modelFactory )
-	{
-		super(suiteName);
-
-		addTest(TestModelFactory.class);
-		addTest(TestSimpleListStatements.class, modelFactory);
-		addTest(TestModelPolymorphism.class, modelFactory);
-		addTest(TestSimpleSelector.class, modelFactory);
-		addTest(TestStatements.class, modelFactory);
-		addTest(TestRDFNodes.class, modelFactory);
-
-		addTest(TestReifiedStatements.class, modelFactory);
-
-		addTest(TestIterators.class, modelFactory);
-
-		addTest(TestContains.class, modelFactory);
-		addTest(TestLiteralImpl.class, modelFactory);
-		addTest(TestResourceImpl.class, modelFactory);
-		addTest(TestHiddenStatements.class, modelFactory);
-		addTest(TestNamespace.class, modelFactory);
-		addTest(TestModelBulkUpdate.class, modelFactory);
-		addTest(TestConcurrencyNesting.class, modelFactory,
-				TestConcurrencyNesting.MODEL1, TestConcurrencyNesting.MODEL1,
-				Lock.READ, Lock.READ, false);
-		addTest(TestConcurrencyNesting.class, modelFactory,
-				TestConcurrencyNesting.MODEL1, TestConcurrencyNesting.MODEL1,
-				Lock.WRITE, Lock.WRITE, false);
-		addTest(TestConcurrencyNesting.class, modelFactory,
-				TestConcurrencyNesting.MODEL1, TestConcurrencyNesting.MODEL1,
-				Lock.READ, Lock.WRITE, true);
-		addTest(TestConcurrencyNesting.class, modelFactory,
-				TestConcurrencyNesting.MODEL1, TestConcurrencyNesting.MODEL1,
-				Lock.WRITE, Lock.READ, false);
-		addTest(TestConcurrencyNesting.class, modelFactory,
-				TestConcurrencyNesting.MODEL1, TestConcurrencyNesting.MODEL2,
-				Lock.READ, Lock.READ, false);
-		addTest(TestConcurrencyNesting.class, modelFactory,
-				TestConcurrencyNesting.MODEL1, TestConcurrencyNesting.MODEL2,
-				Lock.WRITE, Lock.WRITE, false);
-		addTest(TestConcurrencyNesting.class, modelFactory,
-				TestConcurrencyNesting.MODEL1, TestConcurrencyNesting.MODEL2,
-				Lock.READ, Lock.WRITE, false);
-		addTest(TestConcurrencyNesting.class, modelFactory,
-				TestConcurrencyNesting.MODEL1, TestConcurrencyNesting.MODEL2,
-				Lock.WRITE, Lock.READ, false);
-
-		addTest(TestConcurrencyParallel.class, modelFactory);
-		addTest(TestModelMakerImpl.class);
-		addTest(TestModelPrefixMapping.class, modelFactory);
-		addTest(TestContainers.class, modelFactory);
-		addTest(TestModel.class, modelFactory);
-		addTest(TestModelSetOperations.class, modelFactory);
-		addTest(TestSelectors.class, modelFactory);
-		addTest(TestModelEvents.class, modelFactory);
-		addTest(TestReaderEvents.class, modelFactory);
-		addTest(TestList.class, modelFactory);
-		addTest(TestAnonID.class);
-		addTest(TestLiteralsInModel.class, modelFactory);
-		addTest(TestRemoveSPO.class, modelFactory);
-		addTest(TestListSubjectsEtc.class, modelFactory);
-		addTest(TestModelExtract.class, modelFactory);
-		addTest(TestModelRead.class, modelFactory);
-		addTestSuite(TestPropertyImpl.class);
-		addTest(TestRemoveBug.class, modelFactory);
-		addTest(TestContainerConstructors.class, modelFactory);
-		addTest(TestAltMethods.class, modelFactory);
-		addTest(TestBagMethods.class, modelFactory);
-		addTest(TestSeqMethods.class, modelFactory);
-		addTest(TestAddAndContains.class, modelFactory);
-		addTest(TestAddModel.class, modelFactory);
-		addTest(TestGet.class, modelFactory);
-		addTest(TestListSubjects.class, modelFactory);
-		addTest(TestLiterals.class, modelFactory);
-		addTest(TestObjects.class, modelFactory);
-		addTest(TestResourceMethods.class, modelFactory);
-		addTest(TestResources.class, modelFactory);
-		addTest(TestStatementMethods.class, modelFactory);
-		addTest(TestStatementCreation.class, modelFactory);
-		addTest(TestReaders.class, modelFactory);
-		addTest(TestObjectOfProperties.class, modelFactory);
-		addTest(TestCopyInOutOfModel.class, modelFactory);
-		addTest(TestSelectorUse.class, modelFactory);
-		// These tests are probabilistic testing.
-		// See notes in the class.
-		//addTest(IsomorphicTests.class, modelFactory);
-	}
-
-	/**
-	 * Adds a test to the test suite by looking for the standard test methods.
-	 * These are
-	 * methods that start with "test" and have no arguments.
-	 * 
-	 * @param testClass
-	 * @param constructorArgs
-	 * @throws SecurityException
-	 * @throws NoSuchMethodException
-	 * @throws IllegalArgumentException
-	 * @throws InstantiationException
-	 * @throws IllegalAccessException
-	 * @throws InvocationTargetException
-	 */
-	private void addTest( final Class<? extends TestCase> testClass,
-			final Object... constructorArgs )
-	{
-		final Object[] args = new Object[constructorArgs.length + 1];
-		System.arraycopy(constructorArgs, 0, args, 0, constructorArgs.length);
-		final List<Class<?>> parameterTypes = new ArrayList<>();
-		for (final Object o : constructorArgs)
-		{
-			if (o instanceof TestingModelFactory)
-			{
-				parameterTypes.add(TestingModelFactory.class);
-			}
-			else
-			{
-				parameterTypes.add(o.getClass());
-			}
-		}
-		parameterTypes.add(String.class);
-		Constructor<TestCase> c;
-		try
-		{
-		    @SuppressWarnings( "unchecked" )
-		    Constructor<TestCase> cc = (Constructor<TestCase>) testClass.getConstructor(parameterTypes
-					.toArray(new Class[parameterTypes.size()]));
-		    c = cc ;
-		}
-		catch (final SecurityException | NoSuchMethodException e)
-		{
-			e.printStackTrace();
-			throw new RuntimeException(e.getMessage(), e);
-		}
-
-        for (final Method m : testClass.getMethods())
-		{
-			if (m.getParameterTypes().length == 0)
-			{
-				if (m.getName().startsWith("test"))
-				{
-					args[constructorArgs.length] = m.getName();
-					try
-					{
-						addTest(c.newInstance(args));
-					}
-					catch (final IllegalArgumentException | InvocationTargetException | IllegalAccessException | InstantiationException e)
-					{
-						e.printStackTrace();
-						throw new RuntimeException(e.getMessage(), e);
-					}
-                }
-			}
-		}
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/0a716585/jena-core/src/test/java/com/hp/hpl/jena/rdf/model/test/AbstractTestReifiedStatements.java
----------------------------------------------------------------------
diff --git a/jena-core/src/test/java/com/hp/hpl/jena/rdf/model/test/AbstractTestReifiedStatements.java b/jena-core/src/test/java/com/hp/hpl/jena/rdf/model/test/AbstractTestReifiedStatements.java
index e5554ce..0e3ca32 100644
--- a/jena-core/src/test/java/com/hp/hpl/jena/rdf/model/test/AbstractTestReifiedStatements.java
+++ b/jena-core/src/test/java/com/hp/hpl/jena/rdf/model/test/AbstractTestReifiedStatements.java
@@ -18,6 +18,16 @@
 
 package com.hp.hpl.jena.rdf.model.test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.util.Set;
+
+import org.junit.Before;
+import org.junit.Test;
+
 import com.hp.hpl.jena.graph.test.GraphTestBase;
 import com.hp.hpl.jena.rdf.model.DoesNotReifyException;
 import com.hp.hpl.jena.rdf.model.Model;
@@ -32,10 +42,6 @@ import com.hp.hpl.jena.test.JenaTestBase;
 import com.hp.hpl.jena.util.CollectionFactory;
 import com.hp.hpl.jena.vocabulary.RDF;
 
-import java.util.Set;
-
-import org.junit.Assert;
-
 public abstract class AbstractTestReifiedStatements extends ModelTestBase
 {
 	private Model model;
@@ -53,11 +59,6 @@ public abstract class AbstractTestReifiedStatements extends ModelTestBase
 	protected static Set<ReifiedStatement> noStatements = CollectionFactory
 			.createHashedSet();
 
-	public AbstractTestReifiedStatements( final String name )
-	{
-		super(name);
-	}
-
 	public abstract Model getModel();
 
 	/**
@@ -74,7 +75,7 @@ public abstract class AbstractTestReifiedStatements extends ModelTestBase
 		return m.listReifiedStatements(st).toSet();
 	}
 
-	@Override
+	@Before
 	public void setUp()
 	{
 		model = getModel();
@@ -95,6 +96,7 @@ public abstract class AbstractTestReifiedStatements extends ModelTestBase
 	 * the simplest case: if we assert all the components of a reification quad,
 	 * we can get a ReifiedStatement that represents the reified statement.
 	 */
+	@Test
 	public void testBasicReification()
 	{
 		final Resource R = model
@@ -104,7 +106,7 @@ public abstract class AbstractTestReifiedStatements extends ModelTestBase
 		model.add(R, RDF.predicate, P);
 		model.add(R, RDF.object, O);
 		final RDFNode rs = R.as(ReifiedStatement.class);
-		Assert.assertEquals("can recover statement", SPO,
+		assertEquals("can recover statement", SPO,
 				((ReifiedStatement) rs).getStatement());
 	}
 
@@ -135,14 +137,14 @@ public abstract class AbstractTestReifiedStatements extends ModelTestBase
 					m.write(System.out, "TTL");
 				}
 
-				Assert.assertTrue(
+				assertTrue(
 						"should not reify: not all components present [" + mask
 								+ "]: " + rs, (mask & 15) == 15);
 				// System.err.println( "+  and we passed the assertion." );
 			}
 			catch (final DoesNotReifyException e)
 			{ // System.err.println( "+  we exploded" );
-				Assert.assertFalse("should reify: all components present",
+				assertFalse("should reify: all components present",
 						mask == 15);
 			}
 		}
@@ -158,40 +160,45 @@ public abstract class AbstractTestReifiedStatements extends ModelTestBase
 		}
 	}
 
+	@Test
 	public void testConstructionByURI()
 	{
 		final ReifiedStatement rs = model.createReifiedStatement("spoo:handle",
 				SPO);
 		final ReifiedStatement rs2 = SPO.createReifiedStatement("spoo:gripper");
-		Assert.assertEquals("recover statement (URI)", SPO, rs.getStatement());
-		Assert.assertEquals("recover URI", "spoo:handle", rs.getURI());
-		Assert.assertEquals("recover URI", "spoo:gripper", rs2.getURI());
+		assertEquals("recover statement (URI)", SPO, rs.getStatement());
+		assertEquals("recover URI", "spoo:handle", rs.getURI());
+		assertEquals("recover URI", "spoo:gripper", rs2.getURI());
 	}
 
+	@Test
 	public void testConstructionFromModels()
 	{
 		testStatementAndModel("fromModel", model.createReifiedStatement(SPO),
 				model, SPO);
 	}
 
+	@Test
 	public void testConstructionFromStatements()
 	{
 		testStatementAndModel("fromStatement", SPO.createReifiedStatement(),
 				model, SPO);
 	}
 
+	@Test
 	public void testConversion()
 	{
 		final String uri = "spoo:handle";
 		model.createReifiedStatement(uri, SPO);
 		final ReifiedStatement rs2 = model.createResource(uri).as(
 				ReifiedStatement.class);
-		Assert.assertEquals("recover statement", SPO, rs2.getStatement());
+		assertEquals("recover statement", SPO, rs2.getStatement());
 	}
 
 	/**
 	 * "dirty" reifications - those with conflicting quadlets - should fail.
 	 */
+	@Test
 	public void testDirtyReification()
 	{
 		final Resource R = model
@@ -207,13 +214,14 @@ public abstract class AbstractTestReifiedStatements extends ModelTestBase
 		try
 		{
 			r.as(ReifiedStatement.class);
-			Assert.fail(title + " (" + r + ")");
+			fail(title + " (" + r + ")");
 		}
 		catch (final DoesNotReifyException e)
 		{ /* that's what we expect */
 		}
 	}
 
+	@Test
 	public void testDoesNotReifyElsewhere()
 	{
 		final String uri = "spoo:rubbish";
@@ -235,20 +243,23 @@ public abstract class AbstractTestReifiedStatements extends ModelTestBase
 	// ReifiedStatement rs = st.createReifiedStatement( root + "RS" );
 	// }
 
+	@Test
 	public void testDoesNotReifyUnknown()
 	{
 		testDoesNotReify("model should not reify rubbish",
 				model.createResource("spoo:rubbish"));
 	}
 
+	@Test
 	public void testGetAny()
 	{
 		final Resource r = model.getAnyReifiedStatement(SPO);
 		JenaTestBase.assertInstanceOf(ReifiedStatement.class, r);
-		Assert.assertEquals("should get me the statement", SPO,
+		assertEquals("should get me the statement", SPO,
 				((ReifiedStatement) r).getStatement());
 	}
 
+	@Test
 	public void testIsReified()
 	{
 		final ReifiedStatement rs = model.createReifiedStatement(
@@ -260,9 +271,9 @@ public abstract class AbstractTestReifiedStatements extends ModelTestBase
 		final RDFNode BO = model
 				.createProperty(AbstractTestReifiedStatements.anchor + "BO");
 		model.add(rs, P, O);
-		Assert.assertTrue("st should be reified now", SPO.isReified());
-		Assert.assertTrue("m should have st reified now", model.isReified(SPO));
-		Assert.assertFalse("this new statement should not be reified", model
+		assertTrue("st should be reified now", SPO.isReified());
+		assertTrue("m should have st reified now", model.isReified(SPO));
+		assertFalse("this new statement should not be reified", model
 				.createStatement(BS, BP, BO).isReified());
 	}
 
@@ -271,6 +282,7 @@ public abstract class AbstractTestReifiedStatements extends ModelTestBase
 	 * model
 	 * with style Standard didn't leave the model empty. Here's a test for it.
 	 */
+	@Test
 	public void testLeosBug()
 	{
 		final Model A = getModel();
@@ -286,17 +298,19 @@ public abstract class AbstractTestReifiedStatements extends ModelTestBase
 	 * like there was a problem in modelReifier().getRS(), which we're fixing
 	 * ...
 	 */
+	@Test
 	public void testListDoesntCrash()
 	{
 		model.createReifiedStatement(SPO);
 		model.createReifiedStatement(SPO2);
-		Assert.assertTrue("should be non-empty", model.listReifiedStatements()
+		assertTrue("should be non-empty", model.listReifiedStatements()
 				.hasNext());
 	}
 
+	@Test
 	public void testListReifiedSpecificStatements()
 	{
-		Assert.assertEquals("no statements should match st",
+		assertEquals("no statements should match st",
 				AbstractTestReifiedStatements.noStatements,
 				getSetRS(model, SPO));
 		/* */
@@ -310,7 +324,7 @@ public abstract class AbstractTestReifiedStatements extends ModelTestBase
 		/* */
 		final Set<ReifiedStatement> justRS2 = arrayToSet(new ReifiedStatement[] { rs2 });
 		model.add(rs2, P, O);
-		Assert.assertEquals("now one matching statement", justRS2,
+		assertEquals("now one matching statement", justRS2,
 				getSetRS(model, SPO2));
 	}
 
@@ -320,9 +334,10 @@ public abstract class AbstractTestReifiedStatements extends ModelTestBase
 	 * duplicated, because they might be; disallowing duplicates
 	 * could be expensive.
 	 */
+	@Test
 	public void testListReifiedStatements()
 	{
-		Assert.assertEquals("initially: no reified statements",
+		assertEquals("initially: no reified statements",
 				AbstractTestReifiedStatements.noStatements, getSetRS(model));
 		final ReifiedStatement rs = model.createReifiedStatement(
 				AbstractTestReifiedStatements.aURI, SPO);
@@ -330,10 +345,10 @@ public abstract class AbstractTestReifiedStatements extends ModelTestBase
 		/* */
 		model.add(rs, P, O);
 		final Set<ReifiedStatement> justRS = arrayToSet(new ReifiedStatement[] { rs });
-		Assert.assertEquals("post-add: one reified statement", justRS,
+		assertEquals("post-add: one reified statement", justRS,
 				getSetRS(model));
 		model.add(S, P, rs);
-		Assert.assertEquals("post-add: still one reified statement", justRS,
+		assertEquals("post-add: still one reified statement", justRS,
 				getSetRS(model));
 		/* */
 		final ReifiedStatement rs2 = model.createReifiedStatement(
@@ -341,7 +356,7 @@ public abstract class AbstractTestReifiedStatements extends ModelTestBase
 		final Set<ReifiedStatement> bothRS = arrayToSet(new ReifiedStatement[] {
 				rs, rs2 });
 		model.add(rs2, P, O);
-		Assert.assertEquals("post-add: still one reified statement", bothRS,
+		assertEquals("post-add: still one reified statement", bothRS,
 				getSetRS(model));
 	}
 
@@ -350,13 +365,14 @@ public abstract class AbstractTestReifiedStatements extends ModelTestBase
 		try
 		{
 			m.createResource(uri).as(ReifiedStatement.class);
-			Assert.fail("there should be no reifiedStatement for " + uri);
+			fail("there should be no reifiedStatement for " + uri);
 		}
 		catch (final DoesNotReifyException e)
 		{ /* that's what we require */
 		}
 	}
 
+	@Test
 	public void testQuintetOfQuadlets()
 	{
 		final Resource rs = model.createResource();
@@ -371,7 +387,7 @@ public abstract class AbstractTestReifiedStatements extends ModelTestBase
 		while (it.hasNext())
 		{
 			final Statement s = it.nextStatement();
-			Assert.assertFalse(s.getObject().equals(s.getSubject()));
+			assertFalse(s.getObject().equals(s.getSubject()));
 		}
 	}
 
@@ -380,6 +396,7 @@ public abstract class AbstractTestReifiedStatements extends ModelTestBase
 	 * we can convert R into a ReifiedStatement iff the four components of the
 	 * quad are in the model.
 	 */
+	@Test
 	public void testReificationCombinations()
 	{
 		final Resource RR = model
@@ -400,16 +417,18 @@ public abstract class AbstractTestReifiedStatements extends ModelTestBase
 		testCombinations(model, RR, 0, statements, statements.length);
 	}
 
+	@Test
 	public void testRemoveReificationWorks()
 	{
 		final Statement st = SPO;
 		final Model m = model;
 		m.createReifiedStatement(AbstractTestReifiedStatements.aURI, st);
-		Assert.assertTrue("st is now reified", st.isReified());
+		assertTrue("st is now reified", st.isReified());
 		m.removeAllReifications(st);
-		Assert.assertFalse("st is no longer reified", st.isReified());
+		assertFalse("st is no longer reified", st.isReified());
 	}
 
+	@Test
 	public void testRR()
 	{
 		final Statement st = SPO;
@@ -420,34 +439,36 @@ public abstract class AbstractTestReifiedStatements extends ModelTestBase
 				AbstractTestReifiedStatements.anotherURI, st);
 		m.removeReification(rs1);
 		testNotReifying(m, AbstractTestReifiedStatements.aURI);
-		Assert.assertTrue("st is still reified", st.isReified());
+		assertTrue("st is still reified", st.isReified());
 		m.removeReification(rs2);
-		Assert.assertFalse("st should no longer be reified", st.isReified());
+		assertFalse("st should no longer be reified", st.isReified());
 	}
 
 	public void testStatementAndModel( final String title,
 			final ReifiedStatement rs, final Model m, final Statement st )
 	{
-		Assert.assertEquals(title + ": recover statement", st,
+		assertEquals(title + ": recover statement", st,
 				rs.getStatement());
-		Assert.assertEquals(title + ": recover model", m, rs.getModel());
+		assertEquals(title + ": recover model", m, rs.getModel());
 	}
 
+	@Test
 	public void testStatementListReifiedStatements()
 	{
 		final Statement st = SPO;
 		final Model m = model;
-		Assert.assertEquals("it's not there yet",
+		assertEquals("it's not there yet",
 				AbstractTestReifiedStatements.noStatements,
 				GraphTestBase.iteratorToSet(st.listReifiedStatements()));
 		final ReifiedStatement rs = m.createReifiedStatement(
 				AbstractTestReifiedStatements.aURI, st);
 		final Set<ReifiedStatement> justRS = arrayToSet(new ReifiedStatement[] { rs });
 		m.add(rs, P, O);
-		Assert.assertEquals("it's here now", justRS,
+		assertEquals("it's here now", justRS,
 				GraphTestBase.iteratorToSet(st.listReifiedStatements()));
 	}
 
+	@Test
 	public void testThisWillBreak()
 	{
 		final Resource R = model

http://git-wip-us.apache.org/repos/asf/jena/blob/0a716585/jena-core/src/test/java/com/hp/hpl/jena/rdf/model/test/IsomorphicTests.java
----------------------------------------------------------------------
diff --git a/jena-core/src/test/java/com/hp/hpl/jena/rdf/model/test/IsomorphicTests.java b/jena-core/src/test/java/com/hp/hpl/jena/rdf/model/test/IsomorphicTests.java
index ad4f856..798a2cb 100644
--- a/jena-core/src/test/java/com/hp/hpl/jena/rdf/model/test/IsomorphicTests.java
+++ b/jena-core/src/test/java/com/hp/hpl/jena/rdf/model/test/IsomorphicTests.java
@@ -18,16 +18,18 @@
 
 package com.hp.hpl.jena.rdf.model.test;
 
+import java.util.Random;
+
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
 import com.hp.hpl.jena.rdf.model.Model;
 import com.hp.hpl.jena.rdf.model.Resource;
 import com.hp.hpl.jena.rdf.model.Statement;
-import com.hp.hpl.jena.rdf.model.test.helpers.TestingModelFactory;
 import com.hp.hpl.jena.vocabulary.RDF;
 
-import java.util.Random;
-
-import org.junit.Assert;
-
 public class IsomorphicTests extends AbstractModelTestBase
 {
     // This is not part of the standard test suite 
@@ -237,12 +239,7 @@ public class IsomorphicTests extends AbstractModelTestBase
 
 	private Model model2;
 
-	public IsomorphicTests( final TestingModelFactory modelFactory, final String name )
-	{
-		super(modelFactory, name);
-	}
-
-	@Override
+	@Before
 	public void setUp() throws Exception
 	{
 		super.setUp();
@@ -250,7 +247,7 @@ public class IsomorphicTests extends AbstractModelTestBase
 		model2 = createModel();
 	}
 
-	@Override
+	@After
 	public void tearDown() throws Exception
 	{
 		model.close();
@@ -284,16 +281,19 @@ public class IsomorphicTests extends AbstractModelTestBase
 		}
 	}
 
+	@Test
 	public void test2DiHyperCubeFalse()
 	{
 		test2DiHyperCube(IsomorphicTests.QUANTITY, false);
 	}
 
+	@Test
 	public void test2DiHyperCubeTrue()
 	{
 		test2DiHyperCube(IsomorphicTests.QUANTITY, true);
 	}
 
+	@Test
 	public void test2HyperCube()
 	{
 
@@ -337,11 +337,13 @@ public class IsomorphicTests extends AbstractModelTestBase
 
 	}
 
+	@Test
 	public void test4DiHyperCubeFalse()
 	{
 		test4DiHyperCube(IsomorphicTests.QUANTITY, false);
 	}
 
+	@Test
 	public void test4DiHyperCubeTrue()
 	{
 		test4DiHyperCube(IsomorphicTests.QUANTITY, true);
@@ -372,12 +374,14 @@ public class IsomorphicTests extends AbstractModelTestBase
 		}
 	}
 
+	@Test
 	public void test4HyperCubeFalse()
 	{
 	    // Pragmatically, needs more loops
 		test4HyperCube(2 * IsomorphicTests.QUANTITY, false);
 	}
 
+	@Test
 	public void test4HyperCubeTrue()
 	{
 		test4HyperCube(IsomorphicTests.QUANTITY, true);
@@ -406,11 +410,13 @@ public class IsomorphicTests extends AbstractModelTestBase
 		}
 	}
 
+	@Test
 	public void test4ToggleHyperCubeFalse()
 	{
 		test4ToggleHyperCube(2*IsomorphicTests.QUANTITY, false);
 	}
 
+	@Test
 	public void test4ToggleHyperCubeTrue()
 	{
 		test4ToggleHyperCube(IsomorphicTests.QUANTITY, true);

http://git-wip-us.apache.org/repos/asf/jena/blob/0a716585/jena-core/src/test/java/com/hp/hpl/jena/rdf/model/test/PlainModelFactory.java
----------------------------------------------------------------------
diff --git a/jena-core/src/test/java/com/hp/hpl/jena/rdf/model/test/PlainModelFactory.java b/jena-core/src/test/java/com/hp/hpl/jena/rdf/model/test/PlainModelFactory.java
new file mode 100644
index 0000000..78821d2
--- /dev/null
+++ b/jena-core/src/test/java/com/hp/hpl/jena/rdf/model/test/PlainModelFactory.java
@@ -0,0 +1,50 @@
+/*
+ * 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.rdf.model.test;
+
+import com.hp.hpl.jena.graph.Graph;
+import com.hp.hpl.jena.rdf.model.Model;
+import com.hp.hpl.jena.rdf.model.ModelFactory;
+import com.hp.hpl.jena.rdf.model.test.helpers.TestingModelFactory;
+import com.hp.hpl.jena.shared.PrefixMapping;
+
+/**
+ * Standard ModelFactory to create models for testing.
+ */
+public class PlainModelFactory implements TestingModelFactory
+{
+    @Override
+    public Model createModel()
+    {
+        return ModelFactory.createDefaultModel();
+    }
+
+    @Override
+    public Model createModel( final Graph base )
+    {
+        return ModelFactory.createModelForGraph(base);
+    }
+
+    @Override
+    public PrefixMapping getPrefixMapping()
+    {
+        return ModelFactory.createDefaultModel().getGraph()
+                .getPrefixMapping();
+    }
+}
+


Mime
View raw message