You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2025/06/05 17:00:10 UTC

(jena) branch main updated (8982eab3ce -> fe084c9c82)

This is an automated email from the ASF dual-hosted git repository.

andy pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git


    from 8982eab3ce GH-2809: Integration tests for JenaSystem#init The test code triggered a "Deadlock in JenaSystem.init()" (GH-2787 https://github.com/apache/jena/issues/2787) in Jena 5.2.0. --> It seems to be stable now.
     new 4586238c72 GH-3237: Prepare for GraphMem -> GraphMemValue; GraphMem2* -> GraphMem
     new fa7631eb29 Move etc/ to src-examples/
     new 6052981dd9 GH-3236: Convert TestPackage* to TS_* JUnit4
     new 6769071540 GH-3236: jena-core tests: Suppress warnings about GraphMem
     new 678cf4aac6 GH-3237: Change test graph to same-term for non-Model tests
     new fe084c9c82 GH-3237: jena-ontapi - use default memory graph

The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 jena-core/pom.xml                                  |   2 -
 .../{ => src-examples}/etc/location-mapping.ex     |   0
 .../{ => src-examples}/etc/schemagen_example.rdf   |   0
 .../org/apache/jena/graph/GraphMemFactory.java     |  61 ++-
 .../main/java/org/apache/jena/mem/GraphMem.java    |   2 +
 .../jena/ontology/models/SimpleGraphMaker.java     |  43 +-
 .../org/apache/jena/rdf/model/ModelFactory.java    |  17 +-
 .../reasoner/rulesys/BasicForwardRuleInfGraph.java | 122 +++---
 .../jena/reasoner/rulesys/FBRuleInfGraph.java      | 208 +++++-----
 .../reasoner/rulesys/LPBackwardRuleInfGraph.java   |  74 ++--
 .../jena/reasoner/rulesys/impl/BFRuleContext.java  |   2 +-
 .../java/org/apache/jena/util/FileManagerImpl.java |   2 +-
 .../java/org/apache/jena/util/MonitorGraph.java    |   1 -
 .../jena/assembler/acceptance/AllAccept.java       |  67 ----
 .../apache/jena/assembler/test/TS3_Assembler.java  |  88 +++++
 .../jena/assembler/test/TestAssemblerPackage.java  |  35 --
 .../apache/jena/assembler/test/TestAssemblers.java |  59 ---
 .../org/apache/jena/assembler/test/TestMode.java   |  84 ++--
 ...nceTesting.java => TestOntModelAcceptance.java} |   4 +-
 .../java/org/apache/jena/datatypes/TS3_dt.java     |   9 +-
 .../org/apache/jena/datatypes/TestPackage_dt.java  |  42 --
 .../test/{TestPackage_enh.java => TS3_enh.java}    | 207 +++++-----
 .../java/org/apache/jena/graph/TestGraphUtil.java  |   6 +-
 .../jena/graph/compose/test/TS3_compose.java       | 105 +++++
 .../jena/graph/compose/test/TestCaseBasic.java     |  10 +-
 .../apache/jena/graph/compose/test/TestDyadic.java |  98 ++---
 .../graph/compose/test/TestPackage_compose.java    | 114 ------
 .../apache/jena/graph/test/AbstractTestGraph.java  |   4 -
 .../org/apache/jena/graph/test/GraphTestBase.java  |   2 +-
 .../java/org/apache/jena/graph/test/TS3_graph.java |  38 +-
 .../java/org/apache/jena/graph/test/TestGraph.java |   8 +-
 .../apache/jena/graph/test/TestGraphListener.java  |   3 +-
 .../org/apache/jena/graph/test/TestGraphPlain.java |   2 +-
 .../test/TestNodeCreateStrings.java}               |  10 +-
 .../apache/jena/graph/test/TestPackage_graph.java  |  64 ---
 .../org/apache/jena/graph/test/TestReifier.java    |   2 +-
 .../test/java/org/apache/jena/irix/TS_IRIx.java    |  12 +-
 .../java/org/apache/jena/langtagx/TS_LangTagX.java |  12 +-
 .../apache/jena/mem/test/TS3_GraphMemValue.java    |  15 +-
 .../org/apache/jena/mem/test/TestCaseBasic.java    |  43 --
 .../org/apache/jena/mem/test/TestCaseBugs.java     |  60 ---
 .../org/apache/jena/mem/test/TestGraphMem2.java    | 101 -----
 ...stGraphMemValue.java => TestGraphMemModel.java} |  75 +++-
 .../apache/jena/mem/test/TestGraphMemPackage.java  |  34 --
 .../org/apache/jena/mem/test/TestMemPackage.java   |  42 --
 .../org/apache/jena/mem/test/TestTripleBunch.java  |   2 +-
 .../java/org/apache/jena/mem2/TS4_GraphMem2.java   |  83 ++++
 .../org/apache/jena/ontology/impl/TS3_ont.java     |  32 +-
 .../apache/jena/ontology/impl/TestPackage_ont.java |  61 ---
 .../jena/ontology/makers/TS3_ModelMakers.java      |  10 +-
 .../ontology/makers/TestPackage_ModelMakers.java   |  32 --
 .../rdf/model/test/AbstractContainerMethods.java   | 237 +++++------
 .../jena/rdf/model/test/AbstractModelTestBase.java | 253 ++++++------
 .../jena/rdf/model/test/AbstractTestModel.java     | 313 +++++++--------
 .../jena/rdf/model/test/AbstractTestPackage.java   | 205 +++++-----
 .../jena/rdf/model/test/IsomorphicTests.java       |  10 +-
 .../apache/jena/rdf/model/test/ModelTestBase.java  | 434 +++++++++------------
 .../{TestPackage_model.java => TS3_Model1.java}    |  12 +-
 ...StandardModels.java => TS3_StandardModels.java} |  26 +-
 .../apache/jena/rdf/model/test/TestIterators.java  |   7 +-
 .../apache/jena/rdf/model/test/TestModelRead.java  |   2 +-
 .../jena/rdf/model/test/TestReaderEvents.java      |   2 +-
 .../apache/jena/rdf/model/test/TestReaders.java    |   2 +-
 .../org/apache/jena/rdfxml/libtest/package.html    |  30 --
 ...stPackage_xmlinput1.java => TS3_xmlinput1.java} |   6 +-
 ...stPackage_xmloutput.java => TS3_xmloutput.java} |   2 +-
 .../jena/rdfxml/xmloutput/TestXMLFeatures.java     |   2 +-
 .../reasoner/{test => examples}/ManualExample.java |  24 +-
 .../jena/reasoner/rulesys/TS3_RuleReasoners.java   |  59 +++
 .../reasoner/rulesys/impl/TestLPBRuleEngine.java   |  10 +-
 .../rulesys/impl/TestLPBRuleEngineLeak.java        |  22 +-
 .../rulesys/impl/TestRestartableLBRule.java        |   6 +-
 .../jena/reasoner/rulesys/test/DebugOWL.java       | 103 ++---
 .../jena/reasoner/rulesys/test/DebugRules.java     |  18 +-
 .../reasoner/rulesys/test/TestBackchainer.java     | 408 +++++++++----------
 .../jena/reasoner/rulesys/test/TestBasicLP.java    | 258 ++++++------
 .../jena/reasoner/rulesys/test/TestBasics.java     |  28 +-
 .../jena/reasoner/rulesys/test/TestFBRules.java    |  74 ++--
 .../reasoner/rulesys/test/TestGenericRules.java    | 173 ++++----
 .../reasoner/rulesys/test/TestLPDerivation.java    |  54 +--
 .../jena/reasoner/rulesys/test/TestRDFS9.java      |  20 +-
 .../jena/reasoner/rulesys/test/TestRETE.java       |  98 ++---
 .../reasoner/rulesys/test/TestRuleReasoners.java   |  84 ----
 .../apache/jena/reasoner/test/ReasonerTester.java  |   4 +-
 .../apache/jena/reasoner/test/TS3_reasoners.java   |  16 +-
 .../jena/reasoner/test/TestPackage_reasoners.java  |  53 ---
 .../apache/jena/reasoner/test/TestReasoners.java   |  20 +-
 .../jena/reasoner/test/WGReasonerTester.java       |   4 +-
 .../org/apache/jena/shared/TS_SharedPackage.java   |  11 +-
 .../org/apache/jena/shared/TestSharedPackage.java  |  37 --
 .../org/apache/jena/test/TestPackage_core.java     |  89 +++--
 .../java/org/apache/jena/test/TestSystemSetup.java |   7 +-
 .../apache/jena/testing_framework/GraphHelper.java |   2 +-
 .../jena/ttl_test/test/turtle/TS_TestTurtle.java   |  10 +-
 .../{TestBadSyntax.java => TestItemBadSyntax.java} |  29 +-
 .../{TestSyntax.java => TestItemSyntax.java}       |  27 +-
 .../{TestTurtle.java => TestItemTurtleExec.java}   |  57 ++-
 ...eInternalTests.java => TestTurtleInternal.java} |   7 +-
 .../ttl_test/test/turtle/TestTurtleReader.java     |  37 +-
 .../ttl_test/test/turtle/TurtleTestFactory.java    |  80 ++--
 .../jena/ttl_test/test/turtle/TurtleTestSuite.java |  36 --
 .../test/turtle/TurtleTestSuiteManifest.java       |  81 ++++
 .../java/org/apache/jena/util/TS3_coreutil.java    |  27 +-
 .../java/org/apache/jena/util/TestMonitors.java    |   8 +-
 .../org/apache/jena/util/TestPackage_util.java     |  66 ----
 .../apache/jena/util/TestPrefixMappingUtils.java   |   2 +-
 .../jena/util/iterator/test/TS3_coreiter.java      |  13 +-
 .../jena/util/iterator/test/TestPackage_iter.java  |  39 --
 .../jena/vocabulary/test/TS_Vocabularies.java      |  17 +-
 .../jena/vocabulary/test/TestVocabularies.java     |  42 --
 .../org/apache/jena/ontapi/OntModelFactory.java    |   2 +-
 .../apache/jena/ontapi/impl/OntGraphModelImpl.java |   2 +-
 .../org/apache/jena/ontapi/GraphUtilsTest.java     |   5 +-
 .../java/org/apache/jena/ontapi/OntListTest.java   |   2 +-
 .../org/apache/jena/ontapi/OntPersonalityTest.java |   2 +-
 .../org/apache/jena/ontapi/UnionGraphTest.java     |  18 +-
 .../contract/model/SecTestLiterals.java            |   4 +-
 .../contract/model/SecTestReaderEvents.java        |   4 +-
 .../permissions/contract/model/SecTestReaders.java |   4 +-
 119 files changed, 2693 insertions(+), 3362 deletions(-)
 rename jena-core/{ => src-examples}/etc/location-mapping.ex (100%)
 rename jena-core/{ => src-examples}/etc/schemagen_example.rdf (100%)
 delete mode 100644 jena-core/src/test/java/org/apache/jena/assembler/acceptance/AllAccept.java
 create mode 100644 jena-core/src/test/java/org/apache/jena/assembler/test/TS3_Assembler.java
 delete mode 100644 jena-core/src/test/java/org/apache/jena/assembler/test/TestAssemblerPackage.java
 delete mode 100644 jena-core/src/test/java/org/apache/jena/assembler/test/TestAssemblers.java
 rename jena-core/src/test/java/org/apache/jena/assembler/test/{AcceptanceTesting.java => TestOntModelAcceptance.java} (94%)
 copy jena-integration-tests/src/test/java/org/apache/jena/test/assembler/TS_Assembler.java => jena-core/src/test/java/org/apache/jena/datatypes/TS3_dt.java (86%)
 delete mode 100644 jena-core/src/test/java/org/apache/jena/datatypes/TestPackage_dt.java
 rename jena-core/src/test/java/org/apache/jena/enhanced/test/{TestPackage_enh.java => TS3_enh.java} (74%)
 create mode 100755 jena-core/src/test/java/org/apache/jena/graph/compose/test/TS3_compose.java
 delete mode 100755 jena-core/src/test/java/org/apache/jena/graph/compose/test/TestPackage_compose.java
 copy jena-integration-tests/src/test/java/org/apache/jena/http/TS_JenaHttp.java => jena-core/src/test/java/org/apache/jena/graph/test/TS3_graph.java (54%)
 rename jena-core/src/test/java/org/apache/jena/{test/TestModelUtil.java => graph/test/TestNodeCreateStrings.java} (92%)
 delete mode 100644 jena-core/src/test/java/org/apache/jena/graph/test/TestPackage_graph.java
 copy jena-db/jena-dboe-base/src/test/java/org/apache/jena/dboe/base/buffer/TS_Buffer.java => jena-core/src/test/java/org/apache/jena/mem/test/TS3_GraphMemValue.java (77%)
 delete mode 100644 jena-core/src/test/java/org/apache/jena/mem/test/TestCaseBasic.java
 delete mode 100644 jena-core/src/test/java/org/apache/jena/mem/test/TestCaseBugs.java
 delete mode 100644 jena-core/src/test/java/org/apache/jena/mem/test/TestGraphMem2.java
 rename jena-core/src/test/java/org/apache/jena/mem/test/{TestGraphMemValue.java => TestGraphMemModel.java} (83%)
 delete mode 100644 jena-core/src/test/java/org/apache/jena/mem/test/TestGraphMemPackage.java
 delete mode 100644 jena-core/src/test/java/org/apache/jena/mem/test/TestMemPackage.java
 create mode 100644 jena-core/src/test/java/org/apache/jena/mem2/TS4_GraphMem2.java
 copy jena-arq/src/test/java/org/apache/jena/query/TS_Query.java => jena-core/src/test/java/org/apache/jena/ontology/impl/TS3_ont.java (62%)
 delete mode 100644 jena-core/src/test/java/org/apache/jena/ontology/impl/TestPackage_ont.java
 copy jena-arq/src/test/java/org/apache/jena/atlas/csv/TS_CSVParser.java => jena-core/src/test/java/org/apache/jena/ontology/makers/TS3_ModelMakers.java (85%)
 delete mode 100644 jena-core/src/test/java/org/apache/jena/ontology/makers/TestPackage_ModelMakers.java
 rename jena-core/src/test/java/org/apache/jena/rdf/model/test/{TestPackage_model.java => TS3_Model1.java} (86%)
 rename jena-core/src/test/java/org/apache/jena/rdf/model/test/{TestStandardModels.java => TS3_StandardModels.java} (73%)
 delete mode 100644 jena-core/src/test/java/org/apache/jena/rdfxml/libtest/package.html
 rename jena-core/src/test/java/org/apache/jena/rdfxml/xmlinput1/{TestPackage_xmlinput1.java => TS3_xmlinput1.java} (93%)
 rename jena-core/src/test/java/org/apache/jena/rdfxml/xmloutput/{TestPackage_xmloutput.java => TS3_xmloutput.java} (97%)
 rename jena-core/src/test/java/org/apache/jena/reasoner/{test => examples}/ManualExample.java (91%)
 create mode 100755 jena-core/src/test/java/org/apache/jena/reasoner/rulesys/TS3_RuleReasoners.java
 delete mode 100755 jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestRuleReasoners.java
 copy jena-integration-tests/src/test/java/org/apache/jena/test/integration/TS_Integration.java => jena-core/src/test/java/org/apache/jena/reasoner/test/TS3_reasoners.java (78%)
 delete mode 100644 jena-core/src/test/java/org/apache/jena/reasoner/test/TestPackage_reasoners.java
 copy jena-arq/src/test/java/org/apache/jena/atlas/csv/TS_CSVParser.java => jena-core/src/test/java/org/apache/jena/shared/TS_SharedPackage.java (83%)
 delete mode 100644 jena-core/src/test/java/org/apache/jena/shared/TestSharedPackage.java
 copy jena-arq/src/test/java/org/apache/jena/atlas/csv/TS_CSVParser.java => jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TS_TestTurtle.java (85%)
 rename jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/{TestBadSyntax.java => TestItemBadSyntax.java} (67%)
 rename jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/{TestSyntax.java => TestItemSyntax.java} (70%)
 rename jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/{TestTurtle.java => TestItemTurtleExec.java} (58%)
 rename jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/{TurtleInternalTests.java => TestTurtleInternal.java} (98%)
 delete mode 100644 jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TurtleTestSuite.java
 create mode 100644 jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TurtleTestSuiteManifest.java
 copy jena-arq/src/test/java/org/apache/jena/query/TS_Query.java => jena-core/src/test/java/org/apache/jena/util/TS3_coreutil.java (63%)
 delete mode 100644 jena-core/src/test/java/org/apache/jena/util/TestPackage_util.java
 copy jena-arq/src/test/java/org/apache/jena/sparql/solver/TS_Solver.java => jena-core/src/test/java/org/apache/jena/util/iterator/test/TS3_coreiter.java (77%)
 delete mode 100644 jena-core/src/test/java/org/apache/jena/util/iterator/test/TestPackage_iter.java
 copy jena-arq/src/test/java/org/apache/jena/sparql/exec/TS_ExecSPARQL.java => jena-core/src/test/java/org/apache/jena/vocabulary/test/TS_Vocabularies.java (78%)
 delete mode 100644 jena-core/src/test/java/org/apache/jena/vocabulary/test/TestVocabularies.java


(jena) 03/06: GH-3236: Convert TestPackage* to TS_* JUnit4

Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

andy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git

commit 6052981dd9552dff34a89e1d01c1f8dd69045a1a
Author: Andy Seaborne <an...@apache.org>
AuthorDate: Sun Jun 1 20:54:42 2025 +0100

    GH-3236: Convert TestPackage* to TS_* JUnit4
---
 jena-core/pom.xml                                  |   2 -
 .../org/apache/jena/graph/GraphMemFactory.java     |   2 +-
 .../java/org/apache/jena/util/FileManagerImpl.java |   2 +-
 .../jena/assembler/acceptance/AllAccept.java       |  67 ------------
 .../apache/jena/assembler/test/TS3_Assembler.java  |  88 ++++++++++++++++
 .../jena/assembler/test/TestAssemblerPackage.java  |  35 -------
 .../apache/jena/assembler/test/TestAssemblers.java |  59 -----------
 .../org/apache/jena/assembler/test/TestMode.java   |  84 +++++++--------
 ...nceTesting.java => TestOntModelAcceptance.java} |   4 +-
 .../TS3_dt.java}                                   |  14 +--
 .../test/{TestPackage_enh.java => TS3_enh.java}    |   6 +-
 .../jena/graph/compose/test/TS3_compose.java       | 105 +++++++++++++++++++
 .../graph/compose/test/TestPackage_compose.java    | 114 ---------------------
 .../TS_LangTagX.java => graph/test/TS3_graph.java} |  43 +++++---
 .../apache/jena/graph/test/TestPackage_graph.java  |  64 ------------
 .../test/java/org/apache/jena/irix/TS_IRIx.java    |  12 +--
 .../java/org/apache/jena/langtagx/TS_LangTagX.java |   9 +-
 .../test/TS3_GraphMemValue.java}                   |  20 ++--
 .../jena/mem/test/TestPackage_GraphMemValue.java   |  39 -------
 .../java/org/apache/jena/mem2/TS4_GraphMem2.java   |  83 +++++++++++++++
 .../impl/TS3_ont.java}                             |  37 ++++---
 .../apache/jena/ontology/impl/TestPackage_ont.java |  61 -----------
 ...ckage_ModelMakers.java => TS3_ModelMakers.java} |  19 ++--
 .../jena/rdf/model/test/IsomorphicTests.java       |  10 +-
 .../{TestPackage_model.java => TS3_Model1.java}    |  11 +-
 ...StandardModels.java => TS3_StandardModels.java} |   6 +-
 .../apache/jena/rdf/model/test/TestIterators.java  |   7 +-
 .../apache/jena/rdf/model/test/TestModelRead.java  |   2 +-
 .../jena/rdf/model/test/TestReaderEvents.java      |   2 +-
 .../apache/jena/rdf/model/test/TestReaders.java    |   2 +-
 .../org/apache/jena/rdfxml/libtest/package.html    |  30 ------
 ...stPackage_xmlinput1.java => TS3_xmlinput1.java} |   6 +-
 ...stPackage_xmloutput.java => TS3_xmloutput.java} |   2 +-
 .../jena/rdfxml/xmloutput/TestXMLFeatures.java     |   2 +-
 .../reasoner/{test => examples}/ManualExample.java |  24 +++--
 .../jena/reasoner/rulesys/TS3_RuleReasoners.java   |  59 +++++++++++
 .../reasoner/rulesys/test/TestRuleReasoners.java   |  84 ---------------
 .../test/TS3_reasoners.java}                       |  21 ++--
 .../jena/reasoner/test/TestPackage_reasoners.java  |  53 ----------
 .../jena/reasoner/test/WGReasonerTester.java       |   2 +-
 .../org/apache/jena/shared/TestSharedPackage.java  |  25 ++---
 .../java/org/apache/jena/test/TestModelUtil.java   |   8 +-
 .../org/apache/jena/test/TestPackage_core.java     |  77 ++++++++++++--
 .../java/org/apache/jena/test/TestSystemSetup.java |   7 +-
 .../{TurtleTestSuite.java => TS_TestTurtle.java}   |  23 ++---
 .../{TestBadSyntax.java => TestItemBadSyntax.java} |  29 +++---
 .../{TestSyntax.java => TestItemSyntax.java}       |  27 +++--
 .../{TestTurtle.java => TestItemTurtleExec.java}   |  57 +++++------
 ...eInternalTests.java => TestTurtleInternal.java} |   7 +-
 .../ttl_test/test/turtle/TestTurtleReader.java     |  37 +++----
 .../ttl_test/test/turtle/TurtleTestFactory.java    |  80 +++++++--------
 .../test/turtle/TurtleTestSuiteManifest.java       |  84 +++++++++++++++
 .../TestPackage_dt.java => util/TS3_coreutil.java} |  42 ++++----
 .../org/apache/jena/util/TestPackage_util.java     |  66 ------------
 .../iterator/test/TS3_coreiter.java}               |  19 ++--
 .../jena/util/iterator/test/TestPackage_iter.java  |  39 -------
 .../test/TS_Vocabularies.java}                     |  18 ++--
 .../jena/vocabulary/test/TestVocabularies.java     |  42 --------
 .../contract/model/SecTestLiterals.java            |   4 +-
 .../contract/model/SecTestReaderEvents.java        |   4 +-
 .../permissions/contract/model/SecTestReaders.java |   4 +-
 61 files changed, 848 insertions(+), 1143 deletions(-)

diff --git a/jena-core/pom.xml b/jena-core/pom.xml
index ec81cd7240..c474b6f52e 100644
--- a/jena-core/pom.xml
+++ b/jena-core/pom.xml
@@ -175,8 +175,6 @@
           <argLine>-javaagent:${org.mockito:mockito-core:jar} -Xshare:off</argLine>
           <includes>
             <include>org/apache/jena/test/TestPackage_core.java</include>
-            <include>org/apache/jena/mem2/**/*Test.java</include>
-            <include>org/apache/jena/mem2/**/*Test2.java</include>
           </includes>
         </configuration>
       </plugin>
diff --git a/jena-core/src/main/java/org/apache/jena/graph/GraphMemFactory.java b/jena-core/src/main/java/org/apache/jena/graph/GraphMemFactory.java
index 64464e3bd2..cf63f49519 100644
--- a/jena-core/src/main/java/org/apache/jena/graph/GraphMemFactory.java
+++ b/jena-core/src/main/java/org/apache/jena/graph/GraphMemFactory.java
@@ -105,7 +105,7 @@ public class GraphMemFactory
     }
 
     /**
-     * @deprecated To be renamed. Use {@link #createGraphMemForModel()}. The function will be re-purposed for the default samer-term memory graph.
+     * @deprecated To be renamed. Use {@link #createGraphMemForModel()}. The function will be re-purposed for the default same-term memory graph.
      */
     @Deprecated(forRemoval = true)
     public static Graph createGraphMem() {
diff --git a/jena-core/src/main/java/org/apache/jena/util/FileManagerImpl.java b/jena-core/src/main/java/org/apache/jena/util/FileManagerImpl.java
index 0ea439ff6a..cc1b54cbad 100644
--- a/jena-core/src/main/java/org/apache/jena/util/FileManagerImpl.java
+++ b/jena-core/src/main/java/org/apache/jena/util/FileManagerImpl.java
@@ -342,7 +342,7 @@ public class FileManagerImpl implements FileManager
             throw new NotFoundException("Not found: " + filenameOrURI);
         }
         model.read(in.getInput(), baseURI, syntax) ;
-        try { in.getInput().close(); } catch (IOException ex) {}
+        try { in.getInput().close(); } catch (IOException ex) { ex.printStackTrace();}
         return model ;
     }
 
diff --git a/jena-core/src/test/java/org/apache/jena/assembler/acceptance/AllAccept.java b/jena-core/src/test/java/org/apache/jena/assembler/acceptance/AllAccept.java
deleted file mode 100644
index a284c1f492..0000000000
--- a/jena-core/src/test/java/org/apache/jena/assembler/acceptance/AllAccept.java
+++ /dev/null
@@ -1,67 +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 org.apache.jena.assembler.acceptance;
-
-import java.io.File ;
-import java.io.FileOutputStream ;
-import java.io.IOException ;
-
-import junit.framework.TestSuite ;
-import org.apache.jena.assembler.Assembler ;
-import org.apache.jena.assembler.test.AssemblerTestBase ;
-import org.apache.jena.rdf.model.InfModel ;
-import org.apache.jena.rdf.model.Model ;
-import org.apache.jena.rdf.model.Resource ;
-import org.apache.jena.reasoner.rulesys.GenericRuleReasoner ;
-import org.apache.jena.util.FileUtils ;
-
-public class AllAccept extends AssemblerTestBase
-    {
-    public AllAccept( String name )
-        { super( name ); }
-
-    public static TestSuite suite()
-        {
-        TestSuite result = new TestSuite();
-        result.addTestSuite( AllAccept.class );
-        return result;
-        }
-
-    public void testUnadornedInferenceModel()
-        {
-        Resource root = resourceInModel( "x ja:reasoner R; R rdf:type ja:ReasonerFactory" );
-        Model m = Assembler.general().openModel( root );
-        assertInstanceOf( InfModel.class, m );
-        InfModel inf = (InfModel) m;
-        assertIsoModels( empty, inf.getRawModel() );
-        assertInstanceOf( GenericRuleReasoner.class, inf.getReasoner() );
-        }
-
-    public void testWithContent() throws IOException
-        {
-        File f = FileUtils.tempFileName( "assembler-acceptance-", ".n3" );
-        Model data = model( "a P b; b Q c" );
-        try ( FileOutputStream fs = new FileOutputStream( f ) ) {
-            data.write( fs, "N3" );
-        }
-        Resource root = resourceInModel( "x rdf:type ja:MemoryModel; x ja:content y; y ja:externalContent file:" + f.getAbsolutePath() );
-        Model m = Assembler.general().openModel( root );
-        assertIsoModels( data, m );
-        }
-    }
diff --git a/jena-core/src/test/java/org/apache/jena/assembler/test/TS3_Assembler.java b/jena-core/src/test/java/org/apache/jena/assembler/test/TS3_Assembler.java
new file mode 100644
index 0000000000..f48f37cf35
--- /dev/null
+++ b/jena-core/src/test/java/org/apache/jena/assembler/test/TS3_Assembler.java
@@ -0,0 +1,88 @@
+/*
+ * 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 org.apache.jena.assembler.test;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses( {
+    // Convert t0 JUnit4
+    TestMode.class,
+
+    // JUnit3
+    TestModelExpansion.class,
+    TestImportManager.class,
+    TestOntModelAcceptance.class,
+
+//    // Was "TestAssemblers" : 19
+     TestRuleSet.class ,
+     TestAssemblerHelp.class ,
+     TestDefaultModelAssembler.class ,
+     TestMemoryModelAssembler.class ,
+     TestAssemblerVocabulary.class ,
+     TestRuleSetAssembler.class ,
+     TestInfModelAssembler.class ,
+     TestAssemblerGroup.class ,
+     TestAssemblerGroupTracing.class ,
+     TestReasonerFactoryAssembler.class ,
+     TestContentAssembler.class ,
+     TestModelContent.class ,
+     TestUnionModelAssembler.class ,
+     TestPrefixMappingAssembler.class ,
+     TestBuiltinAssemblerGroup.class ,
+     TestModelAssembler.class ,
+     TestDocumentManagerAssembler.class,
+     TestOntModelSpecAssembler.class,
+     TestOntModelAssembler.class
+})
+
+public class TS3_Assembler {}
+
+//    public static TestSuite suite() {
+//        TestSuite result = new TestSuite();
+//        result.addTestSuite(TestMode.class);
+//        result.addTestSuite(TestModelExpansion.class);
+//        result.addTestSuite(TestImportManager.class);
+//        result.addTestSuite(TestOntModelAcceptance.class);
+//
+//        // Was "TestAssemblers" : 19
+//        result.addTestSuite( TestRuleSet.class );
+//        result.addTestSuite( TestAssemblerHelp.class );
+//        result.addTestSuite( TestDefaultModelAssembler.class );
+//        result.addTestSuite( TestMemoryModelAssembler.class );
+//        result.addTestSuite( TestAssemblerVocabulary.class );
+//        result.addTestSuite( TestRuleSetAssembler.class );
+//        result.addTestSuite( TestInfModelAssembler.class );
+//        result.addTestSuite( TestAssemblerGroup.class );
+//        result.addTestSuite( TestAssemblerGroupTracing.class );
+//        result.addTestSuite( TestReasonerFactoryAssembler.class );
+//        result.addTestSuite( TestContentAssembler.class );
+//        result.addTestSuite( TestModelContent.class );
+//        result.addTestSuite( TestUnionModelAssembler.class );
+//        result.addTestSuite( TestPrefixMappingAssembler.class );
+//        result.addTestSuite( TestBuiltinAssemblerGroup.class );
+//        result.addTestSuite( TestModelAssembler.class );
+//        result.addTestSuite( TestDocumentManagerAssembler.class );
+//        result.addTest( TestOntModelSpecAssembler.suite() );
+//        result.addTest( TestOntModelAssembler.suite() );
+//
+//        return result;
+//    }
diff --git a/jena-core/src/test/java/org/apache/jena/assembler/test/TestAssemblerPackage.java b/jena-core/src/test/java/org/apache/jena/assembler/test/TestAssemblerPackage.java
deleted file mode 100644
index c972c4322d..0000000000
--- a/jena-core/src/test/java/org/apache/jena/assembler/test/TestAssemblerPackage.java
+++ /dev/null
@@ -1,35 +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 org.apache.jena.assembler.test;
-
-import junit.framework.*;
-
-public class TestAssemblerPackage extends TestCase
-    {
-    public static TestSuite suite()
-        {
-        TestSuite result = new TestSuite();
-        result.addTestSuite( TestMode.class );
-        result.addTestSuite( TestModelExpansion.class );
-        result.addTestSuite( TestImportManager.class );
-        result.addTest( TestAssemblers.suite() );
-        result.addTestSuite( AcceptanceTesting.class );
-        return result;
-        }
-    }
diff --git a/jena-core/src/test/java/org/apache/jena/assembler/test/TestAssemblers.java b/jena-core/src/test/java/org/apache/jena/assembler/test/TestAssemblers.java
deleted file mode 100644
index 5858e34fe1..0000000000
--- a/jena-core/src/test/java/org/apache/jena/assembler/test/TestAssemblers.java
+++ /dev/null
@@ -1,59 +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 org.apache.jena.assembler.test;
-
-import junit.framework.TestSuite;
-import org.apache.jena.assembler.Assembler ;
-import org.apache.jena.shared.BrokenException ;
-
-public class TestAssemblers extends AssemblerTestBase
-    {
-    public TestAssemblers( String name )
-        { super( name ); }
-
-    public static TestSuite suite()
-        {
-        TestSuite result = new TestSuite( TestAssemblers.class );
-        result.addTestSuite( TestRuleSet.class );
-        result.addTestSuite( TestAssemblerHelp.class );
-        result.addTestSuite( TestDefaultModelAssembler.class );
-        result.addTestSuite( TestMemoryModelAssembler.class );
-        result.addTestSuite( TestAssemblerVocabulary.class );
-        result.addTestSuite( TestRuleSetAssembler.class );
-        result.addTestSuite( TestInfModelAssembler.class );
-        result.addTestSuite( TestAssemblerGroup.class );
-        result.addTestSuite( TestAssemblerGroupTracing.class );
-        result.addTestSuite( TestReasonerFactoryAssembler.class );
-        result.addTestSuite( TestContentAssembler.class );
-        result.addTestSuite( TestModelContent.class );
-        result.addTestSuite( TestUnionModelAssembler.class );
-        result.addTestSuite( TestPrefixMappingAssembler.class );
-        result.addTestSuite( TestBuiltinAssemblerGroup.class );
-        result.addTestSuite( TestModelAssembler.class );
-        result.addTestSuite( TestDocumentManagerAssembler.class );
-        result.addTest( TestOntModelSpecAssembler.suite() );
-        result.addTest( TestOntModelAssembler.suite() );
-        return result;
-        }
-
-    public void testToSilenceJUnit() {}
-
-    @Override protected Class<? extends Assembler> getAssemblerClass()
-        { throw new BrokenException( "TestAssemblers does not need this method" ); }
-    }
diff --git a/jena-core/src/test/java/org/apache/jena/assembler/test/TestMode.java b/jena-core/src/test/java/org/apache/jena/assembler/test/TestMode.java
index 1bef7bd339..ce52c18f57 100644
--- a/jena-core/src/test/java/org/apache/jena/assembler/test/TestMode.java
+++ b/jena-core/src/test/java/org/apache/jena/assembler/test/TestMode.java
@@ -18,50 +18,54 @@
 
 package org.apache.jena.assembler.test;
 
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertTrue;
+
 import org.apache.jena.assembler.Mode ;
 import org.apache.jena.rdf.model.Resource ;
+import org.apache.jena.rdf.model.ResourceFactory;
+import org.junit.Test;
 
-public class TestMode extends AssemblerTestBase
-    {
-    public TestMode( String name )
-        { super( name ); }
+public class TestMode {
 
-    public void testConstantsExist()
-        {
+    @Test
+    public void testConstantsExist() {
         Mode a = Mode.CREATE, b = Mode.DEFAULT;
         Mode c = Mode.REUSE, d = Mode.ANY;
-        assertDiffer( Mode.CREATE, Mode.DEFAULT );
-        assertDiffer( Mode.CREATE, Mode.REUSE );
-        assertDiffer( Mode.CREATE, Mode.ANY );
-        assertDiffer( Mode.DEFAULT, Mode.REUSE );
-        assertDiffer( Mode.DEFAULT, Mode.ANY );
-        assertDiffer( Mode.REUSE, Mode.ANY );
-        }
-    
-    static final String someName = "aName";
-    static final Resource someRoot = resource( "aRoot" );
-    
-    public void testCreate()
-        {
-        assertEquals( true, Mode.CREATE.permitCreateNew( someRoot, someName ) );
-        assertEquals( false, Mode.CREATE.permitUseExisting( someRoot, someName ) );
-        }    
-    
-    public void testReuse()
-        {
-        assertEquals( false, Mode.REUSE.permitCreateNew( someRoot, someName ) );
-        assertEquals( true, Mode.REUSE.permitUseExisting( someRoot, someName ) );
-        }    
-    
-    public void testAny()
-        {
-        assertEquals( true, Mode.ANY.permitCreateNew( someRoot, someName ) );
-        assertEquals( true, Mode.ANY.permitUseExisting( someRoot, someName ) );
-        }    
-    
-    public void testDefault()
-        {
-        assertEquals( false, Mode.DEFAULT.permitCreateNew( someRoot, someName ) );
-        assertEquals( true, Mode.DEFAULT.permitUseExisting( someRoot, someName ) );
-        }
+
+        assertNotEquals(Mode.CREATE, Mode.DEFAULT);
+        assertNotEquals(Mode.CREATE, Mode.REUSE);
+        assertNotEquals(Mode.CREATE, Mode.ANY);
+        assertNotEquals(Mode.DEFAULT, Mode.REUSE);
+        assertNotEquals(Mode.DEFAULT, Mode.ANY);
+        assertNotEquals(Mode.REUSE, Mode.ANY);
+    }
+
+    private static final String someName = "aName";
+    private static final Resource someRoot = ResourceFactory.createResource("http://example/aRoot");
+
+    @Test
+    public void testCreate() {
+        assertTrue(Mode.CREATE.permitCreateNew(someRoot, someName));
+        assertFalse(Mode.CREATE.permitUseExisting(someRoot, someName));
+    }
+
+    @Test
+    public void testReuse() {
+        assertFalse(Mode.REUSE.permitCreateNew(someRoot, someName));
+        assertTrue(Mode.REUSE.permitUseExisting(someRoot, someName));
+    }
+
+    @Test
+    public void testAny() {
+        assertTrue(Mode.ANY.permitCreateNew(someRoot, someName));
+        assertTrue(Mode.ANY.permitUseExisting(someRoot, someName));
+    }
+
+    @Test
+    public void testDefault() {
+        assertFalse(Mode.DEFAULT.permitCreateNew(someRoot, someName));
+        assertTrue(Mode.DEFAULT.permitUseExisting(someRoot, someName));
     }
+}
diff --git a/jena-core/src/test/java/org/apache/jena/assembler/test/AcceptanceTesting.java b/jena-core/src/test/java/org/apache/jena/assembler/test/TestOntModelAcceptance.java
similarity index 94%
rename from jena-core/src/test/java/org/apache/jena/assembler/test/AcceptanceTesting.java
rename to jena-core/src/test/java/org/apache/jena/assembler/test/TestOntModelAcceptance.java
index b02a60d004..1b983115a9 100644
--- a/jena-core/src/test/java/org/apache/jena/assembler/test/AcceptanceTesting.java
+++ b/jena-core/src/test/java/org/apache/jena/assembler/test/TestOntModelAcceptance.java
@@ -21,9 +21,9 @@ package org.apache.jena.assembler.test;
 import org.apache.jena.ontology.* ;
 import org.apache.jena.rdf.model.* ;
 
-public class AcceptanceTesting extends AssemblerTestBase
+public class TestOntModelAcceptance extends AssemblerTestBase
     {
-    public AcceptanceTesting( String name )
+    public TestOntModelAcceptance( String name )
         { super( name ); }
 
     /**
diff --git a/jena-core/src/test/java/org/apache/jena/mem2/TestPackage_GraphMem2.java b/jena-core/src/test/java/org/apache/jena/datatypes/TS3_dt.java
similarity index 83%
copy from jena-core/src/test/java/org/apache/jena/mem2/TestPackage_GraphMem2.java
copy to jena-core/src/test/java/org/apache/jena/datatypes/TS3_dt.java
index 2a4f239f55..eed9b8a8e8 100644
--- a/jena-core/src/test/java/org/apache/jena/mem2/TestPackage_GraphMem2.java
+++ b/jena-core/src/test/java/org/apache/jena/datatypes/TS3_dt.java
@@ -16,17 +16,17 @@
  * limitations under the License.
  */
 
-package org.apache.jena.mem2;
+package org.apache.jena.datatypes;
 
 import org.junit.runner.RunWith;
 import org.junit.runners.Suite;
 
 @RunWith(Suite.class)
 @Suite.SuiteClasses( {
-    GraphMem2LegacyTest.class,
-    GraphMem2FastTest.class,
-    GraphMem2RoaringTest.class,
-    GraphMem2Test.class
-} )
-public class TestPackage_GraphMem2 {
+    TestDatatypes.class,
+    TestDatatypeValues.class,
+    TestRDFXMLiteral.class
+})
+
+public class TS3_dt {
 }
diff --git a/jena-core/src/test/java/org/apache/jena/enhanced/test/TestPackage_enh.java b/jena-core/src/test/java/org/apache/jena/enhanced/test/TS3_enh.java
similarity index 99%
rename from jena-core/src/test/java/org/apache/jena/enhanced/test/TestPackage_enh.java
rename to jena-core/src/test/java/org/apache/jena/enhanced/test/TS3_enh.java
index c1468432d1..60f7c1b1ac 100644
--- a/jena-core/src/test/java/org/apache/jena/enhanced/test/TestPackage_enh.java
+++ b/jena-core/src/test/java/org/apache/jena/enhanced/test/TS3_enh.java
@@ -49,7 +49,7 @@ import org.apache.jena.shared.JenaException ;
  *These tests only test EnhNode polymorphism and not EnhGraph polymorphism.
  *EnhGraph polymorphism currently will not work.
  */
-public class TestPackage_enh extends GraphTestBase  {
+public class TS3_enh extends GraphTestBase  {
 
 	static final private  Personality<RDFNode> split = new Personality<>();
 
@@ -83,13 +83,13 @@ public class TestPackage_enh extends GraphTestBase  {
         broken.add( TestProperty.class, TestObjectImpl.factory );
 	}
     /** Creates a new instance of EnhancedTestSuite */
-   	public TestPackage_enh(String name)
+   	public TS3_enh(String name)
 		{
 		super( name );
 		}
 
     public static TestSuite suite()
-        { return new TestSuite( TestPackage_enh.class ); }
+        { return new TestSuite( TS3_enh.class ); }
 
     /**
         test that equals works on an EnhNode (after hedgehog introduced FrontsNode
diff --git a/jena-core/src/test/java/org/apache/jena/graph/compose/test/TS3_compose.java b/jena-core/src/test/java/org/apache/jena/graph/compose/test/TS3_compose.java
new file mode 100755
index 0000000000..fb4de1b999
--- /dev/null
+++ b/jena-core/src/test/java/org/apache/jena/graph/compose/test/TS3_compose.java
@@ -0,0 +1,105 @@
+/*
+ * 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 org.apache.jena.graph.compose.test;
+
+import junit.framework.*;
+import org.apache.jena.graph.GraphMemFactory;
+import org.apache.jena.graph.Graph;
+import org.apache.jena.graph.compose.*;
+import org.apache.jena.rdf.model.Model;
+import org.apache.jena.rdf.model.ModelFactory;
+import org.apache.jena.rdf.model.test.AbstractTestPackage;
+import org.apache.jena.rdf.model.test.helpers.TestingModelFactory;
+import org.apache.jena.shared.PrefixMapping;
+
+public class TS3_compose extends TestCase {
+
+    public static TestSuite suite() {
+        TestSuite result = new TestSuite();
+
+        GraphModelFactory gmf = new GraphModelFactory() {
+
+            @Override
+            Graph getGraph() {
+                return new Intersection(GraphMemFactory.createGraphMemForModel(), GraphMemFactory.createGraphMemForModel());
+            }
+        };
+
+        AbstractTestPackage atp = new AbstractTestPackage("Intersection", gmf) {};
+        for ( int i = 0 ; i < atp.testCount() ; i++ ) {
+            result.addTest(atp.testAt(i));
+        }
+
+        gmf = new GraphModelFactory() {
+
+            @Override
+            Graph getGraph() {
+                return new Difference(GraphMemFactory.createGraphMemForModel(), GraphMemFactory.createGraphMemForModel());
+            }
+        };
+
+        atp = new AbstractTestPackage("Difference", gmf) {};
+        for ( int i = 0 ; i < atp.testCount() ; i++ ) {
+            result.addTest(atp.testAt(i));
+        }
+
+        gmf = new GraphModelFactory() {
+
+            @Override
+            Graph getGraph() {
+                return new Union(GraphMemFactory.createGraphMemForModel(), GraphMemFactory.createGraphMemForModel());
+            }
+        };
+
+        atp = new AbstractTestPackage("Union", gmf) {};
+        for ( int i = 0 ; i < atp.testCount() ; i++ ) {
+            result.addTest(atp.testAt(i));
+        }
+        /* */
+        result.addTest(TestDelta.suite());
+        result.addTest(TestUnion.suite());
+        result.addTest(TestDisjointUnion.suite());
+        result.addTest(TestDifference.suite());
+        result.addTest(TestIntersection.suite());
+        result.addTest(TestMultiUnion.suite());
+        /* */
+        result.addTest(TestPolyadicPrefixMapping.suite());
+        return result;
+    }
+
+    private static abstract class GraphModelFactory implements TestingModelFactory {
+        abstract Graph getGraph();
+
+        @Override
+        public Model createModel() {
+            return createModel(getGraph());
+        }
+
+        @Override
+        public Model createModel(final Graph base) {
+            return ModelFactory.createModelForGraph(base);
+        }
+
+        @Override
+        public PrefixMapping getPrefixMapping() {
+            return ModelFactory.createDefaultModel().getGraph().getPrefixMapping();
+        }
+    }
+
+}
diff --git a/jena-core/src/test/java/org/apache/jena/graph/compose/test/TestPackage_compose.java b/jena-core/src/test/java/org/apache/jena/graph/compose/test/TestPackage_compose.java
deleted file mode 100755
index 957a57555f..0000000000
--- a/jena-core/src/test/java/org/apache/jena/graph/compose/test/TestPackage_compose.java
+++ /dev/null
@@ -1,114 +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 org.apache.jena.graph.compose.test;
-
-
-import junit.framework.*;
-import org.apache.jena.graph.GraphMemFactory ;
-import org.apache.jena.graph.Graph ;
-import org.apache.jena.graph.compose.* ;
-import org.apache.jena.rdf.model.Model ;
-import org.apache.jena.rdf.model.ModelFactory ;
-import org.apache.jena.rdf.model.test.AbstractTestPackage ;
-import org.apache.jena.rdf.model.test.helpers.TestingModelFactory ;
-import org.apache.jena.shared.PrefixMapping ;
-
-public class TestPackage_compose extends TestCase {
-
-    public static TestSuite suite() {
-    	TestSuite result = new TestSuite();
-
-    	GraphModelFactory gmf = new GraphModelFactory(){
-
-			@Override
-			Graph getGraph()
-			{
-				return new Intersection(GraphMemFactory.createGraphMem(), GraphMemFactory.createGraphMem());
-			}};
-
-    	AbstractTestPackage atp = new AbstractTestPackage( "Intersection",  gmf ){};
-    	for (int i=0;i<atp.testCount();i++)
-    	{
-    		result.addTest( atp.testAt(i) );
-    	}
-
-    	gmf = new GraphModelFactory(){
-
-			@Override
-			Graph getGraph()
-			{
-				return new Difference(GraphMemFactory.createGraphMem(), GraphMemFactory.createGraphMem());
-			}};
-
-    	atp = new AbstractTestPackage( "Difference",  gmf ){};
-    	for (int i=0;i<atp.testCount();i++)
-    	{
-    		result.addTest( atp.testAt(i) );
-    	}
-
-    	gmf = new GraphModelFactory(){
-
-			@Override
-			Graph getGraph()
-			{
-				return new Union(GraphMemFactory.createGraphMem(), GraphMemFactory.createGraphMem());
-			}};
-
-    	atp = new AbstractTestPackage( "Union",  gmf ){};
-    	for (int i=0;i<atp.testCount();i++)
-    	{
-    		result.addTest( atp.testAt(i) );
-    	}
-    /* */
-        result.addTest( TestDelta.suite() );
-        result.addTest( TestUnion.suite() );
-        result.addTest( TestDisjointUnion.suite() );
-        result.addTest( TestDifference.suite() );
-        result.addTest( TestIntersection.suite() );
-        result.addTest( TestMultiUnion.suite() );
-    /* */
-        result.addTest( TestPolyadicPrefixMapping.suite() );
-        return  result;
-    }
-
-    private static abstract class GraphModelFactory implements TestingModelFactory
-	{
-    	abstract Graph getGraph();
-
-		@Override
-		public Model createModel()
-		{
-			return createModel( getGraph());
-		}
-
-		@Override
-		public Model createModel( final Graph base )
-		{
-			return ModelFactory.createModelForGraph(base);
-		}
-
-		@Override
-		public PrefixMapping getPrefixMapping()
-		{
-			return ModelFactory.createDefaultModel().getGraph()
-					.getPrefixMapping();
-		}
-	}
-
-}
diff --git a/jena-core/src/test/java/org/apache/jena/langtagx/TS_LangTagX.java b/jena-core/src/test/java/org/apache/jena/graph/test/TS3_graph.java
similarity index 55%
copy from jena-core/src/test/java/org/apache/jena/langtagx/TS_LangTagX.java
copy to jena-core/src/test/java/org/apache/jena/graph/test/TS3_graph.java
index 96633d00fe..94217962ee 100644
--- a/jena-core/src/test/java/org/apache/jena/langtagx/TS_LangTagX.java
+++ b/jena-core/src/test/java/org/apache/jena/graph/test/TS3_graph.java
@@ -16,27 +16,38 @@
  * limitations under the License.
  */
 
-package org.apache.jena.langtagx;
+package org.apache.jena.graph.test;
 
 import org.junit.runner.RunWith;
 import org.junit.runners.Suite;
 
-import junit.framework.JUnit4TestAdapter;
-import junit.framework.TestSuite;
-
-//JUnit5. Does not mix with JUnit3. So until jena-core updates to JUnit 4 or 5 ...
-//@Suite
-//@SelectClasses({
 @RunWith(Suite.class)
 @Suite.SuiteClasses( {
-    TestLangTagX.class
+    TestFindLiterals.class,
+    TestLiteralLabels.class,
+    TestLiteralLabelSameValueAs.class,
+    TestNode.class,
+    TestTriple.class,
+    TestTripleField.class,
+    TestNodeToTriplesMapMem.class,
+    TestReifier.class,
+    TestTypedLiterals.class,
+    TestDateTime.class,
+    TestFactory.class,
+    TestGraph.class,
+    TestGraphPlain.class,
+    TestCoreGraphUtil.class,
+    TestGraphPrefixMapping.class,
+    TestGraphMatchWithInference.class,
+    TestGraphEvents.class,
+    TestGraphBaseToString.class,
+    TestNodeExtras.class,
+    TestRDFStringLiterals.class,
+    TestNodeEdgeCases.class,
+
+    // Has to be in a specific package.
+    org.apache.jena.graph.TestGraphUtil.class
+
 })
 
-public class TS_LangTagX {
-    public static TestSuite suite() {
-        TestSuite ts = new TestSuite();
-        ts.setName("LangTagX");
-        ts.addTest(new JUnit4TestAdapter(TS_LangTagX.class));
-        return ts;
-    }
-}
+public class TS3_graph { }
diff --git a/jena-core/src/test/java/org/apache/jena/graph/test/TestPackage_graph.java b/jena-core/src/test/java/org/apache/jena/graph/test/TestPackage_graph.java
deleted file mode 100644
index 78d2aa9537..0000000000
--- a/jena-core/src/test/java/org/apache/jena/graph/test/TestPackage_graph.java
+++ /dev/null
@@ -1,64 +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 org.apache.jena.graph.test;
-
-import junit.framework.JUnit4TestAdapter ;
-import junit.framework.TestSuite ;
-import org.apache.jena.graph.TestGraphUtil;
-
-/**
-    Collected test suite for the .graph package.
-*/
-
-public class TestPackage_graph extends TestSuite {
-
-    static public TestSuite suite() {
-        return new TestPackage_graph();
-    }
-
-    /** Creates new TestPackage */
-    private TestPackage_graph() {
-        super("graph");
-        addTest( TestFindLiterals.suite() );
-        addTest( TestLiteralLabels.suite() );
-        addTest( TestLiteralLabelSameValueAs.suite() );
-        addTest( TestNode.suite() );
-        addTest( TestTriple.suite() );
-        addTest( TestTripleField.suite() );
-        addTest( TestNodeToTriplesMapMem.suite() );
-        addTest( TestReifier.suite() );
-        addTest( TestTypedLiterals.suite() );
-        addTest( TestDateTime.suite() );
-        addTest( TestFactory.suite() );
-        addTest( TestGraph.suite() );
-        addTest( new JUnit4TestAdapter(TestGraphPlain.class) );
-        addTest( TestCoreGraphUtil.suite() );
-        addTest( TestGraphPrefixMapping.suite() );
-        addTest( TestGraphMatchWithInference.suite());
-        addTestSuite( TestGraphEvents.class );
-        addTestSuite( TestGraphBaseToString.class );
-        addTest( new JUnit4TestAdapter(TestNodeExtras.class) );
-        addTest( new JUnit4TestAdapter(TestRDFStringLiterals.class) );
-        addTest( new JUnit4TestAdapter(TestNodeEdgeCases.class) );
-
-        // Has to be in a different package.
-        addTest( new JUnit4TestAdapter(TestGraphUtil.class) );
-
-    }
-}
diff --git a/jena-core/src/test/java/org/apache/jena/irix/TS_IRIx.java b/jena-core/src/test/java/org/apache/jena/irix/TS_IRIx.java
index 9b601c9543..9a3253d63d 100644
--- a/jena-core/src/test/java/org/apache/jena/irix/TS_IRIx.java
+++ b/jena-core/src/test/java/org/apache/jena/irix/TS_IRIx.java
@@ -18,13 +18,10 @@
 
 package org.apache.jena.irix;
 
+import org.apache.jena.iri3986.provider.InitIRI3986;
 import org.junit.runner.RunWith;
 import org.junit.runners.Suite;
 
-import junit.framework.JUnit4TestAdapter;
-import junit.framework.TestSuite;
-import org.apache.jena.iri3986.provider.InitIRI3986;
-
 /**
  * Test of IRIx for the system default IRIProvider.
  * This forms the contract for IRIPRoviders.
@@ -59,11 +56,4 @@ public class TS_IRIx {
         SystemIRIx.init();
         InitIRI3986.init();
     }
-
-    public static TestSuite suite() {
-        TestSuite ts = new TestSuite();
-        ts.setName("IRIx");
-        ts.addTest(new JUnit4TestAdapter(TS_IRIx.class));
-        return ts;
-    }
 }
diff --git a/jena-core/src/test/java/org/apache/jena/langtagx/TS_LangTagX.java b/jena-core/src/test/java/org/apache/jena/langtagx/TS_LangTagX.java
index 96633d00fe..b07b9517e9 100644
--- a/jena-core/src/test/java/org/apache/jena/langtagx/TS_LangTagX.java
+++ b/jena-core/src/test/java/org/apache/jena/langtagx/TS_LangTagX.java
@@ -32,11 +32,4 @@ import junit.framework.TestSuite;
     TestLangTagX.class
 })
 
-public class TS_LangTagX {
-    public static TestSuite suite() {
-        TestSuite ts = new TestSuite();
-        ts.setName("LangTagX");
-        ts.addTest(new JUnit4TestAdapter(TS_LangTagX.class));
-        return ts;
-    }
-}
+public class TS_LangTagX {}
diff --git a/jena-core/src/test/java/org/apache/jena/mem2/TestPackage_GraphMem2.java b/jena-core/src/test/java/org/apache/jena/mem/test/TS3_GraphMemValue.java
similarity index 75%
copy from jena-core/src/test/java/org/apache/jena/mem2/TestPackage_GraphMem2.java
copy to jena-core/src/test/java/org/apache/jena/mem/test/TS3_GraphMemValue.java
index 2a4f239f55..b7dd2d4e9e 100644
--- a/jena-core/src/test/java/org/apache/jena/mem2/TestPackage_GraphMem2.java
+++ b/jena-core/src/test/java/org/apache/jena/mem/test/TS3_GraphMemValue.java
@@ -16,17 +16,21 @@
  * limitations under the License.
  */
 
-package org.apache.jena.mem2;
+package org.apache.jena.mem.test;
+
 
 import org.junit.runner.RunWith;
 import org.junit.runners.Suite;
 
 @RunWith(Suite.class)
 @Suite.SuiteClasses( {
-    GraphMem2LegacyTest.class,
-    GraphMem2FastTest.class,
-    GraphMem2RoaringTest.class,
-    GraphMem2Test.class
-} )
-public class TestPackage_GraphMem2 {
-}
+    TestGraphMemModel.class,
+    TestGraphTripleStoreMem.class,
+    TestConcurrentModificationException.class,
+    TestArrayTripleBunch.class,
+    TestHashedTripleBunch.class,
+    TestHashedBunchMap.class,
+    TestHashCommon.class
+})
+
+public class TS3_GraphMemValue {}
diff --git a/jena-core/src/test/java/org/apache/jena/mem/test/TestPackage_GraphMemValue.java b/jena-core/src/test/java/org/apache/jena/mem/test/TestPackage_GraphMemValue.java
deleted file mode 100644
index 153a03d134..0000000000
--- a/jena-core/src/test/java/org/apache/jena/mem/test/TestPackage_GraphMemValue.java
+++ /dev/null
@@ -1,39 +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 org.apache.jena.mem.test;
-
-
-import junit.framework.*;
-
-public class TestPackage_GraphMemValue extends TestCase
-    {
-    public static TestSuite suite()
-        {
-        TestSuite result = new TestSuite();
-        result.addTest( TestGraphMemModel.suite() );
-        result.addTest( TestGraphTripleStoreMem.suite() );
-        result.addTest( TestConcurrentModificationException.suite() );
-        result.addTestSuite( TestArrayTripleBunch.class );
-        result.addTestSuite( TestHashedTripleBunch.class );
-        result.addTestSuite( TestHashedBunchMap.class );
-        result.addTestSuite( TestHashCommon.class );
-
-        return result;
-        }
-    }
diff --git a/jena-core/src/test/java/org/apache/jena/mem2/TS4_GraphMem2.java b/jena-core/src/test/java/org/apache/jena/mem2/TS4_GraphMem2.java
new file mode 100644
index 0000000000..ddbaf26d4c
--- /dev/null
+++ b/jena-core/src/test/java/org/apache/jena/mem2/TS4_GraphMem2.java
@@ -0,0 +1,83 @@
+/*
+ * 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 org.apache.jena.mem2;
+
+import org.apache.jena.mem2.collection.*;
+import org.apache.jena.mem2.iterator.IteratorOfJenaSetsTest;
+import org.apache.jena.mem2.iterator.SparseArrayIteratorTest;
+import org.apache.jena.mem2.pattern.PatternClassifierTest;
+import org.apache.jena.mem2.spliterator.ArraySpliteratorTest;
+import org.apache.jena.mem2.spliterator.ArraySubSpliteratorTest;
+import org.apache.jena.mem2.spliterator.SparseArraySpliteratorTest;
+import org.apache.jena.mem2.spliterator.SparseArraySubSpliteratorTest;
+import org.apache.jena.mem2.store.fast.FastArrayBunchTest;
+import org.apache.jena.mem2.store.fast.FastHashedTripleBunchTest;
+import org.apache.jena.mem2.store.fast.FastTripleStoreTest;
+import org.apache.jena.mem2.store.legacy.*;
+import org.apache.jena.mem2.store.roaring.RoaringBitmapTripleIteratorTest;
+import org.apache.jena.mem2.store.roaring.RoaringTripleStoreTest;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses( {
+    // spliterator/
+    SparseArraySubSpliteratorTest.class,
+    ArraySubSpliteratorTest.class,
+    ArraySpliteratorTest.class,
+    SparseArraySpliteratorTest.class,
+
+    // iterator/
+    IteratorOfJenaSetsTest.class,
+    SparseArrayIteratorTest.class,
+
+    // collection/
+    FastHashMapTest.class,
+    FastHashMapTest2.class,
+    HashCommonMapTest.class,
+    HashCommonSetTest.class,
+    FastHashSetTest.class,
+    FastHashSetTest2.class,
+
+    // store/fast
+    FastTripleStoreTest.class,
+    FastArrayBunchTest.class,
+    FastHashedTripleBunchTest.class,
+
+    // store/roaring
+    RoaringTripleStoreTest.class,
+    RoaringBitmapTripleIteratorTest.class,
+
+    // store/legacy
+    ArrayBunchTest.class,
+    LegacyTripleStoreTest.class,
+    NodeToTriplesMapMemTest.class,
+    FieldFilterTest.class,
+    HashedTripleBunchTest.class,
+
+    // pattern/
+    PatternClassifierTest.class,
+
+    // --
+    GraphMem2LegacyTest.class,
+    GraphMem2FastTest.class,
+    GraphMem2RoaringTest.class,
+    GraphMem2Test.class
+} )
+public class TS4_GraphMem2 {}
diff --git a/jena-core/src/test/java/org/apache/jena/langtagx/TS_LangTagX.java b/jena-core/src/test/java/org/apache/jena/ontology/impl/TS3_ont.java
similarity index 62%
copy from jena-core/src/test/java/org/apache/jena/langtagx/TS_LangTagX.java
copy to jena-core/src/test/java/org/apache/jena/ontology/impl/TS3_ont.java
index 96633d00fe..649ab1be99 100644
--- a/jena-core/src/test/java/org/apache/jena/langtagx/TS_LangTagX.java
+++ b/jena-core/src/test/java/org/apache/jena/ontology/impl/TS3_ont.java
@@ -16,27 +16,30 @@
  * limitations under the License.
  */
 
-package org.apache.jena.langtagx;
+package org.apache.jena.ontology.impl;
 
 import org.junit.runner.RunWith;
 import org.junit.runners.Suite;
 
-import junit.framework.JUnit4TestAdapter;
-import junit.framework.TestSuite;
 
-//JUnit5. Does not mix with JUnit3. So until jena-core updates to JUnit 4 or 5 ...
-//@Suite
-//@SelectClasses({
 @RunWith(Suite.class)
-@Suite.SuiteClasses( {
-    TestLangTagX.class
+@Suite.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 TS_LangTagX {
-    public static TestSuite suite() {
-        TestSuite ts = new TestSuite();
-        ts.setName("LangTagX");
-        ts.addTest(new JUnit4TestAdapter(TS_LangTagX.class));
-        return ts;
-    }
-}
+public class TS3_ont {}
diff --git a/jena-core/src/test/java/org/apache/jena/ontology/impl/TestPackage_ont.java b/jena-core/src/test/java/org/apache/jena/ontology/impl/TestPackage_ont.java
deleted file mode 100644
index cefbfb4986..0000000000
--- a/jena-core/src/test/java/org/apache/jena/ontology/impl/TestPackage_ont.java
+++ /dev/null
@@ -1,61 +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 org.apache.jena.ontology.impl;
-
-
-import junit.framework.TestSuite;
-
-/**
-    Collected test suite for the .ontology.impl package.
-*/
-
-public class TestPackage_ont extends TestSuite {
-
-    static public TestSuite suite() {
-        return new TestPackage_ont();
-    }
-
-    /** Creates new TestPackage */
-    private TestPackage_ont() {
-        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);
-    }
-
-}
diff --git a/jena-core/src/test/java/org/apache/jena/ontology/makers/TestPackage_ModelMakers.java b/jena-core/src/test/java/org/apache/jena/ontology/makers/TS3_ModelMakers.java
similarity index 72%
rename from jena-core/src/test/java/org/apache/jena/ontology/makers/TestPackage_ModelMakers.java
rename to jena-core/src/test/java/org/apache/jena/ontology/makers/TS3_ModelMakers.java
index bdfaa8edae..e5f75578e4 100644
--- a/jena-core/src/test/java/org/apache/jena/ontology/makers/TestPackage_ModelMakers.java
+++ b/jena-core/src/test/java/org/apache/jena/ontology/makers/TS3_ModelMakers.java
@@ -18,15 +18,12 @@
 
 package org.apache.jena.ontology.makers;
 
-import junit.framework.TestSuite;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
 
-public class TestPackage_ModelMakers extends TestSuite {
-
-    public static TestSuite suite() {
-        TestSuite result = new TestSuite();
-        result.addTestSuite(TestSimpleGraphMaker.class);
-        result.addTestSuite(TestModelMakerImpl.class);
-        return result;
-    }
-
-}
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+    TestSimpleGraphMaker.class,
+    TestModelMakerImpl.class
+})
+public class TS3_ModelMakers {}
diff --git a/jena-core/src/test/java/org/apache/jena/rdf/model/test/IsomorphicTests.java b/jena-core/src/test/java/org/apache/jena/rdf/model/test/IsomorphicTests.java
index 96eef1a6a5..89b5a53f7a 100644
--- a/jena-core/src/test/java/org/apache/jena/rdf/model/test/IsomorphicTests.java
+++ b/jena-core/src/test/java/org/apache/jena/rdf/model/test/IsomorphicTests.java
@@ -6,9 +6,9 @@
  * 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.
@@ -29,12 +29,12 @@ import org.junit.Assert;
 
 public class IsomorphicTests extends AbstractModelTestBase
 {
-    // This is not part of the standard test suite 
+    // This is not part of the standard test suite
     // It's not stable enough for inclusion in the automatic test suite.
     // Often, they pass, but there is a significant number of times they don't.
     // It also seems to be machine-dependent - failures are more frequent
-    // on Apache Jenkins (hardware influening "random" numbers?)
-    
+    // on Apache Jenkins (hardware influencing "random" numbers?)
+
 	/**
 	 * A theoretical graph for testing purposes.
 	 * All nodes are anonymous resources. All edges are labelled
diff --git a/jena-core/src/test/java/org/apache/jena/rdf/model/test/TestPackage_model.java b/jena-core/src/test/java/org/apache/jena/rdf/model/test/TS3_Model1.java
similarity index 86%
rename from jena-core/src/test/java/org/apache/jena/rdf/model/test/TestPackage_model.java
rename to jena-core/src/test/java/org/apache/jena/rdf/model/test/TS3_Model1.java
index 1f2df0d31b..26b6ebb835 100644
--- a/jena-core/src/test/java/org/apache/jena/rdf/model/test/TestPackage_model.java
+++ b/jena-core/src/test/java/org/apache/jena/rdf/model/test/TS3_Model1.java
@@ -25,12 +25,7 @@ import org.apache.jena.rdf.model.ModelFactory;
 import org.apache.jena.rdf.model.test.helpers.TestingModelFactory;
 import org.apache.jena.shared.PrefixMapping;
 
-/**
- * Implementation of the basic Model TestPackage. Uses the standard ModelFactory to
- * create models for testing.
- */
-
-public class TestPackage_model extends AbstractTestPackage {
+public class TS3_Model1 extends AbstractTestPackage {
 
     public static class PlainModelFactory implements TestingModelFactory {
         @Override
@@ -50,10 +45,10 @@ public class TestPackage_model extends AbstractTestPackage {
     }
 
     static public TestSuite suite() {
-        return new TestPackage_model();
+        return new TS3_Model1();
     }
 
-    public TestPackage_model() {
+    public TS3_Model1() {
         super("Model", new PlainModelFactory());
     }
 }
diff --git a/jena-core/src/test/java/org/apache/jena/rdf/model/test/TestStandardModels.java b/jena-core/src/test/java/org/apache/jena/rdf/model/test/TS3_StandardModels.java
similarity index 87%
rename from jena-core/src/test/java/org/apache/jena/rdf/model/test/TestStandardModels.java
rename to jena-core/src/test/java/org/apache/jena/rdf/model/test/TS3_StandardModels.java
index 851d3f0bfa..16a32f40e8 100644
--- a/jena-core/src/test/java/org/apache/jena/rdf/model/test/TestStandardModels.java
+++ b/jena-core/src/test/java/org/apache/jena/rdf/model/test/TS3_StandardModels.java
@@ -21,15 +21,15 @@ package org.apache.jena.rdf.model.test;
 import junit.framework.*;
 import org.apache.jena.rdf.model.* ;
 
-public class TestStandardModels extends AbstractTestModel
+public class TS3_StandardModels extends AbstractTestModel
     {
 
-    public TestStandardModels(String name)
+    public TS3_StandardModels(String name)
         { super(name); }
         
     public static TestSuite suite()
         {
-        return new TestSuite( TestStandardModels.class );
+        return new TestSuite( TS3_StandardModels.class );
         }
 
     @Override
diff --git a/jena-core/src/test/java/org/apache/jena/rdf/model/test/TestIterators.java b/jena-core/src/test/java/org/apache/jena/rdf/model/test/TestIterators.java
index 7ab3a6b85d..214fb5d206 100644
--- a/jena-core/src/test/java/org/apache/jena/rdf/model/test/TestIterators.java
+++ b/jena-core/src/test/java/org/apache/jena/rdf/model/test/TestIterators.java
@@ -6,9 +6,9 @@
  * 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.
@@ -81,6 +81,9 @@ public class TestIterators extends AbstractModelTestBase
 			}
 			Assert.assertEquals("Remove failed", 0, model.size());
 		}
+		catch (UnsupportedOperationException ex) {
+		    throw ex;
+		}
 		finally
 		{
 			it.close();
diff --git a/jena-core/src/test/java/org/apache/jena/rdf/model/test/TestModelRead.java b/jena-core/src/test/java/org/apache/jena/rdf/model/test/TestModelRead.java
index 18e26e0619..28d94718d6 100644
--- a/jena-core/src/test/java/org/apache/jena/rdf/model/test/TestModelRead.java
+++ b/jena-core/src/test/java/org/apache/jena/rdf/model/test/TestModelRead.java
@@ -38,7 +38,7 @@ public class TestModelRead extends AbstractModelTestBase
     }
 
     public TestModelRead() {
-        this(new TestPackage_model.PlainModelFactory(), "TestModelRead") ;
+        this(new TS3_Model1.PlainModelFactory(), "TestModelRead") ;
     }
 
     public void testDefaultLangXML() {
diff --git a/jena-core/src/test/java/org/apache/jena/rdf/model/test/TestReaderEvents.java b/jena-core/src/test/java/org/apache/jena/rdf/model/test/TestReaderEvents.java
index 33f24794c8..f9f9f60b00 100644
--- a/jena-core/src/test/java/org/apache/jena/rdf/model/test/TestReaderEvents.java
+++ b/jena-core/src/test/java/org/apache/jena/rdf/model/test/TestReaderEvents.java
@@ -38,7 +38,7 @@ public class TestReaderEvents extends AbstractModelTestBase
 
 	public TestReaderEvents()
 	{
-		this( new TestPackage_model.PlainModelFactory(), "TestReaderEvents");
+		this( new TS3_Model1.PlainModelFactory(), "TestReaderEvents");
 	}
 
 	public void testNTriplesReaderEvents()
diff --git a/jena-core/src/test/java/org/apache/jena/rdf/model/test/TestReaders.java b/jena-core/src/test/java/org/apache/jena/rdf/model/test/TestReaders.java
index 382510591a..8395d983fc 100644
--- a/jena-core/src/test/java/org/apache/jena/rdf/model/test/TestReaders.java
+++ b/jena-core/src/test/java/org/apache/jena/rdf/model/test/TestReaders.java
@@ -38,7 +38,7 @@ public class TestReaders extends AbstractModelTestBase
     }
 
     public TestReaders() {
-        this(new TestPackage_model.PlainModelFactory(), "TestReaders") ;
+        this(new TS3_Model1.PlainModelFactory(), "TestReaders") ;
     }
 
     /**
diff --git a/jena-core/src/test/java/org/apache/jena/rdfxml/libtest/package.html b/jena-core/src/test/java/org/apache/jena/rdfxml/libtest/package.html
deleted file mode 100644
index 8bd36a1994..0000000000
--- a/jena-core/src/test/java/org/apache/jena/rdfxml/libtest/package.html
+++ /dev/null
@@ -1,30 +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.
--->
-
-<html>
-<head>
-<title>shared.wg</title>
-</head>
-<body>
-This package defines some classes to help with accessing tests 
-produced by the RDF Core and WebOnt WGs.
-The tests can be accessed either from the web,
-or from a zip on the web, 
-from a local copy in the testing directory.
-</body>
-</html>
\ No newline at end of file
diff --git a/jena-core/src/test/java/org/apache/jena/rdfxml/xmlinput1/TestPackage_xmlinput1.java b/jena-core/src/test/java/org/apache/jena/rdfxml/xmlinput1/TS3_xmlinput1.java
similarity index 93%
rename from jena-core/src/test/java/org/apache/jena/rdfxml/xmlinput1/TestPackage_xmlinput1.java
rename to jena-core/src/test/java/org/apache/jena/rdfxml/xmlinput1/TS3_xmlinput1.java
index 68008fd177..88cd9f972a 100644
--- a/jena-core/src/test/java/org/apache/jena/rdfxml/xmlinput1/TestPackage_xmlinput1.java
+++ b/jena-core/src/test/java/org/apache/jena/rdfxml/xmlinput1/TS3_xmlinput1.java
@@ -20,14 +20,14 @@ package org.apache.jena.rdfxml.xmlinput1;
 
 import junit.framework.TestSuite;
 
-public class TestPackage_xmlinput1 extends TestSuite
+public class TS3_xmlinput1 extends TestSuite
 {
     static public TestSuite suite()
     {
-        return new TestPackage_xmlinput1() ;
+        return new TS3_xmlinput1() ;
     }
 
-    private TestPackage_xmlinput1()
+    private TS3_xmlinput1()
     {
         super("RDF/XML Input ARP1") ;
         addTest( org.apache.jena.rdfxml.xmlinput1.TestURIs.suite());
diff --git a/jena-core/src/test/java/org/apache/jena/rdfxml/xmloutput/TestPackage_xmloutput.java b/jena-core/src/test/java/org/apache/jena/rdfxml/xmloutput/TS3_xmloutput.java
similarity index 97%
rename from jena-core/src/test/java/org/apache/jena/rdfxml/xmloutput/TestPackage_xmloutput.java
rename to jena-core/src/test/java/org/apache/jena/rdfxml/xmloutput/TS3_xmloutput.java
index 1dcceae5a9..c24caa7328 100644
--- a/jena-core/src/test/java/org/apache/jena/rdfxml/xmloutput/TestPackage_xmloutput.java
+++ b/jena-core/src/test/java/org/apache/jena/rdfxml/xmloutput/TS3_xmloutput.java
@@ -26,7 +26,7 @@ import org.apache.jena.test.X_RDFReaderF;
 /**
  * JUnit regression tests for output
  */
-public class TestPackage_xmloutput extends TestCase{
+public class TS3_xmloutput extends TestCase{
 
     /**
      * Answer a suite of all the tests defined here
diff --git a/jena-core/src/test/java/org/apache/jena/rdfxml/xmloutput/TestXMLFeatures.java b/jena-core/src/test/java/org/apache/jena/rdfxml/xmloutput/TestXMLFeatures.java
index ec19259bc7..4b967cfa19 100644
--- a/jena-core/src/test/java/org/apache/jena/rdfxml/xmloutput/TestXMLFeatures.java
+++ b/jena-core/src/test/java/org/apache/jena/rdfxml/xmloutput/TestXMLFeatures.java
@@ -381,7 +381,7 @@ public class TestXMLFeatures extends XMLOutputTestBase {
         blockLogger() ;
         Node blank = NodeFactory.createBlankNode() ;
         Node prop = NodeFactory.createURI(s) ;
-        Graph g = GraphMemFactory.createGraphMem() ;
+        Graph g = GraphMemFactory.createDefaultGraphSameValue() ;
         g.add(Triple.create(blank, prop, blank)) ;
         // create Model
         Model m = ModelFactory.createModelForGraph(g) ;
diff --git a/jena-core/src/test/java/org/apache/jena/reasoner/test/ManualExample.java b/jena-core/src/test/java/org/apache/jena/reasoner/examples/ManualExample.java
similarity index 91%
rename from jena-core/src/test/java/org/apache/jena/reasoner/test/ManualExample.java
rename to jena-core/src/test/java/org/apache/jena/reasoner/examples/ManualExample.java
index 12bba8bc73..2cf1a2d493 100644
--- a/jena-core/src/test/java/org/apache/jena/reasoner/test/ManualExample.java
+++ b/jena-core/src/test/java/org/apache/jena/reasoner/examples/ManualExample.java
@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-package org.apache.jena.reasoner.test;
+package org.apache.jena.reasoner.examples;
 
 import java.io.PrintWriter;
 import java.util.*;
@@ -36,7 +36,7 @@ import org.apache.jena.vocabulary.ReasonerVocabulary ;
 public class ManualExample {
 
     /** Illustrate different ways of finding a reasoner */
-    public void test1() {
+    public void example1() {
         String NS = "urn:example:";
 
         // Build a trivial example data set
@@ -64,7 +64,7 @@ public class ManualExample {
     }
 
     /** illustrate validation */
-    public void test2(String fname) {
+    public void example2(String fname) {
         System.out.println("Testing " + fname);
         Model data = FileManager.getInternal().loadModelInternal(fname);
         InfModel infmodel = ModelFactory.createRDFSModel(data);
@@ -82,7 +82,7 @@ public class ManualExample {
     }
 
     /** illustrate generic rules and derivation tracing */
-    public void test3() {
+    public void example3() {
         // Test data
         String egNS = PrintUtil.egNS;   // Namespace for examples
         Model rawData = ModelFactory.createDefaultModel();
@@ -114,7 +114,7 @@ public class ManualExample {
     }
 
     /** Another generic rules illustration */
-    public void test4() {
+    public void example4() {
         // Test data
         String egNS = PrintUtil.egNS;   // Namespace for examples
         Model rawData = ModelFactory.createDefaultModel();
@@ -133,7 +133,8 @@ public class ManualExample {
 
         // Rule example for
         String rules =
-            "[r1: (?c eg:concatFirst ?p), (?c eg:concatSecond ?q) -> " +            "     [r1b: (?x ?c ?y) <- (?x ?p ?z) (?z ?q ?y)] ]";        Reasoner reasoner = new GenericRuleReasoner(Rule.parseRules(rules));
+            "[r1: (?c eg:concatFirst ?p), (?c eg:concatSecond ?q) -> " +            "     [r1b: (?x ?c ?y) <- (?x ?p ?z) (?z ?q ?y)] ]";
+        Reasoner reasoner = new GenericRuleReasoner(Rule.parseRules(rules));
 //        reasoner.setParameter(ReasonerVocabulary.PROPtraceOn, Boolean.TRUE);
         InfModel inf = ModelFactory.createInfModel(reasoner, rawData);
 //        System.out.println("OK = " + inf.contains(A, r, C));
@@ -146,11 +147,12 @@ public class ManualExample {
 
     public static void main(String[] args) {
         try {
-//            new ManualExample().test1();
-//            new ManualExample().test2("file:testing/reasoners/rdfs/dttest2.nt");
-//            new ManualExample().test2("file:testing/reasoners/rdfs/dttest3.nt");
-//            new ManualExample().test3();
-            new ManualExample().test4();
+            ManualExample examples = new ManualExample();
+            examples.example1();
+            examples.example2("file:testing/reasoners/rdfs/dttest2.nt");
+            examples.example2("file:testing/reasoners/rdfs/dttest3.nt");
+            examples.example3();
+            examples.example4();
         } catch (Exception e) {
             System.out.println("Problem: " + e);
             e.printStackTrace();
diff --git a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/TS3_RuleReasoners.java b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/TS3_RuleReasoners.java
new file mode 100755
index 0000000000..7ca912231c
--- /dev/null
+++ b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/TS3_RuleReasoners.java
@@ -0,0 +1,59 @@
+/*
+ * 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 org.apache.jena.reasoner.rulesys;
+
+
+import org.apache.jena.reasoner.rulesys.impl.TestLPBRuleCloseBug;
+import org.apache.jena.reasoner.rulesys.impl.TestLPBRuleEngine;
+import org.apache.jena.reasoner.rulesys.impl.TestLPBRuleEngineLeak;
+import org.apache.jena.reasoner.rulesys.impl.TestRestartableLBRule;
+import org.apache.jena.reasoner.rulesys.test.*;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+    TestConfigVocabulary.class,
+    TestGenericRuleReasonerConfig.class,
+    TestBasics.class,
+
+    TestComparatorBuiltins.class,
+    TestRuleUtil.class,
+
+    TestBackchainer.class,
+    TestBasicLP.class,
+
+    TestLPDerivation.class,
+    TestLPBRuleEngine.class,
+    TestRestartableLBRule.class,
+    TestFBRules.class,
+    TestGenericRules.class,
+    TestRETE.class,
+    TestSetRules.class,
+    TestLPBRuleEngineLeak.class,
+    OWLUnitTest.class,
+    TestRuleSystemBugs.class,
+    TestOWLMisc.class,
+    FRuleEngineIFactoryTest.class,
+    TestLPBRuleCloseBug.class,
+
+    ConcurrencyTest.class,
+    TestRestrictionsDontNeedTyping.class
+})
+public class TS3_RuleReasoners {}
diff --git a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestRuleReasoners.java b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestRuleReasoners.java
deleted file mode 100755
index 9d907337cc..0000000000
--- a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestRuleReasoners.java
+++ /dev/null
@@ -1,84 +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 org.apache.jena.reasoner.rulesys.test;
-
-
-import junit.framework.JUnit4TestAdapter;
-import junit.framework.TestSuite ;
-import org.apache.jena.reasoner.rulesys.TestRuleUtil;
-import org.apache.jena.reasoner.rulesys.impl.TestLPBRuleCloseBug;
-import org.apache.jena.reasoner.rulesys.impl.TestLPBRuleEngine;
-import org.apache.jena.reasoner.rulesys.impl.TestLPBRuleEngineLeak;
-import org.apache.jena.reasoner.rulesys.impl.TestRestartableLBRule;
-import org.slf4j.Logger ;
-import org.slf4j.LoggerFactory ;
-
-/**
- * Aggregate tester that runs all the test associated with the rulesys package.
- */
-
-public class TestRuleReasoners extends TestSuite {
-
-    protected static Logger logger = LoggerFactory.getLogger(TestRuleReasoners.class);
-
-    static public TestSuite suite() {
-        return new TestRuleReasoners();
-    }
-
-    /** Creates new TestPackage */
-    private TestRuleReasoners() {
-        super("RuleSys");
-
-        addTestSuite( TestConfigVocabulary.class );
-        addTestSuite( TestGenericRuleReasonerConfig.class );
-        addTest( "TestBasics", TestBasics.suite() );
-
-        addTest( "TestComparatorBuiltins", TestComparatorBuiltins.suite() );
-        addTest( new JUnit4TestAdapter(TestRuleUtil.class));
-
-        addTest( "TestBackchainer", TestBackchainer.suite() );
-        addTest( "TestLPBasics", TestBasicLP.suite() );
-
-        addTest( "TestLPDerivation", TestLPDerivation.suite() );
-        addTest( "TestLPBRuleEngine", TestLPBRuleEngine.suite() );
-        addTest( "TestRestartableLBRule", TestRestartableLBRule.suite() );
-        addTest( "TestFBRules", TestFBRules.suite() );
-        addTest( "TestGenericRules", TestGenericRules.suite() );
-        addTest( "TestRETE", TestRETE.suite() );
-        addTest( "TestSetRules", TestSetRules.suite() );
-        addTest( "TestLPBRuleEngineLeak", TestLPBRuleEngineLeak.suite() );
-        addTest( "OWLRuleUnitTests", OWLUnitTest.suite() );
-        addTest( "TestBugs", TestRuleSystemBugs.suite() );
-        addTest( "TestOWLMisc", TestOWLMisc.suite() );
-        addTest( "FRuleEngineIFactoryTest", FRuleEngineIFactoryTest.suite() );
-        addTest( "TestLPBRuleCloseBug", TestLPBRuleCloseBug.suite() );
-
-        addTest( "ConcurrentyTest", ConcurrencyTest.suite() );
-        addTest( "TestRestrictionsDontNeedTyping", TestRestrictionsDontNeedTyping.suite() );
-
-        // No longer needed because the tests are now subsumed in OWLUnitTest
-        // addTest( "TestOWLConsistency", TestOWLRules.suite() );
-    }
-
-    // helper method
-    private void addTest(String name, TestSuite tc) {
-        tc.setName(name);
-        addTest(tc);
-    }
-}
diff --git a/jena-core/src/test/java/org/apache/jena/mem2/TestPackage_GraphMem2.java b/jena-core/src/test/java/org/apache/jena/reasoner/test/TS3_reasoners.java
similarity index 75%
copy from jena-core/src/test/java/org/apache/jena/mem2/TestPackage_GraphMem2.java
copy to jena-core/src/test/java/org/apache/jena/reasoner/test/TS3_reasoners.java
index 2a4f239f55..11924f49cb 100644
--- a/jena-core/src/test/java/org/apache/jena/mem2/TestPackage_GraphMem2.java
+++ b/jena-core/src/test/java/org/apache/jena/reasoner/test/TS3_reasoners.java
@@ -16,17 +16,20 @@
  * limitations under the License.
  */
 
-package org.apache.jena.mem2;
+package org.apache.jena.reasoner.test;
 
 import org.junit.runner.RunWith;
 import org.junit.runners.Suite;
 
 @RunWith(Suite.class)
-@Suite.SuiteClasses( {
-    GraphMem2LegacyTest.class,
-    GraphMem2FastTest.class,
-    GraphMem2RoaringTest.class,
-    GraphMem2Test.class
-} )
-public class TestPackage_GraphMem2 {
-}
+@Suite.SuiteClasses({
+    TestTransitiveGraphCache.class,
+    TestReasoners.class,
+    TestRDFSReasoners.class,
+    TestInfPrefixMapping.class,
+    TestInfGraph.class,
+    TestInfModel.class,
+    TestSafeModel.class,
+})
+
+public class TS3_reasoners {}
diff --git a/jena-core/src/test/java/org/apache/jena/reasoner/test/TestPackage_reasoners.java b/jena-core/src/test/java/org/apache/jena/reasoner/test/TestPackage_reasoners.java
deleted file mode 100644
index 57e3d4aece..0000000000
--- a/jena-core/src/test/java/org/apache/jena/reasoner/test/TestPackage_reasoners.java
+++ /dev/null
@@ -1,53 +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 org.apache.jena.reasoner.test;
-
-import junit.framework.*;
-import org.apache.jena.reasoner.rulesys.test.TestRuleReasoners;
-
-/**
- * Aggregate tester that runs all the test associated with the reasoner package.
- */
-
-public class TestPackage_reasoners extends TestSuite {
-
-    static public TestSuite suite() {
-        return new TestPackage_reasoners();
-    }
-
-    /** Creates new TestPackage */
-    private TestPackage_reasoners() {
-        super("reasoners");
-        addTest( "TestTransitiveGraphCache", TestTransitiveGraphCache.suite() );
-        addTest( "TestReasoners", TestReasoners.suite() );
-        addTest( "TestRDFSReasoners", TestRDFSReasoners.suite() );
-        addTest( "TestRuleReasoners",  TestRuleReasoners.suite() );
-        addTest( "TestReasonerPrefixMapping", TestInfPrefixMapping.suite() );
-        addTest( "TestInfGraph", TestInfGraph.suite() );
-        addTest( "TestInfModel", TestInfModel.suite() );
-        addTest( "TestSafeModel", TestSafeModel.suite() );
-    }
-
-    // helper method
-    private void addTest(String name, TestSuite tc) {
-        tc.setName(name);
-        addTest(tc);
-    }
-
-}
diff --git a/jena-core/src/test/java/org/apache/jena/reasoner/test/WGReasonerTester.java b/jena-core/src/test/java/org/apache/jena/reasoner/test/WGReasonerTester.java
index 569414e882..dda30375f6 100644
--- a/jena-core/src/test/java/org/apache/jena/reasoner/test/WGReasonerTester.java
+++ b/jena-core/src/test/java/org/apache/jena/reasoner/test/WGReasonerTester.java
@@ -51,7 +51,7 @@ import org.slf4j.LoggerFactory ;
  * entailment tests are handled by this utility. Each test defines a set
  * of data files to load. For normal positive entailment tests we check each
  * triple in the conclusions file to ensure it is included in the inferred
- * graph. For postive entailment tests which are supposed to entail the
+ * graph. For positive entailment tests which are supposed to entail the
  * false document we run an additional validation check. For
  * negative entailment tests which tests all triples in the non-conclusions file
  * and check that at least one trile is missing. </p>
diff --git a/jena-core/src/test/java/org/apache/jena/shared/TestSharedPackage.java b/jena-core/src/test/java/org/apache/jena/shared/TestSharedPackage.java
index 6bcd6f040b..4e8e713926 100644
--- a/jena-core/src/test/java/org/apache/jena/shared/TestSharedPackage.java
+++ b/jena-core/src/test/java/org/apache/jena/shared/TestSharedPackage.java
@@ -18,20 +18,13 @@
 
 package org.apache.jena.shared;
 
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
 
-public class TestSharedPackage extends TestCase
-    {
-    public TestSharedPackage()
-        { super(); }
-
-    public static TestSuite suite()
-        {
-        final TestSuite result = new TestSuite();
-        result.addTest( TestPrefixMapping.suite() );
-        result.addTest( TestJenaException.suite() );
-        result.addTest( TestLockMRPlusSW.suite() );
-        return result;
-        }
-    }
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+    TestPrefixMapping.class,
+    TestJenaException.class,
+    TestLockMRPlusSW.class
+})
+public class TestSharedPackage {}
diff --git a/jena-core/src/test/java/org/apache/jena/test/TestModelUtil.java b/jena-core/src/test/java/org/apache/jena/test/TestModelUtil.java
index a9d1b92b89..97d46e4dc4 100644
--- a/jena-core/src/test/java/org/apache/jena/test/TestModelUtil.java
+++ b/jena-core/src/test/java/org/apache/jena/test/TestModelUtil.java
@@ -21,18 +21,12 @@ package org.apache.jena.test;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
-import junit.framework.TestSuite;
 import org.apache.jena.graph.Node;
 import org.apache.jena.graph.NodeFactory;
 import org.apache.jena.rdf.model.impl.Util;
 import org.junit.Test;
 
-/** Tests for {@link org.apache.jena.rdf.model.impl.Util} */
-public class TestModelUtil extends TestSuite {
-
-    public static TestSuite suite() {
-        return new TestSuite(TestModelUtil.class);
-    }
+public class TestModelUtil {
 
     // -- xsd:string
 
diff --git a/jena-core/src/test/java/org/apache/jena/test/TestPackage_core.java b/jena-core/src/test/java/org/apache/jena/test/TestPackage_core.java
index be450f9217..86ae97f1ff 100644
--- a/jena-core/src/test/java/org/apache/jena/test/TestPackage_core.java
+++ b/jena-core/src/test/java/org/apache/jena/test/TestPackage_core.java
@@ -18,8 +18,7 @@
 
 package org.apache.jena.test;
 
-import junit.framework.TestCase ;
-import junit.framework.TestSuite ;
+import junit.framework.*;
 import org.apache.jena.rdf.model.impl.RDFReaderFImpl;
 import org.apache.jena.sys.JenaSystem;
 
@@ -30,21 +29,76 @@ public class TestPackage_core extends TestCase {
 
     static public TestSuite suite() {
         JenaSystem.init();
-        // Reads Turtle (old parser, not up-to-date but we need something for testing.)
+        // Include old Turtle parser - not up-to-date but enouhg to read test input files
         RDFReaderFImpl.alternative(new X_RDFReaderF());
 
         TestSuite ts = new TestSuite() ;
         ts.setName("Jena Core") ;
 
+        addTest(ts,  "System setup",       adaptJUnit4(TestSystemSetup.class));
+
+        addTest(ts,  "IRIx",                adaptJUnit4(org.apache.jena.irix.TS_IRIx.class));
+        addTest(ts,  "LangTagX",            adaptJUnit4(org.apache.jena.langtagx.TS_LangTagX.class));
+        addTest(ts,  "Datatypes",           adaptJUnit4(org.apache.jena.datatypes.TS3_dt.class));
+        // ** COMPLEX
+        addTest(ts,  "Enhanced",            org.apache.jena.enhanced.test.TS3_enh.suite());
+        addTest(ts,  "Graph",               adaptJUnit4(org.apache.jena.graph.test.TS3_graph.class));
+        // mem2
+        addTest(ts,  "Mem",                 adaptJUnit4(org.apache.jena.mem2.TS4_GraphMem2.class));
+
+        // Old GraphMem/GraphMemValue.
+        // TO CHECK
+        addTest(ts,  "MemValue",            adaptJUnit4(org.apache.jena.mem.test.TS3_GraphMemValue.class));
+
+        // ** COMPLEX (rename class and create TS3_Model for these two)
+        addTest(ts,  "Model",               org.apache.jena.rdf.model.test.TS3_Model1.suite());
+        // ** COMPLEX
+        addTest(ts,  "StandardModels",      org.apache.jena.rdf.model.test.TS3_StandardModels.suite() );
+
+        addTest(ts,  "XML Input [ARP/IRIx]",  org.apache.jena.rdfxml.xmlinput1.TS3_xmlinput1.suite());
+        addTest(ts,  "XML Output",          org.apache.jena.rdfxml.xmloutput.TS3_xmloutput.suite());
+
+        addTest(ts,  "Util",                adaptJUnit4(org.apache.jena.util.TS3_coreutil.class));
+        addTest(ts,  "Jena iterator",       adaptJUnit4(org.apache.jena.util.iterator.test.TS3_coreiter.class));
+        addTest(ts,  "Assembler",           adaptJUnit4(org.apache.jena.assembler.test.TS3_Assembler.class));
+        addTest(ts,  "Vocabularies",        adaptJUnit4(org.apache.jena.vocabulary.test.TS_Vocabularies.class));
+        addTest(ts,  "Shared",              adaptJUnit4(org.apache.jena.shared.TestSharedPackage.class));
+        addTest(ts,  "ModelUtils",          adaptJUnit4(org.apache.jena.test.TestModelUtil.class));
+
+        // ** COMPLEX
+        addTest(ts,  "Composed graphs",     org.apache.jena.graph.compose.test.TS3_compose.suite() );
+
+        addTest(ts,  "Reasoners",           adaptJUnit4(org.apache.jena.reasoner.test.TS3_reasoners.class));
+        addTest(ts,  "RuleReasoners",       adaptJUnit4(org.apache.jena.reasoner.rulesys.TS3_RuleReasoners.class));
+
+        addTest(ts,  "Ontology ModelMaker", adaptJUnit4(org.apache.jena.ontology.makers.TS3_ModelMakers.class));
+        addTest(ts,  "Ontology",            adaptJUnit4(org.apache.jena.ontology.impl.TS3_ont.class));
+
+        // Local TTL parser for tests - not fully compliant.
+        addTest(ts,  "Turtle",              adaptJUnit4(org.apache.jena.ttl_test.test.turtle.TS_TestTurtle.class));
+        // ** Generated tests
+        addTest(ts,  "Turtle:Manifest",     org.apache.jena.ttl_test.test.turtle.TurtleTestSuiteManifest.suite()) ;
+
+        return ts ;
+    }
+
+    /* ORIGINAL
+    static public TestSuite suite() {
+        JenaSystem.init();
+        // Reads Turtle (old parser, not up-to-date but we need something for testing.)
+        RDFReaderFImpl.alternative(new X_RDFReaderF());
+
+        TestSuite ts = new TestSuite() ;
+        ts.setName("Jena") ;
+
         addTest(ts,  "System setup", TestSystemSetup.suite());
         addTest(ts,  "IRIx", org.apache.jena.irix.TS_IRIx.suite());
         addTest(ts,  "LangTagX", org.apache.jena.langtagx.TS_LangTagX.suite());
         addTest(ts,  "Enhanced", org.apache.jena.enhanced.test.TestPackage_enh.suite());
         addTest(ts,  "Datatypes", org.apache.jena.datatypes.TestPackage_dt.suite());
         addTest(ts,  "Graph", org.apache.jena.graph.test.TestPackage_graph.suite());
-
-        addTest(ts,  "Mem",  org.apache.jena.mem.test.TestPackage_GraphMemValue.suite() );
-
+        addTest(ts,  "Mem", org.apache.jena.mem.test.TestMemPackage.suite() );
+        addTest(ts,  "Mem2", org.apache.jena.mem.test.TestGraphMemPackage.suite() );
         addTest(ts,  "Model", org.apache.jena.rdf.model.test.TestPackage_model.suite());
         addTest(ts,  "StandardModels", org.apache.jena.rdf.model.test.TestStandardModels.suite() );
 
@@ -66,10 +120,21 @@ public class TestPackage_core extends TestCase {
 
         return ts ;
     }
+*/
+    private static Test adaptJUnit4(Class<?> testClass) {
+        return new JUnit4TestAdapter(testClass);
+    }
 
     private static void addTest(TestSuite ts, String name, TestSuite tc) {
         if ( name != null )
             tc.setName(name);
         ts.addTest(tc);
     }
+
+    private static void addTest(TestSuite ts, String name, Test test) {
+        // Extra level but does name the test suite.
+        TestSuite ts2 = new TestSuite(name);
+        ts2.addTest(test);
+        ts.addTest(ts2);
+    }
 }
diff --git a/jena-core/src/test/java/org/apache/jena/test/TestSystemSetup.java b/jena-core/src/test/java/org/apache/jena/test/TestSystemSetup.java
index 93321e6872..11bcaf1a1e 100644
--- a/jena-core/src/test/java/org/apache/jena/test/TestSystemSetup.java
+++ b/jena-core/src/test/java/org/apache/jena/test/TestSystemSetup.java
@@ -19,16 +19,13 @@
 package org.apache.jena.test;
 
 import junit.framework.TestCase ;
-import junit.framework.TestSuite ;
+import org.junit.Test;
 
 public class TestSystemSetup extends TestCase {
 
-    public static TestSuite suite() {
-        return new TestSuite(TestSystemSetup.class, "System setup") ;
-    }
-
     // Check any settings that must have particular values in a release.
 
+    @Test
     public void testRDF11() {
         // RDF 1.1 and later is now built-in.
     }
diff --git a/jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TurtleTestSuite.java b/jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TS_TestTurtle.java
similarity index 69%
rename from jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TurtleTestSuite.java
rename to jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TS_TestTurtle.java
index b582863f02..257aa76dcb 100644
--- a/jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TurtleTestSuite.java
+++ b/jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TS_TestTurtle.java
@@ -18,19 +18,12 @@
 
 package org.apache.jena.ttl_test.test.turtle;
 
-import junit.framework.* ;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
 
-public class TurtleTestSuite extends TestSuite
-{
-    static public TestSuite suite() {
-        return new TurtleTestSuite() ;
-    }
-
-	private TurtleTestSuite()
-	{
-		super("Turtle") ;
-        addTest(TestTurtleReader.suite()) ;
-        addTest(TurtleInternalTests.suite()) ;
-        addTest(TurtleTestFactory.make("testing/Turtle/manifest.ttl")) ;
-	}
-}
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+    TestTurtleReader.class,
+    TestTurtleInternal.class,
+})
+public class TS_TestTurtle {}
\ No newline at end of file
diff --git a/jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TestBadSyntax.java b/jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TestItemBadSyntax.java
similarity index 67%
rename from jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TestBadSyntax.java
rename to jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TestItemBadSyntax.java
index a90c0e9d3f..048013891c 100644
--- a/jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TestBadSyntax.java
+++ b/jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TestItemBadSyntax.java
@@ -19,27 +19,26 @@
 package org.apache.jena.ttl_test.test.turtle;
 
 import junit.framework.TestCase;
-import org.apache.jena.rdf.model.* ;
+import org.apache.jena.rdf.model.*;
 import org.apache.jena.ttl_test.turtle.TurtleParseException;
 import org.apache.jena.ttl_test.turtle.TurtleReader;
 
+public class TestItemBadSyntax extends TestCase {
+    String uri;
+    public TestItemBadSyntax(String name, String uri) {
+        super(name);
+        this.uri = uri;
+    }
 
-public class TestBadSyntax extends TestCase
-{
-    String uri ;
-    public TestBadSyntax(String name, String uri) { super(name) ; this.uri = uri ; }
-    
     @Override
-    public void runTest()
-    {
-        Model model = ModelFactory.createDefaultModel() ;
-        RDFReaderI t = new TurtleReader() ;
+    public void runTest() {
+        Model model = ModelFactory.createDefaultModel();
+        RDFReaderI t = new TurtleReader();
         try {
-            t.read(model, uri) ;
-            fail("Bad syntax test succeed in parsing the file") ;
-        } catch (TurtleParseException ex)
-        {
-            return ;    
+            t.read(model, uri);
+            fail("Bad syntax test succeed in parsing the file");
+        } catch (TurtleParseException ex) {
+            return;
         }
 
     }
diff --git a/jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TestSyntax.java b/jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TestItemSyntax.java
similarity index 70%
rename from jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TestSyntax.java
rename to jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TestItemSyntax.java
index 5b3280998f..0c4183149b 100644
--- a/jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TestSyntax.java
+++ b/jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TestItemSyntax.java
@@ -19,26 +19,25 @@
 package org.apache.jena.ttl_test.test.turtle;
 
 import junit.framework.TestCase;
-import org.apache.jena.rdf.model.* ;
+import org.apache.jena.rdf.model.*;
 import org.apache.jena.ttl_test.turtle.TurtleParseException;
 import org.apache.jena.ttl_test.turtle.TurtleReader;
 
+public class TestItemSyntax extends TestCase {
+    String uri;
+    public TestItemSyntax(String name, String uri) {
+        super(name);
+        this.uri = uri;
+    }
 
-public class TestSyntax extends TestCase
-{
-    String uri ;
-    public TestSyntax(String name, String uri) { super(name) ; this.uri = uri ; }
-    
     @Override
-    public void runTest()
-    {
-        Model model = ModelFactory.createDefaultModel() ;
-        RDFReaderI t = new TurtleReader() ;
+    public void runTest() {
+        Model model = ModelFactory.createDefaultModel();
+        RDFReaderI t = new TurtleReader();
         try {
-            t.read(model, uri) ;
-        } catch (TurtleParseException ex)
-        {
-            throw ex ;    
+            t.read(model, uri);
+        } catch (TurtleParseException ex) {
+            throw ex;
         }
     }
 
diff --git a/jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TestTurtle.java b/jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TestItemTurtleExec.java
similarity index 58%
rename from jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TestTurtle.java
rename to jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TestItemTurtleExec.java
index d48764692a..33fcf0ee87 100644
--- a/jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TestTurtle.java
+++ b/jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TestItemTurtleExec.java
@@ -18,47 +18,46 @@
 
 package org.apache.jena.ttl_test.test.turtle;
 
-
 import junit.framework.TestCase;
-import org.apache.jena.rdf.model.Model ;
-import org.apache.jena.rdf.model.ModelFactory ;
-import org.apache.jena.rdf.model.RDFReaderI ;
+import org.apache.jena.rdf.model.Model;
+import org.apache.jena.rdf.model.ModelFactory;
+import org.apache.jena.rdf.model.RDFReaderI;
 import org.apache.jena.ttl_test.turtle.TurtleParseException;
 import org.apache.jena.ttl_test.turtle.TurtleReader;
-import org.apache.jena.util.FileManager ;
-import org.apache.jena.util.FileUtils ;
-
-
-public class TestTurtle extends TestCase
-{
-    String input ;
-    String output ;
-    String baseIRI ;
-
-    public TestTurtle(String name, String input, String output, String baseIRI)
-    { super(name) ; this.input = input ; this.output = output ; this.baseIRI = baseIRI ; }
+import org.apache.jena.util.FileManager;
+import org.apache.jena.util.FileUtils;
+
+public class TestItemTurtleExec extends TestCase {
+    String input;
+    String output;
+    String baseIRI;
+
+    public TestItemTurtleExec(String name, String input, String output, String baseIRI) {
+        super(name);
+        this.input = input;
+        this.output = output;
+        this.baseIRI = baseIRI;
+    }
 
     @Override
-    public void runTest()
-    {
-        Model model = ModelFactory.createDefaultModel() ;
-        RDFReaderI t = new TurtleReader() ;
+    public void runTest() {
+        Model model = ModelFactory.createDefaultModel();
+        RDFReaderI t = new TurtleReader();
         try {
             if ( baseIRI != null )
-                t.read(model, FileManager.getInternal().open(input), baseIRI) ;
+                t.read(model, FileManager.getInternal().open(input), baseIRI);
             else
-                t.read(model, input) ;
+                t.read(model, input);
             // "http://www.w3.org/2001/sw/DataAccess/df1/tests/rdfq-results.ttl"
 
-            String syntax = FileUtils.guessLang(output, FileUtils.langNTriple) ;
-            Model results = ModelFactory.createDefaultModel() ;
+            String syntax = FileUtils.guessLang(output, FileUtils.langNTriple);
+            Model results = ModelFactory.createDefaultModel();
             results.read(output, null, syntax);
-            boolean b = model.isIsomorphicWith(results) ;
+            boolean b = model.isIsomorphicWith(results);
             if ( !b )
-                assertTrue("Models not isomorphic", b) ;
-        } catch (TurtleParseException ex)
-        {
-            throw ex ;
+                assertTrue("Models not isomorphic", b);
+        } catch (TurtleParseException ex) {
+            throw ex;
         }
     }
 }
diff --git a/jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TurtleInternalTests.java b/jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TestTurtleInternal.java
similarity index 98%
rename from jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TurtleInternalTests.java
rename to jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TestTurtleInternal.java
index 7ba92db599..f4ffbabf3d 100644
--- a/jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TurtleInternalTests.java
+++ b/jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TestTurtleInternal.java
@@ -26,17 +26,16 @@ import org.apache.jena.ttl_test.turtle.TurtleEventNull;
 import org.apache.jena.ttl_test.turtle.parser.TurtleParser;
 import org.apache.jena.util.junit.TestUtils ;
 
-public class TurtleInternalTests extends TestSuite
+public class TestTurtleInternal extends TestSuite
 {
     static public TestSuite suite() {
-        return new TurtleInternalTests() ;
+        return new TestTurtleInternal() ;
     }
 
 	static public final String QUOTE3 = "\"\"\"" ;
 	static public boolean VERBOSE = false ;
 
-	public TurtleInternalTests()
-	{
+    public TestTurtleInternal() {
 		super("Turtle Parser Syntactic tests") ;
 
         // ---- Debug testing
diff --git a/jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TestTurtleReader.java b/jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TestTurtleReader.java
index 86832bf031..78f8d7e694 100644
--- a/jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TestTurtleReader.java
+++ b/jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TestTurtleReader.java
@@ -20,36 +20,31 @@ package org.apache.jena.ttl_test.test.turtle;
 
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
-import org.apache.jena.rdf.model.Model ;
-import org.apache.jena.rdf.model.ModelFactory ;
-import org.apache.jena.rdf.model.RDFReaderI ;
+import org.apache.jena.rdf.model.Model;
+import org.apache.jena.rdf.model.ModelFactory;
+import org.apache.jena.rdf.model.RDFReaderI;
 import org.apache.jena.ttl_test.turtle.TurtleReader;
 
-public class TestTurtleReader extends TestCase
-{
+public class TestTurtleReader extends TestCase {
 
-    public static TestSuite suite()
-    {
-        return new TestSuite(TestTurtleReader.class, "Basic Turtle tests") ;
+    public static TestSuite suite() {
+        return new TestSuite(TestTurtleReader.class, "Basic Turtle tests");
     }
 
-    public void test0()
-    {
+    public void test0() {
         RDFReaderI r = new TurtleReader();
-        assertNotNull(r) ;
+        assertNotNull(r);
     }
 
-    public void test1()
-    {
-        Model m = ModelFactory.createDefaultModel() ;
-        m.read("file:testing/Turtle/simple.ttl", "TTL") ;
-        assertFalse(m.isEmpty()) ;
+    public void test1() {
+        Model m = ModelFactory.createDefaultModel();
+        m.read("file:testing/Turtle/simple.ttl", "TTL");
+        assertFalse(m.isEmpty());
     }
 
-    public void test2()
-    {
-        Model m = ModelFactory.createDefaultModel() ;
-        m.read("file:testing/Turtle/i18n.ttl", "TTL") ;
-        assertFalse(m.isEmpty()) ;
+    public void test2() {
+        Model m = ModelFactory.createDefaultModel();
+        m.read("file:testing/Turtle/i18n.ttl", "TTL");
+        assertFalse(m.isEmpty());
     }
 }
diff --git a/jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TurtleTestFactory.java b/jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TurtleTestFactory.java
index 6ab81247ad..03c821cdbf 100644
--- a/jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TurtleTestFactory.java
+++ b/jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TurtleTestFactory.java
@@ -20,58 +20,52 @@ package org.apache.jena.ttl_test.test.turtle;
 
 import junit.framework.Test;
 import junit.framework.TestSuite;
-import org.apache.jena.rdf.model.Resource ;
+import org.apache.jena.rdf.model.Resource;
 import org.apache.jena.ttl_test.TestFactoryManifestOld;
-import org.apache.jena.util.junit.TestUtils ;
-import org.apache.jena.vocabulary.RDF ;
+import org.apache.jena.util.junit.TestUtils;
+import org.apache.jena.vocabulary.RDF;
 
+public class TurtleTestFactory extends TestFactoryManifestOld {
 
-public class TurtleTestFactory extends TestFactoryManifestOld
-{
-    
-    public static TestSuite make(String filename)
-    {
-        return new TurtleTestFactory().process(filename) ;
+    public static TestSuite make(String filename) {
+        return new TurtleTestFactory().process(filename);
     }
-    
+
     @Override
-    public Test makeTest(Resource manifest, Resource item, String testName, Resource action, Resource result)
-    {
+    public Test makeTest(Resource manifest, Resource item, String testName, Resource action, Resource result) {
         try {
-            Resource r = TestUtils.getResource(item, RDF.type) ;
-            Resource input = TestUtils.getResource(action, TurtleTestVocab.input) ;
-            Resource output = TestUtils.getResource(result, TurtleTestVocab.output) ;
-            Resource inputIRIr = TestUtils.getResource(action, TurtleTestVocab.inputIRI) ;
-            String baseIRI = (inputIRIr == null)?null:inputIRIr.getURI() ; 
-            
-            if ( r.equals(TurtleTestVocab.TestInOut))
-            {
-                return new TestTurtle(testName, input.getURI(), output.getURI(), baseIRI) ;
+            Resource r = TestUtils.getResource(item, RDF.type);
+            Resource input = TestUtils.getResource(action, TurtleTestVocab.input);
+            Resource output = TestUtils.getResource(result, TurtleTestVocab.output);
+            Resource inputIRIr = TestUtils.getResource(action, TurtleTestVocab.inputIRI);
+            String baseIRI = (inputIRIr == null) ? null : inputIRIr.getURI();
+
+            if ( r.equals(TurtleTestVocab.TestInOut) ) {
+                System.out.printf("TestInOut %s, in:%s, out:%s, base=%s\n", testName, input.getURI(), output.getURI(), baseIRI);
+                return new TestItemTurtleExec(testName, input.getURI(), output.getURI(), baseIRI);
             }
-            
-            if ( r.equals(TurtleTestVocab.TestSyntax))
-            {
-                return new TestSyntax(testName, input.getURI()) ;
+
+            if ( r.equals(TurtleTestVocab.TestSyntax) ) {
+                System.out.printf("TestSynGood %s, in:%s\n", testName, input.getURI());
+                return new TestItemSyntax(testName, input.getURI());
             }
-            
-            if ( r.equals(TurtleTestVocab.TestBadSyntax))
-            {
-                return new TestBadSyntax(testName, input.getURI()) ;
+
+            if ( r.equals(TurtleTestVocab.TestBadSyntax) ) {
+                System.out.printf("TestSynBad %s, in:%s, out:%s, base=%s\n", testName, input.getURI(), output.getURI(), baseIRI);
+                return new TestItemBadSyntax(testName, input.getURI());
             }
-            
-            //if ( r.equals(TurtleTestVocab.TestSurpeessed )) 
-            //    return new TestSupressed(testName, null) ;
-            
-            System.err.println("Unrecognized test : "+testName) ;
-            return null ;
-            
-            
-        } catch (Exception ex)
-        {
-            ex.printStackTrace(System.err) ;
-            System.err.println("Failed to grok test : "+testName) ;
-            return null ;
+
+            // if ( r.equals(TurtleTestVocab.TestSurpeessed ))
+            // return new TestSupressed(testName, null) ;
+
+            System.err.println("Unrecognized test : " + testName);
+            return null;
+
+        } catch (Exception ex) {
+            ex.printStackTrace(System.err);
+            System.err.println("Failed to grok test : " + testName);
+            return null;
         }
-        
+
     }
 }
diff --git a/jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TurtleTestSuiteManifest.java b/jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TurtleTestSuiteManifest.java
new file mode 100644
index 0000000000..97f049fda0
--- /dev/null
+++ b/jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TurtleTestSuiteManifest.java
@@ -0,0 +1,84 @@
+/*
+ * 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 org.apache.jena.ttl_test.test.turtle;
+
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+public class TurtleTestSuiteManifest extends TestSuite {
+    static public TestSuite suite() {
+        return new TurtleTestSuiteManifest();
+    }
+
+    private TurtleTestSuiteManifest() {
+        super("TurtleManifest");
+        //addTest(TurtleTestFactory.make("testing/Turtle/manifest.ttl"));
+        testGood("rdf-schema"     , "RaptorTurtle/rdf-schema.ttl",      "RaptorTurtle/rdf-schema.out");
+        testGood("rdfq-results"   , "RaptorTurtle/rdfq-results.ttl",    "RaptorTurtle/rdfq-results.out", "http://www.w3.org/2001/sw/DataAccess/df1/tests/rdfq-results.ttl");
+        testGood("rdfs-namespace" , "RaptorTurtle/rdfs-namespace.ttl",  "RaptorTurtle/rdfs-namespace.out");
+        testGood("test-00"        , "RaptorTurtle/test-00.ttl",         "RaptorTurtle/test-00.out", "http://www.w3.org/2001/sw/DataAccess/df1/tests/test-00.ttl");
+        testGood("test-01"        , "RaptorTurtle/test-01.ttl",         "RaptorTurtle/test-01.out");
+        testGood("test-02"        , "RaptorTurtle/test-02.ttl",         "RaptorTurtle/test-02.out");
+        testGood("test-03"        , "RaptorTurtle/test-03.ttl",         "RaptorTurtle/test-03.out");
+        testGood("test-04"        , "RaptorTurtle/test-04.ttl",         "RaptorTurtle/test-04.out");
+        testGood("test-05"        , "RaptorTurtle/test-05.ttl",         "RaptorTurtle/test-05.out");
+        testGood("test-06"        , "RaptorTurtle/test-06.ttl",         "RaptorTurtle/test-06.out");
+        testGood("test-07"        , "RaptorTurtle/test-07.ttl",         "RaptorTurtle/test-07.out");
+        testGood("test-08"        , "RaptorTurtle/test-08.ttl",         "RaptorTurtle/test-08.out");
+        testGood("test-09"        , "RaptorTurtle/test-09.ttl",         "RaptorTurtle/test-09.out");
+        testGood("test-10"        , "RaptorTurtle/test-10.ttl",         "RaptorTurtle/test-10.out");
+        testGood("test-11"        , "RaptorTurtle/test-11.ttl",         "RaptorTurtle/test-11.out");
+        testGood("test-12"        , "RaptorTurtle/test-12.ttl",         "RaptorTurtle/test-12.out");
+        testGood("test-13"        , "RaptorTurtle/test-13.ttl",         "RaptorTurtle/test-13.out");
+        testGood("test-14"        , "RaptorTurtle/test-14.ttl",         "RaptorTurtle/test-14.out");
+        testGood("test-15"        , "RaptorTurtle/test-15.ttl",         "RaptorTurtle/test-15.out");
+        testGood("test-16"        , "RaptorTurtle/test-16.ttl",         "RaptorTurtle/test-16.out");
+
+        testBad("Bad-00" , "RaptorTurtle/bad-00.ttl");
+        testBad("Bad-01" , "RaptorTurtle/bad-01.ttl");
+        testBad("Bad-02" , "RaptorTurtle/bad-02.ttl");
+        testBad("Bad-03" , "RaptorTurtle/bad-03.ttl");
+        testBad("Bad-04" , "RaptorTurtle/bad-04.ttl");
+        testBad("Bad-05" , "RaptorTurtle/bad-05.ttl");
+        testBad("Bad-06" , "RaptorTurtle/bad-06.ttl");
+        testBad("Bad-07" , "RaptorTurtle/bad-07.ttl");
+        testBad("Bad-08" , "RaptorTurtle/bad-08.ttl");
+        testBad("Bad-09" , "RaptorTurtle/bad-09.ttl");
+        testBad("Bad-10" , "RaptorTurtle/bad-10.ttl");
+        testBad("Bad-11" , "RaptorTurtle/bad-11.ttl");
+        testBad("Bad-12" , "RaptorTurtle/bad-12.ttl");
+        testBad("Bad-13" , "RaptorTurtle/bad-13.ttl");
+
+    }
+
+    private void testBad(String name, String inputFile) {
+        TestCase test = new TestItemBadSyntax(name, "file:testing/Turtle/"+inputFile);
+        this.addTest(test);
+
+    }
+
+    private void testGood(String name, String inputFile, String outputFile) {
+        testGood(name, inputFile, outputFile, null);
+    }
+
+    private void testGood(String name, String inputFile, String outputFile, String baseURI) {
+        TestCase test = new TestItemTurtleExec(name, "file:testing/Turtle/"+inputFile, "file:testing/Turtle/"+outputFile, baseURI);
+        this.addTest(test);
+    }
+}
diff --git a/jena-core/src/test/java/org/apache/jena/datatypes/TestPackage_dt.java b/jena-core/src/test/java/org/apache/jena/util/TS3_coreutil.java
similarity index 55%
rename from jena-core/src/test/java/org/apache/jena/datatypes/TestPackage_dt.java
rename to jena-core/src/test/java/org/apache/jena/util/TS3_coreutil.java
index f0df6a9c0c..382407ae30 100644
--- a/jena-core/src/test/java/org/apache/jena/datatypes/TestPackage_dt.java
+++ b/jena-core/src/test/java/org/apache/jena/util/TS3_coreutil.java
@@ -16,27 +16,31 @@
  * limitations under the License.
  */
 
-package org.apache.jena.datatypes;
+package org.apache.jena.util;
 
-import junit.framework.JUnit4TestAdapter ;
-import junit.framework.TestSuite ;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
 
-/**
-    Collected test suite for the .datatype package.
-    (many other tests are elsewhere)
-*/
+@RunWith(Suite.class)
+@Suite.SuiteClasses( {
+    TestSimpleTokenizer.class,
+    TestFileUtils.class,
+    TestCollectionFactory.class,
+    TestLocationMapper.class,
+    TestFileManager.class,
+    TestMonitors.class,
+    TestPrintUtil.class,
+    TestPrefixMappingUtils.class,
+    TestIteratorCollection.class,
+    TestModelCollector.class,
 
-public class TestPackage_dt extends TestSuite {
+    TestSplitIRI_Display.class,
+    TestSplitIRI_XML.class,
+    TestSplitIRI_TTL.class,
 
-    static public TestSuite suite() {
-        return new TestPackage_dt();
-    }
+    // Needs the legacy N3 reader loaded.
+    TestLocators.class,
+    TestOneToManyMap.class
+})
 
-    /** Creates new TestPackage */
-    private TestPackage_dt() {
-        super("datatypes");
-        addTest(new JUnit4TestAdapter(TestDatatypes.class)) ;
-        addTest(new JUnit4TestAdapter(TestDatatypeValues.class)) ;
-        addTest(new JUnit4TestAdapter(TestRDFXMLiteral.class)) ;
-    }
-}
+public class TS3_coreutil {}
diff --git a/jena-core/src/test/java/org/apache/jena/util/TestPackage_util.java b/jena-core/src/test/java/org/apache/jena/util/TestPackage_util.java
deleted file mode 100644
index b40812a9f8..0000000000
--- a/jena-core/src/test/java/org/apache/jena/util/TestPackage_util.java
+++ /dev/null
@@ -1,66 +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 org.apache.jena.util;
-
-import junit.framework.*;
-
-/**
- * All developers should edit this file to add their tests.
- * Please try to name your tests and test suites appropriately.
- * Note, it is better to name your test suites on creation
- * rather than in this file.
- */
-public class TestPackage_util extends TestSuite {
-
-    static public TestSuite suite() {
-        return new TestPackage_util();
-    }
-
-    /** Creates new TestPackage */
-    private TestPackage_util() {
-        super( "util" );
-        addTest( "TestSimpleTokenzier",    TestSimpleTokenizer.suite());
-        addTest( "TestFileUtils",          TestFileUtils.suite() );
-        addTest( "TestHashUtils",          TestCollectionFactory.suite() );
-        addTest( "TestLocationMapper",     TestLocationMapper.suite() ) ;
-        addTest( "TestFileManager",        TestFileManager.suite()) ;
-        addTest( "TestMonitors",           TestMonitors.suite()) ;
-        addTest( "TestPrintUtil",          TestPrintUtil.suite()) ;
-        addTest( "TestPrefixMappingUtils", TestPrefixMappingUtils.suite() );
-        addTest( "TestIteratorCollection", TestIteratorCollection.suite() );
-        addTest( "TestModelCollector",     TestModelCollector.suite()) ;
-
-        addTest( "TestSplitIRI_Display",   TestSplitIRI_Display.suite()) ;
-        addTest( "TestSplitIRI_XML",       TestSplitIRI_XML.suite()) ;
-        addTest( "TestSplitIRI_TTL",       TestSplitIRI_TTL.suite()) ;
-
-        // Needs the legacy N3 reader loaded.
-        addTestSuite( TestLocators.class );
-        addTestSuite( TestOneToManyMap.class );
-    }
-
-    private void addTest(String name, TestSuite tc) {
-        tc.setName(name);
-        addTest(tc);
-    }
-    private void addTest(String name, Test tc) {
-        addTest(tc);
-    }
-
-}
diff --git a/jena-core/src/test/java/org/apache/jena/mem2/TestPackage_GraphMem2.java b/jena-core/src/test/java/org/apache/jena/util/iterator/test/TS3_coreiter.java
similarity index 77%
copy from jena-core/src/test/java/org/apache/jena/mem2/TestPackage_GraphMem2.java
copy to jena-core/src/test/java/org/apache/jena/util/iterator/test/TS3_coreiter.java
index 2a4f239f55..db338d45c5 100644
--- a/jena-core/src/test/java/org/apache/jena/mem2/TestPackage_GraphMem2.java
+++ b/jena-core/src/test/java/org/apache/jena/util/iterator/test/TS3_coreiter.java
@@ -16,17 +16,20 @@
  * limitations under the License.
  */
 
-package org.apache.jena.mem2;
+package org.apache.jena.util.iterator.test;
 
 import org.junit.runner.RunWith;
 import org.junit.runners.Suite;
 
 @RunWith(Suite.class)
 @Suite.SuiteClasses( {
-    GraphMem2LegacyTest.class,
-    GraphMem2FastTest.class,
-    GraphMem2RoaringTest.class,
-    GraphMem2Test.class
-} )
-public class TestPackage_GraphMem2 {
-}
+    TestWrappedIterator.class,
+    TestNullIterator.class,
+    TestFilters.class,
+    TestAndThen.class,
+    TestAsCollection.class,
+    TestMapIterators.class,
+    TestResourceUtils.class
+})
+
+public class TS3_coreiter {}
diff --git a/jena-core/src/test/java/org/apache/jena/util/iterator/test/TestPackage_iter.java b/jena-core/src/test/java/org/apache/jena/util/iterator/test/TestPackage_iter.java
deleted file mode 100644
index e1f2972dca..0000000000
--- a/jena-core/src/test/java/org/apache/jena/util/iterator/test/TestPackage_iter.java
+++ /dev/null
@@ -1,39 +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 org.apache.jena.util.iterator.test;
-
-import junit.framework.TestSuite;
-
-public class TestPackage_iter extends TestSuite
-    {
-    static public TestSuite suite()
-        { return new TestPackage_iter(); }
-        
-    private TestPackage_iter()
-        {
-        super( "iterators" );
-        addTest( TestWrappedIterator.suite() );
-        addTest( TestNullIterator.suite() );
-        addTest( TestFilters.suite() );
-        addTest( TestAndThen.suite() );
-        addTestSuite( TestAsCollection.class );
-        addTestSuite( TestMapIterators.class );
-        addTest( new TestSuite( TestResourceUtils.class ) );
-        }
-    }
diff --git a/jena-core/src/test/java/org/apache/jena/mem2/TestPackage_GraphMem2.java b/jena-core/src/test/java/org/apache/jena/vocabulary/test/TS_Vocabularies.java
similarity index 78%
rename from jena-core/src/test/java/org/apache/jena/mem2/TestPackage_GraphMem2.java
rename to jena-core/src/test/java/org/apache/jena/vocabulary/test/TS_Vocabularies.java
index 2a4f239f55..cd5fb0f3a3 100644
--- a/jena-core/src/test/java/org/apache/jena/mem2/TestPackage_GraphMem2.java
+++ b/jena-core/src/test/java/org/apache/jena/vocabulary/test/TS_Vocabularies.java
@@ -16,17 +16,19 @@
  * limitations under the License.
  */
 
-package org.apache.jena.mem2;
+package org.apache.jena.vocabulary.test;
 
 import org.junit.runner.RunWith;
 import org.junit.runners.Suite;
 
 @RunWith(Suite.class)
-@Suite.SuiteClasses( {
-    GraphMem2LegacyTest.class,
-    GraphMem2FastTest.class,
-    GraphMem2RoaringTest.class,
-    GraphMem2Test.class
+@Suite.SuiteClasses({
+    TestVocabRDF.class,
+    TestVocabRDFS.class,
+    TestVocabVCARD.class,
+    TestVocabRSS.class,
+    TestVocabDC10.class,
+    TestOWL2Vocabulary.class
 } )
-public class TestPackage_GraphMem2 {
-}
+
+public class TS_Vocabularies {}
diff --git a/jena-core/src/test/java/org/apache/jena/vocabulary/test/TestVocabularies.java b/jena-core/src/test/java/org/apache/jena/vocabulary/test/TestVocabularies.java
deleted file mode 100644
index dce0fd06c1..0000000000
--- a/jena-core/src/test/java/org/apache/jena/vocabulary/test/TestVocabularies.java
+++ /dev/null
@@ -1,42 +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 org.apache.jena.vocabulary.test;
-
-import junit.framework.*;
-
-/**
-    Collect together all the vocabulary tests.
-*/
-public class TestVocabularies extends TestCase
-    {
-    public TestVocabularies( String name )
-        { super( name ); }
-
-    public static TestSuite suite()
-        {
-        TestSuite result = new TestSuite();
-        result.addTest( TestVocabRDF.suite() );
-        result.addTest( TestVocabRDFS.suite() );
-        result.addTest( TestVocabVCARD.suite() );
-        result.addTest( TestVocabRSS.suite() );
-        result.addTest( TestVocabDC10.suite() );
-        result.addTestSuite( TestOWL2Vocabulary.class );
-        return result;
-        }
-    }
diff --git a/jena-permissions/src/test/java/org/apache/jena/permissions/contract/model/SecTestLiterals.java b/jena-permissions/src/test/java/org/apache/jena/permissions/contract/model/SecTestLiterals.java
index d415736d18..02f9b59abb 100644
--- a/jena-permissions/src/test/java/org/apache/jena/permissions/contract/model/SecTestLiterals.java
+++ b/jena-permissions/src/test/java/org/apache/jena/permissions/contract/model/SecTestLiterals.java
@@ -18,12 +18,12 @@
 package org.apache.jena.permissions.contract.model;
 
 import org.apache.jena.rdf.model.test.TestLiterals;
-import org.apache.jena.rdf.model.test.TestPackage_model;
+import org.apache.jena.rdf.model.test.TS3_Model1;
 
 public class SecTestLiterals extends TestLiterals {
 
     public SecTestLiterals() {
-        super(new TestPackage_model.PlainModelFactory(), "SecTestLiterals");
+        super(new TS3_Model1.PlainModelFactory(), "SecTestLiterals");
     }
 
 }
diff --git a/jena-permissions/src/test/java/org/apache/jena/permissions/contract/model/SecTestReaderEvents.java b/jena-permissions/src/test/java/org/apache/jena/permissions/contract/model/SecTestReaderEvents.java
index 9c61d13f72..1a45264a82 100644
--- a/jena-permissions/src/test/java/org/apache/jena/permissions/contract/model/SecTestReaderEvents.java
+++ b/jena-permissions/src/test/java/org/apache/jena/permissions/contract/model/SecTestReaderEvents.java
@@ -17,12 +17,12 @@
  */
 package org.apache.jena.permissions.contract.model;
 
-import org.apache.jena.rdf.model.test.TestPackage_model;
+import org.apache.jena.rdf.model.test.TS3_Model1;
 
 public class SecTestReaderEvents extends org.apache.jena.rdf.model.test.TestReaderEvents {
 
     public SecTestReaderEvents() {
-        super(new TestPackage_model.PlainModelFactory(), "SecTestReaderEvents");
+        super(new TS3_Model1.PlainModelFactory(), "SecTestReaderEvents");
     }
 
 }
diff --git a/jena-permissions/src/test/java/org/apache/jena/permissions/contract/model/SecTestReaders.java b/jena-permissions/src/test/java/org/apache/jena/permissions/contract/model/SecTestReaders.java
index e87cc39507..dbc4940c53 100644
--- a/jena-permissions/src/test/java/org/apache/jena/permissions/contract/model/SecTestReaders.java
+++ b/jena-permissions/src/test/java/org/apache/jena/permissions/contract/model/SecTestReaders.java
@@ -17,12 +17,12 @@
  */
 package org.apache.jena.permissions.contract.model;
 
-import org.apache.jena.rdf.model.test.TestPackage_model;
+import org.apache.jena.rdf.model.test.TS3_Model1;
 
 public class SecTestReaders extends org.apache.jena.rdf.model.test.TestReaders {
 
     public SecTestReaders() {
-        super(new TestPackage_model.PlainModelFactory(), "SecTestReaders");
+        super(new TS3_Model1.PlainModelFactory(), "SecTestReaders");
     }
 
 }


(jena) 06/06: GH-3237: jena-ontapi - use default memory graph

Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

andy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git

commit fe084c9c82f887be64f2af3bbbfb25c4c894f714
Author: Andy Seaborne <an...@apache.org>
AuthorDate: Tue Jun 3 10:37:56 2025 +0100

    GH-3237: jena-ontapi - use default memory graph
---
 .../java/org/apache/jena/ontapi/OntModelFactory.java   |  2 +-
 .../org/apache/jena/ontapi/impl/OntGraphModelImpl.java |  2 +-
 .../java/org/apache/jena/ontapi/GraphUtilsTest.java    |  5 +++--
 .../test/java/org/apache/jena/ontapi/OntListTest.java  |  2 +-
 .../org/apache/jena/ontapi/OntPersonalityTest.java     |  2 +-
 .../java/org/apache/jena/ontapi/UnionGraphTest.java    | 18 +++++++++---------
 6 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/jena-ontapi/src/main/java/org/apache/jena/ontapi/OntModelFactory.java b/jena-ontapi/src/main/java/org/apache/jena/ontapi/OntModelFactory.java
index 8e916a4e07..73001f7c00 100644
--- a/jena-ontapi/src/main/java/org/apache/jena/ontapi/OntModelFactory.java
+++ b/jena-ontapi/src/main/java/org/apache/jena/ontapi/OntModelFactory.java
@@ -78,7 +78,7 @@ public class OntModelFactory {
      * @return {@code Graph}
      */
     public static Graph createDefaultGraph() {
-        return GraphMemFactory.createGraphMem();
+        return GraphMemFactory.createDefaultGraph();
     }
 
     /**
diff --git a/jena-ontapi/src/main/java/org/apache/jena/ontapi/impl/OntGraphModelImpl.java b/jena-ontapi/src/main/java/org/apache/jena/ontapi/impl/OntGraphModelImpl.java
index c6747bfe92..c5cd5892be 100644
--- a/jena-ontapi/src/main/java/org/apache/jena/ontapi/impl/OntGraphModelImpl.java
+++ b/jena-ontapi/src/main/java/org/apache/jena/ontapi/impl/OntGraphModelImpl.java
@@ -1763,7 +1763,7 @@ public class OntGraphModelImpl extends ModelCom implements OntModel, OntEnhGraph
     public StmtIterator listStatements(Resource subject, Property predicate, RDFNode object, Model posit) {
         InfGraph graph = getInfGraph();
         if (graph != null) {
-            Graph gp = posit == null ? GraphMemFactory.createGraphMem() : posit.getGraph();
+            Graph gp = posit == null ? GraphMemFactory.createDefaultGraph() : posit.getGraph();
             Iterator<Triple> iter = graph.find(asNode(subject), asNode(predicate), asNode(object), gp);
             return IteratorFactory.asStmtIterator(iter, this);
         } else {
diff --git a/jena-ontapi/src/test/java/org/apache/jena/ontapi/GraphUtilsTest.java b/jena-ontapi/src/test/java/org/apache/jena/ontapi/GraphUtilsTest.java
index fd3f7802b7..050d851504 100644
--- a/jena-ontapi/src/test/java/org/apache/jena/ontapi/GraphUtilsTest.java
+++ b/jena-ontapi/src/test/java/org/apache/jena/ontapi/GraphUtilsTest.java
@@ -117,7 +117,7 @@ public class GraphUtilsTest {
 
     @Test
     public void testIsSame() {
-        Graph g = GraphMemFactory.createGraphMem();
+        Graph g = GraphMemFactory.createDefaultGraph();
         Assertions.assertTrue(Graphs.isSameBase(g, g));
 
         Graph a = new UnionGraphImpl(g);
@@ -134,7 +134,8 @@ public class GraphUtilsTest {
         UnionGraph c2 = new UnionGraphImpl(new WrappedGraph(g));
         Assertions.assertTrue(Graphs.isSameBase(a, c2));
 
-        Assertions.assertFalse(Graphs.isSameBase(g, new GraphMem()));
+        Graph g2 = GraphMemFactory.createDefaultGraph();
+        Assertions.assertFalse(Graphs.isSameBase(g, g2));
 
         Graph d = new UnionGraphImpl(new WrappedGraph(new WrappedGraph(g)));
         Assertions.assertTrue(Graphs.isSameBase(a, d));
diff --git a/jena-ontapi/src/test/java/org/apache/jena/ontapi/OntListTest.java b/jena-ontapi/src/test/java/org/apache/jena/ontapi/OntListTest.java
index 0174523f28..7280d9238b 100644
--- a/jena-ontapi/src/test/java/org/apache/jena/ontapi/OntListTest.java
+++ b/jena-ontapi/src/test/java/org/apache/jena/ontapi/OntListTest.java
@@ -336,7 +336,7 @@ public class OntListTest {
     @Test
     public void testTypedList() {
         OntGraphModelImpl m = new OntGraphModelImpl(
-                OntModelFactory.createUnionGraph(GraphMemFactory.createGraphMem()),
+                OntModelFactory.createUnionGraph(GraphMemFactory.createDefaultGraph()),
                 OntSpecification.OWL2_DL_MEM_BUILTIN_RDFS_INF.getPersonality()
         );
         m.setNsPrefixes(OntModelFactory.STANDARD);
diff --git a/jena-ontapi/src/test/java/org/apache/jena/ontapi/OntPersonalityTest.java b/jena-ontapi/src/test/java/org/apache/jena/ontapi/OntPersonalityTest.java
index 78ebfc52dc..c8bb465c0f 100644
--- a/jena-ontapi/src/test/java/org/apache/jena/ontapi/OntPersonalityTest.java
+++ b/jena-ontapi/src/test/java/org/apache/jena/ontapi/OntPersonalityTest.java
@@ -153,7 +153,7 @@ public class OntPersonalityTest {
     @Test
     public void testPersonalityPunnings() {
         String ns = "http://x#";
-        OntModel m1 = OntModelFactory.createModel(GraphMemFactory.createGraphMem(), TestOntPersonalities.OWL2_PERSONALITY_STRICT_PUNNS)
+        OntModel m1 = OntModelFactory.createModel(GraphMemFactory.createDefaultGraph(), TestOntPersonalities.OWL2_PERSONALITY_STRICT_PUNNS)
                 .setNsPrefixes(OntModelFactory.STANDARD)
                 .setNsPrefix("x", ns);
         OntClass.Named c1 = m1.createOntClass(ns + "C1");
diff --git a/jena-ontapi/src/test/java/org/apache/jena/ontapi/UnionGraphTest.java b/jena-ontapi/src/test/java/org/apache/jena/ontapi/UnionGraphTest.java
index c8d7c8b39d..375537109e 100644
--- a/jena-ontapi/src/test/java/org/apache/jena/ontapi/UnionGraphTest.java
+++ b/jena-ontapi/src/test/java/org/apache/jena/ontapi/UnionGraphTest.java
@@ -159,11 +159,11 @@ public class UnionGraphTest {
 
     @Test
     public void testCloseRecursiveGraph() {
-        UnionGraph a = new UnionGraphImpl(GraphMemFactory.createGraphMem());
-        UnionGraph b = new UnionGraphImpl(GraphMemFactory.createGraphMem());
-        UnionGraph c = new UnionGraphImpl(GraphMemFactory.createGraphMem());
-        UnionGraph d = new UnionGraphImpl(GraphMemFactory.createGraphMem());
-        UnionGraph e = new UnionGraphImpl(GraphMemFactory.createGraphMem());
+        UnionGraph a = new UnionGraphImpl(GraphMemFactory.createDefaultGraph());
+        UnionGraph b = new UnionGraphImpl(GraphMemFactory.createDefaultGraph());
+        UnionGraph c = new UnionGraphImpl(GraphMemFactory.createDefaultGraph());
+        UnionGraph d = new UnionGraphImpl(GraphMemFactory.createDefaultGraph());
+        UnionGraph e = new UnionGraphImpl(GraphMemFactory.createDefaultGraph());
         assertClosed(a, false);
         assertClosed(b, false);
         assertClosed(c, false);
@@ -185,9 +185,9 @@ public class UnionGraphTest {
 
     @Test
     public void testCloseHierarchyGraph() {
-        UnionGraphImpl a = new UnionGraphImpl(GraphMemFactory.createGraphMem());
-        UnionGraphImpl b = new UnionGraphImpl(GraphMemFactory.createGraphMem());
-        UnionGraphImpl c = new UnionGraphImpl(GraphMemFactory.createGraphMem());
+        UnionGraphImpl a = new UnionGraphImpl(GraphMemFactory.createDefaultGraph());
+        UnionGraphImpl b = new UnionGraphImpl(GraphMemFactory.createDefaultGraph());
+        UnionGraphImpl c = new UnionGraphImpl(GraphMemFactory.createDefaultGraph());
         assertClosed(a, false);
         assertClosed(b, false);
         assertClosed(c, false);
@@ -199,7 +199,7 @@ public class UnionGraphTest {
         assertClosed(c, true);
         assertClosed(a, false);
 
-        UnionGraphImpl d = new UnionGraphImpl(GraphMemFactory.createGraphMem());
+        UnionGraphImpl d = new UnionGraphImpl(GraphMemFactory.createDefaultGraph());
         try {
             b.addSubGraph(d);
             Assertions.fail("Possible to add a sub-graph");


(jena) 05/06: GH-3237: Change test graph to same-term for non-Model tests

Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

andy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git

commit 678cf4aac6e39753bd5fdfdf57b239c020d1cb8f
Author: Andy Seaborne <an...@apache.org>
AuthorDate: Tue Jun 3 10:07:24 2025 +0100

    GH-3237: Change test graph to same-term for non-Model tests
---
 jena-core/src/main/java/org/apache/jena/util/MonitorGraph.java    | 1 -
 .../test/java/org/apache/jena/graph/test/AbstractTestGraph.java   | 4 ----
 .../src/test/java/org/apache/jena/graph/test/TestReifier.java     | 2 +-
 .../src/test/java/org/apache/jena/mem/test/TestGraphMemModel.java | 2 +-
 .../org/apache/jena/reasoner/rulesys/impl/TestLPBRuleEngine.java  | 3 +--
 .../apache/jena/reasoner/rulesys/impl/TestLPBRuleEngineLeak.java  | 3 +--
 .../apache/jena/reasoner/rulesys/impl/TestRestartableLBRule.java  | 3 +--
 .../test/java/org/apache/jena/reasoner/rulesys/test/DebugOWL.java | 3 +--
 .../org/apache/jena/reasoner/rulesys/test/TestBackchainer.java    | 5 ++---
 .../java/org/apache/jena/reasoner/rulesys/test/TestBasicLP.java   | 3 +--
 .../java/org/apache/jena/reasoner/rulesys/test/TestBasics.java    | 3 +--
 .../java/org/apache/jena/reasoner/rulesys/test/TestFBRules.java   | 3 +--
 .../org/apache/jena/reasoner/rulesys/test/TestGenericRules.java   | 3 +--
 .../org/apache/jena/reasoner/rulesys/test/TestLPDerivation.java   | 3 +--
 .../java/org/apache/jena/reasoner/rulesys/test/TestRDFS9.java     | 3 +--
 .../test/java/org/apache/jena/reasoner/rulesys/test/TestRETE.java | 3 +--
 .../test/java/org/apache/jena/reasoner/test/TestReasoners.java    | 3 +--
 jena-core/src/test/java/org/apache/jena/util/TestMonitors.java    | 8 ++++++--
 18 files changed, 22 insertions(+), 36 deletions(-)

diff --git a/jena-core/src/main/java/org/apache/jena/util/MonitorGraph.java b/jena-core/src/main/java/org/apache/jena/util/MonitorGraph.java
index a3320f475d..8e0afb54c3 100644
--- a/jena-core/src/main/java/org/apache/jena/util/MonitorGraph.java
+++ b/jena-core/src/main/java/org/apache/jena/util/MonitorGraph.java
@@ -34,7 +34,6 @@ import org.apache.jena.graph.impl.* ;
  * @deprecated Do not use - to be removed.
  */
 @Deprecated(forRemoval = true)
-
 public class MonitorGraph extends WrappedGraph {
 
     /** The last known snapshot, a set of triples */
diff --git a/jena-core/src/test/java/org/apache/jena/graph/test/AbstractTestGraph.java b/jena-core/src/test/java/org/apache/jena/graph/test/AbstractTestGraph.java
index 2840aa6903..db5b3ba08e 100644
--- a/jena-core/src/test/java/org/apache/jena/graph/test/AbstractTestGraph.java
+++ b/jena-core/src/test/java/org/apache/jena/graph/test/AbstractTestGraph.java
@@ -62,10 +62,6 @@ public abstract class AbstractTestGraph extends GraphTestBase
         assertTrue( "closed Graph should be isClosed()", g.isClosed() );
     }
 
-    /**
-        This test case was generated by Ian and was caused by GraphMem
-        not keeping up with changes to the find interface.
-     */
     public void testFindAndContains()
     {
         Graph g = getNewGraph();
diff --git a/jena-core/src/test/java/org/apache/jena/graph/test/TestReifier.java b/jena-core/src/test/java/org/apache/jena/graph/test/TestReifier.java
index 3ad461e61c..6c24cc7d72 100644
--- a/jena-core/src/test/java/org/apache/jena/graph/test/TestReifier.java
+++ b/jena-core/src/test/java/org/apache/jena/graph/test/TestReifier.java
@@ -26,7 +26,7 @@ import org.apache.jena.mem2.GraphMem2Fast;
 import org.apache.jena.shared.JenaException ;
 
 /**
-    This class tests the reifiers of ordinary GraphMem graphs.
+    This class tests the reifiers of ordinary graphs.
     Old test suite - kept to ensure compatibility for the one and only Standard mode
 */
 public class TestReifier extends AbstractTestReifier
diff --git a/jena-core/src/test/java/org/apache/jena/mem/test/TestGraphMemModel.java b/jena-core/src/test/java/org/apache/jena/mem/test/TestGraphMemModel.java
index 75797fb17e..c40cb5730d 100644
--- a/jena-core/src/test/java/org/apache/jena/mem/test/TestGraphMemModel.java
+++ b/jena-core/src/test/java/org/apache/jena/mem/test/TestGraphMemModel.java
@@ -37,7 +37,7 @@ import org.apache.jena.util.iterator.ExtendedIterator ;
 import org.junit.Test;
 
 /**
- * Tests of {@link GraphMem} based on (Java object) value handling.
+ * Tests of a graph which has support for (Java object) value handling.
  * <p>
  * This is used by the Model API.
  * <p>
diff --git a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/impl/TestLPBRuleEngine.java b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/impl/TestLPBRuleEngine.java
index 08f01c3d4e..ac6b957c5a 100644
--- a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/impl/TestLPBRuleEngine.java
+++ b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/impl/TestLPBRuleEngine.java
@@ -44,9 +44,8 @@ public class TestLPBRuleEngine extends TestCase {
 	protected Node C2 = NodeFactory.createURI("C2");
 	protected Node ty = RDF.Nodes.type;
 
-    @SuppressWarnings("removal")
     private static  Graph createGraphForTest() {
-        return GraphMemFactory.createGraphMem();
+        return GraphMemFactory.createDefaultGraph();
     }
 
 	public FBRuleReasoner createReasoner(List<Rule> rules) {
diff --git a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/impl/TestLPBRuleEngineLeak.java b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/impl/TestLPBRuleEngineLeak.java
index 91e448b20a..aa8578f0be 100644
--- a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/impl/TestLPBRuleEngineLeak.java
+++ b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/impl/TestLPBRuleEngineLeak.java
@@ -52,9 +52,8 @@ public class TestLPBRuleEngineLeak extends TestCase {
 	protected Node C2 = NodeFactory.createURI("C2");
 	protected Node ty = RDF.Nodes.type;
 
-    @SuppressWarnings("removal")
     private static  Graph createGraphForTest() {
-        return GraphMemFactory.createGraphMem();
+        return GraphMemFactory.createDefaultGraph();
     }
 
     public FBRuleReasoner createReasoner(List<Rule> rules) {
diff --git a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/impl/TestRestartableLBRule.java b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/impl/TestRestartableLBRule.java
index 1fcae8481e..ce62d54338 100644
--- a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/impl/TestRestartableLBRule.java
+++ b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/impl/TestRestartableLBRule.java
@@ -43,9 +43,8 @@ public class TestRestartableLBRule extends TestCase {
         return new TestSuite(TestRestartableLBRule.class);
     }
 
-    @SuppressWarnings("removal")
     private static  Graph createGraphForTest() {
-        return GraphMemFactory.createGraphMem();
+        return GraphMemFactory.createDefaultGraph();
     }
 
     Resource Senator = ResourceFactory.createResource("http://example.com/ns/Senator");
diff --git a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/DebugOWL.java b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/DebugOWL.java
index 1a31916a53..1a0b648661 100644
--- a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/DebugOWL.java
+++ b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/DebugOWL.java
@@ -82,9 +82,8 @@ public class DebugOWL {
     /** reasoner config: LP RDFS exp */
     public static final int RDFSLPExpt = 7;
 
-    @SuppressWarnings("removal")
     private static  Graph createGraphForTest() {
-        return GraphMemFactory.createGraphMem();
+        return GraphMemFactory.createDefaultGraph();
     }
 
     /**
diff --git a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestBackchainer.java b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestBackchainer.java
index 271495e6a7..5ef11d95cd 100644
--- a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestBackchainer.java
+++ b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestBackchainer.java
@@ -104,9 +104,8 @@ public class TestBackchainer extends TestCase {
 //        return suite;
     }
 
-    @SuppressWarnings("removal")
     private static  Graph createGraphForTest() {
-        return GraphMemFactory.createGraphMem();
+        return GraphMemFactory.createDefaultGraph();
     }
 
     /**
@@ -607,7 +606,7 @@ public class TestBackchainer extends TestCase {
 //     * Test multiheaded rule.
 //     */
 //    public void testMutliHead() {
-//        Graph data = new GraphMem();
+//        Graph data = createGraphForTest();
 //        data.add(Triple.create(a, p, b));
 //        data.add(Triple.create(b, r, c));
 //        List<Rule> rules = Rule.parseRules(
diff --git a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestBasicLP.java b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestBasicLP.java
index ab9d2922d3..3a54204a43 100644
--- a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestBasicLP.java
+++ b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestBasicLP.java
@@ -94,9 +94,8 @@ public class TestBasicLP  extends TestCase {
         return suite;
     }
 
-    @SuppressWarnings("removal")
     private static  Graph createGraphForTest() {
-        return GraphMemFactory.createGraphMem();
+        return GraphMemFactory.createDefaultGraph();
     }
 
     /**
diff --git a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestBasics.java b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestBasics.java
index 2bf2e8e458..6170ffeada 100755
--- a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestBasics.java
+++ b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestBasics.java
@@ -98,9 +98,8 @@ public class TestBasics extends TestCase  {
         return new TestSuite( TestBasics.class );
     }
 
-    @SuppressWarnings("removal")
     private static  Graph createGraphForTest() {
-        return GraphMemFactory.createGraphMem();
+        return GraphMemFactory.createDefaultGraph();
     }
 
     /**
diff --git a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestFBRules.java b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestFBRules.java
index 13748152e8..20387a91a6 100644
--- a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestFBRules.java
+++ b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestFBRules.java
@@ -116,9 +116,8 @@ public class TestFBRules extends TestCase {
 //        return suite;
     }
 
-    @SuppressWarnings("removal")
     private static  Graph createGraphForTest() {
-        return GraphMemFactory.createGraphMem();
+        return GraphMemFactory.createDefaultGraph();
     }
 
     /**
diff --git a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestGenericRules.java b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestGenericRules.java
index 35d551811d..24642914a4 100644
--- a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestGenericRules.java
+++ b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestGenericRules.java
@@ -89,9 +89,8 @@ public class TestGenericRules extends TestCase {
 //        return suite;
     }
 
-    @SuppressWarnings("removal")
     private static  Graph createGraphForTest() {
-        return GraphMemFactory.createGraphMem();
+        return GraphMemFactory.createDefaultGraph();
     }
 
     /**
diff --git a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestLPDerivation.java b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestLPDerivation.java
index 1ce8a6f539..3b5efb935b 100644
--- a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestLPDerivation.java
+++ b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestLPDerivation.java
@@ -54,9 +54,8 @@ public class TestLPDerivation extends TestCase {
         return new TestSuite( TestLPDerivation.class );
     }
 
-    @SuppressWarnings("removal")
     private static  Graph createGraphForTest() {
-        return GraphMemFactory.createGraphMem();
+        return GraphMemFactory.createDefaultGraph();
     }
 
     // Useful constants
diff --git a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestRDFS9.java b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestRDFS9.java
index 3c2c79d5d3..9d3cabc532 100644
--- a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestRDFS9.java
+++ b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestRDFS9.java
@@ -49,9 +49,8 @@ public class TestRDFS9 extends TestCase {
         return new TestSuite(TestRDFS9.class);
     }
 
-    @SuppressWarnings("removal")
     private static  Graph createGraphForTest() {
-        return GraphMemFactory.createGraphMem();
+        return GraphMemFactory.createDefaultGraph();
     }
 
     /**
diff --git a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestRETE.java b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestRETE.java
index 5be4b6d269..b23e38afd4 100644
--- a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestRETE.java
+++ b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestRETE.java
@@ -67,9 +67,8 @@ public class TestRETE  extends TestCase {
 //        return suite;
     }
 
-    @SuppressWarnings("removal")
     private static  Graph createGraphForTest() {
-        return GraphMemFactory.createGraphMem();
+        return GraphMemFactory.createDefaultGraph();
     }
 
     /**
diff --git a/jena-core/src/test/java/org/apache/jena/reasoner/test/TestReasoners.java b/jena-core/src/test/java/org/apache/jena/reasoner/test/TestReasoners.java
index 7bc743e975..bc75001d17 100644
--- a/jena-core/src/test/java/org/apache/jena/reasoner/test/TestReasoners.java
+++ b/jena-core/src/test/java/org/apache/jena/reasoner/test/TestReasoners.java
@@ -76,9 +76,8 @@ public class TestReasoners extends TestCase {
         return new TestSuite(TestReasoners.class);
     }
 
-    @SuppressWarnings("removal")
     private static  Graph createGraphForTest() {
-        return GraphMemFactory.createGraphMem();
+        return GraphMemFactory.createDefaultGraph();
     }
 
     /**
diff --git a/jena-core/src/test/java/org/apache/jena/util/TestMonitors.java b/jena-core/src/test/java/org/apache/jena/util/TestMonitors.java
index 0b3f68a9c8..e2d1d56f9b 100644
--- a/jena-core/src/test/java/org/apache/jena/util/TestMonitors.java
+++ b/jena-core/src/test/java/org/apache/jena/util/TestMonitors.java
@@ -49,6 +49,10 @@ public class TestMonitors extends TestCase {
         return new TestSuite( TestMonitors.class );
     }
 
+    private static  Graph createGraphForTest() {
+        return GraphMemFactory.createDefaultGraph();
+    }
+
     // constants used in the tests
     String NS = "http://jena.hpl.hp.com/test#";
     Node a = NodeCreateUtils.create(NS + "a");
@@ -64,7 +68,7 @@ public class TestMonitors extends TestCase {
      * Basic graph level test, no monitoring
      */
     public void testBasics() {
-        Graph base = GraphMemFactory.createGraphMem();
+        Graph base = createGraphForTest();
         MonitorGraph monitor = new MonitorGraph(base);
 
         // base data
@@ -97,7 +101,7 @@ public class TestMonitors extends TestCase {
      * Monitoring test.
      */
     public void testListener() {
-        Graph base = GraphMemFactory.createGraphMem();
+        Graph base = createGraphForTest();
         MonitorGraph monitor = new MonitorGraph(base);
         RecordingListener listener = new RecordingListener();
         monitor.getEventManager().register(listener);


(jena) 01/06: GH-3237: Prepare for GraphMem -> GraphMemValue; GraphMem2* -> GraphMem

Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

andy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git

commit 4586238c728c99b84417bf9575d91b23b801ca6f
Author: Andy Seaborne <an...@apache.org>
AuthorDate: Fri May 30 19:55:56 2025 +0100

    GH-3237: Prepare for GraphMem -> GraphMemValue; GraphMem2* -> GraphMem
---
 .../org/apache/jena/graph/GraphMemFactory.java     |  61 +++++-
 .../jena/ontology/models/SimpleGraphMaker.java     |  43 ++---
 .../org/apache/jena/rdf/model/ModelFactory.java    |  17 +-
 .../reasoner/rulesys/BasicForwardRuleInfGraph.java | 122 ++++++------
 .../jena/reasoner/rulesys/FBRuleInfGraph.java      | 208 ++++++++++-----------
 .../reasoner/rulesys/LPBackwardRuleInfGraph.java   |  74 ++++----
 .../jena/reasoner/rulesys/impl/BFRuleContext.java  |   2 +-
 .../org/apache/jena/graph/test/GraphTestBase.java  |   2 +-
 .../org/apache/jena/mem/test/TestCaseBasic.java    |  43 -----
 .../org/apache/jena/mem/test/TestCaseBugs.java     |  60 ------
 .../org/apache/jena/mem/test/TestGraphMem2.java    | 101 ----------
 ...stGraphMemValue.java => TestGraphMemModel.java} |  73 +++++++-
 ...Package.java => TestPackage_GraphMemValue.java} |  21 +--
 .../org/apache/jena/mem/test/TestTripleBunch.java  |   2 +-
 .../TestPackage_GraphMem2.java}                    |  26 ++-
 .../org/apache/jena/test/TestPackage_core.java     |   7 +-
 16 files changed, 375 insertions(+), 487 deletions(-)

diff --git a/jena-core/src/main/java/org/apache/jena/graph/GraphMemFactory.java b/jena-core/src/main/java/org/apache/jena/graph/GraphMemFactory.java
index c4b0abfa07..64464e3bd2 100644
--- a/jena-core/src/main/java/org/apache/jena/graph/GraphMemFactory.java
+++ b/jena-core/src/main/java/org/apache/jena/graph/GraphMemFactory.java
@@ -24,6 +24,7 @@ import org.apache.jena.graph.impl.GraphBase ;
 import org.apache.jena.mem2.GraphMem2Fast;
 import org.apache.jena.mem2.GraphMem2Legacy;
 import org.apache.jena.mem2.GraphMem2Roaring;
+import org.apache.jena.sys.JenaSystem;
 import org.apache.jena.util.iterator.ExtendedIterator ;
 import org.apache.jena.util.iterator.NullIterator ;
 
@@ -47,9 +48,12 @@ import org.apache.jena.util.iterator.NullIterator ;
  */
 public class GraphMemFactory
 {
+    static { JenaSystem.init(); }
+
+    private GraphMemFactory() {}
     // Default for sameTerm/sameValue
-    // Jena 4 : default false (same value)
-    // Jena 5 : default false (same term)
+    // Up to Jena 4 : default false (same value)
+    // From Jena 5  : default false (same term)
     private static boolean defaultSameTerm = true;
     static {
         // Initial setting.
@@ -70,7 +74,9 @@ public class GraphMemFactory
      * with the system default is same value (Jena4).
      * <p>
      * This affects {@link #createDefaultGraph}.
+     * @deprecated To be removed.
      */
+    @Deprecated(forRemoval = true)
     public static void setDftGraphSameTerm(boolean value) {
         defaultSameTerm = value;
     }
@@ -80,12 +86,13 @@ public class GraphMemFactory
      * (false).
      * <p>
      * This is used by {@link #createDefaultGraph}.
+     * @deprecated To be removed.
      */
+    @Deprecated(forRemoval = true)
     public static boolean dftGraphSameTerm() {
         return defaultSameTerm;
     }
 
-    private GraphMemFactory() {}
 
     /**
      * Answer a memory-based graph.
@@ -98,9 +105,18 @@ public class GraphMemFactory
     }
 
     /**
-     * This function will track the preferred general purpose graph for the Model API.
+     * @deprecated To be renamed. Use {@link #createGraphMemForModel()}. The function will be re-purposed for the default samer-term memory graph.
      */
+    @Deprecated(forRemoval = true)
     public static Graph createGraphMem() {
+        //return createGraphMemForModel();
+        return createGraphMem2();
+    }
+
+     /**
+      * This function will track the preferred general purpose graph for the Model API.
+      */
+    public static Graph createGraphMemForModel() {
         @SuppressWarnings("deprecation")
         Graph g = new org.apache.jena.mem.GraphMem();
         return g;
@@ -138,9 +154,18 @@ public class GraphMemFactory
      * with a simpler implementation, primarily due to not providing support for {@link Iterator#remove}.
      * <p>
      * See {@link GraphMem2Legacy} for details.
+     *
      */
-    public static Graph createGraphMem2Basic()
-    { return new GraphMem2Legacy(); }
+     public static Graph createGraphMemBasic()
+     { return new GraphMem2Legacy(); }
+
+     /**
+      * @deprecated Use {@link #createGraphMemBasic()}
+      */
+     @Deprecated(forRemoval = true)
+     public static Graph createGraphMem2Basic()
+     { return createGraphMemBasic(); }
+
 
     /**
      * A graph that stores triples in memory. This class is not thread-safe.
@@ -154,8 +179,18 @@ public class GraphMemFactory
      * <p>
      * See {@link GraphMem2Fast} for details.
      */
-    public static Graph createGraphMem2()
-    { return new GraphMem2Fast(); }
+    //public static Graph createGraphMemX() {
+     public static Graph createGraphMem2() {
+        return new GraphMem2Fast();
+    }
+
+//     /**
+//      * @deprecated Use {@link #createGraphMemBasic()}
+//      */
+//     @Deprecated(forRemoval = true)
+//     public static Graph createGraphMem2() {
+//         return new GraphMem2Fast();
+//     }
 
     /**
      * A graph that stores triples in memory. This class is not thread-safe.
@@ -170,9 +205,17 @@ public class GraphMemFactory
      * <p>
      * See {@link GraphMem2Roaring} for details.
      */
-    public static Graph createGraphMem2Roaring()
+    public static Graph createGraphMemRoaring()
     { return new GraphMem2Roaring(); }
 
+
+    /**
+     * @deprecated Use {@link #createGraphMemRoaring()}
+     */
+    @Deprecated(forRemoval = true)
+    public static Graph createGraphMem2Roaring()
+    { return createGraphMemRoaring(); }
+
     private final static Graph emptyGraph = new GraphBase() {
         @Override
         protected ExtendedIterator<Triple> graphBaseFind(Triple triplePattern) {
diff --git a/jena-core/src/main/java/org/apache/jena/ontology/models/SimpleGraphMaker.java b/jena-core/src/main/java/org/apache/jena/ontology/models/SimpleGraphMaker.java
index 29dfdabb8b..537a33c6e3 100644
--- a/jena-core/src/main/java/org/apache/jena/ontology/models/SimpleGraphMaker.java
+++ b/jena-core/src/main/java/org/apache/jena/ontology/models/SimpleGraphMaker.java
@@ -35,17 +35,17 @@ public class SimpleGraphMaker extends BaseGraphMaker
 
     /**
         Initialise a SimpleGraphMaker with reification style Minimal
-     */ 
+     */
     public SimpleGraphMaker()
     { super() ; }
 
     /**
         The mapping from the names of graphs to the Graphs themselves.
-     */    
+     */
     private Map<String, Graph> graphs = new HashMap<>();
 
     public Graph create()
-    { return GraphMemFactory.createGraphMem(); }
+    { return GraphMemFactory.createDefaultGraph(); }
 
     /**
         Create a graph and record it with the given name in the local map.
@@ -54,13 +54,12 @@ public class SimpleGraphMaker extends BaseGraphMaker
     public Graph createGraph( String name, boolean strict )
     {
         GraphMemBase already = (GraphMemBase) graphs.get( name );
-        if (already == null)
-        {
-            Graph result = GraphMemFactory.createGraphMem( );
+        if (already == null) {
+            Graph result = GraphMemFactory.createDefaultGraph();
             graphs.put( name, result );
-            return result;            
+            return result;
         }
-        else if (strict)
+        if (strict)
             throw new AlreadyExistsException( name );
         else
             return already.openAgain();
@@ -70,28 +69,30 @@ public class SimpleGraphMaker extends BaseGraphMaker
         Open (aka find) a graph with the given name in the local map.
      */
     @Override
-    public Graph openGraph( String name, boolean strict )
-    {
-        GraphMemBase already = (GraphMemBase) graphs.get( name );
-        if (already == null) 
-            if (strict) throw new DoesNotExistException( name );
-            else return createGraph( name, true );
+    public Graph openGraph(String name, boolean strict) {
+        GraphMemBase already = (GraphMemBase)graphs.get(name);
+        if ( already == null )
+            if ( strict )
+                throw new DoesNotExistException(name);
+            else
+                return createGraph(name, true);
         else
             return already.openAgain();
     }
 
     @Override
-    public Graph openGraph()
-    { return getGraph(); }
+    public Graph openGraph() {
+        return getGraph();
+    }
 
     /**
-        Remove the mapping from name to any graph from the local map.
+     * Remove the mapping from name to any graph from the local map.
      */
     @Override
-    public void removeGraph( String name )
-    {
-        if (!graphs.containsKey( name )) throw new DoesNotExistException( name );
-        graphs.remove( name );
+    public void removeGraph(String name) {
+        if ( !graphs.containsKey(name) )
+            throw new DoesNotExistException(name);
+        graphs.remove(name);
     }
 
     /**
diff --git a/jena-core/src/main/java/org/apache/jena/rdf/model/ModelFactory.java b/jena-core/src/main/java/org/apache/jena/rdf/model/ModelFactory.java
index 22652a5939..fb9880d372 100644
--- a/jena-core/src/main/java/org/apache/jena/rdf/model/ModelFactory.java
+++ b/jena-core/src/main/java/org/apache/jena/rdf/model/ModelFactory.java
@@ -47,11 +47,8 @@ import org.apache.jena.sys.JenaSystem ;
 public class ModelFactory extends ModelFactoryBase
 {
     static { JenaSystem.init(); }
-    /**
-        No-one can make instances of this.
-    */
-    private ModelFactory()
-        {}
+
+    private ModelFactory() {}
 
     /**
      * Answer a fresh Model for use with the Model API.
@@ -78,10 +75,9 @@ public class ModelFactory extends ModelFactoryBase
         return createModelForGraph(GraphMemFactory.createDefaultGraphSameValue());
     }
 
-
     /**
-        Answer a model that encapsulates the given graph. Existing prefixes are
-        undisturbed.
+        Answer a model that encapsulates the given graph.
+        Existing prefixes are undisturbed.
         @param g A graph structure
         @return A model presenting an API view of graph g
     */
@@ -95,8 +91,9 @@ public class ModelFactory extends ModelFactoryBase
 
         @return a ModelMaker that constructs memory-based models
     */
-    public static ModelMaker createMemModelMaker()
-        { return new ModelMakerImpl( new SimpleGraphMaker( ) );  }
+    public static ModelMaker createMemModelMaker() {
+        return new ModelMakerImpl(new SimpleGraphMaker());
+    }
 
     /**
      * Return a Model through which all the RDFS entailments
diff --git a/jena-core/src/main/java/org/apache/jena/reasoner/rulesys/BasicForwardRuleInfGraph.java b/jena-core/src/main/java/org/apache/jena/reasoner/rulesys/BasicForwardRuleInfGraph.java
index 772e7d5109..373a5d5c65 100755
--- a/jena-core/src/main/java/org/apache/jena/reasoner/rulesys/BasicForwardRuleInfGraph.java
+++ b/jena-core/src/main/java/org/apache/jena/reasoner/rulesys/BasicForwardRuleInfGraph.java
@@ -44,33 +44,33 @@ import org.apache.jena.util.iterator.NullIterator ;
  */
 
 public class BasicForwardRuleInfGraph extends BaseInfGraph implements ForwardRuleInfGraphI {
-    
+
     /** Table of derivation records, maps from triple to RuleDerivation */
     protected OneToManyMap<Triple, Derivation> derivations;
-    
+
     /** The set of deduced triples, this is in addition to base triples in the fdata graph */
     protected FGraph fdeductions;
-    
+
     /** A safe wrapped version of the deductions graph used for reporting getDeductions */
     protected Graph safeDeductions;
-    
+
     /** Reference to any schema graph data bound into the parent reasoner */
     protected Graph schemaGraph;
-    
+
     /** The forward rule engine being used */
     protected FRuleEngineI engine;
-    
+
     /** The original rule set as supplied */
     private List<Rule> rules;
-    
+
     /** Flag, if true then find results will be filtered to remove functors and illegal RDF */
     public boolean filterFunctors = true;
-    
+
     /** Flag which, if true, enables tracing of rule actions to logger.info */
     protected boolean traceOn = false;
-    
+
 //    private static Logger logger = LoggerFactory.getLogger(BasicForwardRuleInfGraph.class);
-    
+
 //=======================================================================
 // Core methods
 
@@ -80,40 +80,40 @@ public class BasicForwardRuleInfGraph extends BaseInfGraph implements ForwardRul
     * any configuration parameters (such as logging) to be set before the data is added.
     * Note that until the data is added using {@link #rebind rebind} then any operations
     * like add, remove, find will result in errors.
-    * 
-    * @param reasoner the parent reasoner 
+    *
+    * @param reasoner the parent reasoner
     * @param schema the (optional) schema data which is being processed
     */
    public BasicForwardRuleInfGraph(Reasoner reasoner, Graph schema) {
        super(null, reasoner);
        instantiateRuleEngine(null);
        this.schemaGraph = schema;
-   }    
+   }
 
    /**
-    * Constructor. Creates a new inference graph based on the given rule set. 
+    * Constructor. Creates a new inference graph based on the given rule set.
     * No data graph is attached at this stage. This is to allow
     * any configuration parameters (such as logging) to be set before the data is added.
     * Note that until the data is added using {@link #rebind rebind} then any operations
     * like add, remove, find will result in errors.
-    * 
-    * @param reasoner the parent reasoner 
+    *
+    * @param reasoner the parent reasoner
     * @param rules the list of rules to use this time
     * @param schema the (optional) schema or preload data which is being processed
     */
    public BasicForwardRuleInfGraph(Reasoner reasoner, List<Rule> rules, Graph schema)
-   {       
+   {
        super( null, reasoner );
        instantiateRuleEngine( rules );
        this.rules = rules;
        this.schemaGraph = schema;
    }
-   
+
     /**
      * Constructor. Creates a new inference graph based on the given rule set
      * then processes the initial data graph. No precomputed deductions are loaded.
-     * 
-     * @param reasoner the parent reasoner 
+     *
+     * @param reasoner the parent reasoner
      * @param rules the list of rules to use this time
      * @param schema the (optional) schema or preload data which is being processed
      * @param data the data graph to be processed
@@ -131,15 +131,15 @@ public class BasicForwardRuleInfGraph extends BaseInfGraph implements ForwardRul
     protected void instantiateRuleEngine(List<Rule> rules) {
         engine = FRuleEngineIFactory.getInstance().createFRuleEngineI(this, rules, false);
     }
-    
+
     /**
      * Attach a compiled rule set to this inference graph.
-     * @param ruleStore a compiled set of rules (i.e. the result of an FRuleEngine.compile). 
+     * @param ruleStore a compiled set of rules (i.e. the result of an FRuleEngine.compile).
      */
     public void setRuleStore(Object ruleStore) {
         engine.setRuleStore(ruleStore);
     }
-    
+
     /**
      * Replace the underlying data graph for this inference graph and start any
      * inferences over again. This is primarily using in setting up ontology imports
@@ -152,13 +152,13 @@ public class BasicForwardRuleInfGraph extends BaseInfGraph implements ForwardRul
         fdata = new FGraph( data );
         rebind();
     }
-    
+
     /**
      * Cause the inference graph to reconsult the underlying graph to take
      * into account changes. Normally changes are made through the InfGraph's add and
      * remove calls are will be handled appropriately. However, in some cases changes
      * are made "behind the InfGraph's back" and this forces a full reconsult of
-     * the changed data. 
+     * the changed data.
      */
     @Override
     public void rebind() {
@@ -173,7 +173,7 @@ public class BasicForwardRuleInfGraph extends BaseInfGraph implements ForwardRul
     public Graph getSchemaGraph() {
         return schemaGraph;
     }
-        
+
     /**
      * Perform any initial processing and caching. This call is optional. Most
      * engines either have negligable set up work or will perform an implicit
@@ -186,7 +186,7 @@ public class BasicForwardRuleInfGraph extends BaseInfGraph implements ForwardRul
     public synchronized void prepare() {
         if (this.isPrepared()) return;
         this.setPreparedState(true);
-        
+
         // initilize the deductions graph
         fdeductions = new FGraph( createDeductionsGraph() );
         boolean rulesLoaded = false;
@@ -194,7 +194,7 @@ public class BasicForwardRuleInfGraph extends BaseInfGraph implements ForwardRul
             rulesLoaded = preloadDeductions(schemaGraph);
         }
         if (rulesLoaded) {
-            engine.fastInit(fdata); 
+            engine.fastInit(fdata);
         } else {
             engine.init(true, fdata);
         }
@@ -222,7 +222,7 @@ public class BasicForwardRuleInfGraph extends BaseInfGraph implements ForwardRul
             return false;
         }
     }
-    
+
     /**
      * Add a new deduction to the deductions graph.
      */
@@ -230,7 +230,7 @@ public class BasicForwardRuleInfGraph extends BaseInfGraph implements ForwardRul
     public void addDeduction(Triple t) {
         getDeductionsGraph().add(t);
     }
-    
+
     /**
      * Set to true to cause functor-valued literals to be dropped from rule output.
      * Default is true.
@@ -239,7 +239,7 @@ public class BasicForwardRuleInfGraph extends BaseInfGraph implements ForwardRul
     public void setFunctorFiltering(boolean param) {
         filterFunctors = param;
     }
-   
+
     /**
      * Extended find interface used in situations where the implementator
      * may or may not be able to answer the complete query. It will
@@ -255,7 +255,7 @@ public class BasicForwardRuleInfGraph extends BaseInfGraph implements ForwardRul
     public ExtendedIterator<Triple> findWithContinuation(TriplePattern pattern, Finder continuation) {
         return findWithContinuation(pattern, continuation, true);
     }
-    
+
     /**
      * Internals of findWithContinuation implementation which allows control
      * over functor filtering.
@@ -279,10 +279,10 @@ public class BasicForwardRuleInfGraph extends BaseInfGraph implements ForwardRul
             return result;
         }
     }
-   
-    /** 
+
+    /**
      * Returns an iterator over Triples.
-     * This implementation assumes that the underlying findWithContinuation 
+     * This implementation assumes that the underlying findWithContinuation
      * will have also consulted the raw data.
      */
     @Override
@@ -292,7 +292,7 @@ public class BasicForwardRuleInfGraph extends BaseInfGraph implements ForwardRul
 
     /**
      * Basic pattern lookup interface.
-     * This implementation assumes that the underlying findWithContinuation 
+     * This implementation assumes that the underlying findWithContinuation
      * will have also consulted the raw data.
      * @param pattern a TriplePattern to be matched against the data
      * @return a ExtendedIterator over all Triples in the data set
@@ -302,7 +302,7 @@ public class BasicForwardRuleInfGraph extends BaseInfGraph implements ForwardRul
     public ExtendedIterator<Triple> find(TriplePattern pattern) {
         return findWithContinuation(pattern, null);
     }
-    
+
 
     /**
      * Add one triple to the data graph, run any rules triggered by
@@ -328,10 +328,10 @@ public class BasicForwardRuleInfGraph extends BaseInfGraph implements ForwardRul
         int dedSize = fdeductions.getGraph().size();
         return baseSize + dedSize;
     }
-    
-    /** 
-     * Removes the triple t (if possible) from the set belonging to this graph. 
-     */   
+
+    /**
+     * Removes the triple t (if possible) from the set belonging to this graph.
+     */
     @Override
     public void performDelete(Triple t) {
         version++;
@@ -345,8 +345,8 @@ public class BasicForwardRuleInfGraph extends BaseInfGraph implements ForwardRul
             fdeductions.getGraph().delete(t);
         }
     }
-   
-    /** 
+
+    /**
      * Free all resources, any further use of this Graph is an error.
      */
     @Override
@@ -363,7 +363,7 @@ public class BasicForwardRuleInfGraph extends BaseInfGraph implements ForwardRul
 //  =======================================================================
 //   Implementation of ForwardRuleInfGraphI interface which is used by
 //   the forward rule engine to invoke functions in this InfGraph
-    
+
     /**
      * Adds a new Backward rule as a rules of a forward rule process. Only some
      * infgraphs support this.
@@ -372,7 +372,7 @@ public class BasicForwardRuleInfGraph extends BaseInfGraph implements ForwardRul
     public void addBRule(Rule brule) {
         throw new ReasonerException("Forward reasoner does not support hybrid rules - " + brule.toShortString());
     }
-        
+
     /**
      * Deletes a new Backward rule as a rules of a forward rule process. Only some
      * infgraphs support this.
@@ -381,7 +381,7 @@ public class BasicForwardRuleInfGraph extends BaseInfGraph implements ForwardRul
     public void deleteBRule(Rule brule) {
         throw new ReasonerException("Forward reasoner does not support hybrid rules - " + brule.toShortString());
     }
-    
+
     /**
      * Return the Graph containing all the static deductions available so far.
      * Will force a prepare.
@@ -389,15 +389,15 @@ public class BasicForwardRuleInfGraph extends BaseInfGraph implements ForwardRul
     @Override
     public Graph getDeductionsGraph() {
         prepare();
-        return safeDeductions; 
+        return safeDeductions;
     }
-   
-    /** 
+
+    /**
      * Create the graph used to hold the deductions. Can be overridden
      * by subclasses that need special purpose graph implementations here.
      * Assumes the graph underlying fdeductions and associated SafeGraph
      * wrapper can be reused if present thus enabling preservation of
-     * listeners. 
+     * listeners.
      */
     protected Graph createDeductionsGraph() {
         if (fdeductions != null) {
@@ -408,11 +408,11 @@ public class BasicForwardRuleInfGraph extends BaseInfGraph implements ForwardRul
                 return dg;
             }
         }
-        Graph dg = GraphMemFactory.createGraphMem( ); 
+        Graph dg = GraphMemFactory.createDefaultGraph( );
         safeDeductions = new SafeGraph( dg );
         return dg;
     }
-    
+
     /**
      * Return the Graph containing all the static deductions available so far.
      * Does not trigger a prepare action. Returns a SafeWrapper and so
@@ -424,7 +424,7 @@ public class BasicForwardRuleInfGraph extends BaseInfGraph implements ForwardRul
         return safeDeductions;
 //        return fdeductions.getGraph();
     }
-    
+
     /**
      * Search the combination of data and deductions graphs for the given triple pattern.
      * This may different from the normal find operation in the base of hybrid reasoners
@@ -434,7 +434,7 @@ public class BasicForwardRuleInfGraph extends BaseInfGraph implements ForwardRul
     public ExtendedIterator<Triple> findDataMatches(Node subject, Node predicate, Node object) {
         return findWithContinuation(new TriplePattern(subject, predicate, object), null, false);
     }
-   
+
 
     /**
      * Log a dervivation record against the given triple.
@@ -443,7 +443,7 @@ public class BasicForwardRuleInfGraph extends BaseInfGraph implements ForwardRul
     public void logDerivation(Triple t, Derivation derivation) {
         derivations.put(t, derivation);
     }
-    
+
     /**
      * Assert a new triple in the deduction graph, bypassing any processing machinery.
      */
@@ -468,7 +468,7 @@ public class BasicForwardRuleInfGraph extends BaseInfGraph implements ForwardRul
             derivations = null;
         }
     }
-    
+
     /**
      * Return true if derivation logging is enabled.
      */
@@ -476,7 +476,7 @@ public class BasicForwardRuleInfGraph extends BaseInfGraph implements ForwardRul
     public boolean shouldLogDerivations() {
         return recordDerivations;
     }
-    
+
     /**
      * Return the derivation of at triple.
      * The derivation is a List of DerivationRecords
@@ -489,7 +489,7 @@ public class BasicForwardRuleInfGraph extends BaseInfGraph implements ForwardRul
             return derivations.getAll(t);
         }
     }
-     
+
     /**
      * Set the state of the trace flag. If set to true then rule firings
      * are logged out to the Log at "INFO" level.
@@ -497,7 +497,7 @@ public class BasicForwardRuleInfGraph extends BaseInfGraph implements ForwardRul
     public void setTraceOn(boolean state) {
         traceOn = state;
     }
-    
+
     /**
      * Return true if tracing should be acted on - i.e. if traceOn is true
      * and we are past the bootstrap phase.
@@ -506,7 +506,7 @@ public class BasicForwardRuleInfGraph extends BaseInfGraph implements ForwardRul
     public boolean shouldTrace() {
         return traceOn && engine.shouldTrace();
     }
-    
+
     /**
      * Return the number of rules fired since this rule engine instance
      * was created and initialized
@@ -514,5 +514,5 @@ public class BasicForwardRuleInfGraph extends BaseInfGraph implements ForwardRul
     public long getNRulesFired() {
         return engine.getNRulesFired();
     }
-    
+
 }
diff --git a/jena-core/src/main/java/org/apache/jena/reasoner/rulesys/FBRuleInfGraph.java b/jena-core/src/main/java/org/apache/jena/reasoner/rulesys/FBRuleInfGraph.java
index 54377e9c37..73a6c2d74f 100644
--- a/jena-core/src/main/java/org/apache/jena/reasoner/rulesys/FBRuleInfGraph.java
+++ b/jena-core/src/main/java/org/apache/jena/reasoner/rulesys/FBRuleInfGraph.java
@@ -51,46 +51,46 @@ import org.slf4j.LoggerFactory ;
  * for future reference).
  */
 public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements BackwardRuleInfGraphI {
-    
+
     /** Single context for the reasoner, used when passing information to builtins */
     protected BBRuleContext context;
-     
+
     /** A finder that searches across the data, schema, axioms and forward deductions*/
     protected Finder dataFind;
-    
+
     /** The core backward rule engine which includes all the memoized results */
     protected LPBRuleEngine bEngine;
-    
+
     /** The original rule set as supplied */
     protected List<Rule> rawRules;
-    
+
     /** The rule list after possible extension by preprocessing hooks */
     protected List<Rule> rules;
-    
+
     /** Static switch from Basic to RETE implementation of the forward component */
     public static boolean useRETE = true;
 
     /** Flag, if true then subClass and subProperty lattices will be optimized using TGCs */
     protected boolean useTGCCaching = false;
-    
+
     /** Optional precomputed cache of the subClass/subproperty lattices */
     protected TransitiveEngine transitiveEngine;
-    
+
     /** Optional list of preprocessing hooks  to be run in sequence during preparation time */
     protected List<RulePreprocessHook> preprocessorHooks;
-    
+
     /** Cache of temporary property values inferred through getTemp calls */
     protected TempNodeCache tempNodecache;
-    
+
     /** Table of temp nodes which should be hidden from output listings */
     protected Set<Node> hiddenNodes;
 
     /** Optional map of property node to datatype ranges */
     protected HashMap<Node, List<RDFDatatype>> dtRange = null;
-    
+
     /** Flag to request datatype range validation be included in the validation step */
     protected boolean requestDatatypeRangeValidation = false;
-    
+
     static Logger logger = LoggerFactory.getLogger(FBRuleInfGraph.class);
 
 //  =======================================================================
@@ -103,7 +103,7 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
      */
     public FBRuleInfGraph(Reasoner reasoner, Graph schema) {
         super(reasoner, schema);
-        constructorInit(schema);    
+        constructorInit(schema);
     }
 
     /**
@@ -115,9 +115,9 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
     public FBRuleInfGraph(Reasoner reasoner, List<Rule> rules, Graph schema) {
         super( reasoner, rules, schema );
         this.rawRules = rules;
-        constructorInit( schema ); 
+        constructorInit( schema );
     }
-    
+
     /**
      * Constructor.
      * @param reasoner the reasoner which created this inf graph instance
@@ -127,8 +127,8 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
      */
     public FBRuleInfGraph( Reasoner reasoner, List<Rule> rules, Graph schema, Graph data ) {
         super(reasoner, rules, schema, data);
-        this.rawRules = rules;  
-        constructorInit(schema);    
+        this.rawRules = rules;
+        constructorInit(schema);
     }
 
 
@@ -136,7 +136,7 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
      * Common pieces of initialization code which apply in all constructor cases.
      */
     private void constructorInit(Graph schema) {
-        initLP(schema);  
+        initLP(schema);
         tempNodecache = new TempNodeCache(this);
         if (JenaParameters.enableFilteringOfHiddenInfNodes) {
             hiddenNodes = new HashSet<>();
@@ -145,7 +145,7 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
             }
         }
     }
-    
+
     /**
      * Instantiate the forward rule engine to use.
      * Subclasses can override this to switch to, say, a RETE implementation.
@@ -158,7 +158,7 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
 
     /**
      * Initialize the LP engine, based on an optional schema graph.
-     */    
+     */
     private void initLP(Graph schema) {
         if (schema != null && schema instanceof FBRuleInfGraph) {
             LPRuleStore newStore = new LPRuleStore();
@@ -168,7 +168,7 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
             bEngine = new LPBRuleEngine(this);
         }
     }
-    
+
     /**
      * Instantiate the optional caches for the subclass/suproperty lattices.
      * Unless this call is made the TGC caching will not be used.
@@ -177,7 +177,7 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
         useTGCCaching = true;
         resetTGCCache();
     }
-    
+
     /**
      * Rest the transitive graph caches
      */
@@ -190,11 +190,11 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
                 new TransitiveGraphCache(ReasonerVocabulary.directSubPropertyOf.asNode(), RDFS.subPropertyOf.asNode()));
         }
     }
-    
+
 //  =======================================================================
 //   Interface between infGraph and the goal processing machinery
 
-    
+
     /**
      * Search the combination of data and deductions graphs for the given triple pattern.
      * This may different from the normal find operation in the base of hybrid reasoners
@@ -204,7 +204,7 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
     public ExtendedIterator<Triple> findDataMatches(Node subject, Node predicate, Node object) {
         return dataFind.find(new TriplePattern(subject, predicate, object));
     }
-    
+
     /**
      * Search the combination of data and deductions graphs for the given triple pattern.
      * This may different from the normal find operation in the base of hybrid reasoners
@@ -214,7 +214,7 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
     public ExtendedIterator<Triple> findDataMatches(TriplePattern pattern) {
         return dataFind.find(pattern);
     }
-            
+
     /**
      * Process a call to a builtin predicate
      * @param clause the Functor representing the call
@@ -225,7 +225,7 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
     @Override
     public boolean processBuiltin(ClauseEntry clause, Rule rule, BindingEnvironment env) {
         throw new ReasonerException("Internal error in FBLP rule engine, incorrect invocation of builtin in rule " + rule);
-        // TODO: Remove 
+        // TODO: Remove
 //        if (clause instanceof Functor) {
 //            context.setEnv(env);
 //            context.setRule(rule);
@@ -234,7 +234,7 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
 //            throw new ReasonerException("Illegal builtin predicate: " + clause + " in rule " + rule);
 //        }
     }
-    
+
     /**
      * Adds a new Backward rule as a result of a forward rule process. Only some
      * infgraphs support this.
@@ -247,7 +247,7 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
         bEngine.addRule(brule);
         bEngine.reset();
     }
-       
+
     /**
      * Deletes a new Backward rule as a rules of a forward rule process. Only some
      * infgraphs support this.
@@ -260,7 +260,7 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
         bEngine.deleteRule(brule);
         bEngine.reset();
     }
-    
+
     /**
      * Adds a set of new Backward rules
      */
@@ -272,7 +272,7 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
         }
         bEngine.reset();
     }
-    
+
     /**
      * Return an ordered list of all registered backward rules. Includes those
      * generated by forward productions.
@@ -280,7 +280,7 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
     public List<Rule> getBRules() {
         return bEngine.getAllRules();
     }
-    
+
     /**
      * Return the originally supplied set of rules, may be a mix of forward
      * and backward rules.
@@ -288,9 +288,9 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
     public List<Rule> getRules() {
         return rules;
     }
-      
+
     /**
-     * Set a predicate to be tabled/memoized by the LP engine. 
+     * Set a predicate to be tabled/memoized by the LP engine.
      */
     public void setTabled(Node predicate) {
         bEngine.tablePredicate(predicate);
@@ -298,7 +298,7 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
             logger.info("LP TABLE " + predicate);
         }
     }
-    
+
     /**
      * Return a compiled representation of all the registered
      * forward rules.
@@ -306,7 +306,7 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
     private Object getForwardRuleStore() {
         return engine.getRuleStore();
     }
-    
+
     /**
      * Add a new deduction to the deductions graph.
      */
@@ -323,16 +323,16 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
      * @param instance the base instance node to which the property applies
      * @param prop the property node whose value is being inferred
      * @param pclass the (optional, can be null) class for the inferred value.
-     * @return the bNode representing the property value 
+     * @return the bNode representing the property value
      */
     @Override
     public Node getTemp(Node instance, Node prop, Node pclass) {
         return tempNodecache.getTemp(instance, prop, pclass);
     }
-   
+
 //  =======================================================================
 //  Core inf graph methods
-    
+
     /**
      * Add a new rule to the rule set. This should only be used by implementations
      * of RuleProprocessHook (which are called during rule system preparation phase).
@@ -353,7 +353,7 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
         }
         rules.add(rule);
     }
-    
+
     /**
      * Add a new preprocessing hook defining an operation that
      * should be run when the preparation phase is underway.
@@ -364,7 +364,7 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
         }
         preprocessorHooks.add(hook);
     }
-    
+
     /**
      * Perform any initial processing and caching. This call is optional. Most
      * engines either have negligable set up work or will perform an implicit
@@ -376,16 +376,16 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
     @Override
     public synchronized void prepare() {
         if (this.isPrepared()) return;
-        
+
         this.setPreparedState(true);
-                    
+
         // Restore the original pre-hookProcess rules
         rules = rawRules;
-        
+
         // Is there any data to bind in yet?
         Graph data = null;
         if (fdata != null) data = fdata.getGraph();
-        
+
         // initilize the deductions graph
         if (fdeductions != null) {
             Graph oldDeductions = (fdeductions).getGraph();
@@ -395,22 +395,22 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
         }
         dataFind = (data == null) ? fdeductions :  FinderUtil.cascade(fdeductions, fdata);
         Finder dataSource = fdata;
-        
+
         // Initialize the optional TGC caches
         if (useTGCCaching) {
             resetTGCCache();
             if (schemaGraph != null) {
-                // Check if we can just reuse the copy of the raw 
+                // Check if we can just reuse the copy of the raw
                 if (
                     (transitiveEngine.checkOccurance(TransitiveReasoner.subPropertyOf, data) ||
                      transitiveEngine.checkOccurance(TransitiveReasoner.subClassOf, data) ||
                      transitiveEngine.checkOccurance(RDFS.domain.asNode(), data) ||
                      transitiveEngine.checkOccurance(RDFS.range.asNode(), data) )) {
-            
+
                     // The data graph contains some ontology knowledge so split the caches
                     // now and rebuild them using merged data
                     transitiveEngine.insert(((FBRuleInfGraph)schemaGraph).fdata, fdata);
-                }     
+                }
             } else {
                 if (data != null) {
                     transitiveEngine.insert(null, fdata);
@@ -437,17 +437,17 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
             transitiveEngine.setCaching(true, true);
 //                dataFind = FinderUtil.cascade(subClassCache, subPropertyCache, dataFind);
             dataFind = FinderUtil.cascade(dataFind, transitiveEngine.getSubClassCache(), transitiveEngine.getSubPropertyCache());
-            
+
             // Without the next statement then the transitive closures are not seen by the forward rules
             dataSource = FinderUtil.cascade(dataSource, transitiveEngine.getSubClassCache(), transitiveEngine.getSubPropertyCache());
         }
-        
+
         // Make sure there are no Brules left over from pior runs
         bEngine.deleteAllRules();
 
         // Call any optional preprocessing hook
         if (preprocessorHooks != null && preprocessorHooks.size() > 0) {
-            Graph inserts = GraphMemFactory.createGraphMem();
+            Graph inserts = GraphMemFactory.createDefaultGraph();
             for ( RulePreprocessHook hook : preprocessorHooks )
             {
                 hook.run( this, dataFind, inserts );
@@ -458,7 +458,7 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
                 dataFind = FinderUtil.cascade(dataFind, finserts);
             }
         }
-        
+
         boolean rulesLoaded = false;
         if (schemaGraph != null) {
             Graph rawPreload = ((InfGraph)schemaGraph).getRawGraph();
@@ -477,13 +477,13 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
         // Prepare the context for builtins run in backwards engine
         context = new BBRuleContext(this);
     }
-    
+
     /**
      * Cause the inference graph to reconsult the underlying graph to take
      * into account changes. Normally changes are made through the InfGraph's add and
      * remove calls are will be handled appropriately. However, in some cases changes
      * are made "behind the InfGraph's back" and this forces a full reconsult of
-     * the changed data. 
+     * the changed data.
      */
     @Override
     public void rebind() {
@@ -491,11 +491,11 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
         if (bEngine != null) bEngine.reset();
         this.setPreparedState(false);
     }
-    
+
     /**
      * Cause the inference graph to reconsult both the underlying graph and
      * the reasoner ruleset, permits the forward rule set to be dynamically changed.
-     * Causes the entire rule engine to be rebuilt from the current ruleset and 
+     * Causes the entire rule engine to be rebuilt from the current ruleset and
      * reinitialized against the current data. Not needed for normal cases.
      */
     public void rebindAll() {
@@ -503,7 +503,7 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
         instantiateRuleEngine( rawRules );
         rebind();
     }
-    
+
     /**
      * Set the state of the trace flag. If set to true then rule firings
      * are logged out to the Log at "INFO" level.
@@ -528,7 +528,7 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
             derivations = null;
         }
     }
-    
+
     /**
      * Return the number of rules fired since this rule engine instance
      * was created and initialized. The current implementation only counts
@@ -539,7 +539,7 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
     public long getNRulesFired() {
         return engine.getNRulesFired();
     }
-    
+
     /**
      * Extended find interface used in situations where the implementator
      * may or may not be able to answer the complete query. It will
@@ -566,7 +566,7 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
             return result;
         }
     }
-    
+
     /**
      * Internal variant of find which omits the filters which block illegal RDF data.
      * @param pattern a TriplePattern to be matched against the data
@@ -576,10 +576,10 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
         this.requirePrepared();
        return bEngine.find(pattern).filterKeep( new UniqueFilter<Triple>());
     }
-   
-    /** 
+
+    /**
      * Returns an iterator over Triples.
-     * This implementation assumes that the underlying findWithContinuation 
+     * This implementation assumes that the underlying findWithContinuation
      * will have also consulted the raw data.
      */
     @Override
@@ -589,7 +589,7 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
 
     /**
      * Basic pattern lookup interface.
-     * This implementation assumes that the underlying findWithContinuation 
+     * This implementation assumes that the underlying findWithContinuation
      * will have also consulted the raw data.
      * @param pattern a TriplePattern to be matched against the data
      * @return a ExtendedIterator over all Triples in the data set
@@ -646,9 +646,9 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
         bEngine.reset();
     }
 
-    /** 
-     * Removes the triple t (if possible) from the set belonging to this graph. 
-     */   
+    /**
+     * Removes the triple t (if possible) from the set belonging to this graph.
+     */
     @Override
     public void performDelete(Triple t) {
         version++;
@@ -661,7 +661,7 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
                 }
                 this.setPreparedState(false);
             }
-        } 
+        }
         // Full incremental remove processing requires reference counting
         // of all deductions. It's not clear the cost of maintaining the
         // reference counts is worth it so the current implementation
@@ -674,7 +674,7 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
         }
         bEngine.reset();
     }
-    
+
     /**
      * Return a new inference graph which is a clone of the current graph
      * together with an additional set of data premises. Attempts to the replace
@@ -689,36 +689,36 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
 //        if (useTGCCaching) graph.setUseTGCCache();
 //        graph.setDerivationLogging(recordDerivations);
 //        graph.setTraceOn(traceOn);
-//        // Implementation note:  whilst current tests pass its not clear that 
+//        // Implementation note:  whilst current tests pass its not clear that
 //        // the nested passing of FBRuleInfGraph's will correctly handle all
 //        // cases of indirectly bound schema data. If we do uncover a problem here
 //        // then either include the raw schema in a Union with the premises or
-//        // revert of a more brute force version. 
+//        // revert of a more brute force version.
 //        graph.rebind(premises);
 //        return graph;
 //    }
-    
-    /** 
+
+    /**
      * Free all resources, any further use of this Graph is an error.
      */
     @Override
     public void close() {
         if (!closed) {
-            bEngine.halt();        
+            bEngine.halt();
             bEngine = null;
             transitiveEngine = null;
             super.close();
         }
     }
-    
+
 //  =======================================================================
 //  Generalized validation machinery. Assumes rule set has special validation
 //  rules that can be turned on.
-   
+
     /**
      * Test the consistency of the bound data. This normally tests
      * the validity of the bound instance data against the bound
-     * schema data. 
+     * schema data.
      * @return a ValidityReport structure
      */
     @Override
@@ -726,14 +726,14 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
         checkOpen();
         StandardValidityReport report = new StandardValidityReport();
         // Switch on validation
-        Triple validateOn = Triple.create(NodeFactory.createBlankNode(), 
+        Triple validateOn = Triple.create(NodeFactory.createBlankNode(),
                                 ReasonerVocabulary.RB_VALIDATION.asNode(),
                                 Functor.makeFunctorNode("on", new Node[] {}));
         // We sneak this switch directly into the engine to avoid contaminating the
         // real data - this is only possible only the forward engine has been prepared
 //      add(validateOn);
         this.requirePrepared();
-        engine.add(validateOn); 
+        engine.add(validateOn);
         // Look for all reports
         TriplePattern pattern = new TriplePattern(null, ReasonerVocabulary.RB_VALIDATION_REPORT.asNode(), null);
         final Model forConversion = ModelFactory.createDefaultModel();
@@ -758,20 +758,20 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
                 }
             }
         }
-        
+
         if (requestDatatypeRangeValidation) {
             performDatatypeRangeValidation( report );
         }
         return report;
     }
-    
+
     /**
      * Switch on/off datatype range validation
      */
     public void setDatatypeRangeValidation(boolean on) {
         requestDatatypeRangeValidation = on;
     }
-    
+
     /**
      * Run a datatype range check on all literal values of all properties with a range declaration.
      * @param report
@@ -802,7 +802,7 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
         if (range != null) {
             if (value.isBlank()) return null;
             if (!value.isLiteral()) {
-                return new ValidityReport.Report(true, "dtRange", 
+                return new ValidityReport.Report(true, "dtRange",
                     "Property " + prop + " has a typed range but was given a non literal value " + value);
             }
             LiteralLabel ll = value.getLiteral();
@@ -850,7 +850,7 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
 
     /**
      * Scan the initial rule set and pick out all the backward-only rules with non-null bodies,
-     * and transfer these rules to the backward engine. 
+     * and transfer these rules to the backward engine.
      */
     private static List<Rule> extractPureBackwardRules(List<Rule> rules) {
         List<Rule> bRules = new ArrayList<>();
@@ -891,7 +891,7 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
             return false;
         }
     }
-   
+
     /**
      * Called to flag that a node should be hidden from external queries.
      */
@@ -904,10 +904,10 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
             hiddenNodes.add(n);
         }
     }
-    
+
 //  =======================================================================
 //  Support for LP engine profiling
-    
+
     /**
      * Reset the LP engine profile.
      * @param enable it true then profiling will continue with a new empty profile table,
@@ -916,17 +916,17 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
     public void resetLPProfile(boolean enable) {
         bEngine.resetProfile(enable);
     }
-    
+
     /**
      * Print a profile of LP rules used since the last reset.
      */
     public void printLPProfile() {
         bEngine.printProfile();
     }
-    
+
 //  =======================================================================
 //  Implement Filter signature
- 
+
     /**
      * Post-filter query results to hide unwanted
      * triples from the glare of publicity. Unwanted triples
@@ -935,25 +935,25 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
      */
     public boolean accept(Object tin) {
         Triple t = (Triple)tin;
-        
+
         if ((t).getSubject().isLiteral()) return true;
-        
+
         if (JenaParameters.enableFilteringOfHiddenInfNodes && hiddenNodes != null) {
             if (hiddenNodes.contains(t.getSubject()) || hiddenNodes.contains(t.getObject()) || hiddenNodes.contains(t.getPredicate())) {
                 return true;
             }
         }
-        
+
         if (filterFunctors) {
             if (Functor.isFunctor(t.getObject())) {
                 return true;
             }
         }
-        
+
         return false;
 
      }
-     
+
 //  =======================================================================
 //   Inner classes
 
@@ -961,17 +961,17 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
      * Structure used to wrap up pre-processed/compiled rule sets.
      */
     public static class RuleStore {
-        
+
         /** The raw rules */
         protected List<Rule> rawRules;
-        
+
         /** The indexed store used by the forward chainer */
         protected Object fRuleStore;
-        
+
         /** The separated backward rules */
         protected List<Rule> bRules;
-        
-        /** 
+
+        /**
          * Constructor.
          */
         public RuleStore(List<Rule> rawRules, Object fRuleStore, List<Rule> bRules) {
@@ -979,8 +979,8 @@ public class FBRuleInfGraph  extends BasicForwardRuleInfGraph implements Backwar
             this.fRuleStore = fRuleStore;
             this.bRules = bRules;
         }
-        
+
     }
-   
-    
+
+
 }
diff --git a/jena-core/src/main/java/org/apache/jena/reasoner/rulesys/LPBackwardRuleInfGraph.java b/jena-core/src/main/java/org/apache/jena/reasoner/rulesys/LPBackwardRuleInfGraph.java
index 64ca0cc933..3ee42f011d 100644
--- a/jena-core/src/main/java/org/apache/jena/reasoner/rulesys/LPBackwardRuleInfGraph.java
+++ b/jena-core/src/main/java/org/apache/jena/reasoner/rulesys/LPBackwardRuleInfGraph.java
@@ -39,24 +39,24 @@ public class LPBackwardRuleInfGraph extends BaseInfGraph implements BackwardRule
 
     /** The LP rule engine controller which handles the processing for this graph */
     protected LPBRuleEngine engine;
-    
+
     /** Table of derivation records, maps from triple to RuleDerivation */
     protected OneToManyMap<Triple, Derivation> derivations;
-    
+
     /** An optional graph of separate schema assertions that should also be processed */
     protected FGraph fschema;
-    
+
     /** Cache of deductions made from the rules */
     protected FGraph fdeductions;
-     
+
     /** A finder that searches across the data, schema and axioms */
     protected Finder dataFind;
-    
+
     /** Cache of temporary property values inferred through getTemp calls */
     protected TempNodeCache tempNodecache;
-        
+
     static Logger logger = LoggerFactory.getLogger(LPBackwardRuleInfGraph.class);
-    
+
 //  =======================================================================
 //   Core methods
 
@@ -64,8 +64,8 @@ public class LPBackwardRuleInfGraph extends BaseInfGraph implements BackwardRule
      * Constructor. Create a new backward inference graph to process
      * the given data. The parent reasoner supplies the ruleset and
      * any additional schema graph.
-     * 
-     * @param reasoner the parent reasoner 
+     *
+     * @param reasoner the parent reasoner
      * @param ruleStore the indexed set of rules to use
      * @param data the data graph to be processed
      * @param schema optional precached schema (use null if not required)
@@ -77,7 +77,7 @@ public class LPBackwardRuleInfGraph extends BaseInfGraph implements BackwardRule
         }
         engine = new LPBRuleEngine(this, ruleStore);
         tempNodecache = new TempNodeCache(this);
-    }    
+    }
 
     /**
      * Return the schema graph, if any, bound into this inference graph.
@@ -86,7 +86,7 @@ public class LPBackwardRuleInfGraph extends BaseInfGraph implements BackwardRule
     public Graph getSchemaGraph() {
         return fschema.getGraph();
     }
-    
+
     /**
      * Perform any initial processing and caching. This call is optional. Most
      * engines either have negligable set up work or will perform an implicit
@@ -98,8 +98,8 @@ public class LPBackwardRuleInfGraph extends BaseInfGraph implements BackwardRule
     @Override
     public synchronized void prepare() {
         if (this.isPrepared()) return;
-        
-        fdeductions = new FGraph( GraphMemFactory.createGraphMem() );
+
+        fdeductions = new FGraph( GraphMemFactory.createDefaultGraph() );
         extractAxioms();
         dataFind = fdata;
         if (fdeductions != null) {
@@ -108,7 +108,7 @@ public class LPBackwardRuleInfGraph extends BaseInfGraph implements BackwardRule
         if (fschema != null) {
             dataFind = FinderUtil.cascade(dataFind, fschema);
         }
-        
+
         this.setPreparedState(true);
     }
 
@@ -125,13 +125,13 @@ public class LPBackwardRuleInfGraph extends BaseInfGraph implements BackwardRule
         fdata = new FGraph(data);
         this.setPreparedState(false);
     }
-    
+
     /**
      * Cause the inference graph to reconsult the underlying graph to take
      * into account changes. Normally changes are made through the InfGraph's add and
      * remove calls are will be handled appropriately. However, in some cases changes
      * are made "behind the InfGraph's back" and this forces a full reconsult of
-     * the changed data. 
+     * the changed data.
      */
     @Override
     public synchronized void rebind() {
@@ -171,10 +171,10 @@ public class LPBackwardRuleInfGraph extends BaseInfGraph implements BackwardRule
         }
         return result.filterDrop(Functor.acceptFilter);
     }
-   
-    /** 
+
+    /**
      * Returns an iterator over Triples.
-     * This implementation assumes that the underlying findWithContinuation 
+     * This implementation assumes that the underlying findWithContinuation
      * will have also consulted the raw data.
      */
     @Override
@@ -184,7 +184,7 @@ public class LPBackwardRuleInfGraph extends BaseInfGraph implements BackwardRule
 
     /**
      * Basic pattern lookup interface.
-     * This implementation assumes that the underlying findWithContinuation 
+     * This implementation assumes that the underlying findWithContinuation
      * will have also consulted the raw data.
      * @param pattern a TriplePattern to be matched against the data
      * @return a ExtendedIterator over all Triples in the data set
@@ -194,7 +194,7 @@ public class LPBackwardRuleInfGraph extends BaseInfGraph implements BackwardRule
     public ExtendedIterator<Triple> find(TriplePattern pattern) {
         return findWithContinuation(pattern, null);
     }
-        
+
     /**
      * Add one triple to the data graph, run any rules triggered by
      * the new data item, recursively adding any generated triples.
@@ -206,10 +206,10 @@ public class LPBackwardRuleInfGraph extends BaseInfGraph implements BackwardRule
         fdata.getGraph().add(t);
         this.setPreparedState(false);
     }
-     
-    /** 
-     * Removes the triple t (if possible) from the set belonging to this graph. 
-     */   
+
+    /**
+     * Removes the triple t (if possible) from the set belonging to this graph.
+     */
     @Override
     public synchronized void performDelete(Triple t) {
         version++;
@@ -217,9 +217,9 @@ public class LPBackwardRuleInfGraph extends BaseInfGraph implements BackwardRule
         fdata.getGraph().delete(t);
         this.setPreparedState(false);
     }
-       
+
     /**
-     * Set a predicate to be tabled/memoized by the LP engine. 
+     * Set a predicate to be tabled/memoized by the LP engine.
      */
     public void setTabled(Node predicate) {
         engine.tablePredicate(predicate);
@@ -227,7 +227,7 @@ public class LPBackwardRuleInfGraph extends BaseInfGraph implements BackwardRule
             logger.info("LP TABLE " + predicate);
         }
     }
-    
+
 //  =======================================================================
 //   support for proof traces
 
@@ -243,7 +243,7 @@ public class LPBackwardRuleInfGraph extends BaseInfGraph implements BackwardRule
             derivations = null;
         }
     }
-    
+
     /**
      * Return the derivation of at triple.
      * The derivation is a List of DerivationRecords
@@ -256,7 +256,7 @@ public class LPBackwardRuleInfGraph extends BaseInfGraph implements BackwardRule
             return derivations.getAll(t);
         }
     }
-       
+
     /**
      * Set the state of the trace flag. If set to true then rule firings
      * are logged out to the Log at "INFO" level.
@@ -264,14 +264,14 @@ public class LPBackwardRuleInfGraph extends BaseInfGraph implements BackwardRule
     public void setTraceOn(boolean state) {
         engine.setTraceOn(state);
     }
-    
+
     /**
      * Return true if tracing is switched on
      */
     public boolean isTraceOn() {
         return engine.isTraceOn();
     }
-        
+
 //    =======================================================================
 //     Interface between infGraph and the goal processing machinery
 
@@ -291,7 +291,7 @@ public class LPBackwardRuleInfGraph extends BaseInfGraph implements BackwardRule
     public ExtendedIterator<Triple> findDataMatches(TriplePattern pattern) {
         return dataFind.find(pattern);
     }
-            
+
     /**
      * Process a call to a builtin predicate
      * @param clause the Functor representing the call
@@ -301,9 +301,9 @@ public class LPBackwardRuleInfGraph extends BaseInfGraph implements BackwardRule
      */
     @Override
     public boolean processBuiltin(ClauseEntry clause, Rule rule, BindingEnvironment env) {
-        throw new ReasonerException("Internal error in FBLP rule engine, incorrect invocation of building in rule " + rule); 
+        throw new ReasonerException("Internal error in FBLP rule engine, incorrect invocation of building in rule " + rule);
     }
-    
+
     /**
      * Assert a new triple in the deduction graph, bypassing any processing machinery.
      */
@@ -317,13 +317,13 @@ public class LPBackwardRuleInfGraph extends BaseInfGraph implements BackwardRule
      * @param instance the base instance node to which the property applies
      * @param prop the property node whose value is being inferred
      * @param pclass the (optional, can be null) class for the inferred value.
-     * @return the bNode representing the property value 
+     * @return the bNode representing the property value
      */
     @Override
     public Node getTemp(Node instance, Node prop, Node pclass) {
         return tempNodecache.getTemp(instance, prop, pclass);
     }
-    
+
 //    =======================================================================
 //     Rule engine extras
 
diff --git a/jena-core/src/main/java/org/apache/jena/reasoner/rulesys/impl/BFRuleContext.java b/jena-core/src/main/java/org/apache/jena/reasoner/rulesys/impl/BFRuleContext.java
index 047232650c..f5ca007c68 100644
--- a/jena-core/src/main/java/org/apache/jena/reasoner/rulesys/impl/BFRuleContext.java
+++ b/jena-core/src/main/java/org/apache/jena/reasoner/rulesys/impl/BFRuleContext.java
@@ -66,7 +66,7 @@ public class BFRuleContext implements RuleContext {
         env = new BindingStack();
         stack = new ArrayList<>();
         pending = new ArrayList<>();
-        pendingCache = GraphMemFactory.createGraphMem();
+        pendingCache = GraphMemFactory.createDefaultGraph();
     }
 
     /**
diff --git a/jena-core/src/test/java/org/apache/jena/graph/test/GraphTestBase.java b/jena-core/src/test/java/org/apache/jena/graph/test/GraphTestBase.java
index 096bf8685a..b287f9c0d1 100644
--- a/jena-core/src/test/java/org/apache/jena/graph/test/GraphTestBase.java
+++ b/jena-core/src/test/java/org/apache/jena/graph/test/GraphTestBase.java
@@ -173,7 +173,7 @@ public class GraphTestBase extends JenaTestBase
     */
     public static Graph newGraph()
         {
-        Graph result = GraphMemFactory.createGraphMem();
+        Graph result = GraphMemFactory.createDefaultGraphSameValue();
         result.getPrefixMapping().setNsPrefixes( PrefixMapping.Extended );
         return result;
         }
diff --git a/jena-core/src/test/java/org/apache/jena/mem/test/TestCaseBasic.java b/jena-core/src/test/java/org/apache/jena/mem/test/TestCaseBasic.java
deleted file mode 100644
index c5b2148972..0000000000
--- a/jena-core/src/test/java/org/apache/jena/mem/test/TestCaseBasic.java
+++ /dev/null
@@ -1,43 +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 org.apache.jena.mem.test;
-
-import org.apache.jena.rdf.model.ModelFactory ;
-
-public class TestCaseBasic extends org.apache.jena.regression.TestCaseBasic {
-
-    public TestCaseBasic(String name) {
-        super(name);
-    }
-    
-    @Override
-    public void setUp() {
-        m1 = ModelFactory.createDefaultModel();
-        m2 = ModelFactory.createDefaultModel();
-        m3 = ModelFactory.createDefaultModel();
-        m4 = ModelFactory.createDefaultModel();
-    }
-    @Override
-    public void tearDown() {
-    	m1 = null;
-    	m2 = null;
-    	m3 = null;
-    	m4 = null;
-    }
-}
diff --git a/jena-core/src/test/java/org/apache/jena/mem/test/TestCaseBugs.java b/jena-core/src/test/java/org/apache/jena/mem/test/TestCaseBugs.java
deleted file mode 100644
index a9fc3640c5..0000000000
--- a/jena-core/src/test/java/org/apache/jena/mem/test/TestCaseBugs.java
+++ /dev/null
@@ -1,60 +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 org.apache.jena.mem.test;
-
-import org.apache.jena.rdf.model.* ;
-
-public class TestCaseBugs 
-            extends TestCaseBasic {
-                
-    Model model = null;
-
-    public TestCaseBugs(String name) {
-        super(name);
-    }
-    
-    @Override public void setUp() {
-        model = ModelFactory.createDefaultModel();
-    }
-    
-    public void bug36() {
-    // addLiteral deprecated, test suppressed
-//            Resource r    = model.createResource();
-//            Object   oc   = RDFS.Class;
-//            Object   op   = RDF.Property;
-//            
-//            Statement s = model.createLiteralStatement(r, RDF.type, oc);
-//            assertInstanceOf(Resource.class, s.getObject() );
-//            
-//            //s.changeObject(op);
-//            s = model.createLiteralStatement(r, RDF.type, op);
-//            
-//            assertInstanceOf(Resource.class, s.getObject() );
-//            
-//            model.addLiteral(r, RDF.type, oc);
-//            RDFNode n = model.listStatements()
-//                             .nextStatement()
-//                             .getObject();
-//            assertInstanceOf(Resource.class, n );
-//            
-//            assertTrue(model.listResourcesWithProperty(RDF.type, oc).hasNext());
-//            
-//            assertTrue(model.containsLiteral(r, RDF.type, oc));  
-         }
-}
diff --git a/jena-core/src/test/java/org/apache/jena/mem/test/TestGraphMem2.java b/jena-core/src/test/java/org/apache/jena/mem/test/TestGraphMem2.java
deleted file mode 100644
index 3d943424df..0000000000
--- a/jena-core/src/test/java/org/apache/jena/mem/test/TestGraphMem2.java
+++ /dev/null
@@ -1,101 +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 org.apache.jena.mem.test;
-
-import java.util.Iterator ;
-
-import junit.framework.TestSuite ;
-import org.apache.jena.graph.* ;
-import org.apache.jena.graph.test.AbstractTestGraph ;
-import org.apache.jena.util.iterator.ExtendedIterator ;
-
-public class TestGraphMem2 extends AbstractTestGraph
-    {
-    public TestGraphMem2(String name)
-        { super( name ); }
-    
-    public static TestSuite suite()
-    { return new TestSuite( TestGraphMem2.class ); }
-    
-    @Override
-    public Graph getNewGraph() { return GraphMemFactory.createGraphMem(); }
-    
-    public void testBrokenIndexes()
-        {
-        Graph g = getGraphWith( "x R y; x S z" );
-        ExtendedIterator<Triple> it = g.find( Node.ANY, Node.ANY, Node.ANY );
-        it.removeNext(); it.removeNext();
-        assertFalse( g.find( node( "x" ), Node.ANY, Node.ANY ).hasNext() );
-        assertFalse( g.find( Node.ANY, node( "R" ), Node.ANY ).hasNext() );
-        assertFalse( g.find( Node.ANY, Node.ANY, node( "y" ) ).hasNext() );
-        }   
-            
-    public void testBrokenSubject()
-        {
-        Graph g = getGraphWith( "x brokenSubject y" );
-        ExtendedIterator<Triple> it = g.find( node( "x" ), Node.ANY, Node.ANY );
-        it.removeNext();
-        assertFalse( g.find( Node.ANY, Node.ANY, Node.ANY ).hasNext() );
-        }
-        
-    public void testBrokenPredicate()
-        {
-        Graph g = getGraphWith( "x brokenPredicate y" );
-        ExtendedIterator<Triple> it = g.find( Node.ANY, node( "brokenPredicate"), Node.ANY );
-        it.removeNext();
-        assertFalse( g.find( Node.ANY, Node.ANY, Node.ANY ).hasNext() );
-        }
-        
-    public void testBrokenObject()
-        {
-        Graph g = getGraphWith( "x brokenObject y" );
-        ExtendedIterator<Triple> it = g.find( Node.ANY, Node.ANY, node( "y" ) );
-        it.removeNext();
-        assertFalse( g.find( Node.ANY, Node.ANY, Node.ANY ).hasNext() );
-        }
-    
-    public void testSizeAfterRemove() 
-        {
-        Graph g = getGraphWith( "x p y" );
-        ExtendedIterator<Triple> it = g.find( triple( "x ?? ??" ) );
-        it.removeNext();
-        assertEquals( 0, g.size() );        
-        }
-    
-    public void testUnnecessaryMatches() 
-        {
-        Node special = new Node_URI( "eg:foo" ) 
-            {
-            @Override
-            public boolean matches( Node s ) 
-                {
-                fail( "Matched called superfluously." );
-                return true;
-                }
-            };
-        Graph g = getGraphWith( "x p y" );
-        g.add( Triple.create( special, special, special ) );
-        exhaust( g.find( special, Node.ANY, Node.ANY ) );
-        exhaust( g.find( Node.ANY, special, Node.ANY ) );
-        exhaust( g.find( Node.ANY, Node.ANY, special ) );
-    }
-    
-    protected void exhaust( Iterator<?> it )
-        { while (it.hasNext()) it.next(); }
-    }
diff --git a/jena-core/src/test/java/org/apache/jena/mem/test/TestGraphMemValue.java b/jena-core/src/test/java/org/apache/jena/mem/test/TestGraphMemModel.java
similarity index 84%
rename from jena-core/src/test/java/org/apache/jena/mem/test/TestGraphMemValue.java
rename to jena-core/src/test/java/org/apache/jena/mem/test/TestGraphMemModel.java
index 1b8f8ebd6d..75797fb17e 100644
--- a/jena-core/src/test/java/org/apache/jena/mem/test/TestGraphMemValue.java
+++ b/jena-core/src/test/java/org/apache/jena/mem/test/TestGraphMemModel.java
@@ -23,14 +23,12 @@ import static org.apache.jena.testing_framework.GraphHelper.txnCommit;
 import static org.apache.jena.testing_framework.GraphHelper.txnRollback;
 import static org.apache.jena.testing_framework.GraphHelper.txnRun;
 
+import java.util.Iterator;
 import java.util.Set;
 
 import junit.framework.JUnit4TestAdapter;
 import org.apache.jena.atlas.iterator.Iter;
-import org.apache.jena.graph.Graph;
-import org.apache.jena.graph.Node;
-import org.apache.jena.graph.NodeFactory;
-import org.apache.jena.graph.Triple;
+import org.apache.jena.graph.*;
 import org.apache.jena.graph.impl.LiteralLabelFactory;
 import org.apache.jena.graph.test.AbstractTestGraph;
 import org.apache.jena.mem.GraphMem ;
@@ -46,19 +44,18 @@ import org.junit.Test;
  * Jena5+ : Only {@link GraphMem} supports this. Other graph are "same term", not "same value"
  * and language tags are held in canonical form.
  */
-public class TestGraphMemValue extends AbstractTestGraph {
-    public TestGraphMemValue(String name) {
+public class TestGraphMemModel extends AbstractTestGraph {
+    public TestGraphMemModel(String name) {
         super(name);
     }
 
     public static junit.framework.Test suite() {
-        return new JUnit4TestAdapter(TestGraphMemValue.class);
+        return new JUnit4TestAdapter(TestGraphMemModel.class);
     }
 
-    @SuppressWarnings("deprecation")
     @Override
     public Graph getNewGraph() {
-        return new GraphMem();
+        return GraphMemFactory.createGraphMemForModel();
     }
 
     @Test public void testSizeAfterRemove() {
@@ -278,4 +275,62 @@ public class TestGraphMemValue extends AbstractTestGraph {
         literalTypingBasedFindTest("a P '1'xsd:short", 1, "'1'xsd:integer", "'1'xsd:short", true);
         literalTypingBasedFindTest("a P '1'xsd:int", 1, "'1'xsd:integer", "'1'xsd:int", true);
     }
+
+    @Test
+    public void testBrokenIndexes() {
+        Graph g = getGraphWith("x R y; x S z");
+        ExtendedIterator<Triple> it = g.find(Node.ANY, Node.ANY, Node.ANY);
+        it.removeNext();
+        it.removeNext();
+        assertFalse(g.find(node("x"), Node.ANY, Node.ANY).hasNext());
+        assertFalse(g.find(Node.ANY, node("R"), Node.ANY).hasNext());
+        assertFalse(g.find(Node.ANY, Node.ANY, node("y")).hasNext());
+    }
+
+    @Test
+    public void testBrokenSubject() {
+        Graph g = getGraphWith("x brokenSubject y");
+        ExtendedIterator<Triple> it = g.find(node("x"), Node.ANY, Node.ANY);
+        it.removeNext();
+        assertFalse(g.find(Node.ANY, Node.ANY, Node.ANY).hasNext());
+    }
+
+    @Test
+    public void testBrokenPredicate() {
+        Graph g = getGraphWith("x brokenPredicate y");
+        ExtendedIterator<Triple> it = g.find(Node.ANY, node("brokenPredicate"), Node.ANY);
+        it.removeNext();
+        assertFalse(g.find(Node.ANY, Node.ANY, Node.ANY).hasNext());
+    }
+
+    @Test
+    public void testBrokenObject() {
+        Graph g = getGraphWith("x brokenObject y");
+        ExtendedIterator<Triple> it = g.find(Node.ANY, Node.ANY, node("y"));
+        it.removeNext();
+        assertFalse(g.find(Node.ANY, Node.ANY, Node.ANY).hasNext());
+    }
+
+    @Test
+    public void testUnnecessaryMatches() {
+        Node special = new Node_URI("eg:foo") {
+            @Override
+            public boolean matches(Node s) {
+                fail("Matched called superfluously.");
+                return true;
+            }
+        };
+        Graph g = getGraphWith("x p y");
+        g.add(Triple.create(special, special, special));
+        exhaust(g.find(special, Node.ANY, Node.ANY));
+        exhaust(g.find(Node.ANY, special, Node.ANY));
+        exhaust(g.find(Node.ANY, Node.ANY, special));
+    }
+
+    protected void exhaust(Iterator<? > it) {
+        while (it.hasNext())
+            it.next();
+    }
 }
+
+
diff --git a/jena-core/src/test/java/org/apache/jena/mem/test/TestMemPackage.java b/jena-core/src/test/java/org/apache/jena/mem/test/TestPackage_GraphMemValue.java
similarity index 75%
rename from jena-core/src/test/java/org/apache/jena/mem/test/TestMemPackage.java
rename to jena-core/src/test/java/org/apache/jena/mem/test/TestPackage_GraphMemValue.java
index 3cab3cadc1..153a03d134 100644
--- a/jena-core/src/test/java/org/apache/jena/mem/test/TestMemPackage.java
+++ b/jena-core/src/test/java/org/apache/jena/mem/test/TestPackage_GraphMemValue.java
@@ -18,25 +18,22 @@
 
 package org.apache.jena.mem.test;
 
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
 
-/**
-     TestMemPackage
- */
-public class TestMemPackage extends TestCase
+import junit.framework.*;
+
+public class TestPackage_GraphMemValue extends TestCase
     {
-    public TestMemPackage( String name )
-        { super( name ); }
-    
     public static TestSuite suite()
-        { 
+        {
         TestSuite result = new TestSuite();
+        result.addTest( TestGraphMemModel.suite() );
         result.addTest( TestGraphTripleStoreMem.suite() );
-        result.addTest( new TestSuite( TestArrayTripleBunch.class ) );
-        result.addTest( new TestSuite( TestHashedTripleBunch.class ) );
+        result.addTest( TestConcurrentModificationException.suite() );
+        result.addTestSuite( TestArrayTripleBunch.class );
+        result.addTestSuite( TestHashedTripleBunch.class );
         result.addTestSuite( TestHashedBunchMap.class );
         result.addTestSuite( TestHashCommon.class );
+
         return result;
         }
     }
diff --git a/jena-core/src/test/java/org/apache/jena/mem/test/TestTripleBunch.java b/jena-core/src/test/java/org/apache/jena/mem/test/TestTripleBunch.java
index 21a83635f9..92771aa0e7 100644
--- a/jena-core/src/test/java/org/apache/jena/mem/test/TestTripleBunch.java
+++ b/jena-core/src/test/java/org/apache/jena/mem/test/TestTripleBunch.java
@@ -30,7 +30,7 @@ import org.apache.jena.mem.* ;
 import org.apache.jena.util.iterator.ExtendedIterator ;
 
 /**
-    Test triple bunch implementations - NOT YET FINISHED
+    Test triple bunch implementations
 */
 public abstract class TestTripleBunch extends GraphTestBase
     {
diff --git a/jena-core/src/test/java/org/apache/jena/mem/test/TestGraphMemPackage.java b/jena-core/src/test/java/org/apache/jena/mem2/TestPackage_GraphMem2.java
similarity index 65%
rename from jena-core/src/test/java/org/apache/jena/mem/test/TestGraphMemPackage.java
rename to jena-core/src/test/java/org/apache/jena/mem2/TestPackage_GraphMem2.java
index 768c2a4828..2a4f239f55 100644
--- a/jena-core/src/test/java/org/apache/jena/mem/test/TestGraphMemPackage.java
+++ b/jena-core/src/test/java/org/apache/jena/mem2/TestPackage_GraphMem2.java
@@ -16,19 +16,17 @@
  * limitations under the License.
  */
 
-package org.apache.jena.mem.test;
+package org.apache.jena.mem2;
 
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
 
-import junit.framework.*;
-
-public class TestGraphMemPackage extends TestCase
-    {
-    public static TestSuite suite()
-        { 
-        TestSuite result = new TestSuite();
-        result.addTest( TestGraphMemValue.suite() );
-        result.addTest( TestGraphMem2.suite() );
-        result.addTest( TestConcurrentModificationException.suite() );
-        return result;
-        }
-    }
+@RunWith(Suite.class)
+@Suite.SuiteClasses( {
+    GraphMem2LegacyTest.class,
+    GraphMem2FastTest.class,
+    GraphMem2RoaringTest.class,
+    GraphMem2Test.class
+} )
+public class TestPackage_GraphMem2 {
+}
diff --git a/jena-core/src/test/java/org/apache/jena/test/TestPackage_core.java b/jena-core/src/test/java/org/apache/jena/test/TestPackage_core.java
index 01dc167056..be450f9217 100644
--- a/jena-core/src/test/java/org/apache/jena/test/TestPackage_core.java
+++ b/jena-core/src/test/java/org/apache/jena/test/TestPackage_core.java
@@ -34,7 +34,7 @@ public class TestPackage_core extends TestCase {
         RDFReaderFImpl.alternative(new X_RDFReaderF());
 
         TestSuite ts = new TestSuite() ;
-        ts.setName("Jena") ;
+        ts.setName("Jena Core") ;
 
         addTest(ts,  "System setup", TestSystemSetup.suite());
         addTest(ts,  "IRIx", org.apache.jena.irix.TS_IRIx.suite());
@@ -42,8 +42,9 @@ public class TestPackage_core extends TestCase {
         addTest(ts,  "Enhanced", org.apache.jena.enhanced.test.TestPackage_enh.suite());
         addTest(ts,  "Datatypes", org.apache.jena.datatypes.TestPackage_dt.suite());
         addTest(ts,  "Graph", org.apache.jena.graph.test.TestPackage_graph.suite());
-        addTest(ts,  "Mem", org.apache.jena.mem.test.TestMemPackage.suite() );
-        addTest(ts,  "Mem2", org.apache.jena.mem.test.TestGraphMemPackage.suite() );
+
+        addTest(ts,  "Mem",  org.apache.jena.mem.test.TestPackage_GraphMemValue.suite() );
+
         addTest(ts,  "Model", org.apache.jena.rdf.model.test.TestPackage_model.suite());
         addTest(ts,  "StandardModels", org.apache.jena.rdf.model.test.TestStandardModels.suite() );
 


(jena) 04/06: GH-3236: jena-core tests: Suppress warnings about GraphMem

Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

andy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git

commit 6769071540b21aa31e4eded63252b0255a996744
Author: Andy Seaborne <an...@apache.org>
AuthorDate: Tue Jun 3 09:45:31 2025 +0100

    GH-3236: jena-core tests: Suppress warnings about GraphMem
---
 .../main/java/org/apache/jena/mem/GraphMem.java    |   2 +
 .../org/apache/jena/enhanced/test/TS3_enh.java     | 205 +++++-----
 .../java/org/apache/jena/graph/TestGraphUtil.java  |   6 +-
 .../jena/graph/compose/test/TestCaseBasic.java     |  10 +-
 .../apache/jena/graph/compose/test/TestDyadic.java |  98 ++---
 .../java/org/apache/jena/graph/test/TS3_graph.java |   1 +
 .../java/org/apache/jena/graph/test/TestGraph.java |   8 +-
 .../apache/jena/graph/test/TestGraphListener.java  |   3 +-
 .../org/apache/jena/graph/test/TestGraphPlain.java |   2 +-
 .../test/TestNodeCreateStrings.java}               |   6 +-
 .../java/org/apache/jena/langtagx/TS_LangTagX.java |   3 -
 .../rdf/model/test/AbstractContainerMethods.java   | 237 +++++------
 .../jena/rdf/model/test/AbstractModelTestBase.java | 253 ++++++------
 .../jena/rdf/model/test/AbstractTestModel.java     | 313 +++++++--------
 .../jena/rdf/model/test/AbstractTestPackage.java   | 205 +++++-----
 .../apache/jena/rdf/model/test/ModelTestBase.java  | 434 +++++++++------------
 .../org/apache/jena/rdf/model/test/TS3_Model1.java |   1 +
 .../jena/rdf/model/test/TS3_StandardModels.java    |  26 +-
 .../reasoner/rulesys/impl/TestLPBRuleEngine.java   |  11 +-
 .../rulesys/impl/TestLPBRuleEngineLeak.java        |  23 +-
 .../rulesys/impl/TestRestartableLBRule.java        |   7 +-
 .../jena/reasoner/rulesys/test/DebugOWL.java       | 104 ++---
 .../jena/reasoner/rulesys/test/DebugRules.java     |  18 +-
 .../reasoner/rulesys/test/TestBackchainer.java     | 407 +++++++++----------
 .../jena/reasoner/rulesys/test/TestBasicLP.java    | 259 ++++++------
 .../jena/reasoner/rulesys/test/TestBasics.java     |  29 +-
 .../jena/reasoner/rulesys/test/TestFBRules.java    |  75 ++--
 .../reasoner/rulesys/test/TestGenericRules.java    | 174 +++++----
 .../reasoner/rulesys/test/TestLPDerivation.java    |  55 +--
 .../jena/reasoner/rulesys/test/TestRDFS9.java      |  21 +-
 .../jena/reasoner/rulesys/test/TestRETE.java       |  99 ++---
 .../apache/jena/reasoner/test/ReasonerTester.java  |   4 +-
 .../apache/jena/reasoner/test/TestReasoners.java   |  21 +-
 .../jena/reasoner/test/WGReasonerTester.java       |   2 +-
 ...estSharedPackage.java => TS_SharedPackage.java} |   2 +-
 .../org/apache/jena/test/TestPackage_core.java     |  57 +--
 .../apache/jena/testing_framework/GraphHelper.java |   2 +-
 .../test/turtle/TurtleTestSuiteManifest.java       |   5 +-
 .../apache/jena/util/TestPrefixMappingUtils.java   |   2 +-
 39 files changed, 1541 insertions(+), 1649 deletions(-)

diff --git a/jena-core/src/main/java/org/apache/jena/mem/GraphMem.java b/jena-core/src/main/java/org/apache/jena/mem/GraphMem.java
index 2f2d4ea9d3..ff5f7de363 100644
--- a/jena-core/src/main/java/org/apache/jena/mem/GraphMem.java
+++ b/jena-core/src/main/java/org/apache/jena/mem/GraphMem.java
@@ -36,6 +36,8 @@ import java.util.stream.Stream;
  */
 @Deprecated
 public class GraphMem extends GraphMemBase {
+    // Rename as GraphMemValue.
+
     /**
      This Graph's TripleStore. Visible for <i>read-only</i> purposes only.
      */
diff --git a/jena-core/src/test/java/org/apache/jena/enhanced/test/TS3_enh.java b/jena-core/src/test/java/org/apache/jena/enhanced/test/TS3_enh.java
index 60f7c1b1ac..e71236b06c 100644
--- a/jena-core/src/test/java/org/apache/jena/enhanced/test/TS3_enh.java
+++ b/jena-core/src/test/java/org/apache/jena/enhanced/test/TS3_enh.java
@@ -83,23 +83,28 @@ public class TS3_enh extends GraphTestBase  {
         broken.add( TestProperty.class, TestObjectImpl.factory );
 	}
     /** Creates a new instance of EnhancedTestSuite */
-   	public TS3_enh(String name)
-		{
-		super( name );
-		}
+    public TS3_enh(String name) {
+        super(name);
+    }
+
+    public static TestSuite suite() {
+        return new TestSuite(TS3_enh.class);
+    }
 
-    public static TestSuite suite()
-        { return new TestSuite( TS3_enh.class ); }
+    // Create the graph to test.
+    // These are model tests so use a same-value model.
+    private static Graph graphToTest() {
+        return GraphMemFactory.createDefaultGraphSameValue();
+    }
 
     /**
-        test that equals works on an EnhNode (after hedgehog introduced FrontsNode
-        it didn't).
-    */
-    public void testEquals()
-        {
-        EnhNode a = new EnhNode( NodeCreateUtils.create( "eg:example" ), null );
-        assertEquals( a, a );
-        }
+     * test that equals works on an EnhNode (after hedgehog introduced FrontsNode it
+     * didn't).
+     */
+    public void testEquals() {
+        EnhNode a = new EnhNode(NodeCreateUtils.create("eg:example"), null);
+        assertEquals(a, a);
+    }
 
     /**
      * View n as intf. This is supported iff rslt.
@@ -140,7 +145,7 @@ public class TS3_enh extends GraphTestBase  {
      *  The methods tested are as and supports.
      */
     private static void basic(String title, Personality<RDFNode> p) {
-        Graph g = GraphMemFactory.createGraphMem();
+        Graph g = graphToTest();
         TestModel model =  new TestModelImpl(g,p);
         // create some data
         graphAdd( g, "x R y;" );
@@ -236,7 +241,7 @@ public class TS3_enh extends GraphTestBase  {
 	}
 
     private void follow(String title, Personality<RDFNode> p) {
-        Graph g = GraphMemFactory.createGraphMem();
+        Graph g = graphToTest();
         TestModel model =  new TestModelImpl(g,p);
         // create some data
         graphAdd( g, "a b c;" );
@@ -307,7 +312,7 @@ public class TS3_enh extends GraphTestBase  {
     	// bitOfBoth is a surprising personality ...
     	// we can have two different java objects implementing the same interface.
 
-		Graph g = GraphMemFactory.createGraphMem();
+		Graph g = graphToTest();
 		TestModel model =  new TestModelImpl(g,bitOfBoth);
 		// create some data
 		graphAdd( g, "a a a;" );
@@ -378,96 +383,98 @@ public class TS3_enh extends GraphTestBase  {
 
         @Override
         public Object visitWith( RDFVisitor rv )
-            { return null; }
-        }
-
-        public void testSimple() {
-            Graph g = GraphMemFactory.createGraphMem();
-            Personality<RDFNode> ours = BuiltinPersonalities.model.copy().add(Example.class, Example.factory);
-            EnhGraph eg = new EnhGraph(g, ours);
-            Node n = NodeFactory.createURI("spoo:bar");
-            EnhNode eNode = new EnhNode(NodeFactory.createURI("spoo:bar"), eg);
-            EnhNode eBlank = new EnhNode(NodeFactory.createBlankNode(), eg);
-            assertTrue("URI node can be an Example", eNode.supports(Example.class));
-            assertFalse("Blank node cannot be an Example", eBlank.supports(Example.class));
-        }
+        { return null; }
+    }
 
-        static class AnotherExample {
-            static final Implementation factory = new Implementation() {
-                @Override
-                public EnhNode wrap(Node n, EnhGraph g) {
-                    return new EnhNode(n, g);
-                }
-
-                @Override
-                public boolean canWrap(Node n, EnhGraph g) {
-                    return n.isURI();
-                }
-            };
-        }
+    public void testSimple() {
+        Graph g = graphToTest();
+        Personality<RDFNode> ours = BuiltinPersonalities.model.copy().add(Example.class, Example.factory);
+        EnhGraph eg = new EnhGraph(g, ours);
+        Node n = NodeFactory.createURI("spoo:bar");
+        EnhNode eNode = new EnhNode(NodeFactory.createURI("spoo:bar"), eg);
+        EnhNode eBlank = new EnhNode(NodeFactory.createBlankNode(), eg);
+        assertTrue("URI node can be an Example", eNode.supports(Example.class));
+        assertFalse("Blank node cannot be an Example", eBlank.supports(Example.class));
+    }
 
-        public void testAlreadyLinkedViewException() {
-            Graph g = GraphMemFactory.createGraphMem();
-            Personality<RDFNode> ours = BuiltinPersonalities.model.copy().add(Example.class, Example.factory);
-            EnhGraph eg = new EnhGraph(g, ours);
-            Node n = NodeCreateUtils.create("spoo:bar");
-            EnhNode eNode = new Example(n, eg);
-            EnhNode multiplexed = new Example(n, eg);
-            multiplexed.as(Property.class);
-            eNode.viewAs(Example.class);
-            try {
-                eNode.addView(multiplexed);
-                fail("should raise an AlreadyLinkedViewException ");
-            } catch (AlreadyLinkedViewException e) {}
-        }
+    static class AnotherExample {
+        static final Implementation factory = new Implementation() {
+            @Override
+            public EnhNode wrap(Node n, EnhGraph g) {
+                return new EnhNode(n, g);
+            }
 
-        /**
-         * Test that an attempt to polymorph an enhanced node into a class that isn't
-         * supported by the enhanced graph generates an UnsupportedPolymorphism
-         * exception.
-         */
-        public void testNullPointerTrap() {
-            EnhGraph eg = new EnhGraph(GraphMemFactory.createGraphMem(), new Personality<RDFNode>());
-            Node n = NodeCreateUtils.create("eh:something");
-            EnhNode en = new EnhNode(n, eg);
-            try {
-                en.as(Property.class);
-                fail("oops");
-            } catch (UnsupportedPolymorphismException e) {
-                assertEquals(en, e.getBadNode());
-                assertTrue("exception should have cuplprit graph", eg == ((EnhNode)e.getBadNode()).getGraph());
-                assertSame("exception should have culprit class", Property.class, e.getBadClass());
+            @Override
+            public boolean canWrap(Node n, EnhGraph g) {
+                return n.isURI();
             }
-        }
+        };
+    }
 
-        public void testNullPointerTrapInCanSupport() {
-            EnhGraph eg = new EnhGraph(GraphMemFactory.createGraphMem(), new Personality<RDFNode>());
-            Node n = NodeCreateUtils.create("eh:something");
-            EnhNode en = new EnhNode(n, eg);
-            assertFalse(en.canAs(Property.class));
-        }
+    public void testAlreadyLinkedViewException() {
+        Graph g = graphToTest();
+        Personality<RDFNode> ours = BuiltinPersonalities.model.copy().add(Example.class, Example.factory);
+        EnhGraph eg = new EnhGraph(g, ours);
+        Node n = NodeCreateUtils.create("spoo:bar");
+        EnhNode eNode = new Example(n, eg);
+        EnhNode multiplexed = new Example(n, eg);
+        multiplexed.as(Property.class);
+        eNode.viewAs(Example.class);
+        try {
+            eNode.addView(multiplexed);
+            fail("should raise an AlreadyLinkedViewException ");
+        } catch (AlreadyLinkedViewException e) {}
+    }
 
-        public void testAsToOwnClassWithNoModel() {
-            Resource r = ResourceFactory.createResource();
-            assertEquals(null, r.getModel());
-            assertTrue(r.canAs(Resource.class));
-            assertSame(r, r.as(Resource.class));
+    /**
+     * Test that an attempt to polymorph an enhanced node into a class that isn't
+     * supported by the enhanced graph generates an UnsupportedPolymorphism
+     * exception.
+     */
+    public void testNullPointerTrap() {
+        Graph g = graphToTest();
+        EnhGraph eg = new EnhGraph(g, new Personality<RDFNode>());
+        Node n = NodeCreateUtils.create("eh:something");
+        EnhNode en = new EnhNode(n, eg);
+        try {
+            en.as(Property.class);
+            fail("oops");
+        } catch (UnsupportedPolymorphismException e) {
+            assertEquals(en, e.getBadNode());
+            assertTrue("exception should have cuplprit graph", eg == ((EnhNode)e.getBadNode()).getGraph());
+            assertSame("exception should have culprit class", Property.class, e.getBadClass());
         }
+    }
 
-        public void testCanAsReturnsFalseIfNoModel() {
-            Resource r = ResourceFactory.createResource();
-            assertEquals(false, r.canAs(Example.class));
-        }
+    public void testNullPointerTrapInCanSupport() {
+        Graph g = graphToTest();
+        EnhGraph eg = new EnhGraph(g, new Personality<RDFNode>());
+        Node n = NodeCreateUtils.create("eh:something");
+        EnhNode en = new EnhNode(n, eg);
+        assertFalse(en.canAs(Property.class));
+    }
 
-        public void testAsThrowsPolymorphismExceptionIfNoModel() {
-            Resource r = ResourceFactory.createResource();
-            try {
-                r.as(Example.class);
-                fail("should throw UnsupportedPolymorphismException");
-            } catch (UnsupportedPolymorphismException e) {
-                assertTrue(e.getBadNode() instanceof EnhNode);
-                assertEquals(null, ((EnhNode)e.getBadNode()).getGraph());
-                assertEquals(Example.class, e.getBadClass());
-            }
+    public void testAsToOwnClassWithNoModel() {
+        Resource r = ResourceFactory.createResource();
+        assertEquals(null, r.getModel());
+        assertTrue(r.canAs(Resource.class));
+        assertSame(r, r.as(Resource.class));
+    }
+
+    public void testCanAsReturnsFalseIfNoModel() {
+        Resource r = ResourceFactory.createResource();
+        assertEquals(false, r.canAs(Example.class));
+    }
+
+    public void testAsThrowsPolymorphismExceptionIfNoModel() {
+        Resource r = ResourceFactory.createResource();
+        try {
+            r.as(Example.class);
+            fail("should throw UnsupportedPolymorphismException");
+        } catch (UnsupportedPolymorphismException e) {
+            assertTrue(e.getBadNode() instanceof EnhNode);
+            assertEquals(null, ((EnhNode)e.getBadNode()).getGraph());
+            assertEquals(Example.class, e.getBadClass());
         }
+    }
 }
diff --git a/jena-core/src/test/java/org/apache/jena/graph/TestGraphUtil.java b/jena-core/src/test/java/org/apache/jena/graph/TestGraphUtil.java
index 4223d8b2bc..8d8ca27d73 100644
--- a/jena-core/src/test/java/org/apache/jena/graph/TestGraphUtil.java
+++ b/jena-core/src/test/java/org/apache/jena/graph/TestGraphUtil.java
@@ -30,14 +30,14 @@ public class TestGraphUtil {
     private static Graph graph2 = make(2);
 
     private static Graph make(int N) {
-        Graph graph = GraphMemFactory.createGraphMem();
+        Graph graph = GraphMemFactory.createDefaultGraph();
         for ( int i = 0 ; i < N ; i++ ) {
             Triple t = GraphTestBase.triple("a P 'x"+i+"'");
             graph.add(t);
         }
         return graph ;
     }
-    
+
     @Test public void compareSizeTo_1() {
         assertEquals(1, GraphUtil.compareSizeTo(graph2, 0));
         assertEquals(1, GraphUtil.compareSizeTo(graph2, 1));
@@ -45,7 +45,7 @@ public class TestGraphUtil {
         assertEquals(-1, GraphUtil.compareSizeTo(graph2, 3));
         assertEquals(-1, GraphUtil.compareSizeTo(graph2, 4));
     }
-    
+
     @Test public void compareSizeTo_2() {
         assertEquals(1, GraphUtil.compareSizeTo(graph1, 0));
         assertEquals(0, GraphUtil.compareSizeTo(graph1, 1));
diff --git a/jena-core/src/test/java/org/apache/jena/graph/compose/test/TestCaseBasic.java b/jena-core/src/test/java/org/apache/jena/graph/compose/test/TestCaseBasic.java
index eb8529bff4..fe559b4780 100755
--- a/jena-core/src/test/java/org/apache/jena/graph/compose/test/TestCaseBasic.java
+++ b/jena-core/src/test/java/org/apache/jena/graph/compose/test/TestCaseBasic.java
@@ -23,22 +23,22 @@ import java.lang.reflect.*;
 import org.apache.jena.graph.* ;
 import org.apache.jena.rdf.model.ModelFactory ;
 
-public class TestCaseBasic extends org.apache.jena.regression.TestCaseBasic 
+public class TestCaseBasic extends org.apache.jena.regression.TestCaseBasic
 	{
     private Class<? extends Graph> graphClass;
 
-    public TestCaseBasic(String name, Class<? extends Graph> graphClass) 
+    public TestCaseBasic(String name, Class<? extends Graph> graphClass)
     	{
         super(name);
         this.graphClass = graphClass;
     	}
-    
+
     private Graph newGraph( Constructor< ? extends Graph> cons ) throws Exception
     	{
     	return cons.newInstance
-            ( GraphMemFactory.createGraphMem(), GraphMemFactory.createGraphMem() );
+            ( GraphMemFactory.createDefaultGraph(), GraphMemFactory.createDefaultGraph() );
     	}
-    	
+
     @Override public void setUp() throws Exception
     	{
 		Constructor< ? extends Graph> constructor = graphClass.getConstructor
diff --git a/jena-core/src/test/java/org/apache/jena/graph/compose/test/TestDyadic.java b/jena-core/src/test/java/org/apache/jena/graph/compose/test/TestDyadic.java
index 132913137e..37996e509a 100755
--- a/jena-core/src/test/java/org/apache/jena/graph/compose/test/TestDyadic.java
+++ b/jena-core/src/test/java/org/apache/jena/graph/compose/test/TestDyadic.java
@@ -26,54 +26,56 @@ import org.apache.jena.graph.compose.* ;
 import org.apache.jena.graph.test.* ;
 import org.apache.jena.util.iterator.* ;
 
-public abstract class TestDyadic extends AbstractTestGraph
-	{
-	public TestDyadic( String name )
-		{ super( name ); }
-		
-	
-	public static TestSuite suite()
-    	{ return new TestSuite( TestDyadic.class ); }
-    
+public abstract class TestDyadic extends AbstractTestGraph {
+    public TestDyadic(String name) {
+        super(name);
+    }
 
-	static private ExtendedIterator<String> things( final String x ) 
-		{
-		return new NiceIterator<String>()
-			{
-			private StringTokenizer tokens = new StringTokenizer( x );
-			@Override public boolean hasNext() { return tokens.hasMoreTokens(); }
-			@Override public String next() { return tokens.nextToken(); }
-			};
-		}
-	
-	/**
-	 * Test the things() iterator generating utility function.
-	 */
-	public void testThings()
-		{
-		ExtendedIterator<String> it1 = things( "now is the time" );
-		ExtendedIterator<String> it2 = things( "now is the time" );
-		ExtendedIterator<String> mt1 = things( "" );
-		ExtendedIterator<String> mt2 = things( "" );
-		assertEquals( "mt1.hasNext()", false, mt1.hasNext() );
-		assertEquals( "mt2.hasNext()", false, mt2.hasNext() );
-		assertEquals( "andThen(mt1,mt2).hasNext()", false, mt1.andThen( mt2 ).hasNext() ); 		
-		assertEquals( "butNot(it1,it2).hasNext()", false, CompositionBase.butNot( it1, it2 ).hasNext() );
-		assertEquals( "x y z @butNot z", true, CompositionBase.butNot( things( "x y z" ), things( "z" ) ).hasNext() );
-		assertEquals( "x y z @butNot a", true, CompositionBase.butNot( things( "x y z" ), things( "z" ) ).hasNext() );
-		}
-    
-    public void testDyadicOperands()
-        {
-        Graph g = GraphMemFactory.createGraphMem(), h = GraphMemFactory.createGraphMem();
-        Dyadic d = new Dyadic( g, h )
-            {
-            @Override protected ExtendedIterator<Triple> _graphBaseFind( Triple m ) { return null; }
-            };
-        assertSame( g, d.getL() );
-        assertSame( h, d.getR() );
-        }
+    public static TestSuite suite() {
+        return new TestSuite(TestDyadic.class);
+    }
 
+    static private ExtendedIterator<String> things(final String x) {
+        return new NiceIterator<String>() {
+            private StringTokenizer tokens = new StringTokenizer(x);
+            @Override
+            public boolean hasNext() {
+                return tokens.hasMoreTokens();
+            }
 
-	
-	}
+            @Override
+            public String next() {
+                return tokens.nextToken();
+            }
+        };
+    }
+
+    /**
+     * Test the things() iterator generating utility function.
+     */
+    public void testThings() {
+        ExtendedIterator<String> it1 = things("now is the time");
+        ExtendedIterator<String> it2 = things("now is the time");
+        ExtendedIterator<String> mt1 = things("");
+        ExtendedIterator<String> mt2 = things("");
+        assertEquals("mt1.hasNext()", false, mt1.hasNext());
+        assertEquals("mt2.hasNext()", false, mt2.hasNext());
+        assertEquals("andThen(mt1,mt2).hasNext()", false, mt1.andThen(mt2).hasNext());
+        assertEquals("butNot(it1,it2).hasNext()", false, CompositionBase.butNot(it1, it2).hasNext());
+        assertEquals("x y z @butNot z", true, CompositionBase.butNot(things("x y z"), things("z")).hasNext());
+        assertEquals("x y z @butNot a", true, CompositionBase.butNot(things("x y z"), things("z")).hasNext());
+    }
+
+    public void testDyadicOperands() {
+        Graph g = GraphMemFactory.createDefaultGraph();
+        Graph h = GraphMemFactory.createDefaultGraph();
+        Dyadic d = new Dyadic(g, h) {
+            @Override
+            protected ExtendedIterator<Triple> _graphBaseFind(Triple m) {
+                return null;
+            }
+        };
+        assertSame(g, d.getL());
+        assertSame(h, d.getR());
+    }
+}
diff --git a/jena-core/src/test/java/org/apache/jena/graph/test/TS3_graph.java b/jena-core/src/test/java/org/apache/jena/graph/test/TS3_graph.java
index 94217962ee..6ce9b1dd80 100644
--- a/jena-core/src/test/java/org/apache/jena/graph/test/TS3_graph.java
+++ b/jena-core/src/test/java/org/apache/jena/graph/test/TS3_graph.java
@@ -27,6 +27,7 @@ import org.junit.runners.Suite;
     TestLiteralLabels.class,
     TestLiteralLabelSameValueAs.class,
     TestNode.class,
+    TestNodeCreateStrings.class,
     TestTriple.class,
     TestTripleField.class,
     TestNodeToTriplesMapMem.class,
diff --git a/jena-core/src/test/java/org/apache/jena/graph/test/TestGraph.java b/jena-core/src/test/java/org/apache/jena/graph/test/TestGraph.java
index 333380cb37..afb869102c 100644
--- a/jena-core/src/test/java/org/apache/jena/graph/test/TestGraph.java
+++ b/jena-core/src/test/java/org/apache/jena/graph/test/TestGraph.java
@@ -71,12 +71,11 @@ public class TestGraph extends GraphTestBase
         { return MetaTestGraph.suite( classWithTests, graphClass ); }
 
     /**
-        Trivial [incomplete] test that a Wrapped graph pokes through to the underlying
-        graph. Really want something using mock classes. Will think about it.
+        Trivial [incomplete] test that a Wrapped graph pokes through to the underlying graph.
     */
     public void testWrappedSame()
         {
-        Graph m = GraphMemFactory.createGraphMem();
+        Graph m = GraphMemFactory.createDefaultGraph();
         Graph w = new WrappedGraph( m );
         graphAdd( m, "a trumps b; c eats d" );
         assertIsomorphic( m, w );
@@ -89,7 +88,8 @@ public class TestGraph extends GraphTestBase
     */
     public static class WrappedGraphMem extends WrappedGraph
         {
+        @SuppressWarnings("removal")
         public WrappedGraphMem( )
-            { super( GraphMemFactory.createGraphMem( ) ); }
+            { super( GraphMemFactory.createGraphMem() ); }
         }
     }
diff --git a/jena-core/src/test/java/org/apache/jena/graph/test/TestGraphListener.java b/jena-core/src/test/java/org/apache/jena/graph/test/TestGraphListener.java
index 7f2d13fe99..17a24eecfa 100644
--- a/jena-core/src/test/java/org/apache/jena/graph/test/TestGraphListener.java
+++ b/jena-core/src/test/java/org/apache/jena/graph/test/TestGraphListener.java
@@ -144,8 +144,7 @@ public class TestGraphListener extends MetaTestGraph {
 
     @Override
 	public Graph getNewGraph() {
-    	Graph g = GraphMemFactory.createGraphMem();
-
+    	Graph g = GraphMemFactory.createDefaultGraph();
     	g.getEventManager().register(new CheckChanges("simple tracking",g));
 	    return g;
 	}
diff --git a/jena-core/src/test/java/org/apache/jena/graph/test/TestGraphPlain.java b/jena-core/src/test/java/org/apache/jena/graph/test/TestGraphPlain.java
index a2996d4cd6..c926f06b24 100644
--- a/jena-core/src/test/java/org/apache/jena/graph/test/TestGraphPlain.java
+++ b/jena-core/src/test/java/org/apache/jena/graph/test/TestGraphPlain.java
@@ -41,7 +41,7 @@ public class TestGraphPlain {
     private static Graph graph;
 
     @BeforeClass public static void setUp() {
-        // GraphMem is the old in-memeory graph which has value-based indexing.
+        // GraphMem is the old in-memory graph which has value-based indexing.
         // It is not the default graph implementation.
         graph = new org.apache.jena.mem.GraphMem();
         if ( ! graph.getCapabilities().handlesLiteralTyping() )
diff --git a/jena-core/src/test/java/org/apache/jena/test/TestModelUtil.java b/jena-core/src/test/java/org/apache/jena/graph/test/TestNodeCreateStrings.java
similarity index 96%
rename from jena-core/src/test/java/org/apache/jena/test/TestModelUtil.java
rename to jena-core/src/test/java/org/apache/jena/graph/test/TestNodeCreateStrings.java
index 97d46e4dc4..ba66617231 100644
--- a/jena-core/src/test/java/org/apache/jena/test/TestModelUtil.java
+++ b/jena-core/src/test/java/org/apache/jena/graph/test/TestNodeCreateStrings.java
@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-package org.apache.jena.test;
+package org.apache.jena.graph.test;
 
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
@@ -26,7 +26,9 @@ import org.apache.jena.graph.NodeFactory;
 import org.apache.jena.rdf.model.impl.Util;
 import org.junit.Test;
 
-public class TestModelUtil {
+
+/** Testing making string-like RDF terms */
+public class TestNodeCreateStrings {
 
     // -- xsd:string
 
diff --git a/jena-core/src/test/java/org/apache/jena/langtagx/TS_LangTagX.java b/jena-core/src/test/java/org/apache/jena/langtagx/TS_LangTagX.java
index b07b9517e9..abf098a1b9 100644
--- a/jena-core/src/test/java/org/apache/jena/langtagx/TS_LangTagX.java
+++ b/jena-core/src/test/java/org/apache/jena/langtagx/TS_LangTagX.java
@@ -21,9 +21,6 @@ package org.apache.jena.langtagx;
 import org.junit.runner.RunWith;
 import org.junit.runners.Suite;
 
-import junit.framework.JUnit4TestAdapter;
-import junit.framework.TestSuite;
-
 //JUnit5. Does not mix with JUnit3. So until jena-core updates to JUnit 4 or 5 ...
 //@Suite
 //@SelectClasses({
diff --git a/jena-core/src/test/java/org/apache/jena/rdf/model/test/AbstractContainerMethods.java b/jena-core/src/test/java/org/apache/jena/rdf/model/test/AbstractContainerMethods.java
index 9fd1034110..01016ebca9 100644
--- a/jena-core/src/test/java/org/apache/jena/rdf/model/test/AbstractContainerMethods.java
+++ b/jena-core/src/test/java/org/apache/jena/rdf/model/test/AbstractContainerMethods.java
@@ -6,9 +6,9 @@
  * 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.
@@ -18,149 +18,128 @@
 
 package org.apache.jena.rdf.model.test;
 
-import org.apache.jena.rdf.model.Container ;
-import org.apache.jena.rdf.model.Literal ;
-import org.apache.jena.rdf.model.NodeIterator ;
-import org.apache.jena.rdf.model.Resource ;
-import org.apache.jena.rdf.model.test.helpers.TestingModelFactory ;
-import org.apache.jena.vocabulary.RDF ;
+import org.apache.jena.rdf.model.Container;
+import org.apache.jena.rdf.model.Literal;
+import org.apache.jena.rdf.model.NodeIterator;
+import org.apache.jena.rdf.model.Resource;
+import org.apache.jena.rdf.model.test.helpers.TestingModelFactory;
+import org.apache.jena.vocabulary.RDF;
 import org.junit.Assert;
 
-public abstract class AbstractContainerMethods extends AbstractModelTestBase
-{
+public abstract class AbstractContainerMethods extends AbstractModelTestBase {
 
-	protected Resource resource;
+    protected Resource resource;
 
-	public AbstractContainerMethods( final TestingModelFactory modelFactory,
-			final String name )
-	{
-		super(modelFactory, name);
-	}
+    public AbstractContainerMethods(final TestingModelFactory modelFactory, final String name) {
+        super(modelFactory, name);
+    }
 
-	protected abstract Container createContainer();
+    protected abstract Container createContainer();
 
-	protected abstract Resource getContainerType();
+    protected abstract Resource getContainerType();
 
-	@Override
-	public void setUp()
-	{
-		super.setUp();
-		resource = model.createResource();
-	}
+    @Override
+    public void setUp() {
+        super.setUp();
+        resource = model.createResource();
+    }
 
-	public void testContainerOfIntegers()
-	{
-		final int num = 10;
-		final Container c = createContainer();
-		for (int i = 0; i < num; i += 1)
-		{
-			c.add(i);
-		}
-		Assert.assertEquals(num, c.size());
-		final NodeIterator it = c.iterator();
-		for (int i = 0; i < num; i += 1)
-		{
-			Assert.assertEquals(i, ((Literal) it.nextNode()).getInt());
-		}
-		Assert.assertFalse(it.hasNext());
-	}
+    public void testContainerOfIntegers() {
+        final int num = 10;
+        final Container c = createContainer();
+        for ( int i = 0 ; i < num ; i += 1 ) {
+            c.add(i);
+        }
+        Assert.assertEquals(num, c.size());
+        final NodeIterator it = c.iterator();
+        for ( int i = 0 ; i < num ; i += 1 ) {
+            Assert.assertEquals(i, ((Literal)it.nextNode()).getInt());
+        }
+        Assert.assertFalse(it.hasNext());
+    }
 
-	public void testContainerOfIntegersRemovingA()
-	{
-		final boolean[] retain = { true, true, true, false, false, false,
-				false, false, true, true };
-		testContainerOfIntegersWithRemoving(retain);
-	}
+    public void testContainerOfIntegersRemovingA() {
+        final boolean[] retain = {true, true, true, false, false, false, false, false, true, true};
+        testContainerOfIntegersWithRemoving(retain);
+    }
 
-	public void testContainerOfIntegersRemovingB()
-	{
-		final boolean[] retain = { false, true, true, false, false, false,
-				false, false, true, false };
-		testContainerOfIntegersWithRemoving(retain);
-	}
+    public void testContainerOfIntegersRemovingB() {
+        final boolean[] retain = {false, true, true, false, false, false, false, false, true, false};
+        testContainerOfIntegersWithRemoving(retain);
+    }
 
-	public void testContainerOfIntegersRemovingC()
-	{
-		final boolean[] retain = { false, false, false, false, false, false,
-				false, false, false, false };
-		testContainerOfIntegersWithRemoving(retain);
-	}
+    public void testContainerOfIntegersRemovingC() {
+        final boolean[] retain = {false, false, false, false, false, false, false, false, false, false};
+        testContainerOfIntegersWithRemoving(retain);
+    }
 
-	protected void testContainerOfIntegersWithRemoving( final boolean[] retain )
-	{
-		final int num = retain.length;
-		final boolean[] found = new boolean[num];
-		final Container c = createContainer();
-		for (int i = 0; i < num; i += 1)
-		{
-			c.add(i);
-		}
-		final NodeIterator it = c.iterator();
-        for ( boolean aRetain : retain )
-        {
+    protected void testContainerOfIntegersWithRemoving(final boolean[] retain) {
+        final int num = retain.length;
+        final boolean[] found = new boolean[num];
+        final Container c = createContainer();
+        for ( int i = 0 ; i < num ; i += 1 ) {
+            c.add(i);
+        }
+        final NodeIterator it = c.iterator();
+        for ( boolean aRetain : retain ) {
             it.nextNode();
-            if ( aRetain == false )
-            {
+            if ( aRetain == false ) {
                 it.remove();
             }
         }
-		final NodeIterator s = c.iterator();
-		while (s.hasNext())
-		{
-			final int v = ((Literal) s.nextNode()).getInt();
-			Assert.assertFalse(found[v]);
-			found[v] = true;
-		}
-		for (int i = 0; i < num; i += 1)
-		{
-			Assert.assertEquals("element " + i, retain[i], found[i]);
-		}
-	}
+        final NodeIterator s = c.iterator();
+        while (s.hasNext()) {
+            final int v = ((Literal)s.nextNode()).getInt();
+            Assert.assertFalse(found[v]);
+            found[v] = true;
+        }
+        for ( int i = 0 ; i < num ; i += 1 ) {
+            Assert.assertEquals("element " + i, retain[i], found[i]);
+        }
+    }
 
-	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));
-	}
+    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));
+    }
 
-	public void testFillingContainer()
-	{
-		final Container c = createContainer();
-		final String lang = "fr";
-		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));
-		c.add(AbstractModelTestBase.tvByte);
-		Assert.assertTrue(c.contains(AbstractModelTestBase.tvByte));
-		c.add(AbstractModelTestBase.tvShort);
-		Assert.assertTrue(c.contains(AbstractModelTestBase.tvShort));
-		c.add(AbstractModelTestBase.tvInt);
-		Assert.assertTrue(c.contains(AbstractModelTestBase.tvInt));
-		c.add(AbstractModelTestBase.tvLong);
-		Assert.assertTrue(c.contains(AbstractModelTestBase.tvLong));
-		c.add(AbstractModelTestBase.tvChar);
-		Assert.assertTrue(c.contains(AbstractModelTestBase.tvChar));
-		c.add(AbstractModelTestBase.tvFloat);
-		Assert.assertTrue(c.contains(AbstractModelTestBase.tvFloat));
-		c.add(AbstractModelTestBase.tvString);
-		Assert.assertTrue(c.contains(AbstractModelTestBase.tvString));
-		c.add(AbstractModelTestBase.tvString, lang);
-		Assert.assertTrue(c.contains(AbstractModelTestBase.tvString, lang));
-		c.add(tvLiteral);
-		Assert.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());
-	}
+    public void testFillingContainer() {
+        final Container c = createContainer();
+        final String lang = "fr";
+        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));
+        c.add(AbstractModelTestBase.tvByte);
+        Assert.assertTrue(c.contains(AbstractModelTestBase.tvByte));
+        c.add(AbstractModelTestBase.tvShort);
+        Assert.assertTrue(c.contains(AbstractModelTestBase.tvShort));
+        c.add(AbstractModelTestBase.tvInt);
+        Assert.assertTrue(c.contains(AbstractModelTestBase.tvInt));
+        c.add(AbstractModelTestBase.tvLong);
+        Assert.assertTrue(c.contains(AbstractModelTestBase.tvLong));
+        c.add(AbstractModelTestBase.tvChar);
+        Assert.assertTrue(c.contains(AbstractModelTestBase.tvChar));
+        c.add(AbstractModelTestBase.tvFloat);
+        Assert.assertTrue(c.contains(AbstractModelTestBase.tvFloat));
+        c.add(AbstractModelTestBase.tvString);
+        Assert.assertTrue(c.contains(AbstractModelTestBase.tvString));
+        c.add(AbstractModelTestBase.tvString, lang);
+        Assert.assertTrue(c.contains(AbstractModelTestBase.tvString, lang));
+        c.add(tvLiteral);
+        Assert.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());
+    }
 }
diff --git a/jena-core/src/test/java/org/apache/jena/rdf/model/test/AbstractModelTestBase.java b/jena-core/src/test/java/org/apache/jena/rdf/model/test/AbstractModelTestBase.java
index 4c0b9639bf..a59d771c54 100644
--- a/jena-core/src/test/java/org/apache/jena/rdf/model/test/AbstractModelTestBase.java
+++ b/jena-core/src/test/java/org/apache/jena/rdf/model/test/AbstractModelTestBase.java
@@ -6,9 +6,9 @@
  * 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.
@@ -18,149 +18,116 @@
 
 package org.apache.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.apache.jena.rdf.model.Model ;
-import org.apache.jena.rdf.model.test.helpers.TestingModelFactory ;
+import junit.framework.TestCase;
+import org.apache.jena.rdf.model.Model;
+import org.apache.jena.rdf.model.test.helpers.TestingModelFactory;
 
 /**
- * Base for all test cases.
- * 
- * All derived classes will use the getModel to get the model created in the
- * setUp method.
- * 
- * createModel will create a model using the TestingModelFactory methods.
+ * Base for all test cases. All derived classes will use the getModel to get the
+ * model created in the setUp method. createModel will create a model using the
+ * TestingModelFactory methods.
  */
-public abstract class AbstractModelTestBase extends TestCase
-{
-	protected static String getFileName( final String fn )
-   	{
-   		URL u = AbstractModelTestBase.class.getClassLoader().getResource( fn );
-   		if (u == null)
-   		{
-   			throw new RuntimeException( new FileNotFoundException( fn ));
-   		}
-   		try {
-   			return u.toURI().toString();
-   		} catch (URISyntaxException e) {
-   			throw new RuntimeException( e );
-   		}
-   	}
-	
-	protected InputStream getInputStream( final String fn )
-	{
-		ClassLoader loader = AbstractModelTestBase.class.getClassLoader();
-		if (loader == null)
-			throw new SecurityException("Cannot access class loader");
-		final InputStream in = loader.getResourceAsStream(fn);
-		if (in == null)
-			throw new IllegalArgumentException("Resource: " + fn
-					+ " not found on class path.");
-		return in;
-	}
-	
-	public static class LitTestObj
-	{
-		protected long content;
-
-		public LitTestObj( final long l )
-		{
-			content = l;
-		}
-
-		public LitTestObj( final String s )
-		{
-			content = Long.parseLong(s.substring(1, s.length() - 1));
-		}
-
-		@Override
-		public boolean equals( final Object o )
-		{
-			return (o instanceof LitTestObj)
-					&& (content == ((LitTestObj) o).content);
-		}
-
-		@Override
-		public int hashCode()
-		{
-			return (int) (content ^ (content >> 32));
-		}
-
-		@Override
-		public String toString()
-		{
-			return "[" + Long.toString(content) + "]";
-		}
-	}
-
-	protected static final boolean tvBoolean = true;
-	protected static final byte tvByte = 1;
-	protected static final short tvShort = 2;
-	protected static final int tvInt = -1;
-	protected static final long tvLong = -2;
-	protected static final char tvChar = '!';
-	protected static final float tvFloat = (float) 123.456;
-	protected static final double tvDouble = -123.456;
-	protected static final String tvString = "test 12 string";
-	protected static final Object tvLitObj = new LitTestObj(1234);
-	protected static final LitTestObj tvObject = new LitTestObj(12345);
-	protected static final double dDelta = 0.000000005;
-
-	protected static final float fDelta = 0.000005f;
-	protected Model model;
-
-	protected TestingModelFactory modelFactory;
-
-	public AbstractModelTestBase( final TestingModelFactory modelFactory,
-			final String name )
-	{
-		super(name);
-		this.modelFactory = modelFactory;
-	}
-
-	/**
-	 * Create a new model.
-	 * 
-	 * @return A new model from the modelFactory.
-	 */
-	public final Model createModel()
-	{
-		return modelFactory.createModel();
-	}
-
-	/**
-	 * Do not call this.
-	 * 
-	 * This is here to make modification of legacy tests easier.
-	 * 
-	 * @Throws RuntimeException ALWAYS
-	 */
-	public final Model getModel()
-	{
-		throw new RuntimeException(
-				"Do not call getModel() in tests either use model instance variable or call createModel()");
-	}
-
-	/**
-	 * sets the model instance variable
-	 */
-	@Override
-	public void setUp()
-	{
-		model = createModel();
-	}
-
-	/**
-	 * Closes the model instance variable and shuts it down.
-	 */
-	@Override
-	public void tearDown()
-	{
-		model.close();
-		model = null;
-	}
+public abstract class AbstractModelTestBase extends TestCase {
+    protected static String getFileName(final String fn) {
+        URL u = AbstractModelTestBase.class.getClassLoader().getResource(fn);
+        if ( u == null ) {
+            throw new RuntimeException(new FileNotFoundException(fn));
+        }
+        try {
+            return u.toURI().toString();
+        } catch (URISyntaxException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    protected InputStream getInputStream(final String fn) {
+        ClassLoader loader = AbstractModelTestBase.class.getClassLoader();
+        if ( loader == null )
+            throw new SecurityException("Cannot access class loader");
+        final InputStream in = loader.getResourceAsStream(fn);
+        if ( in == null )
+            throw new IllegalArgumentException("Resource: " + fn + " not found on class path.");
+        return in;
+    }
+
+    public static class LitTestObj {
+        protected long content;
+
+        public LitTestObj(final long l) {
+            content = l;
+        }
+
+        public LitTestObj(final String s) {
+            content = Long.parseLong(s.substring(1, s.length() - 1));
+        }
+
+        @Override
+        public boolean equals(final Object o) {
+            return (o instanceof LitTestObj) && (content == ((LitTestObj)o).content);
+        }
+
+        @Override
+        public int hashCode() {
+            return (int)(content ^ (content >> 32));
+        }
+
+        @Override
+        public String toString() {
+            return "[" + Long.toString(content) + "]";
+        }
+    }
+
+    protected static final boolean tvBoolean = true;
+    protected static final byte tvByte = 1;
+    protected static final short tvShort = 2;
+    protected static final int tvInt = -1;
+    protected static final long tvLong = -2;
+    protected static final char tvChar = '!';
+    protected static final float tvFloat = (float)123.456;
+    protected static final double tvDouble = -123.456;
+    protected static final String tvString = "test 12 string";
+    protected static final Object tvLitObj = new LitTestObj(1234);
+    protected static final LitTestObj tvObject = new LitTestObj(12345);
+    protected static final double dDelta = 0.000000005;
+
+    protected static final float fDelta = 0.000005f;
+    protected Model model;
+
+    protected TestingModelFactory modelFactory;
+
+    public AbstractModelTestBase(final TestingModelFactory modelFactory, final String name) {
+        super(name);
+        this.modelFactory = modelFactory;
+    }
+
+    /**
+     * Create a new model.
+     *
+     * @return A new model from the modelFactory.
+     */
+    public final Model createModel() {
+        return modelFactory.createModel();
+    }
+
+    /**
+     * sets the model instance variable
+     */
+    @Override
+    public void setUp() {
+        model = createModel();
+    }
+
+    /**
+     * Closes the model instance variable and shuts it down.
+     */
+    @Override
+    public void tearDown() {
+        model.close();
+        model = null;
+    }
 }
diff --git a/jena-core/src/test/java/org/apache/jena/rdf/model/test/AbstractTestModel.java b/jena-core/src/test/java/org/apache/jena/rdf/model/test/AbstractTestModel.java
index 54b26f310d..217e30bf86 100644
--- a/jena-core/src/test/java/org/apache/jena/rdf/model/test/AbstractTestModel.java
+++ b/jena-core/src/test/java/org/apache/jena/rdf/model/test/AbstractTestModel.java
@@ -18,9 +18,9 @@
 
 package org.apache.jena.rdf.model.test;
 
-import org.apache.jena.graph.Node ;
-import org.apache.jena.graph.Triple ;
-import org.apache.jena.graph.test.NodeCreateUtils ;
+import org.apache.jena.graph.Node;
+import org.apache.jena.graph.Triple;
+import org.apache.jena.graph.test.NodeCreateUtils;
 import org.apache.jena.rdf.model.AnonId;
 import org.apache.jena.rdf.model.Literal;
 import org.apache.jena.rdf.model.Model;
@@ -29,245 +29,226 @@ import org.apache.jena.rdf.model.Property;
 import org.apache.jena.rdf.model.RDFNode;
 import org.apache.jena.rdf.model.Resource;
 import org.apache.jena.rdf.model.Statement;
-import org.apache.jena.rdf.model.impl.ModelCom ;
+import org.apache.jena.rdf.model.impl.ModelCom;
 import org.apache.jena.shared.PropertyNotFoundException;
 
-public abstract class AbstractTestModel extends ModelTestBase
-{
-    public AbstractTestModel( String name )
-    { super(name); }
+public abstract class AbstractTestModel extends ModelTestBase {
+    public AbstractTestModel(String name) {
+        super(name);
+    }
 
     public abstract Model getModel();
 
     private Model model;
 
     @Override
-    public void setUp()
-    { model = getModel(); }
+    public void setUp() {
+        model = getModel();
+    }
 
     @Override
-    public void tearDown()
-    { model.close(); }
+    public void tearDown() {
+        model.close();
+    }
 
     public void testTransactions() {
         if ( model.supportsTransactions() )
-            model.executeInTxn(() -> {}) ;
+            model.executeInTxn(() -> {});
     }
 
-    public void testCreateResourceFromNode()
-    {
-        RDFNode S = model.getRDFNode( NodeCreateUtils.create( "spoo:S" ) );
-        assertInstanceOf( Resource.class, S );
-        assertEquals( "spoo:S", ((Resource) S).getURI() );
+    public void testCreateResourceFromNode() {
+        RDFNode S = model.getRDFNode(NodeCreateUtils.create("spoo:S"));
+        assertInstanceOf(Resource.class, S);
+        assertEquals("spoo:S", ((Resource)S).getURI());
     }
 
-    public void testCreateLiteralFromNode()
-    {
-        RDFNode S = model.getRDFNode( NodeCreateUtils.create( "42" ) );
-        assertInstanceOf( Literal.class, S );
-        assertEquals( "42", ((Literal) S).getLexicalForm() );
+    public void testCreateLiteralFromNode() {
+        RDFNode S = model.getRDFNode(NodeCreateUtils.create("42"));
+        assertInstanceOf(Literal.class, S);
+        assertEquals("42", ((Literal)S).getLexicalForm());
     }
 
-    public void testCreateBlankFromNode()
-    {
-        RDFNode S = model.getRDFNode( NodeCreateUtils.create( "_Blank" ) );
-        assertInstanceOf( Resource.class, S );
-        assertEquals( new AnonId( "_Blank" ), ((Resource) S).getId() );
+    public void testCreateBlankFromNode() {
+        RDFNode S = model.getRDFNode(NodeCreateUtils.create("_Blank"));
+        assertInstanceOf(Resource.class, S);
+        assertEquals(new AnonId("_Blank"), ((Resource)S).getId());
     }
 
-    public void testIsEmpty()
-    {
-        Statement S1 = statement( model, "model rdf:type nonEmpty" );
-        Statement S2 = statement( model, "pinky rdf:type Pig" );
-        assertTrue( model.isEmpty() );
-        model.add( S1 );
-        assertFalse( model.isEmpty() );
-        model.add( S2 );
-        assertFalse( model.isEmpty() );
-        model.remove( S1 );
-        assertFalse( model.isEmpty() );
-        model.remove( S2 );
-        assertTrue( model.isEmpty() );
+    public void testIsEmpty() {
+        Statement S1 = statement(model, "model rdf:type nonEmpty");
+        Statement S2 = statement(model, "pinky rdf:type Pig");
+        assertTrue(model.isEmpty());
+        model.add(S1);
+        assertFalse(model.isEmpty());
+        model.add(S2);
+        assertFalse(model.isEmpty());
+        model.remove(S1);
+        assertFalse(model.isEmpty());
+        model.remove(S2);
+        assertTrue(model.isEmpty());
     }
 
-    public void testContainsResource()
-    {
-        modelAdd( model, "x R y; _a P _b" );
-        assertTrue( model.containsResource( resource( model, "x" ) ) );
-        assertTrue( model.containsResource( resource( model, "R" ) ) );
-        assertTrue( model.containsResource( resource( model, "y" ) ) );
-        assertTrue( model.containsResource( resource( model, "_a" ) ) );
-        assertTrue( model.containsResource( resource( model, "P" ) ) );
-        assertTrue( model.containsResource( resource( model, "_b" ) ) );
-        assertFalse( model.containsResource( resource( model, "i" ) ) );
-        assertFalse( model.containsResource( resource( model, "_j" ) ) );
+    public void testContainsResource() {
+        modelAdd(model, "x R y; _a P _b");
+        assertTrue(model.containsResource(resource(model, "x")));
+        assertTrue(model.containsResource(resource(model, "R")));
+        assertTrue(model.containsResource(resource(model, "y")));
+        assertTrue(model.containsResource(resource(model, "_a")));
+        assertTrue(model.containsResource(resource(model, "P")));
+        assertTrue(model.containsResource(resource(model, "_b")));
+        assertFalse(model.containsResource(resource(model, "i")));
+        assertFalse(model.containsResource(resource(model, "_j")));
     }
 
-
-
     /**
-        Test the new version of getProperty(), which delivers null for not-found
-        properties.
+     * Test the new version of getProperty(), which delivers null for not-found
+     * properties.
      */
-    public void testGetProperty()
-    {
-        modelAdd( model, "x P a; x P b; x R c" );
-        Resource x = resource( model, "x" );
-        assertEquals( resource( model, "c" ), x.getProperty( property( model, "R" ) ).getObject() );
-        RDFNode ob = x.getProperty( property( model, "P" ) ).getObject();
-        assertTrue( ob.equals( resource( model, "a" ) ) || ob.equals( resource( model, "b" ) ) );
-        assertNull( x.getProperty( property( model, "noSuchPropertyHere" ) ) );
+    public void testGetProperty() {
+        modelAdd(model, "x P a; x P b; x R c");
+        Resource x = resource(model, "x");
+        assertEquals(resource(model, "c"), x.getProperty(property(model, "R")).getObject());
+        RDFNode ob = x.getProperty(property(model, "P")).getObject();
+        assertTrue(ob.equals(resource(model, "a")) || ob.equals(resource(model, "b")));
+        assertNull(x.getProperty(property(model, "noSuchPropertyHere")));
     }
 
     /**
      * Tests {@link Resource#getProperty(Property, String)} and
      * {@link Resource#getRequiredProperty(Property, String)}.
      */
-    public void testGetPropertyWithLanguage()
-    {
+    public void testGetPropertyWithLanguage() {
         model.add(ModelTestBase.resource(model, "x"), ModelTestBase.property(model, "P"), "a", "pt");
         model.add(ModelTestBase.resource(model, "x"), ModelTestBase.property(model, "P"), "b", "en");
         model.add(ModelTestBase.resource(model, "x"), ModelTestBase.property(model, "P"), "c", "es");
         model.add(ModelTestBase.resource(model, "x"), ModelTestBase.property(model, "R"), "d", "fr");
         model.add(ModelTestBase.resource(model, "x"), ModelTestBase.property(model, "R"), "e", "de");
 
-        {//Tests {@link Resource#getProperty(Property, String)}
-            final Resource x = resource( model, "x" );
-            assertEquals("a", x.getProperty( property( model, "P" ), "pt").getString() );
-            assertEquals("b", x.getProperty( property( model, "P" ), "en").getString() );
-            assertNull(x.getProperty( property( model, "P" ), "ja") );
-            final Literal l = x.getProperty( property(model, "R") ).getLiteral();
-            assertTrue( "d".equals( l.getString() ) || "e".equals( l.getString() ) );
+        {// Tests {@link Resource#getProperty(Property, String)}
+            final Resource x = resource(model, "x");
+            assertEquals("a", x.getProperty(property(model, "P"), "pt").getString());
+            assertEquals("b", x.getProperty(property(model, "P"), "en").getString());
+            assertNull(x.getProperty(property(model, "P"), "ja"));
+            final Literal l = x.getProperty(property(model, "R")).getLiteral();
+            assertTrue("d".equals(l.getString()) || "e".equals(l.getString()));
         }
 
-        {//Tests {@link Resource#getRequiredProperty(Property, String)}
-            final Resource x = resource( model, "x" );
-            assertEquals("a", x.getRequiredProperty( property( model, "P" ), "pt").getString() );
-            assertEquals("b", x.getRequiredProperty( property( model, "P" ), "en").getString() );
+        {// Tests {@link Resource#getRequiredProperty(Property, String)}
+            final Resource x = resource(model, "x");
+            assertEquals("a", x.getRequiredProperty(property(model, "P"), "pt").getString());
+            assertEquals("b", x.getRequiredProperty(property(model, "P"), "en").getString());
             try {
-                x.getRequiredProperty( property( model, "P" ), "ja");
+                x.getRequiredProperty(property(model, "P"), "ja");
                 fail("Must thrown PropertyNotFoundException.");
             } catch (PropertyNotFoundException e) {}
-            final Literal l = x.getRequiredProperty( property(model, "R") ).getLiteral();
-            assertTrue( "d".equals( l.getString() ) || "e".equals( l.getString() ) );
-            assertTrue("de".equals( l.getLanguage() ) || "fr".equals( l.getLanguage() ) );
+            final Literal l = x.getRequiredProperty(property(model, "R")).getLiteral();
+            assertTrue("d".equals(l.getString()) || "e".equals(l.getString()));
+            assertTrue("de".equals(l.getLanguage()) || "fr".equals(l.getLanguage()));
         }
     }
 
-    public void testToStatement()
-    {
-        Triple t = triple( "a P b" );
-        Statement s = model.asStatement( t );
-        assertEquals( node( "a" ), s.getSubject().asNode() );
-        assertEquals( node( "P" ), s.getPredicate().asNode() );
-        assertEquals( node( "b" ), s.getObject().asNode() );
+    public void testToStatement() {
+        Triple t = triple("a P b");
+        Statement s = model.asStatement(t);
+        assertEquals(node("a"), s.getSubject().asNode());
+        assertEquals(node("P"), s.getPredicate().asNode());
+        assertEquals(node("b"), s.getObject().asNode());
     }
 
-    public void testAsRDF()
-    {
-        testPresentAsRDFNode( node( "a" ), Resource.class );
-        testPresentAsRDFNode( node( "17" ), Literal.class );
-        testPresentAsRDFNode( node( "_b" ), Resource.class );
+    public void testAsRDF() {
+        testPresentAsRDFNode(node("a"), Resource.class);
+        testPresentAsRDFNode(node("17"), Literal.class);
+        testPresentAsRDFNode(node("_b"), Resource.class);
     }
 
-    private void testPresentAsRDFNode( Node n, Class<? extends RDFNode> nodeClass )
-    {
-        RDFNode r = model.asRDFNode( n );
-        assertSame( n, r.asNode() );
-        assertInstanceOf( nodeClass, r );
+    private void testPresentAsRDFNode(Node n, Class<? extends RDFNode> nodeClass) {
+        RDFNode r = model.asRDFNode(n);
+        assertSame(n, r.asNode());
+        assertInstanceOf(nodeClass, r);
     }
 
-    public void testURINodeAsResource()
-    {
-        Node n = node( "a" );
-        Resource r = model.wrapAsResource( n );
-        assertSame( n, r.asNode() );
+    public void testURINodeAsResource() {
+        Node n = node("a");
+        Resource r = model.wrapAsResource(n);
+        assertSame(n, r.asNode());
     }
 
-    public void testLiteralNodeAsResourceFails()
-    {
-        try
-        {
-            model.wrapAsResource( node( "17" ) );
-            fail( "should fail to convert literal to Resource" );
+    public void testLiteralNodeAsResourceFails() {
+        try {
+            model.wrapAsResource(node("17"));
+            fail("should fail to convert literal to Resource");
+        } catch (UnsupportedOperationException e) {
+            pass();
         }
-        catch (UnsupportedOperationException e)
-        { pass(); }
     }
 
-    public void testRemoveAll()
-    {
-        testRemoveAll( "" );
-        testRemoveAll( "a RR b" );
-        testRemoveAll( "x P y; a Q b; c R 17; _d S 'e'" );
-        testRemoveAll( "subject Predicate 'object'; http://nowhere/x scheme:cunning not:plan" );
+    public void testRemoveAll() {
+        testRemoveAll("");
+        testRemoveAll("a RR b");
+        testRemoveAll("x P y; a Q b; c R 17; _d S 'e'");
+        testRemoveAll("subject Predicate 'object'; http://nowhere/x scheme:cunning not:plan");
     }
 
-    protected void testRemoveAll( String statements )
-    {
-        modelAdd( model, statements );
-        assertSame( model, model.removeAll() );
-        assertEquals( "model should have size 0 following removeAll(): ", 0, model.size() );
+    protected void testRemoveAll(String statements) {
+        modelAdd(model, statements);
+        assertSame(model, model.removeAll());
+        assertEquals("model should have size 0 following removeAll(): ", 0, model.size());
     }
 
     /**
- 		Test cases for RemoveSPO(); each entry is a triple (add, remove, result).
-	 	<ul>
-	 	<li>add - the triples to add to the graph to start with
-	 	<li>remove - the pattern to use in the removal
-	 	<li>result - the triples that should remain in the graph
-	 	</ul>
+     * Test cases for RemoveSPO(); each entry is a triple (add, remove, result).
+     * <ul>
+     * <li>add - the triples to add to the graph to start with
+     * <li>remove - the pattern to use in the removal
+     * <li>result - the triples that should remain in the graph
+     * </ul>
      */
-    protected String[][] cases =
-        {
-            { "x R y", "x R y", "" },
-            { "x R y; a P b", "x R y", "a P b" },
-            { "x R y; a P b", "?? R y", "a P b" },
-            { "x R y; a P b", "x R ??", "a P b" },
-            { "x R y; a P b", "x ?? y", "a P b" },
-            { "x R y; a P b", "?? ?? ??", "" },
-            { "x R y; a P b; c P d", "?? P ??", "x R y" },
-            { "x R y; a P b; x S y", "x ?? ??", "a P b" },
-        };
+    //@formatter:off
+    protected String[][] cases = {
+        { "x R y", "x R y", "" },
+        { "x R y; a P b", "x R y", "a P b" },
+        { "x R y; a P b", "?? R y", "a P b" },
+        { "x R y; a P b", "x R ??", "a P b" },
+        { "x R y; a P b", "x ?? y", "a P b" },
+        { "x R y; a P b", "?? ?? ??", "" },
+        { "x R y; a P b; c P d", "?? P ??", "x R y" },
+        { "x R y; a P b; x S y", "x ?? ??", "a P b" },
+    };
+    //@formatter:on
 
     /**
- 	Test that remove(s, p, o) works, in the presence of inferencing graphs that
- 	mean emptyness isn't available. This is why we go round the houses and
- 	test that expected ~= initialContent + addedStuff - removed - initialContent.
+     * Test that remove(s, p, o) works, in the presence of inferencing graphs that
+     * mean emptiness isn't available. This is why we go round the houses and test
+     * that expected ~= initialContent + addedStuff - removed - initialContent.
      */
-    public void testRemoveSPO()
-    {
-        ModelCom mc = (ModelCom) ModelFactory.createDefaultModel();
-        for ( String[] aCase : cases )
-        {
-            for ( int j = 0; j < 3; j += 1 )
-            {
+    public void testRemoveSPO() {
+        ModelCom mc = (ModelCom)ModelFactory.createDefaultModel();
+        for ( String[] aCase : cases ) {
+            for ( int j = 0 ; j < 3 ; j += 1 ) {
                 Model content = getModel();
-                Model baseContent = copy( content );
-                modelAdd( content, aCase[0] );
-                Triple remove = triple( aCase[1] );
+                Model baseContent = copy(content);
+                modelAdd(content, aCase[0]);
+                Triple remove = triple(aCase[1]);
                 Node s = remove.getSubject(), p = remove.getPredicate(), o = remove.getObject();
-                Resource S = (Resource) ( s.equals( Node.ANY ) ? null : mc.getRDFNode( s ) );
-                Property P = ( ( p.equals( Node.ANY ) ? null : mc.getRDFNode( p ).as( Property.class ) ) );
-                RDFNode O = o.equals( Node.ANY ) ? null : mc.getRDFNode( o );
-                Model expected = modelWithStatements( aCase[2] );
-                content.removeAll( S, P, O );
-                Model finalContent = copy( content ).remove( baseContent );
-                assertIsoModels( aCase[1], expected, finalContent );
+                Resource S = (Resource)(s.equals(Node.ANY) ? null : mc.getRDFNode(s));
+                Property P = ((p.equals(Node.ANY) ? null : mc.getRDFNode(p).as(Property.class)));
+                RDFNode O = o.equals(Node.ANY) ? null : mc.getRDFNode(o);
+                Model expected = modelWithStatements(aCase[2]);
+                content.removeAll(S, P, O);
+                Model finalContent = copy(content).remove(baseContent);
+                assertIsoModels(aCase[1], expected, finalContent);
             }
         }
     }
 
-    public void testIsClosedDelegatedToGraph()
-    {
+    public void testIsClosedDelegatedToGraph() {
         Model m = getModel();
-        assertFalse( m.isClosed() );
+        assertFalse(m.isClosed());
         m.close();
-        assertTrue( m.isClosed() );
+        assertTrue(m.isClosed());
     }
 
-    protected Model copy( Model m )
-    {
-        return ModelFactory.createDefaultModel().add( m );
+    protected Model copy(Model m) {
+        return ModelFactory.createDefaultModel().add(m);
     }
 }
diff --git a/jena-core/src/test/java/org/apache/jena/rdf/model/test/AbstractTestPackage.java b/jena-core/src/test/java/org/apache/jena/rdf/model/test/AbstractTestPackage.java
index f9b57f133a..e8ce287bd6 100644
--- a/jena-core/src/test/java/org/apache/jena/rdf/model/test/AbstractTestPackage.java
+++ b/jena-core/src/test/java/org/apache/jena/rdf/model/test/AbstractTestPackage.java
@@ -31,17 +31,9 @@ import org.apache.jena.shared.Lock;
 
 /**
  * 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.
 	 *
@@ -57,65 +49,66 @@ public abstract class AbstractTestPackage extends TestSuite
 	 * @throws InvocationTargetException
 	 */
 	protected AbstractTestPackage( String suiteName, TestingModelFactory modelFactory ) {
-		super(suiteName);
+	    super(suiteName);
 
-		addTest(TestModelFactory.class);
-		addTest(TestSimpleListStatements.class, modelFactory);
-		addTest(TestModelPolymorphism.class, modelFactory);
-		addTest(TestStatements.class, modelFactory);
-		addTest(TestRDFNodes.class, modelFactory);
-		addTest(TestIterators.class, modelFactory);
+	    addTest(TestModelFactory.class);
+	    addTest(TestSimpleListStatements.class, modelFactory);
+	    addTest(TestModelPolymorphism.class, modelFactory);
+	    addTest(TestStatements.class, modelFactory);
+	    addTest(TestRDFNodes.class, modelFactory);
+	    addTest(TestIterators.class, modelFactory);
 
-		addTest(TestContains.class, modelFactory);
-		addTest(TestLiteralImpl.class, modelFactory);
-		addTest(TestResourceImpl.class, modelFactory);
-		addTest(TestStatementTerms.class, modelFactory);
+	    addTest(TestContains.class, modelFactory);
+	    addTest(TestLiteralImpl.class, modelFactory);
+	    addTest(TestResourceImpl.class, modelFactory);
+	    addTest(TestStatementTerms.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(TestHiddenStatements.class, modelFactory);
+	    addTest(TestNamespace.class, modelFactory);
+	    addTest(TestModelBulkUpdate.class, modelFactory);
 
-		addTest(TestConcurrencyParallel.class, modelFactory);
-		addTest(TestContainers.class, modelFactory);
-		addTest(TestModel.class, modelFactory);
-		addTest(TestModelSetOperations.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(TestModelRead.class, modelFactory);
-		addTestSuite(TestProperties.class);
-		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);
-		// These tests are probabilistic testing.
-		// See notes in the class.
-		//addTest(IsomorphicTests.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(TestContainers.class, modelFactory);
+	    addTest(TestModel.class, modelFactory);
+	    addTest(TestModelSetOperations.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(TestModelRead.class, modelFactory);
+	    addTestSuite(TestProperties.class);
+	    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);
+	    // These tests are probabilistic testing.
+	    // See notes in the class.
+	    //addTest(IsomorphicTests.class, modelFactory);
 	}
 
 	/**
@@ -132,57 +125,41 @@ public abstract class AbstractTestPackage extends TestSuite
 	 * @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);
-		}
+    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);
-					}
+        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);
+                    }
                 }
-			}
-		}
-	}
-
+            }
+        }
+    }
 }
diff --git a/jena-core/src/test/java/org/apache/jena/rdf/model/test/ModelTestBase.java b/jena-core/src/test/java/org/apache/jena/rdf/model/test/ModelTestBase.java
index e6725e13d2..2cf73c84b9 100644
--- a/jena-core/src/test/java/org/apache/jena/rdf/model/test/ModelTestBase.java
+++ b/jena-core/src/test/java/org/apache/jena/rdf/model/test/ModelTestBase.java
@@ -6,9 +6,9 @@
  * 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.
@@ -24,246 +24,202 @@ import java.util.Map;
 import java.util.Set;
 import java.util.StringTokenizer;
 
-import org.apache.jena.graph.Node ;
-import org.apache.jena.graph.test.GraphTestBase ;
-import org.apache.jena.graph.test.NodeCreateUtils ;
-import org.apache.jena.rdf.model.* ;
-import org.apache.jena.shared.PrefixMapping ;
-import org.apache.jena.util.CollectionFactory ;
+import org.apache.jena.graph.Node;
+import org.apache.jena.graph.test.GraphTestBase;
+import org.apache.jena.graph.test.NodeCreateUtils;
+import org.apache.jena.rdf.model.*;
+import org.apache.jena.shared.PrefixMapping;
+import org.apache.jena.util.CollectionFactory;
 import org.junit.Assert;
 
 /**
- * provides useful functionality for testing models, eg building small models
- * from strings, testing equality, etc.
+ * provides useful functionality for testing models, eg building small models from
+ * strings, testing equality, etc.
  */
 
-public class ModelTestBase extends GraphTestBase
-{
-	protected static Model aModel = ModelTestBase.extendedModel();
-
-	protected static final Model empty = ModelFactory.createDefaultModel();
-
-	/**
-	 * Fail if the two models are not isomorphic. See
-	 * assertIsoModels(String,Model,Model).
-	 */
-	public static void assertIsoModels( final Model wanted, final Model got )
-	{
-		ModelTestBase.assertIsoModels("models must be isomorphic", wanted, got);
-	}
-
-	/**
-	 * test that two models are isomorphic and fail if they are not.
-	 * 
-	 * @param title
-	 *            a String appearing at the beginning of the failure message
-	 * @param wanted
-	 *            the model value that is expected
-	 * @param got
-	 *            the model value to check
-	 * @exception junit.framework.AssertionFailedError if the models are not isomorphic
-	 */
-	public static void assertIsoModels( final String title, final Model wanted,
-			final Model got )
-	{
-		if (wanted.isIsomorphicWith(got) == false)
-		{
-			final Map<Node, Object> map = CollectionFactory.createHashedMap();
-			Assert.fail(title + ": expected "
-					+ GraphTestBase.nice(wanted.getGraph(), map)
-					+ "\n but had " + GraphTestBase.nice(got.getGraph(), map));
-		}
-	}
-
-	/**
-	 * Answer a default model; it exists merely to abbreviate the rather long
-	 * explicit
-	 * invocation.
-	 * 
-	 * @return a new default [aka memory-based] model
-	 */
-	public static Model createMemModel()
-	{
-		return ModelFactory.createDefaultModel();
-	}
-
-	/**
-	 * make a model, give it Extended prefixes
-	 */
-	public static Model createModel()
-	{
-		final Model result = ModelFactory.createDefaultModel();
-		result.setNsPrefixes(PrefixMapping.Extended);
-		return result;
-	}
-
-	protected static Model extendedModel()
-	{
-		final Model result = ModelFactory.createDefaultModel();
-		result.setNsPrefixes(PrefixMapping.Extended);
-		return result;
-	}
-
-	public static Literal literal( final Model m, final String s )
-	{
-		return ModelTestBase.rdfNode(m, s).as(Literal.class);
-	}
-
-	/**
-	 * add to a model all the statements expressed by a string.
-	 * 
-	 * @param m
-	 *            the model to be updated
-	 * @param facts
-	 *            a sequence of semicolon-separated "S P O" facts
-	 * @return the updated model
-	 */
-	public static Model modelAdd( final Model m, final String facts )
-	{
-		final StringTokenizer semis = new StringTokenizer(facts, ";");
-		while (semis.hasMoreTokens())
-		{
-			m.add(ModelTestBase.statement(m, semis.nextToken()));
-		}
-		return m;
-	}
-
-	/**
-	 * makes a model initialised with statements parsed from a string.
-	 * 
-	 * @param facts
-	 *            a string in semicolon-separated "S P O" format
-	 * @return a model containing those facts
-	 */
-	public static Model modelWithStatements( final String facts )
-	{
-		return ModelTestBase.modelAdd(ModelTestBase.createModel(), facts);
-	}
-
-	protected static String nice( final RDFNode n )
-	{
-		return GraphTestBase.nice(n.asNode());
-	}
-
-	public static Property property( final Model m, final String s )
-	{
-		return ModelTestBase.rdfNode(m, s).as(Property.class);
-	}
-
-	public static Property property( final String s )
-	{
-		return ModelTestBase.property(ModelTestBase.aModel, s);
-	}
-
-	public static RDFNode rdfNode( final Model m, final String s )
-	{
-		return m.asRDFNode(NodeCreateUtils.create(m, s));
-	}
-
-	public static <T extends RDFNode> T rdfNode( final Model m, final String s,
-			final Class<T> c )
-	{
-		return ModelTestBase.rdfNode(m, s).as(c);
-	}
-
-	protected static Resource resource()
-	{
-		return ResourceFactory.createResource();
-	}
-
-	public static Resource resource( final Model m, final String s )
-	{
-		return (Resource) ModelTestBase.rdfNode(m, s);
-	}
-
-	public static Resource resource( final String s )
-	{
-		return ModelTestBase.resource(ModelTestBase.aModel, s);
-	}
-
-	/**
-	 * Create an array of Resources from a whitespace-separated string
-	 * 
-	 * @param m
-	 *            a model to serve as a resource factory
-	 * @param items
-	 *            a whitespace-separated sequence to feed to resource
-	 * @return a RDFNode[] of the parsed resources
-	 */
-	public static Resource[] resources( final Model m, final String items )
-	{
-		final ArrayList<Resource> rl = new ArrayList<>();
-		final StringTokenizer st = new StringTokenizer(items);
-		while (st.hasMoreTokens())
-		{
-			rl.add(ModelTestBase.resource(m, st.nextToken()));
-		}
-		return rl.toArray(new Resource[rl.size()]);
-	}
-
-	/**
-	 * Answer the set of resources given by the space-separated
-	 * <code>items</code> string. Each resource specification is interpreted
-	 * as per <code>resource</code>.
-	 */
-	public static Set<Resource> resourceSet( final String items )
-	{
-		final Set<Resource> result = new HashSet<>();
-		final StringTokenizer st = new StringTokenizer(items);
-		while (st.hasMoreTokens())
-		{
-			result.add(ModelTestBase.resource(st.nextToken()));
-		}
-		return result;
-	}
-
-	/**
-	 * create a Statement in a given Model with (S, P, O) extracted by parsing a
-	 * string.
-	 * 
-	 * @param m
-	 *            the model the statement is attached to
-	 * @param fact
-	 *            "S P O" string.
-	 * @return m.createStatement(S, P, O)
-	 */
-	public static Statement statement( final Model m, final String fact )
-	{
-		final StringTokenizer st = new StringTokenizer(fact);
-		final Resource sub = ModelTestBase.resource(m, st.nextToken());
-		final Property pred = ModelTestBase.property(m, st.nextToken());
-		final RDFNode obj = ModelTestBase.rdfNode(m, st.nextToken());
-		return m.createStatement(sub, pred, obj);
-	}
-
-	public static Statement statement( final String fact )
-	{
-		return ModelTestBase.statement(ModelTestBase.aModel, fact);
-	}
-
-	/**
-	 * Create an array of Statements parsed from a semi-separated string.
-	 * 
-	 * @param m
-	 *            a model to serve as a statement factory
-	 * @param facts
-	 *            a sequence of semicolon-separated "S P O" facts
-	 * @return a Statement[] of the (S P O) statements from the string
-	 */
-	public static Statement[] statements( final Model m, final String facts )
-	{
-		final ArrayList<Statement> sl = new ArrayList<>();
-		final StringTokenizer st = new StringTokenizer(facts, ";");
-		while (st.hasMoreTokens())
-		{
-			sl.add(ModelTestBase.statement(m, st.nextToken()));
-		}
-		return sl.toArray(new Statement[sl.size()]);
-	}
-
-	public ModelTestBase( final String name )
-	{
-		super(name);
-	}
-
+public class ModelTestBase extends GraphTestBase {
+    protected static Model aModel = ModelTestBase.extendedModel();
+
+    protected static final Model empty = ModelFactory.createDefaultModel();
+
+    /**
+     * Fail if the two models are not isomorphic. See
+     * assertIsoModels(String,Model,Model).
+     */
+    public static void assertIsoModels(final Model wanted, final Model got) {
+        ModelTestBase.assertIsoModels("models must be isomorphic", wanted, got);
+    }
+
+    /**
+     * test that two models are isomorphic and fail if they are not.
+     *
+     * @param title a String appearing at the beginning of the failure message
+     * @param wanted the model value that is expected
+     * @param got the model value to check
+     * @exception junit.framework.AssertionFailedError if the models are not
+     *     isomorphic
+     */
+    public static void assertIsoModels(final String title, final Model wanted, final Model got) {
+        if ( wanted.isIsomorphicWith(got) == false ) {
+            final Map<Node, Object> map = CollectionFactory.createHashedMap();
+            Assert.fail(title + ": expected " + GraphTestBase.nice(wanted.getGraph(), map) +
+                        "\n but had " + GraphTestBase.nice(got.getGraph(), map));
+        }
+    }
+
+    /**
+     * Answer a default model; it exists merely to abbreviate the rather long
+     * explicit invocation.
+     *
+     * @return a new default [aka memory-based] model
+     */
+    public static Model createMemModel() {
+        return ModelFactory.createDefaultModel();
+    }
+
+    /**
+     * make a model, give it Extended prefixes
+     */
+    public static Model createModel() {
+        final Model result = ModelFactory.createDefaultModel();
+        result.setNsPrefixes(PrefixMapping.Extended);
+        return result;
+    }
+
+    protected static Model extendedModel() {
+        final Model result = ModelFactory.createDefaultModel();
+        result.setNsPrefixes(PrefixMapping.Extended);
+        return result;
+    }
+
+    public static Literal literal(final Model m, final String s) {
+        return ModelTestBase.rdfNode(m, s).as(Literal.class);
+    }
+
+    /**
+     * add to a model all the statements expressed by a string.
+     *
+     * @param m the model to be updated
+     * @param facts a sequence of semicolon-separated "S P O" facts
+     * @return the updated model
+     */
+    public static Model modelAdd(final Model m, final String facts) {
+        final StringTokenizer semis = new StringTokenizer(facts, ";");
+        while (semis.hasMoreTokens()) {
+            m.add(ModelTestBase.statement(m, semis.nextToken()));
+        }
+        return m;
+    }
+
+    /**
+     * makes a model initialised with statements parsed from a string.
+     *
+     * @param facts a string in semicolon-separated "S P O" format
+     * @return a model containing those facts
+     */
+    public static Model modelWithStatements(final String facts) {
+        return ModelTestBase.modelAdd(ModelTestBase.createModel(), facts);
+    }
+
+    protected static String nice(final RDFNode n) {
+        return GraphTestBase.nice(n.asNode());
+    }
+
+    public static Property property(final Model m, final String s) {
+        return ModelTestBase.rdfNode(m, s).as(Property.class);
+    }
+
+    public static Property property(final String s) {
+        return ModelTestBase.property(ModelTestBase.aModel, s);
+    }
+
+    public static RDFNode rdfNode(final Model m, final String s) {
+        return m.asRDFNode(NodeCreateUtils.create(m, s));
+    }
+
+    public static <T extends RDFNode> T rdfNode(final Model m, final String s, final Class<T> c) {
+        return ModelTestBase.rdfNode(m, s).as(c);
+    }
+
+    protected static Resource resource() {
+        return ResourceFactory.createResource();
+    }
+
+    public static Resource resource(final Model m, final String s) {
+        return (Resource)ModelTestBase.rdfNode(m, s);
+    }
+
+    public static Resource resource(final String s) {
+        return ModelTestBase.resource(ModelTestBase.aModel, s);
+    }
+
+    /**
+     * Create an array of Resources from a whitespace-separated string
+     *
+     * @param m a model to serve as a resource factory
+     * @param items a whitespace-separated sequence to feed to resource
+     * @return a RDFNode[] of the parsed resources
+     */
+    public static Resource[] resources(final Model m, final String items) {
+        final ArrayList<Resource> rl = new ArrayList<>();
+        final StringTokenizer st = new StringTokenizer(items);
+        while (st.hasMoreTokens()) {
+            rl.add(ModelTestBase.resource(m, st.nextToken()));
+        }
+        return rl.toArray(new Resource[rl.size()]);
+    }
+
+    /**
+     * Answer the set of resources given by the space-separated <code>items</code>
+     * string. Each resource specification is interpreted as per
+     * <code>resource</code>.
+     */
+    public static Set<Resource> resourceSet(final String items) {
+        final Set<Resource> result = new HashSet<>();
+        final StringTokenizer st = new StringTokenizer(items);
+        while (st.hasMoreTokens()) {
+            result.add(ModelTestBase.resource(st.nextToken()));
+        }
+        return result;
+    }
+
+    /**
+     * create a Statement in a given Model with (S, P, O) extracted by parsing a
+     * string.
+     *
+     * @param m the model the statement is attached to
+     * @param fact "S P O" string.
+     * @return m.createStatement(S, P, O)
+     */
+    public static Statement statement(final Model m, final String fact) {
+        final StringTokenizer st = new StringTokenizer(fact);
+        final Resource sub = ModelTestBase.resource(m, st.nextToken());
+        final Property pred = ModelTestBase.property(m, st.nextToken());
+        final RDFNode obj = ModelTestBase.rdfNode(m, st.nextToken());
+        return m.createStatement(sub, pred, obj);
+    }
+
+    public static Statement statement(final String fact) {
+        return ModelTestBase.statement(ModelTestBase.aModel, fact);
+    }
+
+    /**
+     * Create an array of Statements parsed from a semi-separated string.
+     *
+     * @param m a model to serve as a statement factory
+     * @param facts a sequence of semicolon-separated "S P O" facts
+     * @return a Statement[] of the (S P O) statements from the string
+     */
+    public static Statement[] statements(final Model m, final String facts) {
+        final ArrayList<Statement> sl = new ArrayList<>();
+        final StringTokenizer st = new StringTokenizer(facts, ";");
+        while (st.hasMoreTokens()) {
+            sl.add(ModelTestBase.statement(m, st.nextToken()));
+        }
+        return sl.toArray(new Statement[sl.size()]);
+    }
+
+    public ModelTestBase(final String name) {
+        super(name);
+    }
 }
diff --git a/jena-core/src/test/java/org/apache/jena/rdf/model/test/TS3_Model1.java b/jena-core/src/test/java/org/apache/jena/rdf/model/test/TS3_Model1.java
index 26b6ebb835..35bac0dfb6 100644
--- a/jena-core/src/test/java/org/apache/jena/rdf/model/test/TS3_Model1.java
+++ b/jena-core/src/test/java/org/apache/jena/rdf/model/test/TS3_Model1.java
@@ -26,6 +26,7 @@ import org.apache.jena.rdf.model.test.helpers.TestingModelFactory;
 import org.apache.jena.shared.PrefixMapping;
 
 public class TS3_Model1 extends AbstractTestPackage {
+    // AbstractTestPackage create a large test suite of many test classes.
 
     public static class PlainModelFactory implements TestingModelFactory {
         @Override
diff --git a/jena-core/src/test/java/org/apache/jena/rdf/model/test/TS3_StandardModels.java b/jena-core/src/test/java/org/apache/jena/rdf/model/test/TS3_StandardModels.java
index 16a32f40e8..1a8ccdac90 100644
--- a/jena-core/src/test/java/org/apache/jena/rdf/model/test/TS3_StandardModels.java
+++ b/jena-core/src/test/java/org/apache/jena/rdf/model/test/TS3_StandardModels.java
@@ -19,23 +19,21 @@
 package org.apache.jena.rdf.model.test;
 
 import junit.framework.*;
-import org.apache.jena.rdf.model.* ;
+import org.apache.jena.rdf.model.*;
 
-public class TS3_StandardModels extends AbstractTestModel
-    {
+public class TS3_StandardModels extends AbstractTestModel {
 
-    public TS3_StandardModels(String name)
-        { super(name); }
-        
-    public static TestSuite suite()
-        {
-        return new TestSuite( TS3_StandardModels.class );
-        }
+    public TS3_StandardModels(String name) {
+        super(name);
+    }
+
+    public static TestSuite suite() {
+        return new TestSuite(TS3_StandardModels.class);
+    }
 
     @Override
-    public Model getModel()
-        {
+    public Model getModel() {
         return ModelFactory.createDefaultModel();
-        }   
-
     }
+
+}
diff --git a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/impl/TestLPBRuleEngine.java b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/impl/TestLPBRuleEngine.java
index ad37171918..08f01c3d4e 100644
--- a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/impl/TestLPBRuleEngine.java
+++ b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/impl/TestLPBRuleEngine.java
@@ -44,6 +44,11 @@ public class TestLPBRuleEngine extends TestCase {
 	protected Node C2 = NodeFactory.createURI("C2");
 	protected Node ty = RDF.Nodes.type;
 
+    @SuppressWarnings("removal")
+    private static  Graph createGraphForTest() {
+        return GraphMemFactory.createGraphMem();
+    }
+
 	public FBRuleReasoner createReasoner(List<Rule> rules) {
 		FBRuleReasoner reasoner = new FBRuleReasoner(rules);
 		reasoner.tablePredicate(RDFS.Nodes.subClassOf);
@@ -54,7 +59,7 @@ public class TestLPBRuleEngine extends TestCase {
 
 	@Test
 	public void testTabledGoalsCacheHits() throws Exception {
-		Graph data = GraphMemFactory.createGraphMem();
+		Graph data = createGraphForTest();
 		data.add(Triple.create(a, ty, C1));
 		List<Rule> rules = Rule
 				.parseRules("[r1:  (?x p ?t) <- (?x rdf:type C1), makeInstance(?x, p, C2, ?t)]"
@@ -94,7 +99,7 @@ public class TestLPBRuleEngine extends TestCase {
 
 	@Test
 	public void testTabledGoalsLeak() throws Exception {
-		Graph data = GraphMemFactory.createGraphMem();
+		Graph data = createGraphForTest();
 		data.add(Triple.create(a, ty, C1));
 		List<Rule> rules = Rule
 				.parseRules("[r1:  (?x p ?t) <- (?x rdf:type C1), makeInstance(?x, p, C2, ?t)]"
@@ -135,7 +140,7 @@ public class TestLPBRuleEngine extends TestCase {
 		// Set the cache size very small just for this test
 		System.setProperty("jena.rulesys.lp.max_cached_tabled_goals", "" + MAX);
 		try {
-			Graph data = GraphMemFactory.createGraphMem();
+			Graph data = createGraphForTest();
 			data.add(Triple.create(a, ty, C1));
 			List<Rule> rules = Rule
 					.parseRules("[r1:  (?x p ?t) <- (?x rdf:type C1), makeInstance(?x, p, C2, ?t)]"
diff --git a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/impl/TestLPBRuleEngineLeak.java b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/impl/TestLPBRuleEngineLeak.java
index dda4695765..91e448b20a 100644
--- a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/impl/TestLPBRuleEngineLeak.java
+++ b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/impl/TestLPBRuleEngineLeak.java
@@ -52,7 +52,12 @@ public class TestLPBRuleEngineLeak extends TestCase {
 	protected Node C2 = NodeFactory.createURI("C2");
 	protected Node ty = RDF.Nodes.type;
 
-	public FBRuleReasoner createReasoner(List<Rule> rules) {
+    @SuppressWarnings("removal")
+    private static  Graph createGraphForTest() {
+        return GraphMemFactory.createGraphMem();
+    }
+
+    public FBRuleReasoner createReasoner(List<Rule> rules) {
 		FBRuleReasoner reasoner = new FBRuleReasoner(rules);
 		reasoner.tablePredicate(RDFS.Nodes.subClassOf);
 		reasoner.tablePredicate(RDF.Nodes.type);
@@ -62,7 +67,7 @@ public class TestLPBRuleEngineLeak extends TestCase {
 
 	@Test
 	public void testNotLeakingActiveInterpreters() throws Exception {
-		Graph data = GraphMemFactory.createGraphMem();
+		Graph data = createGraphForTest();
 		data.add(Triple.create(a, ty, C1));
 		data.add(Triple.create(b, ty, C1));
 		List<Rule> rules = Rule
@@ -89,25 +94,25 @@ public class TestLPBRuleEngineLeak extends TestCase {
 		it2.close();
 		assertEquals(0, engine.activeInterpreters.size());
 
-		
+
 		// OK, let's ask for something that is in the graph
-		
+
 		ExtendedIterator<Triple> it3 = infgraph.find(a, ty, C1);
 		assertTrue(it3.hasNext());
 		assertEquals(a, it3.next().getMatchSubject());
-		
+
 		// .. and what if we forget to call next() to consume b?
 		// (e.g. return from a method with the first hit)
-		
+
 		// this should be enough
 		it3.close();
 		// without leaks of activeInterpreters
 		assertEquals(0, engine.activeInterpreters.size());
 	}
-	
+
 	@Test
 	public void testTabledGoalsCacheHits() throws Exception {
-		Graph data = GraphMemFactory.createGraphMem();
+		Graph data = createGraphForTest();
 		data.add(Triple.create(a, ty, C1));
 		List<Rule> rules = Rule
 				.parseRules("[r1:  (?x p ?t) <- (?x rdf:type C1), makeInstance(?x, p, C2, ?t)]"
@@ -151,7 +156,7 @@ public class TestLPBRuleEngineLeak extends TestCase {
 	 * be in the wrong package for either FBRuleInfGraph or LPBRuleEngine.
 	 * <p>
 	 * <strong>This method should only be used for test purposes.</strong>
-	 * 
+	 *
 	 * @param infgraph
 	 * @return
 	 * @throws SecurityException
diff --git a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/impl/TestRestartableLBRule.java b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/impl/TestRestartableLBRule.java
index ef80c1f31d..1fcae8481e 100644
--- a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/impl/TestRestartableLBRule.java
+++ b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/impl/TestRestartableLBRule.java
@@ -43,6 +43,11 @@ public class TestRestartableLBRule extends TestCase {
         return new TestSuite(TestRestartableLBRule.class);
     }
 
+    @SuppressWarnings("removal")
+    private static  Graph createGraphForTest() {
+        return GraphMemFactory.createGraphMem();
+    }
+
     Resource Senator = ResourceFactory.createResource("http://example.com/ns/Senator");
     Resource Person = ResourceFactory.createResource("http://example.com/ns/Person");
     Resource Politician = ResourceFactory.createResource("http://example.com/ns/Politician");
@@ -107,7 +112,7 @@ public class TestRestartableLBRule extends TestCase {
 
     class DummyTxnGraph extends GraphBase implements Graph {
         TransactionHandler th = new DummyTxnHandler();
-        Graph base = GraphMemFactory.createGraphMem();
+        Graph base = createGraphForTest();
 
         @Override
         public void performAdd( Triple t ) { base.add(t); }
diff --git a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/DebugOWL.java b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/DebugOWL.java
index c19d712443..1a31916a53 100644
--- a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/DebugOWL.java
+++ b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/DebugOWL.java
@@ -40,58 +40,62 @@ public class DebugOWL {
 
     /** The base reasoner being tested */
     Reasoner reasoner;
-    
+
     /** The raw tests data as a Graph */
     Graph testdata;
-    
+
     /** The (optional) schema graph used in interpreting the test data */
     Graph schema;
-    
+
     /** The inference graph under test */
     InfGraph infgraph;
-    
+
     /** Concepts created by testGenerator, [layer, index] */
     Node[] concepts;
-    
+
     /** Instances of each concept */
     Node[] instances;
-    
+
     /** Instance properties */
     Node[] properties;
-        
+
     static Logger logger = LoggerFactory.getLogger(DebugOWL.class);
-    
+
     /** reasoner config: experimental ruleset and config */
     public static final int EXPT = 1;
-    
+
     /** reasoner config: normal OWL-FB */
     public static final int OWLFB = 2;
-    
+
     /** reasoner config: normal OWL forward */
     public static final int OWL = 3;
-    
+
     /** reasoner config: normal RDFS */
     public static final int RDFSFB = 4;
-    
+
     /** reasoner config: final RDFS - hybrid + TGC */
     public static final int RDFSFinal = 5;
-    
+
     /** reasoner config: experimental OWL */
     public static final int OWLExpt = 6;
-    
+
     /** reasoner config: LP RDFS exp */
     public static final int RDFSLPExpt = 7;
-    
-    
+
+    @SuppressWarnings("removal")
+    private static  Graph createGraphForTest() {
+        return GraphMemFactory.createGraphMem();
+    }
+
     /**
      * Construct an empty test harness.
      */
     public DebugOWL(int config) {
-        testdata = GraphMemFactory.createGraphMem();
+        testdata = createGraphForTest();
         schema = null;
-        
+
         switch(config) {
-            
+
         case EXPT:
             reasoner = GenericRuleReasonerFactory.theInstance().create(null);
             GenericRuleReasoner grr = (GenericRuleReasoner)reasoner;
@@ -106,20 +110,20 @@ public class DebugOWL {
 //            grr.setOWLTranslation(true);
 //            grr.setTraceOn(true);
             break;
-            
+
             case OWLFB:
                 reasoner = OWLFBRuleReasonerFactory.theInstance().create(null);
 //                ((OWLFBRuleReasoner)reasoner).setTraceOn(true);
                 break;
-                        
+
             case RDFSFB:
                 reasoner = RDFSFBRuleReasonerFactory.theInstance().create(null);
                 break;
-            
+
             case RDFSFinal:
                 reasoner = RDFSRuleReasonerFactory.theInstance().create(null);
                 break;
-                        
+
             case RDFSLPExpt:
                 try {
                     List<Rule> rules = Rule.parseRules(Util.loadRuleParserFromResourceFile("etc/expt.rules"));
@@ -129,11 +133,11 @@ public class DebugOWL {
                     System.exit(1);
                 }
                 break;
-            
-        } 
-        
+
+        }
+
     }
-    
+
     /**
      * Load a test data set from file.
      */
@@ -141,7 +145,7 @@ public class DebugOWL {
         testdata = FileManager.getInternal().loadModelInternal(testFile).getGraph();
         schema = null;
     }
-    
+
     /**
      * Load both a schema and an instance data file.
      */
@@ -149,7 +153,7 @@ public class DebugOWL {
         testdata = FileManager.getInternal().loadModelInternal(testFile).getGraph();
         schema = FileManager.getInternal().loadModelInternal(schemaFile).getGraph();
     }
-    
+
     /**
      * Create an artificial data set. This variant puts schema and
      * instance data into the same testdata graph.
@@ -163,7 +167,7 @@ public class DebugOWL {
         int numClasses = 0;
         int levelSize = 1;
         for (int i = 0; i < depth; i++) {
-            levelSize *= NS; 
+            levelSize *= NS;
             numClasses += levelSize;
         }
         concepts = new Node[numClasses];
@@ -171,9 +175,9 @@ public class DebugOWL {
         instances = new Node[numClasses * NI];
         logger.info("Classes: " + numClasses +" Instances: " + (numClasses * NI)
                         + (withProps ? " with properties" : ""));
-        
+
         // Create the tree
-        testdata = GraphMemFactory.createGraphMem();
+        testdata = createGraphForTest();
         // First level
         int conceptPtr = 0;
         int levelStart = 0;
@@ -185,7 +189,7 @@ public class DebugOWL {
             if (i == 0) {
                 for (int j = 0; j < NS; j++) {
                     Node concept = NodeFactory.createURI("concept" + conceptPtr);
-                    if (withProps) { 
+                    if (withProps) {
                         property = NodeFactory.createURI("prop" + conceptPtr);
                         properties[conceptPtr] = property;
                     }
@@ -196,7 +200,7 @@ public class DebugOWL {
                     Node superConcept = concepts[j];
                     for (int k = 0; k < NS; k++) {
                         Node concept = NodeFactory.createURI("concept" + conceptPtr);
-                        if (withProps) { 
+                        if (withProps) {
                             property = NodeFactory.createURI("prop" + conceptPtr);
                             properties[conceptPtr] = property;
                         }
@@ -221,7 +225,7 @@ public class DebugOWL {
             }
         }
     }
-    
+
     /**
      * Configure the inference graph ready for testing.
      */
@@ -241,14 +245,14 @@ public class DebugOWL {
             System.out.println(".. finished");
         }
     }
-    
+
     /**
      * Test and time an predefined class extension listing
      */
     long listC0(boolean print) {
         return list(null, RDF.type.asNode(), concepts[0], print);
     }
-    
+
     /**
      * Test and time an general access operation.
      */
@@ -267,7 +271,7 @@ public class DebugOWL {
         System.out.println("Found " + count + " results");
         return (t2 - t1);
     }
-   
+
     /**
      * Create and run a list classes test.
      */
@@ -276,7 +280,7 @@ public class DebugOWL {
         long t = list(null, RDF.type.asNode(), RDFS.Class.asNode(), false);
         System.out.println("Took " + t + "ms");
     }
-   
+
     /**
      * Create and run a volz test.
      */
@@ -288,7 +292,7 @@ public class DebugOWL {
             ((FBRuleInfGraph)infgraph).printLPProfile();
         }
     }
-    
+
     /**
      * Run a standard test squence based on Volz et al sets
      */
@@ -297,7 +301,7 @@ public class DebugOWL {
         runVolz(3,5,10, false);
         runVolz(4,5,10, false);
         runVolz(5,5,10, false);
-        
+
 //        runVolz(3,5,30, false);
 //        runVolz(4,5,30, false);
 //        runVolz(5,5,30, false);
@@ -305,7 +309,7 @@ public class DebugOWL {
 //        run(4,5,10, true);
 //        run(5,5,10, true);
     }
-    
+
     /**
      * Run default test on a named file.
      */
@@ -315,7 +319,7 @@ public class DebugOWL {
         long t = list(null, RDF.type.asNode(), RDFS.Class.asNode(), false);
         System.out.println("Took " + t + "ms");
     }
-    
+
     public static void main(String[] args) {
         try {
             String dataFile = "file:testing/ontology/owl/list-syntax/test-with-import.rdf";
@@ -324,30 +328,30 @@ public class DebugOWL {
             String dataFile2 = "file:testing/reasoners/bugs/test.owl";
             String food = "file:testing/reasoners/bugs/food.owl";
 
-            // Example from ontology development which takes s rather than ms            
+            // Example from ontology development which takes s rather than ms
 //            new DebugOWL(OWLExpt).listClassesOn(dataFile2);
-            
+
             // owl.owl goes into meltdown with even the forward rules
 //            new DebugOWL(OWLFB).run(schemaFile);
 //            new DebugOWL(OWL).run("file:temp/owl-subset.owl");
-            
+
             // Test volz examples on OWL config
 //            new DebugOWL(OWLFB).runVolz();
 //            new DebugOWL(OWLExpt).runVolz();
-            
+
             // Test volz examples on RDFS config
             System.out.println("Volz tests on normal RDFS, tgc + type rules");
             new DebugOWL(RDFSFinal).runVolz();
 //            System.out.println("Volz tests on lp + expt RDFS rules");
 //            new DebugOWL(RDFSLPExpt).runVolz();
-            
+
 //            System.out.println("Volz tests on normal RDFS fb rules");
 //            new DebugOWL(RDFSFB).runVolz();
 //            System.out.println("Volz tests on lp + expt owl rules");
 //            new DebugOWL(OWLExpt).runVolz();
 //            System.out.println("Volz tests on normal OWL-FB");
 //            new DebugOWL(OWLFB).runVolz();
-                        
+
 //            DebugOWL tester = new DebugOWL(OWLFB);
 //            tester.load(dataFile2);
 //            System.out.println("Test schema + data  started ...");
@@ -367,5 +371,5 @@ public class DebugOWL {
             e.printStackTrace();
         }
     }
-    
+
 }
diff --git a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/DebugRules.java b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/DebugRules.java
index fbb9a5ab42..c01d41f5a3 100755
--- a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/DebugRules.java
+++ b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/DebugRules.java
@@ -29,7 +29,7 @@ import org.apache.jena.reasoner.rulesys.Rule ;
 import org.apache.jena.reasoner.rulesys.Util ;
 import org.apache.jena.util.PrintUtil ;
 
-/** * Using during debuging of the rule systems.
+/** * Using during debugging of the rule systems.
  * Runs a named set of rules (can contain axioms and rules) and
  * lists all the resulting entailments.
  */
@@ -37,27 +37,27 @@ public class DebugRules {
 
     /** The name of the rule set to load */
     public static final String ruleFile = "etc/temp.rules";
-    
+
     /** The parsed set of rules */
     public List<Rule> ruleset;
-    
+
     /** Constructor - loads the rules */
     public DebugRules(String rulefileName) {
         ruleset = Rule.parseRules(Util.loadRuleParserFromResourceFile(rulefileName));
     }
-    
+
     /** Run a single test */
     public void run() {
-        
+
         BasicForwardRuleReasoner reasoner = new BasicForwardRuleReasoner(ruleset);
-        InfGraph result = reasoner.bind(GraphMemFactory.createGraphMem());
+        InfGraph result = reasoner.bind(GraphMemFactory.createDefaultGraph());
         System.out.println("Final graph state");
         for (Iterator<Triple> i = result.find(null, null, null); i.hasNext(); ) {
             System.out.println(PrintUtil.print(i.next()));
         }
-        
+
     }
-    
+
     public static void main(String[] args) {
         try {
             DebugRules tester = new DebugRules(ruleFile);
@@ -66,5 +66,5 @@ public class DebugRules {
             System.out.println("Problem: " + e);
         }
     }
-    
+
 }
diff --git a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestBackchainer.java b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestBackchainer.java
index 56b2a355e7..271495e6a7 100644
--- a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestBackchainer.java
+++ b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestBackchainer.java
@@ -44,14 +44,14 @@ import java.util.ArrayList;
 import java.util.List;
 
 /**
- * Test harness for the backward chainer. 
+ * Test harness for the backward chainer.
  * Parameterizable in subclasses by overriding createReasoner.
- * The original version was developed for the original backchaining interpeter. 
+ * The original version was developed for the original backchaining interpeter.
  * That has now been obsoleted at this is now used to double check the
  * LP engine, though the bulk of such tests are really done by TestBasicLP.
  */
 public class TestBackchainer extends TestCase {
-    
+
     // Maximum size of binding environment needed in the tests
     private static final int MAX_VARS = 10;
 
@@ -71,38 +71,43 @@ public class TestBackchainer extends TestCase {
     protected Node sP = RDFS.Nodes.subPropertyOf;
     protected Node sC = RDFS.Nodes.subClassOf;
     protected Node ty = RDF.Nodes.type;
-    
-    String testRules1 = 
-        "(?x ?q ?y) <- (?p rdfs:subPropertyOf ?q)(?x ?p ?y). " + 
+
+    String testRules1 =
+        "(?x ?q ?y) <- (?p rdfs:subPropertyOf ?q)(?x ?p ?y). " +
         "(?a rdfs:subPropertyOf ?c) <- (?a rdfs:subPropertyOf ?b)(?b rdfs:subPropertyOf ?c). ";
-        
+
     String testRuleAxioms = "[ -> (p rdfs:subPropertyOf q)]" +
                             "[ -> (q rdfs:subPropertyOf r) ]" +
                             "[ -> (a p b) ]";
-                            
+
     Triple[] dataElts = new Triple[] {
                             Triple.create(p, sP, q),
                             Triple.create(q, sP, r),
-                            Triple.create(a,  p, b) 
+                            Triple.create(a,  p, b)
                             };
-     
+
     /**
      * Boilerplate for junit
-     */ 
+     */
     public TestBackchainer( String name ) {
-        super( name ); 
+        super( name );
     }
-    
+
     /**
      * Boilerplate for junit.
      * This is its own test suite
      */
     public static TestSuite suite() {
-        return new TestSuite( TestBackchainer.class ); 
+        return new TestSuite( TestBackchainer.class );
 //        TestSuite suite = new TestSuite();
 //        suite.addTest(new TestBackchainer( "testRDFSProblemsb" ));
 //        return suite;
-    }  
+    }
+
+    @SuppressWarnings("removal")
+    private static  Graph createGraphForTest() {
+        return GraphMemFactory.createGraphMem();
+    }
 
     /**
      * Override in subclasses to test other reasoners.
@@ -117,20 +122,20 @@ public class TestBackchainer extends TestCase {
         reasoner.tablePredicate(b);
         return reasoner;
     }
-    
+
     /**
      * Test parser modes to support backarrow notation are working
      */
     public void testParse() {
         List<Rule> rules = Rule.parseRules(testRules1);
-        assertEquals("BRule parsing", 
-                        "[ (?x ?q ?y) <- (?p rdfs:subPropertyOf ?q) (?x ?p ?y) ]", 
+        assertEquals("BRule parsing",
+                        "[ (?x ?q ?y) <- (?p rdfs:subPropertyOf ?q) (?x ?p ?y) ]",
                         rules.get(0).toString());
-        assertEquals("BRule parsing", 
-                        "[ (?a rdfs:subPropertyOf ?c) <- (?a rdfs:subPropertyOf ?b) (?b rdfs:subPropertyOf ?c) ]", 
+        assertEquals("BRule parsing",
+                        "[ (?a rdfs:subPropertyOf ?c) <- (?a rdfs:subPropertyOf ?b) (?b rdfs:subPropertyOf ?c) ]",
                         rules.get(1).toString());
     }
-    
+
     /**
      * Test goal/head unify operation.
      */
@@ -138,65 +143,65 @@ public class TestBackchainer extends TestCase {
         Node_RuleVariable xg = new Node_RuleVariable("?x", 0);
         Node_RuleVariable yg = new Node_RuleVariable("?y", 1);
         Node_RuleVariable zg = new Node_RuleVariable("?z", 2);
-        
+
         Node_RuleVariable xh = new Node_RuleVariable("?x", 0);
         Node_RuleVariable yh = new Node_RuleVariable("?y", 1);
         Node_RuleVariable zh = new Node_RuleVariable("?z", 2);
-        
+
         TriplePattern g1 = new TriplePattern(xg, p, yg);
         TriplePattern g2 = new TriplePattern(xg, p, xg);
         TriplePattern g3 = new TriplePattern( a, p, xg);
         TriplePattern g4 = new TriplePattern( a, p,  b);
-        
+
         TriplePattern h1 = new TriplePattern(xh, p, yh);
         TriplePattern h2 = new TriplePattern(xh, p, xh);
         TriplePattern h3 = new TriplePattern( a, p, xh);
         TriplePattern h4 = new TriplePattern( a, p,  b);
         TriplePattern h5 = new TriplePattern(xh, p,  a);
-        
+
         doTestUnify(g1, h1, true, new Node[] {null, null});
         doTestUnify(g1, h2, true, new Node[] {null, null});
         doTestUnify(g1, h3, true, new Node[] {null, null});
         doTestUnify(g1, h4, true, new Node[] {null, null});
         doTestUnify(g1, h5, true, new Node[] {null, null});
-        
+
         doTestUnify(g2, h1, true, new Node[] {null, xh});
         doTestUnify(g2, h2, true, new Node[] {null, null});
         doTestUnify(g2, h3, true, new Node[] {a, null});
         doTestUnify(g2, h4, false, null);
         doTestUnify(g2, h5, true, new Node[] {a, null});
-        
+
         doTestUnify(g3, h1, true, new Node[] {a, null});
         doTestUnify(g3, h2, true, new Node[] {a, null});
         doTestUnify(g3, h3, true, new Node[] {null, null});
         doTestUnify(g3, h4, true, new Node[] {null, null});
         doTestUnify(g3, h5, true, new Node[] {a, null});
-        
+
         doTestUnify(g4, h1, true, new Node[] {a, b});
         doTestUnify(g4, h2, false, null);
         doTestUnify(g4, h3, true, new Node[] {b});
         doTestUnify(g4, h4, true, null);
         doTestUnify(g4, h5, false, null);
-        
+
         // Recursive case
         doTestUnify(h1, h1, true, new Node[] {null, null});
-        
+
         // Wildcard case
         doTestUnify(new TriplePattern(null, null, null), h2, true, new Node[] {null, null});
 
         // Test functor cases as well!
-        TriplePattern gf = new TriplePattern(xg, p, 
+        TriplePattern gf = new TriplePattern(xg, p,
                                 Functor.makeFunctorNode("f", new Node[]{xg, b}));
-        TriplePattern hf1 = new TriplePattern(yh, p, 
+        TriplePattern hf1 = new TriplePattern(yh, p,
                                 Functor.makeFunctorNode("f", new Node[]{zh, b}));
-        TriplePattern hf2 = new TriplePattern(yh, p, 
+        TriplePattern hf2 = new TriplePattern(yh, p,
                                 Functor.makeFunctorNode("f", new Node[]{a, yh}));
-        TriplePattern hf3 = new TriplePattern(yh, p, 
+        TriplePattern hf3 = new TriplePattern(yh, p,
                                 Functor.makeFunctorNode("f", new Node[]{b, yh}));
         doTestUnify(gf, hf1, true, new Node[] {null, null, yh});
         doTestUnify(gf, hf2, false, null);
         doTestUnify(gf, hf3, true, new Node[] {null, b});
-        
+
         // Check binding environment use
         BindingVector env = BindingVector.unify(g2, h1, MAX_VARS);
         env.bind(xh, c);
@@ -205,14 +210,14 @@ public class TestBackchainer extends TestCase {
         env.bind(yh, c);
         assertEquals(env.getBinding(xh), c);
     }
-    
+
     /**
      * Helper for testUnify.
      * @param goal goal triple pattern
      * @param head head triple pattern
      * @param succeed whether match should succeeed or fail
      * @param env list list of expected environment bindings
-     * 
+     *
      */
     private void doTestUnify(TriplePattern goal, TriplePattern head, boolean succeed, Node[] env) {
         BindingVector result = BindingVector.unify(goal, head, MAX_VARS);
@@ -232,141 +237,141 @@ public class TestBackchainer extends TestCase {
             assertNull(result);
         }
     }
-    
+
     /**
      * Check that a reasoner over an empty rule set accesses
      * the raw data successfully.
      */
     public void testListData() {
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         for ( Triple dataElt : dataElts )
         {
             data.add( dataElt );
         }
-        Graph schema = GraphMemFactory.createGraphMem();
+        Graph schema = createGraphForTest();
         schema.add(Triple.create(c, p, c));
-        
+
         // Case of schema and data but no rule axioms
         Reasoner reasoner =  createReasoner(new ArrayList<Rule>());
         InfGraph infgraph = reasoner.bindSchema(schema).bind(data);
-        TestUtil.assertIteratorValues(this, 
-            infgraph.find(null, null, null), 
+        TestUtil.assertIteratorValues(this,
+            infgraph.find(null, null, null),
             new Object[] {
                 Triple.create(p, sP, q),
                 Triple.create(q, sP, r),
-                Triple.create(a,  p, b), 
+                Triple.create(a,  p, b),
                 Triple.create(c, p, c)});
-                
+
         // Case of data and rule axioms but no schema
         List<Rule> rules = Rule.parseRules("-> (d p d).");
         reasoner =  createReasoner(rules);
         infgraph = reasoner.bind(data);
-        TestUtil.assertIteratorValues(this, 
-            infgraph.find(null, null, null), 
+        TestUtil.assertIteratorValues(this,
+            infgraph.find(null, null, null),
             new Object[] {
                 Triple.create(p, sP, q),
                 Triple.create(q, sP, r),
-                Triple.create(a,  p, b), 
+                Triple.create(a,  p, b),
                 Triple.create(d, p, d)});
-                
+
         // Case of data and rule axioms and schema
         infgraph = reasoner.bindSchema(schema).bind(data);
-        TestUtil.assertIteratorValues(this, 
-            infgraph.find(null, null, null), 
+        TestUtil.assertIteratorValues(this,
+            infgraph.find(null, null, null),
             new Object[] {
                 Triple.create(p, sP, q),
                 Triple.create(q, sP, r),
-                Triple.create(a,  p, b), 
+                Triple.create(a,  p, b),
                 Triple.create(c, p, c),
                 Triple.create(d, p, d)});
-                
+
     }
-   
+
     /**
-     * Test basic rule operations - simple AND rule 
+     * Test basic rule operations - simple AND rule
      */
-    public void testBaseRules1() {    
-        List<Rule> rules = Rule.parseRules("[r1: (?a r ?c) <- (?a p ?b),(?b p ?c)]");        
-        Graph data = GraphMemFactory.createGraphMem();
+    public void testBaseRules1() {
+        List<Rule> rules = Rule.parseRules("[r1: (?a r ?c) <- (?a p ?b),(?b p ?c)]");
+        Graph data = createGraphForTest();
         data.add(Triple.create(a, p, b));
         data.add(Triple.create(b, p, c));
         data.add(Triple.create(b, p, d));
         Reasoner reasoner =  createReasoner(rules);
         InfGraph infgraph = reasoner.bind(data);
-        TestUtil.assertIteratorValues(this, 
-            infgraph.find(null, r, null), 
+        TestUtil.assertIteratorValues(this,
+            infgraph.find(null, r, null),
             new Object[] {
                 Triple.create(a, r, c),
                 Triple.create(a, r, d)
             } );
     }
-   
+
     /**
-     * Test basic rule operations - simple OR rule 
+     * Test basic rule operations - simple OR rule
      */
-    public void testBaseRules2() {    
+    public void testBaseRules2() {
         List<Rule> rules = Rule.parseRules(
                 "[r1: (?a r ?b) <- (?a p ?b)]" +
                 "[r2: (?a r ?b) <- (?a q ?b)]" +
                 "[r3: (?a r ?b) <- (?a s ?c), (?c s ?b)]"
-        );        
-        Graph data = GraphMemFactory.createGraphMem();
+        );
+        Graph data = createGraphForTest();
         data.add(Triple.create(a, p, b));
         data.add(Triple.create(b, q, c));
         data.add(Triple.create(a, s, b));
         data.add(Triple.create(b, s, d));
         Reasoner reasoner =  createReasoner(rules);
         InfGraph infgraph = reasoner.bind(data);
-        TestUtil.assertIteratorValues(this, 
-            infgraph.find(null, r, null), 
+        TestUtil.assertIteratorValues(this,
+            infgraph.find(null, r, null),
             new Object[] {
                 Triple.create(a, r, b),
                 Triple.create(b, r, c),
                 Triple.create(a, r, d)
             } );
     }
-   
+
     /**
-     * Test basic rule operations - simple OR rule with chaining 
+     * Test basic rule operations - simple OR rule with chaining
      */
-    public void testBaseRules2b() {    
+    public void testBaseRules2b() {
         List<Rule> rules = Rule.parseRules(
                 "[r1: (?a r ?b) <- (?a p ?b)]" +
                 "[r2: (?a r ?b) <- (?a q ?b)]" +
                 "[r3: (?a r ?b) <- (?a t ?c), (?c t ?b)]" +
                 "[r4: (?a t ?b) <- (?a s ?b)]"
-        );        
-        Graph data = GraphMemFactory.createGraphMem();
+        );
+        Graph data = createGraphForTest();
         data.add(Triple.create(a, p, b));
         data.add(Triple.create(b, q, c));
         data.add(Triple.create(a, s, b));
         data.add(Triple.create(b, s, d));
         Reasoner reasoner =  createReasoner(rules);
         InfGraph infgraph = reasoner.bind(data);
-        TestUtil.assertIteratorValues(this, 
-            infgraph.find(null, r, null), 
+        TestUtil.assertIteratorValues(this,
+            infgraph.find(null, r, null),
             new Object[] {
                 Triple.create(a, r, b),
                 Triple.create(b, r, c),
                 Triple.create(a, r, d)
             } );
     }
-    
+
     /**
      * Test basic rule operations - simple AND rule check with tabling.
      */
-    public void testBaseRules3() {    
-        List<Rule> rules = Rule.parseRules("[rule: (?a rdfs:subPropertyOf ?c) <- (?a rdfs:subPropertyOf ?b),(?b rdfs:subPropertyOf ?c)]");        
+    public void testBaseRules3() {
+        List<Rule> rules = Rule.parseRules("[rule: (?a rdfs:subPropertyOf ?c) <- (?a rdfs:subPropertyOf ?b),(?b rdfs:subPropertyOf ?c)]");
         Reasoner reasoner =  createReasoner(rules);
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(p, sP, q) );
         data.add(Triple.create(q, sP, r) );
         data.add(Triple.create(p, sP, s) );
         data.add(Triple.create(s, sP, t) );
         data.add(Triple.create(a,  p, b) );
         InfGraph infgraph = reasoner.bind(data);
-        TestUtil.assertIteratorValues(this, 
-            infgraph.find(null, RDFS.subPropertyOf.asNode(), null), 
+        TestUtil.assertIteratorValues(this,
+            infgraph.find(null, RDFS.subPropertyOf.asNode(), null),
             new Object[] {
                 Triple.create(p, sP, q),
                 Triple.create(q, sP, r),
@@ -376,21 +381,21 @@ public class TestBackchainer extends TestCase {
                 Triple.create(p, sP, r)
             } );
     }
-    
+
     /**
      * Test basic rule operations - simple AND rule check with tabling.
      */
-    public void testBaseRules3b() {    
-        List<Rule> rules = Rule.parseRules("[rule: (?a rdfs:subPropertyOf ?c) <- (?a rdfs:subPropertyOf ?b),(?b rdfs:subPropertyOf ?c)]");        
+    public void testBaseRules3b() {
+        List<Rule> rules = Rule.parseRules("[rule: (?a rdfs:subPropertyOf ?c) <- (?a rdfs:subPropertyOf ?b),(?b rdfs:subPropertyOf ?c)]");
         Reasoner reasoner =  createReasoner(rules);
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(p, sP, q) );
         data.add(Triple.create(q, sP, r) );
         data.add(Triple.create(r, sP, t) );
         data.add(Triple.create(q, sP, s) );
         InfGraph infgraph = reasoner.bind(data);
-        TestUtil.assertIteratorValues(this, 
-            infgraph.find(null, RDFS.subPropertyOf.asNode(), null), 
+        TestUtil.assertIteratorValues(this,
+            infgraph.find(null, RDFS.subPropertyOf.asNode(), null),
             new Object[] {
                 Triple.create(p, sP, q),
                 Triple.create(q, sP, r),
@@ -407,20 +412,20 @@ public class TestBackchainer extends TestCase {
     /**
      * Test basic rule operations - simple AND/OR with tabling.
      */
-    public void testBaseRules4() {    
-        Graph data = GraphMemFactory.createGraphMem();
+    public void testBaseRules4() {
+        Graph data = createGraphForTest();
         data.add(Triple.create(a, r, b));
         data.add(Triple.create(b, r, c));
         data.add(Triple.create(b, r, b));
         data.add(Triple.create(b, r, d));
         List<Rule> rules = Rule.parseRules(
                         "[r1: (?x p ?y) <- (?x r ?y)]" +
-                        "[r2: (?x p ?z) <- (?x p ?y), (?y r ?z)]" 
-                        );        
+                        "[r2: (?x p ?z) <- (?x p ?y), (?y r ?z)]"
+                        );
         Reasoner reasoner =  createReasoner(rules);
         InfGraph infgraph = reasoner.bind(data);
-        TestUtil.assertIteratorValues(this, 
-            infgraph.find(a, p, null), 
+        TestUtil.assertIteratorValues(this,
+            infgraph.find(a, p, null),
             new Object[] {
                 Triple.create(a, p, b),
                 Triple.create(a, p, d),
@@ -431,8 +436,8 @@ public class TestBackchainer extends TestCase {
     /**
      * Test basic rule operations - simple AND/OR with tabling.
      */
-    public void testBaseRulesXSB1() {    
-        Graph data = GraphMemFactory.createGraphMem();
+    public void testBaseRulesXSB1() {
+        Graph data = createGraphForTest();
         data.add(Triple.create(p, c, q));
         data.add(Triple.create(q, c, r));
         data.add(Triple.create(p, d, q));
@@ -445,19 +450,19 @@ public class TestBackchainer extends TestCase {
         );
         Reasoner reasoner =  createReasoner(rules);
         InfGraph infgraph = reasoner.bind(data);
-        TestUtil.assertIteratorValues(this, 
-            infgraph.find(p, a, null), 
+        TestUtil.assertIteratorValues(this,
+            infgraph.find(p, a, null),
             new Object[] {
                 Triple.create(p, a, q),
                 Triple.create(p, a, r)
             } );
     }
-    
+
     /**
      * Test basic functor usage.
      */
     public void testFunctors1() {
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(a, p, b));
         data.add(Triple.create(a, q, c));
         List<Rule> rules = Rule.parseRules(
@@ -466,18 +471,18 @@ public class TestBackchainer extends TestCase {
         );
         Reasoner reasoner =  createReasoner(rules);
         InfGraph infgraph = reasoner.bind(data);
-        TestUtil.assertIteratorValues(this, 
-            infgraph.find(a, s, null), 
+        TestUtil.assertIteratorValues(this,
+            infgraph.find(a, s, null),
             new Object[] {
                 Triple.create(a, s, b)
             } );
     }
-    
+
     /**
      * Test basic functor usage.
      */
     public void testFunctors2() {
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(a, p, b));
         data.add(Triple.create(a, q, c));
         data.add(Triple.create(a, t, d));
@@ -489,19 +494,19 @@ public class TestBackchainer extends TestCase {
         );
         Reasoner reasoner =  createReasoner(rules);
         InfGraph infgraph = reasoner.bind(data);
-        TestUtil.assertIteratorValues(this, 
-            infgraph.find(a, s, null), 
+        TestUtil.assertIteratorValues(this,
+            infgraph.find(a, s, null),
             new Object[] {
                 Triple.create(a, s, b),
                 Triple.create(a, s, d)
             } );
     }
-    
+
     /**
      * Test basic functor usage.
      */
     public void testFunctors3() {
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(a, s, b));
         data.add(Triple.create(a, t, c));
         List<Rule> rules = Rule.parseRules(
@@ -511,8 +516,8 @@ public class TestBackchainer extends TestCase {
         );
         Reasoner reasoner =  createReasoner(rules);
         InfGraph infgraph = reasoner.bind(data);
-        TestUtil.assertIteratorValues(this, 
-            infgraph.find(a, r, null), 
+        TestUtil.assertIteratorValues(this,
+            infgraph.find(a, r, null),
             new Object[] {
                 Triple.create(a, r, c)
             } );
@@ -522,7 +527,7 @@ public class TestBackchainer extends TestCase {
      * Test basic builtin usage.
      */
     public void testBuiltin1() {
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         List<Rule> rules = Rule.parseRules(
             "[a1: -> (a p 2) ]" +
             "[a2: -> (a q 3) ]" +
@@ -530,18 +535,18 @@ public class TestBackchainer extends TestCase {
         );
         Reasoner reasoner =  createReasoner(rules);
         InfGraph infgraph = reasoner.bind(data);
-        TestUtil.assertIteratorValues(this, 
-            infgraph.find(a, r, null), 
+        TestUtil.assertIteratorValues(this,
+            infgraph.find(a, r, null),
             new Object[] {
                 Triple.create(a, r, Util.makeIntNode(5))
             } );
     }
-   
+
     /**
      * Test basic builtin usage.
      */
     public void testBuiltin2() {
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(a, p, b));
         data.add(Triple.create(a, q, c));
         List<Rule> rules = Rule.parseRules(
@@ -550,54 +555,54 @@ public class TestBackchainer extends TestCase {
         );
         Reasoner reasoner =  createReasoner(rules);
         InfGraph infgraph = reasoner.bind(data);
-        TestUtil.assertIteratorValues(this, 
-            infgraph.find(a, r, null), 
+        TestUtil.assertIteratorValues(this,
+            infgraph.find(a, r, null),
             new Object[] {
                 Triple.create(a, r, b)
             } );
-        TestUtil.assertIteratorValues(this, 
-            infgraph.find(null, r, null), 
+        TestUtil.assertIteratorValues(this,
+            infgraph.find(null, r, null),
             new Object[] {
                 Triple.create(a, r, c)
             } );
     }
-   
+
     /**
      * Test basic builtin usage.
      */
     public void testBuiltin3() {
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         List<Rule> rules = Rule.parseRules(
             "[r1: (a p b ) <- unbound(?x) ]"
         );
         Reasoner reasoner =  createReasoner(rules);
         InfGraph infgraph = reasoner.bind(data);
-        TestUtil.assertIteratorValues(this, 
-            infgraph.find(a, null, null), 
+        TestUtil.assertIteratorValues(this,
+            infgraph.find(a, null, null),
             new Object[] {
                 Triple.create(a, p, b)
             } );
     }
-  
+
     /**
      * Test basic ground head patterns.
      */
     public void testGroundHead() {
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(a, r, b));
         List<Rule> rules = Rule.parseRules(
             "[r1: (a p b ) <- (a r b) ]"
         );
         Reasoner reasoner =  createReasoner(rules);
         InfGraph infgraph = reasoner.bind(data);
-        TestUtil.assertIteratorValues(this, 
-            infgraph.find(a, null, null), 
+        TestUtil.assertIteratorValues(this,
+            infgraph.find(a, null, null),
             new Object[] {
                 Triple.create(a, p, b),
                 Triple.create(a, r, b)
             } );
     }
-  
+
 //    /**
 //     * Test multiheaded rule.
 //     */
@@ -610,8 +615,8 @@ public class TestBackchainer extends TestCase {
 //        );
 //        Reasoner reasoner =  createReasoner(rules);
 //        InfGraph infgraph = reasoner.bind(data);
-//        TestUtil.assertIteratorValues(this, 
-//            infgraph.find(null, s, null), 
+//        TestUtil.assertIteratorValues(this,
+//            infgraph.find(null, s, null),
 //            new Object[] {
 //                Triple.create(a, s, c),
 //                Triple.create(c, s, a)
@@ -622,25 +627,25 @@ public class TestBackchainer extends TestCase {
      * Test rebind operation
      */
     public void testRebind() {
-        List<Rule> rules = Rule.parseRules("[r1: (?a r ?c) <- (?a p ?b),(?b p ?c)]");        
-        Graph data = GraphMemFactory.createGraphMem();
+        List<Rule> rules = Rule.parseRules("[r1: (?a r ?c) <- (?a p ?b),(?b p ?c)]");
+        Graph data = createGraphForTest();
         data.add(Triple.create(a, p, b));
         data.add(Triple.create(b, p, c));
         data.add(Triple.create(b, p, d));
         Reasoner reasoner =  createReasoner(rules);
         InfGraph infgraph = reasoner.bind(data);
-        TestUtil.assertIteratorValues(this, 
-            infgraph.find(null, r, null), 
+        TestUtil.assertIteratorValues(this,
+            infgraph.find(null, r, null),
             new Object[] {
                 Triple.create(a, r, c),
                 Triple.create(a, r, d)
             } );
-        Graph ndata = GraphMemFactory.createGraphMem();
+        Graph ndata = createGraphForTest();
         ndata.add(Triple.create(a, p, d));
         ndata.add(Triple.create(d, p, b));
         infgraph.rebind(ndata);
-        TestUtil.assertIteratorValues(this, 
-            infgraph.find(null, r, null), 
+        TestUtil.assertIteratorValues(this,
+            infgraph.find(null, r, null),
             new Object[] {
                 Triple.create(a, r, b)
             } );
@@ -650,21 +655,21 @@ public class TestBackchainer extends TestCase {
     /**
      * Test troublesome rdfs rules
      */
-    public void testRDFSProblemsb() {    
-        Graph data = GraphMemFactory.createGraphMem();
+    public void testRDFSProblemsb() {
+        Graph data = createGraphForTest();
         data.add(Triple.create(C1, sC, C2));
         data.add(Triple.create(C2, sC, C3));
         data.add(Triple.create(C1, ty, RDFS.Class.asNode()));
         data.add(Triple.create(C2, ty, RDFS.Class.asNode()));
         data.add(Triple.create(C3, ty, RDFS.Class.asNode()));
         List<Rule> rules = Rule.parseRules(
-        "[rdfs8:  (?a rdfs:subClassOf ?b), (?b rdfs:subClassOf ?c) -> (?a rdfs:subClassOf ?c)]" + 
+        "[rdfs8:  (?a rdfs:subClassOf ?b), (?b rdfs:subClassOf ?c) -> (?a rdfs:subClassOf ?c)]" +
         "[rdfs7:  (?a rdf:type rdfs:Class) -> (?a rdfs:subClassOf ?a)]"
-                        );        
+                        );
         Reasoner reasoner =  createReasoner(rules);
         InfGraph infgraph = reasoner.bind(data);
-        TestUtil.assertIteratorValues(this, 
-            infgraph.find(null, sC, null), 
+        TestUtil.assertIteratorValues(this,
+            infgraph.find(null, sC, null),
             new Object[] {
                 Triple.create(C1, sC, C2),
                 Triple.create(C1, sC, C3),
@@ -678,31 +683,31 @@ public class TestBackchainer extends TestCase {
     /**
      * Test troublesome rdfs rules
      */
-    public void testRDFSProblems() {    
-        Graph data = GraphMemFactory.createGraphMem();
+    public void testRDFSProblems() {
+        Graph data = createGraphForTest();
         data.add(Triple.create(p, sP, q));
         data.add(Triple.create(q, sP, r));
         data.add(Triple.create(C1, sC, C2));
         data.add(Triple.create(C2, sC, C3));
         data.add(Triple.create(a, ty, C1));
         List<Rule> rules = Rule.parseRules(
-        "[rdfs8:  (?a rdfs:subClassOf ?b), (?b rdfs:subClassOf ?c) -> (?a rdfs:subClassOf ?c)]" + 
+        "[rdfs8:  (?a rdfs:subClassOf ?b), (?b rdfs:subClassOf ?c) -> (?a rdfs:subClassOf ?c)]" +
         "[rdfs9:  (?x rdfs:subClassOf ?y), (?a rdf:type ?x) -> (?a rdf:type ?y)]" +
 //        "[-> (rdf:type rdfs:range rdfs:Class)]" +
         "[rdfs3:  (?x ?p ?y), (?p rdfs:range ?c) -> (?y rdf:type ?c)]" +
         "[rdfs7:  (?a rdf:type rdfs:Class) -> (?a rdfs:subClassOf ?a)]"
-                        );        
+                        );
         Reasoner reasoner =  createReasoner(rules);
         InfGraph infgraph = reasoner.bind(data);
-        TestUtil.assertIteratorValues(this, 
-            infgraph.find(a, ty, null), 
+        TestUtil.assertIteratorValues(this,
+            infgraph.find(a, ty, null),
             new Object[] {
                 Triple.create(a, ty, C1),
                 Triple.create(a, ty, C2),
                 Triple.create(a, ty, C3)
             } );
-        TestUtil.assertIteratorValues(this, 
-            infgraph.find(C1, sC, a), 
+        TestUtil.assertIteratorValues(this,
+            infgraph.find(C1, sC, a),
             new Object[] {
             } );
     }
@@ -710,32 +715,32 @@ public class TestBackchainer extends TestCase {
     /**
      * Test complex rule head unification
      */
-    public void testHeadUnify() {    
-        Graph data = GraphMemFactory.createGraphMem();
+    public void testHeadUnify() {
+        Graph data = createGraphForTest();
         data.add(Triple.create(c, q, d));
         List<Rule> rules = Rule.parseRules(
             "[r1: (c r ?x) <- (?x p f(?x b))]" +
             "[r2: (?y p f(a ?y)) <- (c q ?y)]"
-                          );        
+                          );
         Reasoner reasoner =  createReasoner(rules);
         InfGraph infgraph = reasoner.bind(data);
-        TestUtil.assertIteratorValues(this, 
+        TestUtil.assertIteratorValues(this,
               infgraph.find(c, r, null), new Object[] { } );
-              
+
         data.add(Triple.create(c, q, a));
         rules = Rule.parseRules(
         "[r1: (c r ?x) <- (?x p f(?x a))]" +
         "[r2: (?y p f(a ?y)) <- (c q ?y)]"
-                          );        
+                          );
         reasoner =  createReasoner(rules);
         infgraph = reasoner.bind(data);
-        TestUtil.assertIteratorValues(this, 
-              infgraph.find(c, r, null), 
+        TestUtil.assertIteratorValues(this,
+              infgraph.find(c, r, null),
               new Object[] {
                   Triple.create(c, r, a)
               } );
-            
-        data = GraphMemFactory.createGraphMem();
+
+        data = createGraphForTest();
         data.add(Triple.create(a, q, a));
         data.add(Triple.create(a, q, b));
         data.add(Triple.create(a, q, c));
@@ -744,23 +749,23 @@ public class TestBackchainer extends TestCase {
         rules = Rule.parseRules(
           "[r1: (c r ?x) <- (?x p ?x)]" +
           "[r2: (?x p ?y) <- (a q ?x), (b q ?y)]"
-                          );        
+                          );
         reasoner =  createReasoner(rules);
         infgraph = reasoner.bind(data);
-        TestUtil.assertIteratorValues(this, 
-              infgraph.find(c, r, null), 
+        TestUtil.assertIteratorValues(this,
+              infgraph.find(c, r, null),
               new Object[] {
                   Triple.create(c, r, b)
               } );
-              
+
         rules = Rule.parseRules(
           "[r1: (c r ?x) <- (?x p ?x)]" +
           "[r2: (a p ?x) <- (a q ?x)]"
-                          );        
+                          );
         reasoner =  createReasoner(rules);
         infgraph = reasoner.bind(data);
-        TestUtil.assertIteratorValues(this, 
-              infgraph.find(c, r, null), 
+        TestUtil.assertIteratorValues(this,
+              infgraph.find(c, r, null),
               new Object[] {
                   Triple.create(c, r, a)
               } );
@@ -769,8 +774,8 @@ public class TestBackchainer extends TestCase {
     /**
      * Test restriction example
      */
-    public void testRestriction1() {    
-        Graph data = GraphMemFactory.createGraphMem();
+    public void testRestriction1() {
+        Graph data = createGraphForTest();
         data.add(Triple.create(a, ty, r));
         data.add(Triple.create(a, p, b));
         data.add(Triple.create(r, sC, C1));
@@ -781,23 +786,23 @@ public class TestBackchainer extends TestCase {
     "[restriction2: (?C owl:onProperty ?P), (?C owl:allValuesFrom ?D) -> (?C owl:equivalentClass all(?P, ?D))]" +
     "[rs2: (?D owl:equivalentClass all(?P,?C)), (?X rdf:type ?D) -> (?X rdf:type all(?P,?C))]" +
     "[rp4: (?X rdf:type all(?P, ?C)), (?X ?P ?Y) -> (?Y rdf:type ?C)]"
-                          );        
+                          );
         Reasoner reasoner =  createReasoner(rules);
         InfGraph infgraph = reasoner.bind(data);
-        TestUtil.assertIteratorValues(this, 
+        TestUtil.assertIteratorValues(this,
               infgraph.find(b, ty, c), new Object[] {
                   Triple.create(b, ty, c)
               } );
     }
-    
+
 
     /**
      * Test restriction example. The rules are more than the minimum required
      * to solve the query and they interact to given run away seaches if there
-     * is a problem. 
+     * is a problem.
      */
-    public void testRestriction2() {    
-        Graph data = GraphMemFactory.createGraphMem();
+    public void testRestriction2() {
+        Graph data = createGraphForTest();
         data.add(Triple.create(a, ty, OWL.Thing.asNode()));
         data.add(Triple.create(p, ty, OWL.FunctionalProperty.asNode()));
         data.add(Triple.create(c, OWL.equivalentClass.asNode(), C1));
@@ -806,32 +811,32 @@ public class TestBackchainer extends TestCase {
         data.add(Triple.create(C1, OWL.maxCardinality.asNode(), Util.makeIntNode(1)));
         List<Rule> rules = Rule.parseRules(
         // these ones are required for the inference.
-        "[rdfs9:  bound(?y)   (?x rdfs:subClassOf ?y) (?a rdf:type ?x) -> (?a rdf:type ?y)]" + 
+        "[rdfs9:  bound(?y)   (?x rdfs:subClassOf ?y) (?a rdf:type ?x) -> (?a rdf:type ?y)]" +
         "[restriction4: (?C rdf:type owl:Restriction), (?C owl:onProperty ?P), (?C owl:maxCardinality ?X) -> (?C owl:equivalentClass max(?P, ?X))]" +
         "[restrictionProc11: (?P rdf:type owl:FunctionalProperty), (?X rdf:type owl:Thing) -> (?X rdf:type max(?P, 1))]" +
 //        "[equivalentClass1: (?P owl:equivalentClass ?Q) -> (?P rdfs:subClassOf ?Q), (?Q rdfs:subClassOf ?P) ]" +
         "[equivalentClass1: (?P owl:equivalentClass ?Q) -> (?P rdfs:subClassOf ?Q) ]" +
         "[equivalentClass1: (?P owl:equivalentClass ?Q) -> (?Q rdfs:subClassOf ?P) ]" +
         "[restrictionSubclass1: bound(?D) (?D owl:equivalentClass ?R), isFunctor(?R) (?X rdf:type ?R)-> (?X rdf:type ?D)]" +
-         // these ones are noise which can cause run aways or failures if there are bugs        
-        "[rdfs8:  unbound(?c) (?a rdfs:subClassOf ?b) (?b rdfs:subClassOf ?c) -> (?a rdfs:subClassOf ?c)]" + 
-        "[rdfs8:  bound(?c)   (?b rdfs:subClassOf ?c) (?a rdfs:subClassOf ?b) -> (?a rdfs:subClassOf ?c)]" + 
-        "[rdfs9:  unbound(?y) (?a rdf:type ?x) (?x rdfs:subClassOf ?y) -> (?a rdf:type ?y)]" + 
+         // these ones are noise which can cause run aways or failures if there are bugs
+        "[rdfs8:  unbound(?c) (?a rdfs:subClassOf ?b) (?b rdfs:subClassOf ?c) -> (?a rdfs:subClassOf ?c)]" +
+        "[rdfs8:  bound(?c)   (?b rdfs:subClassOf ?c) (?a rdfs:subClassOf ?b) -> (?a rdfs:subClassOf ?c)]" +
+        "[rdfs9:  unbound(?y) (?a rdf:type ?x) (?x rdfs:subClassOf ?y) -> (?a rdf:type ?y)]" +
         "[-> (rdf:type      rdfs:range rdfs:Class)]" +
-        "[rdfs3:  bound(?c)   (?p rdfs:range ?c) (?x ?p ?y) -> (?y rdf:type ?c)]" + 
+        "[rdfs3:  bound(?c)   (?p rdfs:range ?c) (?x ?p ?y) -> (?y rdf:type ?c)]" +
         "[rdfs7:  (?a rdf:type rdfs:Class) -> (?a rdfs:subClassOf ?a)]" +
         "[restrictionProc13: (owl:Thing rdfs:subClassOf all(?P, ?C)) -> (?P rdfs:range ?C)]" +
         "[restrictionSubclass1: unbound(?D) (?X rdf:type ?R), isFunctor(?R) (?D owl:equivalentClass ?R) -> (?X rdf:type ?D)]" +
         "[restrictionSubclass2: bound(?R), isFunctor(?R), (?D owl:equivalentClass ?R),(?X rdf:type ?D) -> (?X rdf:type ?R)]" +
         "[restrictionSubclass2: unbound(?R), (?X rdf:type ?D), (?D owl:equivalentClass ?R) isFunctor(?R) -> (?X rdf:type ?R)]" +
-                       ""  );        
+                       ""  );
         Reasoner reasoner =  createReasoner(rules);
         InfGraph infgraph = reasoner.bind(data);
-        TestUtil.assertIteratorValues(this, 
+        TestUtil.assertIteratorValues(this,
               infgraph.find(a, ty, C1), new Object[] {
                   Triple.create(a, ty, C1)
               } );
-        TestUtil.assertIteratorValues(this, 
+        TestUtil.assertIteratorValues(this,
               infgraph.find(a, ty, c), new Object[] {
                   Triple.create(a, ty, c)
               } );
@@ -840,8 +845,8 @@ public class TestBackchainer extends TestCase {
     /**
      * Test restriction example
      */
-    public void testRestriction3() {    
-        Graph data = GraphMemFactory.createGraphMem();
+    public void testRestriction3() {
+        Graph data = createGraphForTest();
         data.add(Triple.create(a, ty, r));
         data.add(Triple.create(r, sC, C1));
         data.add(Triple.create(C1, ty, OWL.Restriction.asNode()));
@@ -850,16 +855,16 @@ public class TestBackchainer extends TestCase {
         List<Rule> rules = Rule.parseRules(
         "[-> (rdfs:subClassOf rdfs:range rdfs:Class)]" +
 //        "[-> (owl:Class rdfs:subClassOf rdfs:Class)]" +
-        "[rdfs3:  bound(?c)   (?p rdfs:range ?c) (?x ?p ?y) -> (?y rdf:type ?c)]" + 
-        "[rdfs3:  unbound(?c) (?x ?p ?y), (?p rdfs:range ?c) -> (?y rdf:type ?c)]" +    
+        "[rdfs3:  bound(?c)   (?p rdfs:range ?c) (?x ?p ?y) -> (?y rdf:type ?c)]" +
+        "[rdfs3:  unbound(?c) (?x ?p ?y), (?p rdfs:range ?c) -> (?y rdf:type ?c)]" +
         "[rdfs7:  (?a rdf:type rdfs:Class) -> (?a rdfs:subClassOf ?a)]" +
-        "[rdfs8:  (?a rdfs:subClassOf ?b) (?b rdfs:subClassOf ?c) -> (?a rdfs:subClassOf ?c)]" + 
+        "[rdfs8:  (?a rdfs:subClassOf ?b) (?b rdfs:subClassOf ?c) -> (?a rdfs:subClassOf ?c)]" +
         "[restrictionProc4b: bound(?Y) (?X ?P ?Y), notEqual(?P, rdf:type), (?X rdf:type all(?P, ?C)),-> (?Y rdf:type ?C)]" +
         "[restrictionProc4b: unbound(?Y), (?X rdf:type all(?P, ?C)), (?X ?P ?Y), notEqual(?P, rdf:type),-> (?Y rdf:type ?C)]" +
-                       ""  );        
+                       ""  );
         Reasoner reasoner =  createReasoner(rules);
         InfGraph infgraph = reasoner.bind(data);
-        TestUtil.assertIteratorValues(this, 
+        TestUtil.assertIteratorValues(this,
               infgraph.find(null, ty, c), new Object[] {
               } );
     }
@@ -867,8 +872,8 @@ public class TestBackchainer extends TestCase {
     /**
      * Test close and halt operation.
      */
-    public void testClose() {    
-        Graph data = GraphMemFactory.createGraphMem();
+    public void testClose() {
+        Graph data = createGraphForTest();
         data.add(Triple.create(p, sP, q));
         data.add(Triple.create(q, sP, r));
         data.add(Triple.create(C1, sC, C2));
@@ -876,12 +881,12 @@ public class TestBackchainer extends TestCase {
         data.add(Triple.create(a, ty, C1));
         data.add(Triple.create(ty, RDFS.range.asNode(), RDFS.Class.asNode()));
         List<Rule> rules = Rule.parseRules(
-        "[rdfs8:  (?a rdfs:subClassOf ?b), (?b rdfs:subClassOf ?c) -> (?a rdfs:subClassOf ?c)]" + 
+        "[rdfs8:  (?a rdfs:subClassOf ?b), (?b rdfs:subClassOf ?c) -> (?a rdfs:subClassOf ?c)]" +
         "[rdfs9:  (?x rdfs:subClassOf ?y), (?a rdf:type ?x) -> (?a rdf:type ?y)]" +
 //        "[-> (rdf:type rdfs:range rdfs:Class)]" +
         "[rdfs3:  (?x ?p ?y), (?p rdfs:range ?c) -> (?y rdf:type ?c)]" +
         "[rdfs7:  (?a rdf:type rdfs:Class) -> (?a rdfs:subClassOf ?a)]"
-                        );        
+                        );
         Reasoner reasoner =  createReasoner(rules);
         InfGraph infgraph = reasoner.bind(data);
         // Get just one result
@@ -891,8 +896,8 @@ public class TestBackchainer extends TestCase {
         assertEquals(result.getPredicate(), ty);
         it.close();
         // Make sure if we start again we get the full listing.
-        TestUtil.assertIteratorValues(this, 
-            infgraph.find(a, ty, null), 
+        TestUtil.assertIteratorValues(this,
+            infgraph.find(a, ty, null),
             new Object[] {
                 Triple.create(a, ty, C1),
                 Triple.create(a, ty, C2),
@@ -904,7 +909,7 @@ public class TestBackchainer extends TestCase {
      * Test problematic rdfs case
      */
     public void testBug1() {
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         Node p = NodeFactory.createURI("http://www.hpl.hp.com/semweb/2003/eg#p");
         Node r = NodeFactory.createURI("http://www.hpl.hp.com/semweb/2003/eg#r");
         Node C1 = NodeFactory.createURI("http://www.hpl.hp.com/semweb/2003/eg#C1");
@@ -912,12 +917,12 @@ public class TestBackchainer extends TestCase {
         List<Rule> rules = Rule.parseRules(Util.loadRuleParserFromResourceFile("testing/reasoners/bugs/rdfs-error1.brules"));
         Reasoner reasoner =  createReasoner(rules);
         InfGraph infgraph = reasoner.bind(data);
-        TestUtil.assertIteratorValues(this, 
-            infgraph.find(b, ty, C1), 
+        TestUtil.assertIteratorValues(this,
+            infgraph.find(b, ty, C1),
             new Object[] {
                 Triple.create(b, ty, C1)
             } );
-        
+
     }
-    
+
 }
diff --git a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestBasicLP.java b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestBasicLP.java
index 3d6770c432..ab9d2922d3 100644
--- a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestBasicLP.java
+++ b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestBasicLP.java
@@ -51,7 +51,7 @@ import java.util.List;
  * </p>
  */
 public class TestBasicLP  extends TestCase {
-    
+
     // Useful constants
     Node p = NodeFactory.createURI("p");
     Node q = NodeFactory.createURI("q");
@@ -77,23 +77,28 @@ public class TestBasicLP  extends TestCase {
 
     /**
      * Boilerplate for junit
-     */ 
+     */
     public TestBasicLP( String name ) {
-        super( name ); 
+        super( name );
     }
-    
+
     /**
      * Boilerplate for junit.
      * This is its own test suite
      */
     public static TestSuite suite() {
 //        return new TestSuite( TestBasicLP.class );
-        
+
         TestSuite suite = new TestSuite();
         suite.addTest(new TestBasicLP( "testCME" ));
         return suite;
-    }  
-   
+    }
+
+    @SuppressWarnings("removal")
+    private static  Graph createGraphForTest() {
+        return GraphMemFactory.createGraphMem();
+    }
+
     /**
      * Return an inference graph working over the given rule set and raw data.
      * Can be overridden by subclasses of this test class.
@@ -106,7 +111,7 @@ public class TestBasicLP  extends TestCase {
 //        infgraph.setTraceOn(true);
         return infgraph;
     }
-   
+
     /**
      * Return an inference graph working over the given rule set and raw data.
      * Can be overridden by subclasses of this test class.
@@ -123,108 +128,108 @@ public class TestBasicLP  extends TestCase {
         }
         return infgraph;
     }
-    
+
     /**
      * Test basic rule operations - lookup, no matching rules
      */
-    public void testBaseRules1() {    
-        doBasicTest("[r1: (?x r c) <- (?x p b)]", 
+    public void testBaseRules1() {
+        doBasicTest("[r1: (?x r c) <- (?x p b)]",
                      Triple.create(Node.ANY, p, b),
                      new Object[] {
                         Triple.create(a, p, b)
                      } );
     }
-   
+
     /**
      * Test basic rule operations - simple chain rule
      */
-    public void testBaseRules2() {    
-        doBasicTest("[r1: (?x r c) <- (?x p b)]", 
+    public void testBaseRules2() {
+        doBasicTest("[r1: (?x r c) <- (?x p b)]",
                      Triple.create(Node.ANY, r, c),
                      new Object[] {
                         Triple.create(a, r, c)
                      } );
     }
-   
+
     /**
      * Test basic rule operations - chain rule with head unification
      */
-    public void testBaseRules3() {    
-        doBasicTest("[r1: (?x r ?x) <- (?x p b)]", 
+    public void testBaseRules3() {
+        doBasicTest("[r1: (?x r ?x) <- (?x p b)]",
                      Triple.create(Node.ANY, r, a),
                      new Object[] {
                         Triple.create(a, r, a)
                      } );
     }
-    
+
     /**
      * Test basic rule operations - rule with head unification, non-temp var
      */
-    public void testBaseRules4() {    
-        doBasicTest("[r1: (?x r ?x) <- (?y p b), (?x p b)]", 
+    public void testBaseRules4() {
+        doBasicTest("[r1: (?x r ?x) <- (?y p b), (?x p b)]",
                      Triple.create(Node.ANY, r, a),
                      new Object[] {
                         Triple.create(a, r, a)
                      } );
     }
-    
+
     /**
      * Test basic rule operations - simple cascade
      */
-    public void testBaseRules5() {    
+    public void testBaseRules5() {
         doBasicTest("[r1: (?x q ?y) <- (?x r ?y)(?y s ?x)]" +
-                    "[r2: (?x r ?y) <- (?x p ?y)]" + 
-                    "[r3: (?x s ?y) <- (?y p ?x)]", 
+                    "[r2: (?x r ?y) <- (?x p ?y)]" +
+                    "[r3: (?x s ?y) <- (?y p ?x)]",
                      Triple.create(Node.ANY, q, Node.ANY),
                      new Object[] {
                         Triple.create(a, q, b)
                      } );
     }
-   
+
     /**
      * Test basic rule operations - chain rule which will fail at head time
      */
-    public void testBaseRules6() {    
-        doBasicTest("[r1: (?x r ?x) <- (?x p b)]", 
+    public void testBaseRules6() {
+        doBasicTest("[r1: (?x r ?x) <- (?x p b)]",
                      Triple.create(a, r, b),
                      new Object[] {
                      } );
     }
-   
+
     /**
      * Test basic rule operations - chain rule which will fail in search
      */
-    public void testBaseRules7() {    
-        doBasicTest("[r1: (?x r ?y) <- (?x p c)]", 
+    public void testBaseRules7() {
+        doBasicTest("[r1: (?x r ?y) <- (?x p c)]",
                      Triple.create(a, r, b),
                      new Object[] {
                      } );
     }
-    
+
     /**
      * Test basic rule operations - simple chain
      */
-    public void testBaseRules8() {    
+    public void testBaseRules8() {
         doBasicTest("[r1: (?x q ?y) <- (?x r ?y)]" +
-                    "[r2: (?x r ?y) <- (?x p ?y)]", 
+                    "[r2: (?x r ?y) <- (?x p ?y)]",
                      Triple.create(Node.ANY, q, Node.ANY),
                      new Object[] {
                         Triple.create(a, q, b)
                      } );
     }
-    
+
     /**
      * Test basic rule operations - simple chain
      */
-    public void testBaseRules9() {    
+    public void testBaseRules9() {
         doBasicTest("[r1: (?x q ?y) <- (?x r ?y)]" +
-                    "[r2: (?x r ?y) <- (?y p ?x)]", 
+                    "[r2: (?x r ?y) <- (?y p ?x)]",
                      Triple.create(Node.ANY, q, Node.ANY),
                      new Object[] {
                         Triple.create(b, q, a)
                      } );
     }
-    
+
     /**
      * Test backtracking - simple triple query.
      */
@@ -242,7 +247,7 @@ public class TestBasicLP  extends TestCase {
                     Triple.create(a, p, d)
                 } );
     }
-    
+
     /**
      * Test backtracking - chain to simple triple query.
      */
@@ -260,7 +265,7 @@ public class TestBasicLP  extends TestCase {
                     Triple.create(a, r, d)
                 } );
     }
-    
+
     /**
      * Test backtracking - simple choice point
      */
@@ -278,7 +283,7 @@ public class TestBasicLP  extends TestCase {
                     Triple.create(a, r, C3)
                 } );
     }
-    
+
     /**
      * Test backtracking - nested choice point
      */
@@ -300,7 +305,7 @@ public class TestBasicLP  extends TestCase {
                     Triple.create(a, s, D3)
                 } );
     }
-    
+
     /**
      * Test backtracking - nested choice point with multiple triple matches
      */
@@ -322,7 +327,7 @@ public class TestBasicLP  extends TestCase {
                     Triple.create(b, s, C2)
                 } );
     }
-    
+
     /**
      * Test backtracking - nested choice point with multiple triple matches, and
      * checking temp v. permanent variable usage
@@ -345,7 +350,7 @@ public class TestBasicLP  extends TestCase {
                     Triple.create(D2, s, C2),
                 } );
     }
-    
+
     /**
      * Test backtracking - nested choice point with simple triple matches
      */
@@ -370,7 +375,7 @@ public class TestBasicLP  extends TestCase {
                     Triple.create(a, s, C3),
                 } );
     }
-    
+
     /**
      * Test backtracking - nested choice point with simple triple matches,
      * permanent vars but used just once in body
@@ -397,7 +402,7 @@ public class TestBasicLP  extends TestCase {
                     Triple.create(a, s, C3),
                 } );
     }
-   
+
     /**
      * Test backtracking - multiple triple matches
      */
@@ -418,7 +423,7 @@ public class TestBasicLP  extends TestCase {
                     Triple.create(b, s, D2),
                 } );
     }
-   
+
     /**
      * Test backtracking - multiple triple matches
      */
@@ -441,7 +446,7 @@ public class TestBasicLP  extends TestCase {
                     Triple.create(a, s, D2),
                 } );
     }
-    
+
     /**
      * Test clause order is right
      */
@@ -450,7 +455,7 @@ public class TestBasicLP  extends TestCase {
             "[r1: (?x r C1) <- (?x p b)]" +
             "[r1: (?x r C2) <- (?x p b)]" +
             "[r2: (?x r C3) <- (?x r C3) (?x p b)]");
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(a, p, b));
         InfGraph infgraph =  makeInfGraph(rules, data);
         ExtendedIterator<Triple> i = infgraph.find(Node.ANY, r, Node.ANY);
@@ -458,7 +463,7 @@ public class TestBasicLP  extends TestCase {
         assertEquals(i.next(), Triple.create(a, r, C1));
         i.close();
     }
-    
+
     /**
      * Test axioms work.
      */
@@ -498,7 +503,7 @@ public class TestBasicLP  extends TestCase {
                     Triple.create(a, s, c),
                 } );
     }
-    
+
     /**
      * Test simple invocation of a builtin
      */
@@ -514,8 +519,8 @@ public class TestBasicLP  extends TestCase {
                     Triple.create(b, r, Util.makeIntNode(6)),
                 } );
     }
-    
-    
+
+
     /**
      * Test simple invocation of a builtin
      */
@@ -532,7 +537,7 @@ public class TestBasicLP  extends TestCase {
                     Triple.create(b, r, C1),
                 } );
     }
-    
+
     /**
      * Test wildcard predicate usage - simple triple search.
      * Rules look odd because we have to hack around the recursive loops.
@@ -550,7 +555,7 @@ public class TestBasicLP  extends TestCase {
                     Triple.create(b, r, q)
                 } );
     }
-    
+
     /**
      * Test wildcard predicate usage - combind triple search and multiclause matching.
      * Rules look odd because we have to hack around the recursive loops.
@@ -581,7 +586,7 @@ public class TestBasicLP  extends TestCase {
                     Triple.create(a, r, s),
                 } );
     }
-    
+
     /**
      * Test wildcard predicate usage - combined triple search and multiclause matching.
      * Rules look odd because we have to hack around the recursive loops.
@@ -622,7 +627,7 @@ public class TestBasicLP  extends TestCase {
                     Triple.create(c, t, q)
                 } );
     }
-    
+
     /**
      * Test wildcard predicate usage - wildcard in head as well
      */
@@ -710,7 +715,7 @@ public class TestBasicLP  extends TestCase {
                 Triple.create(c, s, d)
             } );
     }
-    
+
     /**
      * Test tabled predicates. Simple chain call case.
      */
@@ -728,7 +733,7 @@ public class TestBasicLP  extends TestCase {
                     Triple.create(b, r, c)
                 } );
     }
-    
+
     /**
      * Test tabled predicates. Simple transitive closure case.
      */
@@ -749,7 +754,7 @@ public class TestBasicLP  extends TestCase {
                     Triple.create(a, p, d),
                 } );
     }
-    
+
     /**
      * Test tabled predicates. Simple transitive closure over normal predicates
      */
@@ -772,7 +777,7 @@ public class TestBasicLP  extends TestCase {
                     Triple.create(a, p, c)
                 } );
     }
-    
+
     /**
      * Test tabled predicates. Co-routining example.
      */
@@ -794,7 +799,7 @@ public class TestBasicLP  extends TestCase {
                     Triple.create(p, a, r)
                 } );
     }
-    
+
     /**
      * Test tabled predicates. Simple transitive closure case.
      */
@@ -816,7 +821,7 @@ public class TestBasicLP  extends TestCase {
                     Triple.create(a, r, d),
                 } );
     }
-   
+
     /**
      * Test tabled predicates. Simple transitive closure case, tabling set
      * by rule base.
@@ -840,7 +845,7 @@ public class TestBasicLP  extends TestCase {
 
     /**
      * Test tabled calls with aliased local vars in the call.
-     */   
+     */
     public void testTabled7() {
         doTest("[r1: (?a q ?b) <- (?a p ?b)]" +
                "[r2: (?a q ?a) <- (?a s ?a)]" +
@@ -860,7 +865,7 @@ public class TestBasicLP  extends TestCase {
                     Triple.create(d, r, C1),
                 } );
     }
-    
+
     /**
      * Test RDFS example.
      */
@@ -884,7 +889,7 @@ public class TestBasicLP  extends TestCase {
                     Triple.create(d, ty, C1),
                 } );
     }
-   
+
     /**
      * Test RDFS example - branched version
      */
@@ -934,8 +939,8 @@ public class TestBasicLP  extends TestCase {
      * A problem from the original backchainer tests - tabled closure operation.
      */
     public void testProblem2() {
-        String ruleSrc = 
-        "[rdfs8:  (?a rdfs:subClassOf ?c) <- (?a rdfs:subClassOf ?b), (?b rdfs:subClassOf ?c)]" + 
+        String ruleSrc =
+        "[rdfs8:  (?a rdfs:subClassOf ?c) <- (?a rdfs:subClassOf ?b), (?b rdfs:subClassOf ?c)]" +
         "[rdfs7:  (?a rdfs:subClassOf ?a) <- (?a rdf:type rdfs:Class)]";
         doTest( ruleSrc,
                 new Node[] { ty, sC },
@@ -1005,11 +1010,11 @@ public class TestBasicLP  extends TestCase {
     }
 
     /**
-     * A problem from the original backchainer tests - RDFS example which threw an NPE 
+     * A problem from the original backchainer tests - RDFS example which threw an NPE
      */
     public void testProblem5() {
-        String ruleSrc = 
-        "[rdfs8:  (?a rdfs:subClassOf ?c) <- (?a rdfs:subClassOf ?b), (?b rdfs:subClassOf ?c)]" + 
+        String ruleSrc =
+        "[rdfs8:  (?a rdfs:subClassOf ?c) <- (?a rdfs:subClassOf ?b), (?b rdfs:subClassOf ?c)]" +
         "[rdfs9:   (?a rdf:type ?y) <- (?x rdfs:subClassOf ?y), (?a rdf:type ?x)]" +
         "[(rdf:type rdfs:range rdfs:Class) <-]" +
         "[rdfs3:  (?y rdf:type ?c) <- (?x ?p ?y), (?p rdfs:range ?c)]" +
@@ -1032,10 +1037,10 @@ public class TestBasicLP  extends TestCase {
     }
 
     /**
-     * A problem from the original backchainer tests - RDFS example which threw an NPE 
+     * A problem from the original backchainer tests - RDFS example which threw an NPE
      */
     public void testProblem6() {
-        String ruleSrc = 
+        String ruleSrc =
         "[rdfs9:   (?a rdf:type ?y) <- (?x rdfs:subClassOf ?y), (?a rdf:type ?x)]" +
         "[restriction2: (?C owl:equivalentClass all(?P, ?D)) <- (?C owl:onProperty ?P), (?C owl:allValuesFrom ?D)]" +
         "[rs2: (?X rdf:type all(?P,?C)) <- (?D owl:equivalentClass all(?P,?C)), (?X rdf:type ?D)]" +
@@ -1060,21 +1065,21 @@ public class TestBasicLP  extends TestCase {
      * Was due to interpeter setup failing to clone input variables.
      */
     public void testProblem7() {
-        String ruleSrc = 
-        "[rdfs8:  (?a rdfs:subClassOf ?c) <- (?a rdfs:subClassOf ?b), (?b rdfs:subClassOf ?c)]" + 
+        String ruleSrc =
+        "[rdfs8:  (?a rdfs:subClassOf ?c) <- (?a rdfs:subClassOf ?b), (?b rdfs:subClassOf ?c)]" +
         "[rdfs9:   (?a rdf:type ?y) <- (?x rdfs:subClassOf ?y), (?a rdf:type ?x)]" +
 //        "[(rdf:type rdfs:range rdfs:Class) <-]" +
 //        "[rdfs3:  (?y rdf:type ?c) <- (?x ?p ?y), (?p rdfs:range ?c)]" +
         "[rdfs3:  (?y rdf:type rdfs:Class) <- (?x rdf:type ?y)]" +
         "[rdfs7:  (?a rdfs:subClassOf ?a) <- (?a rdf:type rdfs:Class)]";
         List<Rule> rules = Rule.parseRules(ruleSrc);
-        Node[] tabled = new Node[] { ty, sC }; 
+        Node[] tabled = new Node[] { ty, sC };
         Triple[] triples = new Triple[] {
                     Triple.create(C1, sC, C2),
                     Triple.create(C2, sC, C3),
                     Triple.create(a, ty, C1)
                 };
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         for ( Triple triple : triples )
         {
             data.add( triple );
@@ -1086,8 +1091,8 @@ public class TestBasicLP  extends TestCase {
         assertEquals(result.getPredicate(), ty);
         it.close();
         // Make sure if we start again we get the full listing.
-        TestUtil.assertIteratorValues(this, 
-            infgraph.find(a, ty, null), 
+        TestUtil.assertIteratorValues(this,
+            infgraph.find(a, ty, null),
             new Object[] {
                 Triple.create(a, ty, C1),
                 Triple.create(a, ty, C2),
@@ -1100,8 +1105,8 @@ public class TestBasicLP  extends TestCase {
      * Was due to unsupported multi-head statement.
      */
     public void testProblem8() {
-        String ruleSrc = 
-        "[rdfs9:   (?a rdf:type ?y) <- bound(?y) (?x rdfs:subClassOf ?y) (?a rdf:type ?x)]" + 
+        String ruleSrc =
+        "[rdfs9:   (?a rdf:type ?y) <- bound(?y) (?x rdfs:subClassOf ?y) (?a rdf:type ?x)]" +
         "[restriction4:  (?C owl:equivalentClass max(?P, ?X)) <- (?C rdf:type owl:Restriction), (?C owl:onProperty ?P), (?C owl:maxCardinality ?X)]" +
         "[restrictionProc11: (?X rdf:type max(?P, 1)) <- (?P rdf:type owl:FunctionalProperty), (?X rdf:type owl:Thing)]" +
         "[equivalentClass1: (?Q rdfs:subClassOf ?P) <- (?P owl:equivalentClass ?Q) ]" +
@@ -1122,7 +1127,7 @@ public class TestBasicLP  extends TestCase {
                     Triple.create(a, ty, c)
                 } );
     }
-      
+
     /**
      * Test derivation machinery
      */
@@ -1131,7 +1136,7 @@ public class TestBasicLP  extends TestCase {
                        "[testRule2: (C2, q, ?a) <- (C1 q ?a)]" +
                        "[testRule3: (a p ?a)  <- (C2 p ?a), (C2 q ?a)]";
         List<Rule> ruleList = Rule.parseRules(rules);
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(C1, p, C3));
         data.add(Triple.create(C1, q, C4));
         data.add(Triple.create(C1, q, C3));
@@ -1142,7 +1147,7 @@ public class TestBasicLP  extends TestCase {
             new Triple[] {
                 Triple.create(a, p, C3)
             });
-        
+
         Iterator<Derivation> derivs = infgraph.getDerivation(Triple.create(a, p, C3));
         StringWriter outString = new StringWriter(250);
         PrintWriter out = new PrintWriter(outString);
@@ -1163,9 +1168,9 @@ public class TestBasicLP  extends TestCase {
     /**
      * A suspect problem, originally derived from the OWL rules - risk of unbound variables escaping.
      * Not managed to isolate or reproduce the problem yet.
-     */ 
+     */
     public void testProblem9() {
-        String ruleSrc = 
+        String ruleSrc =
         "[test:   (?x owl:sameAs ?x) <- (?x rdf:type owl:Thing) ]" +
         "[sameIndividualAs6: (?X rdf:type owl:Thing) <- (?X owl:sameAs ?Y) ]" +
         "[ans:    (?x p C1) <- (?y owl:sameAs ?x)]";
@@ -1187,8 +1192,8 @@ public class TestBasicLP  extends TestCase {
 //                    Triple.create(a, ty, OWL.Thing.asNode()),
 //                    Triple.create(b, ty, OWL.Thing.asNode())
 //                } );
-    } 
-    
+    }
+
     /**
      * Test 3-arg builtins such as arithmetic.
      */
@@ -1225,7 +1230,7 @@ public class TestBasicLP  extends TestCase {
             Util.makeIntNode(4),Util.makeIntNode(3), Util.makeIntNode(4)
         );
     }
-    
+
     /**
      * Test the temporary list builtins
      */
@@ -1233,19 +1238,19 @@ public class TestBasicLP  extends TestCase {
         String ruleSrc = "[(a r ?n) <- (a p ?l), listLength(?l, ?n)]" +
         "[(a s ?e) <- (a p ?l), listEntry(?l, 1, ?e)]";
         List<Rule> rules = Rule.parseRules(ruleSrc);
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(a, p, Util.makeList(new Node[]{C1,C2,C3},data)));
         InfGraph infgraph =  makeInfGraph(rules, data);
-        TestUtil.assertIteratorValues(this, 
-                infgraph.find(Triple.create(a, r, Node.ANY)), 
+        TestUtil.assertIteratorValues(this,
+                infgraph.find(Triple.create(a, r, Node.ANY)),
                 new Triple[] {
                     Triple.create(a, r, Util.makeIntNode(3))
-                }); 
-        TestUtil.assertIteratorValues(this, 
-                infgraph.find(Triple.create(a, s, Node.ANY)), 
+                });
+        TestUtil.assertIteratorValues(this,
+                infgraph.find(Triple.create(a, s, Node.ANY)),
                 new Triple[] {
                     Triple.create(a, s, C2)
-                }); 
+                });
 
         rules = Rule.parseRules(
         "[(a s b) <- (a p ?l), (a, q, ?j) listEqual(?l, ?j)]" +
@@ -1253,41 +1258,41 @@ public class TestBasicLP  extends TestCase {
         "[(a s d) <- (a p ?l), (a, r, ?j) listEqual(?l, ?j)]" +
         "[(a s e) <- (a p ?l), (a, r, ?j) listNotEqual(?l, ?j)]"
             );
-        data = GraphMemFactory.createGraphMem();
-        data.add(Triple.create(a, p, 
+        data = createGraphForTest();
+        data.add(Triple.create(a, p,
             Util.makeList( new Node[]{C1, Util.makeIntNode(3), C3}, data) ));
-        data.add(Triple.create(a, q, 
+        data.add(Triple.create(a, q,
             Util.makeList( new Node[]{C3, C1, Util.makeLongNode(3)}, data) ));
-        data.add(Triple.create(a, r, 
+        data.add(Triple.create(a, r,
             Util.makeList( new Node[]{C3, C1, Util.makeLongNode(2)}, data) ));
         infgraph =  makeInfGraph(rules, data);
-        TestUtil.assertIteratorValues(this, 
-            infgraph.find(Triple.create(a, s, Node.ANY)), 
+        TestUtil.assertIteratorValues(this,
+            infgraph.find(Triple.create(a, s, Node.ANY)),
             new Triple[] {
                 Triple.create(a, s, b),
                 Triple.create(a, s, e),
-            }); 
+            });
 
         rules = Rule.parseRules(
         "[(b r ?j) <- (a p ?l), (a, q, ?j) listContains(?l, ?j)]" +
         "[(b s ?j) <- (a p ?l), (a, q, ?j) listNotContains(?l, ?j)]"
             );
-        data = GraphMemFactory.createGraphMem();
-        data.add(Triple.create(a, p, 
+        data = createGraphForTest();
+        data.add(Triple.create(a, p,
             Util.makeList( new Node[]{C1, Util.makeIntNode(3), C3}, data) ));
         data.add(Triple.create(a, q, C1));
         data.add(Triple.create(a, q, Util.makeLongNode(3)));
         data.add(Triple.create(a, q, C2));
         infgraph =  makeInfGraph(rules, data);
-        TestUtil.assertIteratorValues(this, 
-            infgraph.find(Triple.create(b, Node.ANY, Node.ANY)), 
+        TestUtil.assertIteratorValues(this,
+            infgraph.find(Triple.create(b, Node.ANY, Node.ANY)),
             new Triple[] {
                 Triple.create(b, r, C1),
                 Triple.create(b, r, Util.makeIntNode(3)),
                 Triple.create(b, s, C2),
-            }); 
+            });
     }
-    
+
     /**
      * Test that we detect concurrent modification of LP graphs with
      * non-closed iterators.
@@ -1295,19 +1300,19 @@ public class TestBasicLP  extends TestCase {
     public void testCME() {
         String ruleSrc = "(?a p 1) <- (?a p 0). (?a p 2) <- (?a p 0).";
         List<Rule> rules = Rule.parseRules(ruleSrc);
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(a, p, Util.makeIntNode(0)));
         InfGraph infgraph =  makeInfGraph(rules, data);
-        
+
         // Check the base case works
-        TestUtil.assertIteratorValues(this, 
-                infgraph.find(Triple.create(a, p, Node.ANY)), 
+        TestUtil.assertIteratorValues(this,
+                infgraph.find(Triple.create(a, p, Node.ANY)),
                 new Triple[] {
             Triple.create(a, p, Util.makeIntNode(0)),
             Triple.create(a, p, Util.makeIntNode(1)),
             Triple.create(a, p, Util.makeIntNode(2)),
-                }); 
-        
+                });
+
         // Now force a CME
         boolean ok = false;
         ExtendedIterator<Triple> i = infgraph.find(Triple.create(a, p, Node.ANY));
@@ -1322,8 +1327,8 @@ public class TestBasicLP  extends TestCase {
         }
         assertTrue("Expect CME on unclosed iterators", ok);
     }
-    
-    /** 
+
+    /**
      * Generic test operation.
      * @param ruleSrc the source of the rules
      * @param triples a set of triples to insert in the graph before the query
@@ -1332,16 +1337,16 @@ public class TestBasicLP  extends TestCase {
      */
     private void doTest(String ruleSrc, Triple[] triples, Triple query, Object[] results) {
         List<Rule> rules = Rule.parseRules(ruleSrc);
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         for ( Triple triple : triples )
         {
             data.add( triple );
         }
         InfGraph infgraph =  makeInfGraph(rules, data);
-        TestUtil.assertIteratorValues(this, infgraph.find(query), results); 
+        TestUtil.assertIteratorValues(this, infgraph.find(query), results);
     }
 
-    /** 
+    /**
      * Generic test operation.
      * @param ruleSrc the source of the rules
      * @param tabled the predicates that should be tabled
@@ -1351,17 +1356,17 @@ public class TestBasicLP  extends TestCase {
      */
     private void doTest(String ruleSrc, Node[] tabled, Triple[] triples, Triple query, Object[] results) {
         List<Rule> rules = Rule.parseRules(ruleSrc);
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         for ( Triple triple : triples )
         {
             data.add( triple );
         }
         InfGraph infgraph =  makeInfGraph(rules, data, tabled);
-        TestUtil.assertIteratorValues(this, infgraph.find(query), results); 
+        TestUtil.assertIteratorValues(this, infgraph.find(query), results);
 
     }
-    
-    /** 
+
+    /**
      * Generic base test operation on a graph with the single triple (a, p, b)
      * @param ruleSrc the source of the rules
      * @param query the Triple to search for
@@ -1370,7 +1375,7 @@ public class TestBasicLP  extends TestCase {
     private void doBasicTest(String ruleSrc, Triple query, Object[] results) {
         doTest(ruleSrc, new Triple[]{Triple.create(a,p,b)}, query, results);
     }
-    
+
     /**
      * Generic test operation.
      * @param rule to test a simple builtin operation
@@ -1380,14 +1385,14 @@ public class TestBasicLP  extends TestCase {
      */
     private void doBuiltinTest(String ruleSrc, Node param1, Node param2, Node result) {
         doTest(ruleSrc,
-               new Triple[] { 
+               new Triple[] {
                    Triple.create(a, p, param1),
-                   Triple.create(a, q, param2) 
+                   Triple.create(a, q, param2)
                 },
                 Triple.create(a, r, Node.ANY),
                 new Triple[] {
                     Triple.create(a, r, result)
                 });
     }
-    
+
 }
diff --git a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestBasics.java b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestBasics.java
index 57d6e15a4a..2bf2e8e458 100755
--- a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestBasics.java
+++ b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestBasics.java
@@ -98,6 +98,11 @@ public class TestBasics extends TestCase  {
         return new TestSuite( TestBasics.class );
     }
 
+    @SuppressWarnings("removal")
+    private static  Graph createGraphForTest() {
+        return GraphMemFactory.createGraphMem();
+    }
+
     /**
      * Test the internal rule parser
      */
@@ -390,7 +395,7 @@ public class TestBasics extends TestCase  {
                        "[r4: (n4 ?p ?a) -> (n4, ?a, ?p)]";
         List<Rule> ruleList = Rule.parseRules(rules);
 
-        InfGraph infgraph = new BasicForwardRuleReasoner(ruleList).bind(GraphMemFactory.createGraphMem());
+        InfGraph infgraph = new BasicForwardRuleReasoner(ruleList).bind(createGraphForTest());
         infgraph.add(Triple.create(n1, p, n2));
         infgraph.add(Triple.create(n2, p, n3));
         infgraph.add(Triple.create(n2, q, n3));
@@ -417,7 +422,7 @@ public class TestBasics extends TestCase  {
                        "[testRule3: (n2 p ?a), (n2 q ?a) -> (res p ?a)]";
         List<Rule> ruleList = Rule.parseRules(rules);
 
-        InfGraph infgraph = new BasicForwardRuleReasoner(ruleList).bind(GraphMemFactory.createGraphMem());
+        InfGraph infgraph = new BasicForwardRuleReasoner(ruleList).bind(createGraphForTest());
         infgraph.setDerivationLogging(true);
         infgraph.add(Triple.create(n1, p, n3));
         infgraph.add(Triple.create(n1, q, n4));
@@ -462,7 +467,7 @@ public class TestBasics extends TestCase  {
                        "[axiom1: -> (n1 p n3)]";
         List<Rule> ruleList = Rule.parseRules(rules);
 
-        InfGraph infgraph = new BasicForwardRuleReasoner(ruleList).bind(GraphMemFactory.createGraphMem());
+        InfGraph infgraph = new BasicForwardRuleReasoner(ruleList).bind(createGraphForTest());
         TestUtil.assertIteratorValues(this, infgraph.find(null, null, null),
             new Triple[] {
                 Triple.create(n1, p, n3),
@@ -493,9 +498,9 @@ public class TestBasics extends TestCase  {
                        "[testRule2: (n1 q ?a) -> (n2, q, ?a)]" +
                        "[testRule3: (n2 p ?a), (n2 q ?a) -> (res p ?a)]";
         List<Rule> ruleList = Rule.parseRules(rules);
-        Graph schema = GraphMemFactory.createGraphMem();
+        Graph schema = createGraphForTest();
         schema.add(Triple.create(n1, p, n3));
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(n1, q, n4));
         data.add(Triple.create(n1, q, n3));
 
@@ -565,7 +570,7 @@ public class TestBasics extends TestCase  {
                        "";
         List<Rule> ruleList = Rule.parseRules(rules);
 
-        InfGraph infgraph = new BasicForwardRuleReasoner(ruleList).bind(GraphMemFactory.createGraphMem());
+        InfGraph infgraph = new BasicForwardRuleReasoner(ruleList).bind(createGraphForTest());
         TestUtil.assertIteratorValues(this, infgraph.find(n1, q, null),
             new Triple[] {
                 Triple.create(n1, q, Util.makeIntNode(2)),
@@ -587,7 +592,7 @@ public class TestBasics extends TestCase  {
                        "";
         List<Rule> ruleList = Rule.parseRules(rules);
 
-        InfGraph infgraph = new BasicForwardRuleReasoner(ruleList).bind(GraphMemFactory.createGraphMem());
+        InfGraph infgraph = new BasicForwardRuleReasoner(ruleList).bind(createGraphForTest());
         infgraph.add(Triple.create(n1, p, Util.makeIntNode(1)));
         infgraph.add(Triple.create(n1, p, Util.makeIntNode(2)));
         infgraph.add(Triple.create(n1, q, Util.makeIntNode(2)));
@@ -609,7 +614,7 @@ public class TestBasics extends TestCase  {
                        "";
         List<Rule> ruleList = Rule.parseRules(rules);
 
-        InfGraph infgraph = new BasicForwardRuleReasoner(ruleList).bind(GraphMemFactory.createGraphMem());
+        InfGraph infgraph = new BasicForwardRuleReasoner(ruleList).bind(createGraphForTest());
         infgraph.add(Triple.create(n1, p, Util.makeIntNode(1)));
         infgraph.add(Triple.create(n1, p, Util.makeIntNode(2)));
         infgraph.add(Triple.create(n1, q, Util.makeIntNode(2)));
@@ -627,7 +632,7 @@ public class TestBasics extends TestCase  {
     public void testRebind() {
         String rules = "[rule1: (?x p ?y) -> (?x q ?y)]";
         List<Rule> ruleList = Rule.parseRules(rules);
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(n1, p, n2));
         InfGraph infgraph = new BasicForwardRuleReasoner(ruleList).bind(data);
         TestUtil.assertIteratorValues(this, infgraph.find(n1, null, null),
@@ -635,7 +640,7 @@ public class TestBasics extends TestCase  {
                 Triple.create(n1, p, n2),
                 Triple.create(n1, q, n2)
             });
-        Graph ndata = GraphMemFactory.createGraphMem();
+        Graph ndata = createGraphForTest();
         ndata.add(Triple.create(n1, p, n3));
         infgraph.rebind(ndata);
         TestUtil.assertIteratorValues(this, infgraph.find(n1, null, null),
@@ -651,7 +656,7 @@ public class TestBasics extends TestCase  {
     public void testSize() {
         String rules = "[rule1: (?x p ?y) -> (?x q ?y)]";
         List<Rule> ruleList = Rule.parseRules(rules);
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(n1, p, n2));
         InfGraph infgraph = new BasicForwardRuleReasoner(ruleList).bind(data);
         assertEquals(infgraph.size(), 2);
@@ -685,7 +690,7 @@ public class TestBasics extends TestCase  {
      * Test the list conversion utility that is used in some of the builtins.
      */
     public void testConvertList() {
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         Node first = RDF.Nodes.first;
         Node rest  = RDF.Nodes.rest;
         Node nil = RDF.Nodes.nil;
diff --git a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestFBRules.java b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestFBRules.java
index 4f1323d85e..13748152e8 100644
--- a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestFBRules.java
+++ b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestFBRules.java
@@ -116,6 +116,11 @@ public class TestFBRules extends TestCase {
 //        return suite;
     }
 
+    @SuppressWarnings("removal")
+    private static  Graph createGraphForTest() {
+        return GraphMemFactory.createGraphMem();
+    }
+
     /**
      * Override in subclasses to test other reasoners.
      */
@@ -139,7 +144,7 @@ public class TestFBRules extends TestCase {
      * Assemble a test infGraph from a rule source and empty data
      */
     public InfGraph createInfGraph(String rules) {
-        return createReasoner( Rule.parseRules(rules) ).bind(GraphMemFactory.createGraphMem());
+        return createReasoner( Rule.parseRules(rules) ).bind(createGraphForTest());
     }
 
     /**
@@ -245,9 +250,9 @@ public class TestFBRules extends TestCase {
                        "[testRule3: (n2 p ?a), (n2 q ?a) -> (res p ?a)]" +
                        "[testBRule4: (n3 p ?a) <- (n1, p, ?a)]";
         List<Rule> ruleList = Rule.parseRules(rules);
-        Graph schema = GraphMemFactory.createGraphMem();
+        Graph schema = createGraphForTest();
         schema.add(Triple.create(n1, p, n3));
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(n1, q, n4));
         data.add(Triple.create(n1, q, n3));
 
@@ -294,7 +299,7 @@ public class TestFBRules extends TestCase {
      */
     public void testRebind() {
         String rules = "[rule1: (?x p ?y) -> (?x q ?y)]";
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(n1, p, n2));
         InfGraph infgraph = createInfGraph(rules, data);
         TestUtil.assertIteratorValues(this, infgraph.find(n1, null, null),
@@ -302,7 +307,7 @@ public class TestFBRules extends TestCase {
                 Triple.create(n1, p, n2),
                 Triple.create(n1, q, n2)
             });
-        Graph ndata = GraphMemFactory.createGraphMem();
+        Graph ndata = createGraphForTest();
         ndata.add(Triple.create(n1, p, n3));
         infgraph.rebind(ndata);
         TestUtil.assertIteratorValues(this, infgraph.find(n1, null, null),
@@ -365,7 +370,7 @@ public class TestFBRules extends TestCase {
      */
     public void testClose() {
         String rules = "[rule1: (?x p ?y) -> (?x q ?y)]";
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(n1, p, n2));
         InfGraph infgraph = createInfGraph(rules, data);
         TestUtil.assertIteratorValues(this, infgraph.find(n1, null, null),
@@ -387,7 +392,7 @@ public class TestFBRules extends TestCase {
      * Test example pure backchaining rules
      */
     public void testBackchain1() {
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(p, sP, q));
         data.add(Triple.create(q, sP, r));
         data.add(Triple.create(C1, sC, C2));
@@ -417,7 +422,7 @@ public class TestFBRules extends TestCase {
      * Test complex rule head unification
      */
     public void testBackchain2() {
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(c, q, d));
         String rules =
             "[r1: (c r ?x) <- (?x p f(?x b))]" +
@@ -437,7 +442,7 @@ public class TestFBRules extends TestCase {
                   Triple.create(c, r, a)
               } );
 
-        data = GraphMemFactory.createGraphMem();
+        data = createGraphForTest();
         data.add(Triple.create(a, q, a));
         data.add(Triple.create(a, q, b));
         data.add(Triple.create(a, q, c));
@@ -468,7 +473,7 @@ public class TestFBRules extends TestCase {
      * Test restriction example
      */
     public void testBackchain3() {
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(a, ty, r));
         data.add(Triple.create(a, p, b));
         data.add(Triple.create(r, sC, C1));
@@ -491,7 +496,7 @@ public class TestFBRules extends TestCase {
      * Test example hybrid rule.
      */
     public void testHybrid1() {
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(a, p, b));
         data.add(Triple.create(p, ty, s));
         String rules =
@@ -508,7 +513,7 @@ public class TestFBRules extends TestCase {
      * Test example hybrid rule.
      */
     public void testHybrid2() {
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(a, r, b));
         data.add(Triple.create(p, ty, s));
         String rules =
@@ -543,7 +548,7 @@ public class TestFBRules extends TestCase {
      * Test example hybrid rules for rdfs.
      */
     public void testHybridRDFS() {
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(a, p, b));
         data.add(Triple.create(p, RDFS.range.asNode(), C1));
         String rules =
@@ -567,7 +572,7 @@ public class TestFBRules extends TestCase {
      * Test example hybrid rules for rdfs.
      */
     public void testHybridRDFS2() {
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(a, p, b));
         data.add(Triple.create(p, sP, r));
         data.add(Triple.create(r, RDFS.range.asNode(), C1));
@@ -586,7 +591,7 @@ public class TestFBRules extends TestCase {
      * Test access to makeInstance machinery from a Brule.
      */
     public void testMakeInstance() {
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(a, ty, C1));
         String rules =
         "[r1:  (?x p ?t) <- (?x rdf:type C1), makeInstance(?x, p, C2, ?t)]" +
@@ -605,7 +610,7 @@ public class TestFBRules extends TestCase {
      * Test access to makeInstance machinery from a Brule.
      */
     public void testMakeInstances() {
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(a, ty, C1));
         String rules =
         "[r1:  (?x p ?t) <- (?x rdf:type C1), makeInstance(?x, p, ?t)]" ;
@@ -621,7 +626,7 @@ public class TestFBRules extends TestCase {
      * Test case for makeInstance which failed during development.
      */
     public void testMakeInstanceBug() {
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(a, ty, r));
         data.add(Triple.create(r, sC, Functor.makeFunctorNode("some", new Node[] {p, C1})));
         String rules =
@@ -646,7 +651,7 @@ public class TestFBRules extends TestCase {
         "[r1: (?x p f(a, ?x)) -> (?x q f(?x)) ]" +
         "[r1: (?x p f(a, 0)) -> (?x s res) ]" +
                        "";
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(n1, p, Util.makeIntNode(2)) );
         data.add(Triple.create(n2, p, Functor.makeFunctorNode("f", new Node[] {
                                         a, Util.makeIntNode(0)  })));
@@ -680,7 +685,7 @@ public class TestFBRules extends TestCase {
         "[r5: (?x q ?vx), (?y q ?vy), notEqual(?vx, ?vy) -> (?x ne ?y)]" +
         "[r6: (?x q ?vx), (?y q ?vy), equal(?vx, ?vy) -> (?x eq ?y)]" +
                        "";
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(n1, q, Util.makeIntNode(2)) );
         data.add(Triple.create(n2, q, Util.makeIntNode(2)) );
         data.add(Triple.create(n3, q, Util.makeIntNode(3)) );
@@ -706,7 +711,7 @@ public class TestFBRules extends TestCase {
             });
 
         // Floating point comparisons
-        data = GraphMemFactory.createGraphMem();
+        data = createGraphForTest();
         data.add(Triple.create(n1, q, Util.makeIntNode(2)) );
         data.add(Triple.create(n2, q, Util.makeDoubleNode(2.2)) );
         data.add(Triple.create(n3, q, Util.makeDoubleNode(2.3)) );
@@ -726,7 +731,7 @@ public class TestFBRules extends TestCase {
             });
 
         // XSD timeDate point comparisons
-        data = GraphMemFactory.createGraphMem();
+        data = createGraphForTest();
         XSDDatatype dt = new XSDDatatype("dateTime");
         data.add(Triple.create(n1, q, NodeFactory.createLiteralDT("2000-03-04T20:00:00Z", XSDDatatype.XSDdateTime)));
         data.add(Triple.create(n2, q, NodeFactory.createLiteralDT("2001-03-04T20:00:00Z", XSDDatatype.XSDdateTime)));
@@ -779,7 +784,7 @@ public class TestFBRules extends TestCase {
         "[r4: (?x p ?a), (?x q ?b), min(?b, ?a, ?c) -> (?x r ?c)]" +
         "[r4: (?x p ?a), (?x q ?b), max(?b, ?a, ?c) -> (?x x ?c)]" +
                        "";
-        data = GraphMemFactory.createGraphMem();
+        data = createGraphForTest();
         data.add(Triple.create(n1, p, Util.makeIntNode(3)) );
         data.add(Triple.create(n1, q, Util.makeIntNode(5)) );
         infgraph = createInfGraph(rules, data);
@@ -803,7 +808,7 @@ public class TestFBRules extends TestCase {
         "[r1: (?x p ?y), isBNode(?y) -> (?x s 'bNode')]" +
         "[r1: (?x p ?y), notBNode(?y) -> (?x s 'notBNode')]" +
                        "";
-        data = GraphMemFactory.createGraphMem();
+        data = createGraphForTest();
         data.add(Triple.create(n1, p, Util.makeIntNode(3)) );
         data.add(Triple.create(n2, p, res));
         data.add(Triple.create(n3, p, NodeFactory.createBlankNode()));
@@ -834,7 +839,7 @@ public class TestFBRules extends TestCase {
         "[r1: (?x p ?y), notDType(?y, http://www.w3.org/2001/XMLSchema#int) -> (?x s 'notXSDInt')]" +
         "[r1: (?x p ?y), notDType(?y, http://www.w3.org/2001/XMLSchema#string) -> (?x s 'notXSDString')]" +
                        "";
-        data = GraphMemFactory.createGraphMem();
+        data = createGraphForTest();
         data.add(Triple.create(n1, p, Util.makeIntNode(3)) );
         data.add(Triple.create(n2, p, NodeFactory.createLiteralString("foo")) );
         data.add(Triple.create(n3, p, NodeFactory.createLiteralDT("foo", XSDDatatype.XSDstring)) );
@@ -867,7 +872,7 @@ public class TestFBRules extends TestCase {
 
         // Literal counting
         rules = "[r1: (?x p ?y), countLiteralValues(?x, p, ?c) -> (?x s ?c)]";
-        data = GraphMemFactory.createGraphMem();
+        data = createGraphForTest();
         data.add(Triple.create(n1, p, Util.makeIntNode(2)) );
         data.add(Triple.create(n1, p, Util.makeIntNode(2)) );
         data.add(Triple.create(n1, p, Util.makeIntNode(3)) );
@@ -881,7 +886,7 @@ public class TestFBRules extends TestCase {
         // Map list operation
         rules = "[r1: (n1 p ?l) -> listMapAsSubject(?l, q, C1)]" +
                 "[r2: (n1 p ?l) -> listMapAsObject ( a, q, ?l)]";
-        data = GraphMemFactory.createGraphMem();
+        data = createGraphForTest();
         data.add(Triple.create(n1, p, Util.makeList(new Node[]{b, c, d}, data) ));
         infgraph = createInfGraph(rules, data);
         TestUtil.assertIteratorValues(this, infgraph.find(null, q, null),
@@ -903,7 +908,7 @@ public class TestFBRules extends TestCase {
             "[r1: (?x p ?y) strConcat(?y, rdf:type, 'foo', ?z) -> (?x q ?z) ] \n" +
             "[r1: (?x p ?y) strConcat(?z) -> (?x q ?z) ] \n" +
             "[r2: (?x p ?y) uriConcat('http://jena.hpl.hp.com/test#', ?y, ?z) -> (?x q ?z) ]";
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(n1, p, NodeFactory.createLiteralString("test")) );
         InfGraph infgraph = createInfGraph(rules, data);
 
@@ -918,7 +923,7 @@ public class TestFBRules extends TestCase {
             "[r1: (?x p ?y) regex(?y, '(.*)\\\\s(.*) (f.*)') -> (?x q 'ok') ] \n" +
             "[r2: (?x p ?y) regex(?y, '(.*)\\\\s(.*) (f.*)', ?m1, ?m2, ?m3) -> (?x r ?m2) ] \n" +
             "";
-        data = GraphMemFactory.createGraphMem();
+        data = createGraphForTest();
         data.add(Triple.create(n1, p, NodeFactory.createLiteralString("foo bar foo")) );
         data.add(Triple.create(n2, p, NodeFactory.createLiteralString("foo bar baz")) );
         infgraph = createInfGraph(rules, data);
@@ -939,7 +944,7 @@ public class TestFBRules extends TestCase {
         String rules =
             "[r2: (?x p ?y) regex(?y, '((Boys)|(Girls))(.*)', ?m1, ?m2, ?m3, ?m4) ->  (?x q ?m2) (?x r ?m3) (?x s ?m4) ] \n" +
             "";
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(n1, p, NodeFactory.createLiteralString("Girls44")) );
         InfGraph infgraph = createInfGraph(rules, data);
         infgraph.prepare();
@@ -972,7 +977,7 @@ public class TestFBRules extends TestCase {
         String rules =
             "[r1: (?x p ?a), (?x q ?b), (?x r ?c) " + op + "(?a, ?b, ?c) -> (?x s ?c)]\n " +
             "[r2: (?x p ?a), (?x q ?b), (?x t ?c) " + op + "(?a, ?b, ?c) -> (?x u ?c)]";
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(n1, p, Util.makeIntNode(arg1)) );
         data.add(Triple.create(n1, q, Util.makeIntNode(arg2)) );
         data.add(Triple.create(n1, r, Util.makeIntNode(expected)) );
@@ -1018,7 +1023,7 @@ public class TestFBRules extends TestCase {
             }
 //            listFBGraph("direct databind case", (FBRuleInfGraph)infgraph);
             assertEquals(5, count);
-            infgraph = reasoner.bindSchema(data).bind(GraphMemFactory.createGraphMem());
+            infgraph = reasoner.bindSchema(data).bind(createGraphForTest());
             count = 0;
             for (Iterator<Triple> i = infgraph.find(null, rbPrototypeProp, null); i.hasNext(); ) {
                 Triple t = i.next();
@@ -1057,7 +1062,7 @@ public class TestFBRules extends TestCase {
 
     private Node getSkolem(Node x, Node y) {
         String rules =  "[r1: (?n p ?x) (?n q ?y) makeSkolem(?s ?x ?y) -> (?n s ?s)]";
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(n1, p, x));
         data.add(Triple.create(n1, q, y));
         InfGraph infgraph = createInfGraph(rules, data);
@@ -1066,7 +1071,7 @@ public class TestFBRules extends TestCase {
 
     private Node getSkolem(Node x) {
         String rules =  "[r1: (?n p ?x)  makeSkolem(?s ?x) -> (?n s ?s)]";
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(n1, p, x));
         InfGraph infgraph = createInfGraph(rules, data);
         return infgraph.find(n1, s, Node.ANY).next().getObject();
@@ -1076,8 +1081,8 @@ public class TestFBRules extends TestCase {
      * Check cost of creating an empty OWL closure.
      */
     public void temp() {
-        Graph data = GraphMemFactory.createGraphMem();
-        Graph data2 = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
+        Graph data2 = createGraphForTest();
         Reasoner reasoner =  new OWLFBRuleReasoner(OWLFBRuleReasonerFactory.theInstance());
         FBRuleInfGraph infgraph = (FBRuleInfGraph)reasoner.bind(data);
         FBRuleInfGraph infgraph2 = (FBRuleInfGraph)reasoner.bind(data2);
diff --git a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestGenericRules.java b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestGenericRules.java
index d59e21be1f..35d551811d 100644
--- a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestGenericRules.java
+++ b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestGenericRules.java
@@ -41,11 +41,11 @@ import org.slf4j.LoggerFactory;
 
 /**
  * Test the packaging of all the reasoners into the GenericRuleReasoner.
- * The other tests check out this engine. These tests just need to touch 
+ * The other tests check out this engine. These tests just need to touch
  * enough to validate the packaging.
  */
 public class TestGenericRules extends TestCase {
-    
+
     protected static Logger logger = LoggerFactory.getLogger(TestFBRules.class);
 
     // Useful constants
@@ -70,12 +70,12 @@ public class TestGenericRules extends TestCase {
     Triple[] ans = new Triple[] { Triple.create(a, p, b),
                                    Triple.create(b, p, c),
                                    Triple.create(a, p, c) };
-                                 
+
     /**
      * Boilerplate for junit
-     */ 
+     */
     public TestGenericRules( String name ) {
-        super( name ); 
+        super( name );
     }
 
     /**
@@ -83,60 +83,64 @@ public class TestGenericRules extends TestCase {
      * This is its own test suite
      */
     public static TestSuite suite() {
-        return new TestSuite( TestGenericRules.class ); 
+        return new TestSuite( TestGenericRules.class );
 //        TestSuite suite = new TestSuite();
 //        suite.addTest(new TestGenericRules( "testFunctorLooping" ));
 //        return suite;
-    }  
-    
-     
+    }
+
+    @SuppressWarnings("removal")
+    private static  Graph createGraphForTest() {
+        return GraphMemFactory.createGraphMem();
+    }
+
     /**
      * Minimal rule tester to check basic pattern match, forward style.
      */
     public void testForward() {
-        Graph test = GraphMemFactory.createGraphMem();
+        Graph test = createGraphForTest();
         test.add(Triple.create(a, p, b));
         test.add(Triple.create(b, p, c));
-        
+
         GenericRuleReasoner reasoner = (GenericRuleReasoner)GenericRuleReasonerFactory.theInstance().create(null);
         reasoner.setRules(ruleList);
         reasoner.setMode(GenericRuleReasoner.FORWARD);
-        
+
         // Check data bind version
         InfGraph infgraph = reasoner.bind(test);
         TestUtil.assertIteratorValues(this, infgraph.find(null, p, null), ans);
-        
+
         // Check schema bind version
-        infgraph = reasoner.bindSchema(test).bind(GraphMemFactory.createGraphMem());
+        infgraph = reasoner.bindSchema(test).bind(createGraphForTest());
         TestUtil.assertIteratorValues(this, infgraph.find(null, p, null), ans);
     }
-     
+
     /**
      * Minimal rule tester to check basic pattern match, backward style.
      */
     public void testBackward() {
-        Graph test = GraphMemFactory.createGraphMem();
+        Graph test = createGraphForTest();
         test.add(Triple.create(a, p, b));
         test.add(Triple.create(b, p, c));
-        
+
         GenericRuleReasoner reasoner = (GenericRuleReasoner)GenericRuleReasonerFactory.theInstance().create(null);
         reasoner.setRules(ruleList);
         reasoner.setMode(GenericRuleReasoner.BACKWARD);
-        
+
         // Check data bind version
         InfGraph infgraph = reasoner.bind(test);
         TestUtil.assertIteratorValues(this, infgraph.find(null, p, null), ans);
-        
+
         // Check schema bind version
-        infgraph = reasoner.bindSchema(test).bind(GraphMemFactory.createGraphMem());
+        infgraph = reasoner.bindSchema(test).bind(createGraphForTest());
         TestUtil.assertIteratorValues(this, infgraph.find(null, p, null), ans);
     }
-    
+
     /**
      * Test example hybrid rule.
      */
     public void testHybrid() {
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(a, r, b));
         data.add(Triple.create(p, ty, s));
         List<Rule> rules = Rule.parseRules(
@@ -145,37 +149,37 @@ public class TestGenericRules extends TestCase {
         "[r1: (?p rdf:type s) -> [r1b: (?x ?p ?y) <- (?y ?p ?x)]]" +
         "[r2: (?p rdf:type s) -> [r2b: (?x ?p ?x) <- (?x rdf:type t)]]" +
         "-> tableAll()."
-                          );        
+                          );
         GenericRuleReasoner reasoner = (GenericRuleReasoner)GenericRuleReasonerFactory.theInstance().create(null);
         reasoner.setRules(rules);
         reasoner.setMode(GenericRuleReasoner.HYBRID);
-        
+
         InfGraph infgraph = reasoner.bind(data);
         infgraph.setDerivationLogging(true);
-        TestUtil.assertIteratorValues(this, 
+        TestUtil.assertIteratorValues(this,
               infgraph.find(null, p, null), new Object[] {
                   Triple.create(a, p, a),
                   Triple.create(a, p, b),
                   Triple.create(b, p, a)
               } );
-              
+
         // Check derivation tracing as well
         Iterator<Derivation> di = infgraph.getDerivation(Triple.create(b, p, a));
         assertTrue(di.hasNext());
         RuleDerivation d = (RuleDerivation)di.next();
-//        java.io.PrintWriter out = new java.io.PrintWriter(System.out); 
+//        java.io.PrintWriter out = new java.io.PrintWriter(System.out);
 //        d.printTrace(out, true);
 //        out.close();
         assertTrue(d.getRule().getName().equals("r1b"));
         TestUtil.assertIteratorValues(this, d.getMatches().iterator(), new Object[] { Triple.create(a, p, b) });
         assertTrue(! di.hasNext());
     }
-    
+
     /**
      * Test early detection of illegal backward rules.
      */
     public void testBRuleErrorHandling() {
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         List<Rule> rules = Rule.parseRules(
                     "[a1: -> [(?x eg:p ?y) (?x eg:q ?y) <- (?x eg:r ?y)]]"
                 );
@@ -191,12 +195,12 @@ public class TestGenericRules extends TestCase {
         }
         assertTrue("Catching use of multi-headed brules", foundException);
     }
-    
+
     /**
      * Test example parameter setting
      */
     public void testParameters() {
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(a, r, b));
         data.add(Triple.create(p, ty, s));
 
@@ -206,15 +210,15 @@ public class TestGenericRules extends TestCase {
         configuration.addProperty(ReasonerVocabulary.PROPruleMode, "hybrid");
         configuration.addProperty(ReasonerVocabulary.PROPruleSet, "testing/reasoners/genericRuleTest.rules");
         GenericRuleReasoner reasoner = (GenericRuleReasoner)GenericRuleReasonerFactory.theInstance().create(configuration);
-        
+
         InfGraph infgraph = reasoner.bind(data);
-        TestUtil.assertIteratorValues(this, 
+        TestUtil.assertIteratorValues(this,
               infgraph.find(null, p, null), new Object[] {
                   Triple.create(a, p, a),
                   Triple.create(a, p, b),
                   Triple.create(b, p, a)
               } );
-              
+
         // Check derivation tracing as well
         Iterator<Derivation> di = infgraph.getDerivation(Triple.create(b, p, a));
         assertTrue(di.hasNext());
@@ -222,7 +226,7 @@ public class TestGenericRules extends TestCase {
         assertTrue(d.getRule().getName().equals("r1b"));
         TestUtil.assertIteratorValues(this, d.getMatches().iterator(), new Object[] { Triple.create(a, p, b) });
         assertTrue(! di.hasNext());
-        
+
         // Check retrieval of configuration
         Model m2 = ModelFactory.createDefaultModel();
         Resource newConfig = m2.createResource();
@@ -232,7 +236,7 @@ public class TestGenericRules extends TestCase {
             m2.createStatement(newConfig, ReasonerVocabulary.PROPruleMode, "hybrid"),
             m2.createStatement(newConfig, ReasonerVocabulary.PROPruleSet, "testing/reasoners/genericRuleTest.rules")
             } );
-       
+
         // Manual reconfig and check retrieval of changes
         reasoner.setParameter(ReasonerVocabulary.PROPderivationLogging, "false");
         newConfig = m2.createResource();
@@ -242,7 +246,7 @@ public class TestGenericRules extends TestCase {
             m2.createStatement(newConfig, ReasonerVocabulary.PROPruleMode, "hybrid"),
             m2.createStatement(newConfig, ReasonerVocabulary.PROPruleSet, "testing/reasoners/genericRuleTest.rules")
             } );
-        
+
         // Mutiple rule file loading
         m = ModelFactory.createDefaultModel();
         configuration= m.createResource(GenericRuleReasonerFactory.URI);
@@ -250,17 +254,17 @@ public class TestGenericRules extends TestCase {
         configuration.addProperty(ReasonerVocabulary.PROPruleSet, "testing/reasoners/ruleset1.rules");
         configuration.addProperty(ReasonerVocabulary.PROPruleSet, "testing/reasoners/ruleset2.rules");
         reasoner = (GenericRuleReasoner)GenericRuleReasonerFactory.theInstance().create(configuration);
-        
-        infgraph = reasoner.bind(GraphMemFactory.createGraphMem());
+
+        infgraph = reasoner.bind(createGraphForTest());
         Node an = NodeFactory.createURI(PrintUtil.egNS + "a");
         Node C = NodeFactory.createURI(PrintUtil.egNS + "C");
         Node D = NodeFactory.createURI(PrintUtil.egNS + "D");
-        TestUtil.assertIteratorValues(this, 
+        TestUtil.assertIteratorValues(this,
               infgraph.find(null, null, null), new Object[] {
                 Triple.create(an, RDF.Nodes.type, C),
                 Triple.create(an, RDF.Nodes.type, D),
               } );
-        
+
         // Test that the parameter initialization is not be overridden by subclasses
         m = ModelFactory.createDefaultModel();
         configuration = m.createResource(GenericRuleReasonerFactory.URI);
@@ -273,9 +277,9 @@ public class TestGenericRules extends TestCase {
         im.add(Ac, RDFS.subClassOf, Bc);
         im.add(Bc, RDFS.subClassOf, Cc);
         assertTrue("TGC enabled correctly", im.contains(Ac, RDFS.subClassOf, Cc));
-        
+
      }
-    
+
     /**
      * Check that the use of typed literals in the configuration also works
      */
@@ -283,7 +287,7 @@ public class TestGenericRules extends TestCase {
         Model m = ModelFactory.createDefaultModel();
         Resource configuration= m.createResource(GenericRuleReasonerFactory.URI);
         configuration.addProperty(ReasonerVocabulary.PROPenableTGCCaching, m.createTypedLiteral(Boolean.TRUE));
-        
+
         GenericRuleReasoner reasoner = (GenericRuleReasoner)GenericRuleReasonerFactory.theInstance().create(configuration);
         InfModel im = ModelFactory.createInfModel(reasoner, ModelFactory.createDefaultModel());
         Resource Ac = im.createResource(PrintUtil.egNS + "A");
@@ -293,32 +297,32 @@ public class TestGenericRules extends TestCase {
         im.add(Bc, RDFS.subClassOf, Cc);
         assertTrue("TGC enabled correctly", im.contains(Ac, RDFS.subClassOf, Cc));
     }
-    
+
     /**
      * Test control of functor filtering
      */
     public void testHybridFunctorFilter() {
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(a, r, b));
         data.add(Triple.create(a, p, s));
-        List<Rule> rules = Rule.parseRules( "[r0: (?x r ?y) (?x p ?z) -> (?x q func(?y, ?z)) ]" );        
+        List<Rule> rules = Rule.parseRules( "[r0: (?x r ?y) (?x p ?z) -> (?x q func(?y, ?z)) ]" );
         GenericRuleReasoner reasoner = (GenericRuleReasoner)GenericRuleReasonerFactory.theInstance().create(null);
         reasoner.setRules(rules);
         reasoner.setMode(GenericRuleReasoner.HYBRID);
-        
+
         InfGraph infgraph = reasoner.bind(data);
-        TestUtil.assertIteratorValues(this, 
+        TestUtil.assertIteratorValues(this,
               infgraph.find(null, q, null), new Object[] {
               } );
-              
+
         reasoner.setFunctorFiltering(false);
         infgraph = reasoner.bind(data);
-        TestUtil.assertIteratorValues(this, 
+        TestUtil.assertIteratorValues(this,
               infgraph.find(null, q, null), new Object[] {
                   Triple.create(a, q, Functor.makeFunctorNode("func", new Node[]{b, s}))
               } );
     }
-    
+
     /**
      * Test recursive rules involving functors
      * May lock up in there is a bug.
@@ -327,25 +331,25 @@ public class TestGenericRules extends TestCase {
         doTestFunctorLooping(GenericRuleReasoner.FORWARD_RETE);
         doTestFunctorLooping(GenericRuleReasoner.HYBRID);
     }
-    
+
     /**
      * Test recursive rules involving functors.
      * May lock up in there is a bug.
      * TODO: arrange test to run in a separate thread with a timeout
      */
     public void doTestFunctorLooping(RuleMode mode) {
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(a, r, b));
-        List<Rule> rules = Rule.parseRules( "(?x r ?y) -> (?x p func(?x)). (?x p ?y) -> (?x p func(?x))." );        
+        List<Rule> rules = Rule.parseRules( "(?x r ?y) -> (?x p func(?x)). (?x p ?y) -> (?x p func(?x))." );
         GenericRuleReasoner reasoner = (GenericRuleReasoner)GenericRuleReasonerFactory.theInstance().create(null);
         reasoner.setRules(rules);
         reasoner.setMode(mode);
-        
+
         InfGraph infgraph = reasoner.bind(data);
         // The p should have been asserted but is invisible
         assertFalse( infgraph.contains(Node.ANY, p, Node.ANY) );
     }
-    
+
     /**
      * Test the @prefix and @include extensions to the rule parser
      */
@@ -355,18 +359,18 @@ public class TestGenericRules extends TestCase {
         reasoner.setTransitiveClosureCaching(true);
         Model base = ModelFactory.createDefaultModel();
         InfModel m = ModelFactory.createInfModel(reasoner, base);
-        
+
         // Check prefix case
         String NS1 = "http://jena.hpl.hp.com/newprefix#";
         String NS2 = "http://jena.hpl.hp.com/newprefix2#";
         String NS3 = "http://jena.hpl.hp.com/newprefix3#";
-        Resource A = m.getResource(NS1 + "A"); 
-        Resource C = m.getResource(NS1 + "C"); 
+        Resource A = m.getResource(NS1 + "A");
+        Resource C = m.getResource(NS1 + "C");
         Property p = m.getProperty(NS2 + "p");
         Property a = m.getProperty(NS3 + "a");
         Resource foo = m.getResource(NS1 + "foo");
         assertTrue("@prefix test", m.contains(A, p, foo));
-        
+
         // Check RDFS rule inclusion
         assertTrue("@include RDFS test", m.contains(A, RDFS.subClassOf, C));
         assertTrue("@include test", m.contains(a,a,a));
@@ -378,14 +382,14 @@ public class TestGenericRules extends TestCase {
     public void testIncludeRedirect() {
         assertFalse( checkIncludeFound("file:testing/reasoners/importTest.rules") );
         LocationMapper lm = FileManager.getInternal().getLocationMapper();
-        lm.addAltEntry("file:testing/reasoners/includeAlt.rules", 
+        lm.addAltEntry("file:testing/reasoners/includeAlt.rules",
                      "file:testing/reasoners/include.rules");
         assertTrue( checkIncludeFound("file:testing/reasoners/importTest.rules") );
-        lm.removeAltEntry("file:testing/reasoners/includeAlt.rules"); 
+        lm.removeAltEntry("file:testing/reasoners/includeAlt.rules");
     }
-    
+
     /**
-     * Check whether the test included file has been found 
+     * Check whether the test included file has been found
      */
     private boolean checkIncludeFound(String ruleSrc) {
         try {
@@ -393,7 +397,7 @@ public class TestGenericRules extends TestCase {
             GenericRuleReasoner reasoner = new GenericRuleReasoner(rules);
             Model base = ModelFactory.createDefaultModel();
             InfModel m = ModelFactory.createInfModel(reasoner, base);
-            
+
             // Check prefix case
             String NS3 = "http://jena.hpl.hp.com/newprefix3#";
             Property a = m.getProperty(NS3 + "a");
@@ -402,7 +406,7 @@ public class TestGenericRules extends TestCase {
             return false;
         }
     }
-    
+
     /**
      * Test add/remove support
      */
@@ -410,13 +414,13 @@ public class TestGenericRules extends TestCase {
         doTestAddRemove(false);
         doTestAddRemove(true);
     }
-    
+
     /**
      * Internals of add/remove test.
      * @param useTGC set to true to use transitive caching
      */
     public void doTestAddRemove(boolean useTGC) {
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(a, p, C1));
         data.add(Triple.create(C1, sC, C2));
         data.add(Triple.create(C2, sC, C3));
@@ -426,44 +430,44 @@ public class TestGenericRules extends TestCase {
         "[rdfs9:  (?x rdfs:subClassOf ?y) -> [ (?a rdf:type ?y) <- (?a rdf:type ?x)] ]"
                           );
         if (!useTGC) {
-            rules.add(Rule.parseRule("[rdfs8:  (?a rdfs:subClassOf ?b), (?b rdfs:subClassOf ?c) -> (?a rdfs:subClassOf ?c)] "));        
+            rules.add(Rule.parseRule("[rdfs8:  (?a rdfs:subClassOf ?b), (?b rdfs:subClassOf ?c) -> (?a rdfs:subClassOf ?c)] "));
         }
         GenericRuleReasoner reasoner = (GenericRuleReasoner)GenericRuleReasonerFactory.theInstance().create(null);
         reasoner.setRules(rules);
 //        reasoner.setTraceOn(true);
         reasoner.setMode(GenericRuleReasoner.HYBRID);
         reasoner.setTransitiveClosureCaching(useTGC);
-        
+
         InfGraph infgraph = reasoner.bind(data);
-        TestUtil.assertIteratorValues(this, 
+        TestUtil.assertIteratorValues(this,
               infgraph.find(a, ty, null), new Object[] {
                   Triple.create(a, ty, C1),
                   Triple.create(a, ty, C2),
                   Triple.create(a, ty, C3)
               } );
-              
+
         logger.debug("Checkpoint 1");
         infgraph.delete(Triple.create(C1, sC, C2));
-        TestUtil.assertIteratorValues(this, 
+        TestUtil.assertIteratorValues(this,
               infgraph.find(a, ty, null), new Object[] {
                   Triple.create(a, ty, C1)
               } );
-         
+
         logger.debug("Checkpoint 2");
         infgraph.add(Triple.create(C1, sC, C3));
         infgraph.add(Triple.create(b, p, C2));
-        TestUtil.assertIteratorValues(this, 
+        TestUtil.assertIteratorValues(this,
               infgraph.find(a, ty, null), new Object[] {
                   Triple.create(a, ty, C1),
                   Triple.create(a, ty, C3)
               } );
-        TestUtil.assertIteratorValues(this, 
+        TestUtil.assertIteratorValues(this,
               infgraph.find(b, ty, null), new Object[] {
                   Triple.create(b, ty, C2),
                   Triple.create(b, ty, C3)
               } );
-         
-        TestUtil.assertIteratorValues(this, 
+
+        TestUtil.assertIteratorValues(this,
               data.find(null, null, null), new Object[] {
                   Triple.create(a, p, C1),
                   Triple.create(b, p, C2),
@@ -471,29 +475,29 @@ public class TestGenericRules extends TestCase {
                   Triple.create(C1, sC, C3)
               } );
     }
-    
+
     /**
      * Resolve a bug using remove in rules themselves.
      */
     public void testAddRemove2() {
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(a, p, Util.makeIntNode(0)));
         List<Rule> rules = Rule.parseRules(
                 "(?x p ?v)-> (?x q inc(1, a)).\n" +
                 "(?x p ?v)-> (?x q inc(1, b)).\n" +
                 "(?x p ?v) (?x q inc(?i, ?t)) noValue(?x r ?t) sum(?v, ?i, ?s) -> remove(0,1), (?x p ?s) (?x r ?t).\n");
-        
+
         // Older version, relied on implicit rule ordering in Jena2.2 not value in 2.3
 //        "(?x p ?v) noValue(a r 1) -> (?x q inc(1, a)) (?x r 1).\n" +
 //        "(?x p ?v) noValue(a r 2) -> (?x q inc(1, b)) (?x r 2).\n" +
 //        "(?x p ?v) (?x q inc(?i, ?t)) sum(?v, ?i, ?s) -> remove(0,1), (?x p ?s).\n");
-        
+
         GenericRuleReasoner reasoner = (GenericRuleReasoner)GenericRuleReasonerFactory.theInstance().create(null);
         reasoner.setRules(rules);
         reasoner.setMode(GenericRuleReasoner.FORWARD_RETE);
-        
+
         InfGraph infgraph = reasoner.bind(data);
-        TestUtil.assertIteratorValues(this, 
+        TestUtil.assertIteratorValues(this,
               infgraph.find(a, p, null), new Object[] {
                   Triple.create(a, p, Util.makeIntNode(2))
               } );
diff --git a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestLPDerivation.java b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestLPDerivation.java
index 50101c89cc..1ce8a6f539 100644
--- a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestLPDerivation.java
+++ b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestLPDerivation.java
@@ -38,14 +38,14 @@ import org.apache.jena.util.iterator.ExtendedIterator ;
  */
 
 public class TestLPDerivation extends TestCase {
-    
+
     /**
      * Boilerplate for junit
-     */ 
+     */
     public TestLPDerivation( String name ) {
-        super( name ); 
+        super( name );
     }
-    
+
     /**
      * Boilerplate for junit.
      * This is its own test suite
@@ -53,7 +53,12 @@ public class TestLPDerivation extends TestCase {
     public static TestSuite suite() {
         return new TestSuite( TestLPDerivation.class );
     }
-    
+
+    @SuppressWarnings("removal")
+    private static  Graph createGraphForTest() {
+        return GraphMemFactory.createGraphMem();
+    }
+
     // Useful constants
     Node p = NodeFactory.createURI("p");
     Node q = NodeFactory.createURI("q");
@@ -95,7 +100,7 @@ public class TestLPDerivation extends TestCase {
      */
     private void doTest(String ruleSrc, Node[] tabled, Triple[] triples, Triple query, Triple[] matches, int rulenumber) {
         List<Rule> rules = Rule.parseRules(ruleSrc);
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         for ( Triple triple : triples )
         {
             data.add( triple );
@@ -125,7 +130,7 @@ public class TestLPDerivation extends TestCase {
         doTest(
                 "(?x p ?y) <- (?x q ?y).", new Node[]{},    // Rules + tabling
                 new Triple[] {                              // Data
-                        Triple.create(a, q, b),  
+                        Triple.create(a, q, b),
                 },
                 Triple.create(a, p, b),                        // query
                 new Triple[] {                              // Expected match list in derivation
@@ -134,16 +139,16 @@ public class TestLPDerivation extends TestCase {
                 0                                           // Expected rule in derivation
                 );
     }
-    
+
     /**
      * Test simple rule derivation from pair
      */
     public void testBasic2() {
         doTest(
-                "(?x p ?y) <- (?x q ?y). (?x p ?y) <- (?x r ?y).", 
+                "(?x p ?y) <- (?x q ?y). (?x p ?y) <- (?x r ?y).",
                 new Node[]{},    // Rules + tabling
                 new Triple[] {                              // Data
-                        Triple.create(a, r, b),  
+                        Triple.create(a, r, b),
                 },
                 Triple.create(a, p, b),                        // query
                 new Triple[] {                              // Expected match list in derivation
@@ -152,7 +157,7 @@ public class TestLPDerivation extends TestCase {
                 1                                           // Expected rule in derivation
                 );
     }
-    
+
     /**
      * Test composite derivation.
      */
@@ -160,38 +165,38 @@ public class TestLPDerivation extends TestCase {
         doTest(
                 "(?x p ?y) <- (?x q ?y) (?x r ?y).",  new Node[]{},    // Rules + tabling
                 new Triple[] {                              // Data
-                        Triple.create(a, q, b),  
-                        Triple.create(a, r, b),  
+                        Triple.create(a, q, b),
+                        Triple.create(a, r, b),
                 },
                 Triple.create(a, p, b),                        // query
                 new Triple[] {                              // Expected match list in derivation
-                        Triple.create(a, q, b),  
+                        Triple.create(a, q, b),
                         Triple.create(a, r, b)
                 },
                 0                                           // Expected rule in derivation
                 );
     }
-    
+
     /**
      * Test Chain derivation.
      */
     public void testChain() {
         doTest(
-                "(?x s ?y) <- (?x r ?y). (?x p ?y) <- (?x q ?y) (?x s ?y). ",  
+                "(?x s ?y) <- (?x r ?y). (?x p ?y) <- (?x q ?y) (?x s ?y). ",
                 new Node[]{},    // Rules + tabling
                 new Triple[] {                              // Data
-                        Triple.create(a, q, b),  
-                        Triple.create(a, r, b),  
+                        Triple.create(a, q, b),
+                        Triple.create(a, r, b),
                 },
                 Triple.create(a, p, b),                        // query
                 new Triple[] {                              // Expected match list in derivation
-                        Triple.create(a, q, b),  
+                        Triple.create(a, q, b),
                         Triple.create(a, s, b)
                 },
                 1                                           // Expected rule in derivation
                 );
     }
-    
+
     /**
      * Test tabled chaining
      */
@@ -200,17 +205,17 @@ public class TestLPDerivation extends TestCase {
                 "(?x p ?z) <- (?x p ?y) (?y p ?z).",
                 new Node[]{ p },    // Rules + tabling
                 new Triple[] {                              // Data
-                        Triple.create(a, p, b),  
-                        Triple.create(a, p, c),  
-                        Triple.create(b, p, d),  
+                        Triple.create(a, p, b),
+                        Triple.create(a, p, c),
+                        Triple.create(b, p, d),
                 },
                 Triple.create(a, p, d),                        // query
                 new Triple[] {                              // Expected match list in derivation
-                        Triple.create(a, p, b),  
+                        Triple.create(a, p, b),
                         Triple.create(b, p, d)
                 },
                 0                                           // Expected rule in derivation
                 );
     }
-    
+
 }
diff --git a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestRDFS9.java b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestRDFS9.java
index 95eab1dbbf..3c2c79d5d3 100644
--- a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestRDFS9.java
+++ b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestRDFS9.java
@@ -33,21 +33,26 @@ import org.apache.jena.vocabulary.* ;
  * of modified versions of rule rdfs9.
  */
 public class TestRDFS9 extends TestCase {
-    
+
     /**
      * Boilerplate for junit
-     */ 
+     */
     public TestRDFS9( String name ) {
-        super( name ); 
+        super( name );
     }
-    
+
     /**
      * Boilerplate for junit.
      * This is its own test suite
      */
     public static TestSuite suite() {
         return new TestSuite(TestRDFS9.class);
-    }  
+    }
+
+    @SuppressWarnings("removal")
+    private static  Graph createGraphForTest() {
+        return GraphMemFactory.createGraphMem();
+    }
 
     /**
      * Test a type inheritance example.
@@ -65,14 +70,14 @@ public class TestRDFS9 extends TestCase {
         Node r = NodeFactory.createURI("r");
         Node sC = RDFS.subClassOf.asNode();
         Node ty = RDF.type.asNode();
-        
-        Graph tdata = GraphMemFactory.createGraphMem();
+
+        Graph tdata = createGraphForTest();
         tdata.add(Triple.create(C1, sC, C2));
         tdata.add(Triple.create(C2, sC, C3));
         tdata.add(Triple.create(p, RDFS.subPropertyOf.asNode(), q));
         tdata.add(Triple.create(q, RDFS.subPropertyOf.asNode(), r));
         tdata.add(Triple.create(r, RDFS.domain.asNode(), D));
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add(Triple.create(a, p, b));
         InfGraph igraph = ReasonerRegistry.getRDFSReasoner().bind(new Union(tdata, data));
         TestUtil.assertIteratorValues(this, igraph.find(a, ty, null),
diff --git a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestRETE.java b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestRETE.java
index 3cae0fcf80..5be4b6d269 100644
--- a/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestRETE.java
+++ b/jena-core/src/test/java/org/apache/jena/reasoner/rulesys/test/TestRETE.java
@@ -29,7 +29,7 @@ import org.apache.jena.reasoner.rulesys.impl.* ;
 import org.apache.jena.reasoner.test.TestUtil ;
 
 public class TestRETE  extends TestCase {
-     
+
     // Useful constants
     Node_RuleVariable x = new Node_RuleVariable("x", 0);
     Node_RuleVariable y = new Node_RuleVariable("y", 1);
@@ -48,61 +48,66 @@ public class TestRETE  extends TestCase {
     Node n3 = NodeFactory.createURI("n3");
     Node n4 = NodeFactory.createURI("n4");
     Node res = NodeFactory.createURI("res");
-         
+
     /**
      * Boilerplate for junit
-     */ 
+     */
     public TestRETE( String name ) {
-        super( name ); 
+        super( name );
     }
-    
+
     /**
      * Boilerplate for junit.
      * This is its own test suite
      */
     public static TestSuite suite() {
-        return new TestSuite( TestRETE.class ); 
+        return new TestSuite( TestRETE.class );
 //        TestSuite suite = new TestSuite();
 //        suite.addTest(new TestRETE( "foo" ));
 //        return suite;
-    }  
+    }
+
+    @SuppressWarnings("removal")
+    private static  Graph createGraphForTest() {
+        return GraphMemFactory.createGraphMem();
+    }
 
     /**
      * Test clause compiler and clause filter implementation.
      */
     public void testClauseFilter() {
-        doTestClauseFilter( new TriplePattern(a, p, x), 
+        doTestClauseFilter( new TriplePattern(a, p, x),
                             Triple.create(a, p, b), new Node[]{b, null, null});
-        doTestClauseFilter( new TriplePattern(x, p, b), 
+        doTestClauseFilter( new TriplePattern(x, p, b),
                             Triple.create(a, p, b), new Node[]{a, null, null});
         doTestClauseFilter( new TriplePattern(a, p, x), Triple.create(b, p, a), null);
         doTestClauseFilter( new TriplePattern(a, p, x), Triple.create(a, q, a), null);
-        doTestClauseFilter( new TriplePattern(x, p, x), 
+        doTestClauseFilter( new TriplePattern(x, p, x),
                             Triple.create(a, p, a), new Node[]{a, null, null});
         doTestClauseFilter( new TriplePattern(x, p, x), Triple.create(a, p, b), null);
-        doTestClauseFilter( 
-            new TriplePattern(a, p, Functor.makeFunctorNode("f", new Node[]{x, c})), 
-            Triple.create(a, p, a), 
+        doTestClauseFilter(
+            new TriplePattern(a, p, Functor.makeFunctorNode("f", new Node[]{x, c})),
+            Triple.create(a, p, a),
             null);
-        doTestClauseFilter( 
-            new TriplePattern(a, p, x), 
-            Triple.create(a, p, Functor.makeFunctorNode("f", new Node[]{b, c})), 
+        doTestClauseFilter(
+            new TriplePattern(a, p, x),
+            Triple.create(a, p, Functor.makeFunctorNode("f", new Node[]{b, c})),
             new Node[]{Functor.makeFunctorNode("f", new Node[]{b, c}), null, null});
-        doTestClauseFilter( 
-            new TriplePattern(a, p, Functor.makeFunctorNode("g", new Node[]{x, c})), 
-            Triple.create(a, p, Functor.makeFunctorNode("f", new Node[]{b, c})), 
+        doTestClauseFilter(
+            new TriplePattern(a, p, Functor.makeFunctorNode("g", new Node[]{x, c})),
+            Triple.create(a, p, Functor.makeFunctorNode("f", new Node[]{b, c})),
             null);
-        doTestClauseFilter( 
-            new TriplePattern(a, p, Functor.makeFunctorNode("f", new Node[]{x, c})), 
-            Triple.create(a, p, Functor.makeFunctorNode("f", new Node[]{b, c})), 
+        doTestClauseFilter(
+            new TriplePattern(a, p, Functor.makeFunctorNode("f", new Node[]{x, c})),
+            Triple.create(a, p, Functor.makeFunctorNode("f", new Node[]{b, c})),
             new Node[] {b, null, null});
-        doTestClauseFilter( 
-            new TriplePattern(x, p, Functor.makeFunctorNode("f", new Node[]{x, c})), 
-            Triple.create(a, p, Functor.makeFunctorNode("f", new Node[]{a, c})), 
+        doTestClauseFilter(
+            new TriplePattern(x, p, Functor.makeFunctorNode("f", new Node[]{x, c})),
+            Triple.create(a, p, Functor.makeFunctorNode("f", new Node[]{a, c})),
             new Node[] {a, null, null});
-        doTestClauseFilter( 
-            new TriplePattern(x, p, Functor.makeFunctorNode("f", new Node[]{x, c})), 
-            Triple.create(a, p, Functor.makeFunctorNode("f", new Node[]{b, c})), 
+        doTestClauseFilter(
+            new TriplePattern(x, p, Functor.makeFunctorNode("f", new Node[]{x, c})),
+            Triple.create(a, p, Functor.makeFunctorNode("f", new Node[]{b, c})),
             null);
     }
 
@@ -122,23 +127,23 @@ public class TestRETE  extends TestCase {
             assertEquals(new BindingVector(expected), tnode.env);
         }
     }
-    
+
     /**
      * Inner class usable as a dummy RETENode end point for testing.
      */
     protected static class RETETestNode implements RETESinkNode {
         /** The environment passed in */
         BindingVector env;
-        
+
         /** The mode flag */
         boolean isAdd;
-        
+
         /** True if the fire has been called */
         int firings = 0;
 
-        /** 
+        /**
          * Propagate a token to this node.
-         * @param env a set of variable bindings for the rule being processed. 
+         * @param env a set of variable bindings for the rule being processed.
          * @param isAdd distinguishes between add and remove operations.
          */
         @Override
@@ -147,7 +152,7 @@ public class TestRETE  extends TestCase {
             this.env = env;
             this.isAdd = isAdd;
         }
-        
+
         /**
          * Clone this node in the network across to a different context.
          * @param netCopy a map from RETENodes to cloned instance so far.
@@ -158,9 +163,9 @@ public class TestRETE  extends TestCase {
             // Dummy, not used in testing
             return this;
         }
-        
+
     }
-      
+
     /**
      * Minimal rule tester to check basic pattern match.
      */
@@ -183,7 +188,7 @@ public class TestRETE  extends TestCase {
                         Triple.create(n1, q, n3),
                         Triple.create(n4, n4, p),
                     });
-                    
+
         doRuleTest( "[testRule1: (n1 p ?a) -> (n2, p, ?a)]" +
                         "[testRule2: (n1 q ?a) -> (n2, q, ?a)]" +
                         "[testRule3: (n2 p ?a), (n2 q ?a) -> (res p ?a)]" +
@@ -193,7 +198,7 @@ public class TestRETE  extends TestCase {
                          Triple.create(n1, p, n3),
                          Triple.create(n2, p, n3)
                      });
-        
+
         doRuleTest( "[testRule1: (n1 p ?a) -> (n2, p, ?a)]" +
                         "[testRule2: (n1 q ?a) -> (n2, q, ?a)]" +
                         "[testRule3: (n2 p ?a), (n2 q ?a) -> (res p ?a)]" +
@@ -229,11 +234,11 @@ public class TestRETE  extends TestCase {
      */
     private void doRuleTest(String rules, Triple[] adds, Triple[] expected) {
         List<Rule> ruleList = Rule.parseRules(rules);
-        BasicForwardRuleInfGraph infgraph = new BasicForwardRuleInfGraph(null, new ArrayList<Rule>(), null, GraphMemFactory.createGraphMem());
+        BasicForwardRuleInfGraph infgraph = new BasicForwardRuleInfGraph(null, new ArrayList<Rule>(), null, createGraphForTest());
 //        infgraph.setTraceOn(true);
         RETEEngine engine = new RETEEngine(infgraph, ruleList);
         infgraph.prepare();
-        engine.init(true, new FGraph(GraphMemFactory.createGraphMem()));
+        engine.init(true, new FGraph(createGraphForTest()));
         for ( Triple add : adds )
         {
             engine.addTriple( add, true );
@@ -241,25 +246,25 @@ public class TestRETE  extends TestCase {
         engine.runAll();
         TestUtil.assertIteratorValues(this, infgraph.find(null, null, null), expected);
     }
-    
+
     /**
      * Check that the rulestate cloning keeps two descendent graphs independent.
-     * 
+     *
      */
     public void testRuleClone() {
         String rules = "[testRule1: (a p ?x) (b p ?x) -> (n1 p ?x) ]" +
                        "[testRule2: (?x q ?y) -> (?x p ?y)]";
         List<Rule> ruleList = Rule.parseRules(rules);
-        Graph schema = GraphMemFactory.createGraphMem();
+        Graph schema = createGraphForTest();
         schema.add(Triple.create(a, q, c));
         schema.add(Triple.create(a, q, d));
 
-        Graph data1 = GraphMemFactory.createGraphMem();
+        Graph data1 = createGraphForTest();
         data1.add(Triple.create(b, q, c));
-        
-        Graph data2 = GraphMemFactory.createGraphMem();
+
+        Graph data2 = createGraphForTest();
         data2.add(Triple.create(b, q, d));
-        
+
         GenericRuleReasoner reasoner =  new GenericRuleReasoner(ruleList);
         reasoner.setMode(GenericRuleReasoner.FORWARD_RETE);
         Reasoner boundReasoner = reasoner.bindSchema(schema);
diff --git a/jena-core/src/test/java/org/apache/jena/reasoner/test/ReasonerTester.java b/jena-core/src/test/java/org/apache/jena/reasoner/test/ReasonerTester.java
index 0cf06d60bb..8a31bf5d9d 100644
--- a/jena-core/src/test/java/org/apache/jena/reasoner/test/ReasonerTester.java
+++ b/jena-core/src/test/java/org/apache/jena/reasoner/test/ReasonerTester.java
@@ -157,7 +157,7 @@ public class ReasonerTester {
             boolean cache = predicate.equals(tboxP) || predicate.equals(dataP);
             return loadFile(fileName, cache).getGraph();
         } else {
-            return GraphMemFactory.createGraphMem();
+            return GraphMemFactory.createDefaultGraph();
         }
     }
 
@@ -278,7 +278,7 @@ public class ReasonerTester {
 
         // Run each query triple and accumulate the results
         Graph queryG = loadTestFile(test, queryP);
-        Graph resultG = GraphMemFactory.createGraphMem();
+        Graph resultG = GraphMemFactory.createDefaultGraph();
 
         Iterator<Triple> queries = queryG.find(null, null, null);
         while (queries.hasNext()) {
diff --git a/jena-core/src/test/java/org/apache/jena/reasoner/test/TestReasoners.java b/jena-core/src/test/java/org/apache/jena/reasoner/test/TestReasoners.java
index 688259e909..7bc743e975 100644
--- a/jena-core/src/test/java/org/apache/jena/reasoner/test/TestReasoners.java
+++ b/jena-core/src/test/java/org/apache/jena/reasoner/test/TestReasoners.java
@@ -76,6 +76,11 @@ public class TestReasoners extends TestCase {
         return new TestSuite(TestReasoners.class);
     }
 
+    @SuppressWarnings("removal")
+    private static  Graph createGraphForTest() {
+        return GraphMemFactory.createGraphMem();
+    }
+
     /**
      * Test the basic functioning of a Transitive closure cache
      */
@@ -89,7 +94,7 @@ public class TestReasoners extends TestCase {
      * Test rebind operation for the transitive reasoner
      */
     public void testTransitiveRebind() {
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         Node C1 = NodeFactory.createURI("C1");
         Node C2 = NodeFactory.createURI("C2");
         Node C3 = NodeFactory.createURI("C3");
@@ -107,7 +112,7 @@ public class TestReasoners extends TestCase {
                 Triple.create(C1, RDFS.subClassOf.asNode(), C2),
                 Triple.create(C1, RDFS.subClassOf.asNode(), C3)
             } );
-        Graph data2 = GraphMemFactory.createGraphMem();
+        Graph data2 = createGraphForTest();
         data2.add( Triple.create(C1, RDFS.subClassOf.asNode(), C2) );
         data2.add( Triple.create(C2, RDFS.subClassOf.asNode(), C4) );
         infgraph.rebind(data2);
@@ -155,7 +160,7 @@ public class TestReasoners extends TestCase {
      * Test delete operation for Transtive reasoner.
      */
     public void testTransitiveRemove() {
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         Node a = NodeFactory.createURI("a");
         Node b = NodeFactory.createURI("b");
         Node c = NodeFactory.createURI("c");
@@ -234,7 +239,7 @@ public class TestReasoners extends TestCase {
      * Test metalevel add/remove subproperty operations for a reasoner.
      */
     public void doTestMetaLevel(ReasonerFactory rf) {
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         Node c1 = NodeFactory.createURI("C1");
         Node c2 = NodeFactory.createURI("C2");
         Node c3 = NodeFactory.createURI("C3");
@@ -381,7 +386,7 @@ public class TestReasoners extends TestCase {
      * Test rebind operation for the RDFS reasoner
      */
     public void testRDFSRebind() {
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         Node C1 = NodeFactory.createURI("C1");
         Node C2 = NodeFactory.createURI("C2");
         Node C3 = NodeFactory.createURI("C3");
@@ -397,7 +402,7 @@ public class TestReasoners extends TestCase {
                 Triple.create(C1, RDFS.subClassOf.asNode(), C2),
                 Triple.create(C1, RDFS.subClassOf.asNode(), C3)
             } );
-        Graph data2 = GraphMemFactory.createGraphMem();
+        Graph data2 = createGraphForTest();
         data2.add( Triple.create(C1, RDFS.subClassOf.asNode(), C2) );
         data2.add( Triple.create(C2, RDFS.subClassOf.asNode(), C4) );
         infgraph.rebind(data2);
@@ -492,9 +497,9 @@ public class TestReasoners extends TestCase {
         Node c2 = NodeFactory.createURI("C2");
         Node c3 = NodeFactory.createURI("C3");
         Node sC = RDFS.subClassOf.asNode();
-        Graph data = GraphMemFactory.createGraphMem();
+        Graph data = createGraphForTest();
         data.add( Triple.create(c2, sC, c3));
-        Graph premise = GraphMemFactory.createGraphMem();
+        Graph premise = createGraphForTest();
         premise.add( Triple.create(c1, sC, c2));
         Reasoner reasoner = rf.create(null);
         InfGraph infgraph = reasoner.bind(data);
diff --git a/jena-core/src/test/java/org/apache/jena/reasoner/test/WGReasonerTester.java b/jena-core/src/test/java/org/apache/jena/reasoner/test/WGReasonerTester.java
index dda30375f6..2731a2771d 100644
--- a/jena-core/src/test/java/org/apache/jena/reasoner/test/WGReasonerTester.java
+++ b/jena-core/src/test/java/org/apache/jena/reasoner/test/WGReasonerTester.java
@@ -195,7 +195,7 @@ public class WGReasonerTester {
             String fileName = test.getRequiredProperty(predicate).getObject().toString();
             return loadFile(fileName).getGraph();
         } else {
-            return GraphMemFactory.createGraphMem();
+            return GraphMemFactory.createDefaultGraph();
         }
     }
 
diff --git a/jena-core/src/test/java/org/apache/jena/shared/TestSharedPackage.java b/jena-core/src/test/java/org/apache/jena/shared/TS_SharedPackage.java
similarity index 96%
rename from jena-core/src/test/java/org/apache/jena/shared/TestSharedPackage.java
rename to jena-core/src/test/java/org/apache/jena/shared/TS_SharedPackage.java
index 4e8e713926..d760892f51 100644
--- a/jena-core/src/test/java/org/apache/jena/shared/TestSharedPackage.java
+++ b/jena-core/src/test/java/org/apache/jena/shared/TS_SharedPackage.java
@@ -27,4 +27,4 @@ import org.junit.runners.Suite;
     TestJenaException.class,
     TestLockMRPlusSW.class
 })
-public class TestSharedPackage {}
+public class TS_SharedPackage {}
diff --git a/jena-core/src/test/java/org/apache/jena/test/TestPackage_core.java b/jena-core/src/test/java/org/apache/jena/test/TestPackage_core.java
index 86ae97f1ff..c5bcdc6e0f 100644
--- a/jena-core/src/test/java/org/apache/jena/test/TestPackage_core.java
+++ b/jena-core/src/test/java/org/apache/jena/test/TestPackage_core.java
@@ -35,12 +35,14 @@ public class TestPackage_core extends TestCase {
         TestSuite ts = new TestSuite() ;
         ts.setName("Jena Core") ;
 
-        addTest(ts,  "System setup",       adaptJUnit4(TestSystemSetup.class));
+        addTest(ts,  "System setup",        adaptJUnit4(TestSystemSetup.class));
 
         addTest(ts,  "IRIx",                adaptJUnit4(org.apache.jena.irix.TS_IRIx.class));
         addTest(ts,  "LangTagX",            adaptJUnit4(org.apache.jena.langtagx.TS_LangTagX.class));
         addTest(ts,  "Datatypes",           adaptJUnit4(org.apache.jena.datatypes.TS3_dt.class));
+
         // ** COMPLEX
+        // Generates tests.
         addTest(ts,  "Enhanced",            org.apache.jena.enhanced.test.TS3_enh.suite());
         addTest(ts,  "Graph",               adaptJUnit4(org.apache.jena.graph.test.TS3_graph.class));
         // mem2
@@ -50,20 +52,20 @@ public class TestPackage_core extends TestCase {
         // TO CHECK
         addTest(ts,  "MemValue",            adaptJUnit4(org.apache.jena.mem.test.TS3_GraphMemValue.class));
 
-        // ** COMPLEX (rename class and create TS3_Model for these two)
-        addTest(ts,  "Model",               org.apache.jena.rdf.model.test.TS3_Model1.suite());
         // ** COMPLEX
-        addTest(ts,  "StandardModels",      org.apache.jena.rdf.model.test.TS3_StandardModels.suite() );
+        addTest(ts,  "Model1",              org.apache.jena.rdf.model.test.TS3_Model1.suite());
+        // ** COMPLEX
+        addTest(ts,  "Model2",              org.apache.jena.rdf.model.test.TS3_StandardModels.suite() );
 
-        addTest(ts,  "XML Input [ARP/IRIx]",  org.apache.jena.rdfxml.xmlinput1.TS3_xmlinput1.suite());
+        // Test suite building
+        addTest(ts,  "XML Input [ARP1]",    org.apache.jena.rdfxml.xmlinput1.TS3_xmlinput1.suite());
         addTest(ts,  "XML Output",          org.apache.jena.rdfxml.xmloutput.TS3_xmloutput.suite());
 
         addTest(ts,  "Util",                adaptJUnit4(org.apache.jena.util.TS3_coreutil.class));
         addTest(ts,  "Jena iterator",       adaptJUnit4(org.apache.jena.util.iterator.test.TS3_coreiter.class));
         addTest(ts,  "Assembler",           adaptJUnit4(org.apache.jena.assembler.test.TS3_Assembler.class));
         addTest(ts,  "Vocabularies",        adaptJUnit4(org.apache.jena.vocabulary.test.TS_Vocabularies.class));
-        addTest(ts,  "Shared",              adaptJUnit4(org.apache.jena.shared.TestSharedPackage.class));
-        addTest(ts,  "ModelUtils",          adaptJUnit4(org.apache.jena.test.TestModelUtil.class));
+        addTest(ts,  "Shared",              adaptJUnit4(org.apache.jena.shared.TS_SharedPackage.class));
 
         // ** COMPLEX
         addTest(ts,  "Composed graphs",     org.apache.jena.graph.compose.test.TS3_compose.suite() );
@@ -78,49 +80,10 @@ public class TestPackage_core extends TestCase {
         addTest(ts,  "Turtle",              adaptJUnit4(org.apache.jena.ttl_test.test.turtle.TS_TestTurtle.class));
         // ** Generated tests
         addTest(ts,  "Turtle:Manifest",     org.apache.jena.ttl_test.test.turtle.TurtleTestSuiteManifest.suite()) ;
-
         return ts ;
     }
 
-    /* ORIGINAL
-    static public TestSuite suite() {
-        JenaSystem.init();
-        // Reads Turtle (old parser, not up-to-date but we need something for testing.)
-        RDFReaderFImpl.alternative(new X_RDFReaderF());
-
-        TestSuite ts = new TestSuite() ;
-        ts.setName("Jena") ;
-
-        addTest(ts,  "System setup", TestSystemSetup.suite());
-        addTest(ts,  "IRIx", org.apache.jena.irix.TS_IRIx.suite());
-        addTest(ts,  "LangTagX", org.apache.jena.langtagx.TS_LangTagX.suite());
-        addTest(ts,  "Enhanced", org.apache.jena.enhanced.test.TestPackage_enh.suite());
-        addTest(ts,  "Datatypes", org.apache.jena.datatypes.TestPackage_dt.suite());
-        addTest(ts,  "Graph", org.apache.jena.graph.test.TestPackage_graph.suite());
-        addTest(ts,  "Mem", org.apache.jena.mem.test.TestMemPackage.suite() );
-        addTest(ts,  "Mem2", org.apache.jena.mem.test.TestGraphMemPackage.suite() );
-        addTest(ts,  "Model", org.apache.jena.rdf.model.test.TestPackage_model.suite());
-        addTest(ts,  "StandardModels", org.apache.jena.rdf.model.test.TestStandardModels.suite() );
-
-        addTest(ts,  "XML Input [ARP/IRIx]", org.apache.jena.rdfxml.xmlinput1.TestPackage_xmlinput1.suite());
-        addTest(ts,  "XML Output", org.apache.jena.rdfxml.xmloutput.TestPackage_xmloutput.suite());
-        addTest(ts,  "Util", org.apache.jena.util.TestPackage_util.suite());
-        addTest(ts,  "Jena iterator", org.apache.jena.util.iterator.test.TestPackage_iter.suite() );
-        addTest(ts,  "Assembler", org.apache.jena.assembler.test.TestAssemblerPackage.suite() );
-        addTest(ts,  "Vocabularies", org.apache.jena.vocabulary.test.TestVocabularies.suite() );
-        addTest(ts,  "Shared", org.apache.jena.shared.TestSharedPackage.suite() );
-        addTest(ts,  "Composed graphs", org.apache.jena.graph.compose.test.TestPackage_compose.suite() );
-        addTest(ts,  "Reasoners", org.apache.jena.reasoner.test.TestPackage_reasoners.suite());
-        addTest(ts,  "Ontology ModelMaker", org.apache.jena.ontology.makers.TestPackage_ModelMakers.suite() );
-        addTest(ts,  "Ontology", org.apache.jena.ontology.impl.TestPackage_ont.suite() );
-
-        // Local TTL parser for tests - not fully compliant.
-        addTest(ts,  "Turtle", org.apache.jena.ttl_test.test.turtle.TurtleTestSuite.suite()) ;
-        addTest(ts,  "ModelUtils", org.apache.jena.test.TestModelUtil.suite());
-
-        return ts ;
-    }
-*/
+    // JUnit4 in a JUnit3 test runner.
     private static Test adaptJUnit4(Class<?> testClass) {
         return new JUnit4TestAdapter(testClass);
     }
diff --git a/jena-core/src/test/java/org/apache/jena/testing_framework/GraphHelper.java b/jena-core/src/test/java/org/apache/jena/testing_framework/GraphHelper.java
index 4c7cc68ac8..f15c52c678 100644
--- a/jena-core/src/test/java/org/apache/jena/testing_framework/GraphHelper.java
+++ b/jena-core/src/test/java/org/apache/jena/testing_framework/GraphHelper.java
@@ -190,7 +190,7 @@ public class GraphHelper extends TestUtils {
 	 * Answer a new memory-based graph with Extended prefixes.
 	 */
 	public static Graph memGraph() {
-		Graph result = GraphMemFactory.createGraphMem();
+		Graph result = GraphMemFactory.createDefaultGraph();
 		result.getPrefixMapping().setNsPrefixes(PrefixMapping.Extended);
 		return result;
 	}
diff --git a/jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TurtleTestSuiteManifest.java b/jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TurtleTestSuiteManifest.java
index 97f049fda0..57fb253d7c 100644
--- a/jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TurtleTestSuiteManifest.java
+++ b/jena-core/src/test/java/org/apache/jena/ttl_test/test/turtle/TurtleTestSuiteManifest.java
@@ -28,11 +28,10 @@ public class TurtleTestSuiteManifest extends TestSuite {
 
     private TurtleTestSuiteManifest() {
         super("TurtleManifest");
-        //addTest(TurtleTestFactory.make("testing/Turtle/manifest.ttl"));
         testGood("rdf-schema"     , "RaptorTurtle/rdf-schema.ttl",      "RaptorTurtle/rdf-schema.out");
         testGood("rdfq-results"   , "RaptorTurtle/rdfq-results.ttl",    "RaptorTurtle/rdfq-results.out", "http://www.w3.org/2001/sw/DataAccess/df1/tests/rdfq-results.ttl");
         testGood("rdfs-namespace" , "RaptorTurtle/rdfs-namespace.ttl",  "RaptorTurtle/rdfs-namespace.out");
-        testGood("test-00"        , "RaptorTurtle/test-00.ttl",         "RaptorTurtle/test-00.out", "http://www.w3.org/2001/sw/DataAccess/df1/tests/test-00.ttl");
+        testGood("test-00"        , "RaptorTurtle/test-00.ttl",         "RaptorTurtle/test-00.out",      "http://www.w3.org/2001/sw/DataAccess/df1/tests/test-00.ttl");
         testGood("test-01"        , "RaptorTurtle/test-01.ttl",         "RaptorTurtle/test-01.out");
         testGood("test-02"        , "RaptorTurtle/test-02.ttl",         "RaptorTurtle/test-02.out");
         testGood("test-03"        , "RaptorTurtle/test-03.ttl",         "RaptorTurtle/test-03.out");
@@ -64,13 +63,11 @@ public class TurtleTestSuiteManifest extends TestSuite {
         testBad("Bad-11" , "RaptorTurtle/bad-11.ttl");
         testBad("Bad-12" , "RaptorTurtle/bad-12.ttl");
         testBad("Bad-13" , "RaptorTurtle/bad-13.ttl");
-
     }
 
     private void testBad(String name, String inputFile) {
         TestCase test = new TestItemBadSyntax(name, "file:testing/Turtle/"+inputFile);
         this.addTest(test);
-
     }
 
     private void testGood(String name, String inputFile, String outputFile) {
diff --git a/jena-core/src/test/java/org/apache/jena/util/TestPrefixMappingUtils.java b/jena-core/src/test/java/org/apache/jena/util/TestPrefixMappingUtils.java
index 72c49bc92c..422b8af9eb 100644
--- a/jena-core/src/test/java/org/apache/jena/util/TestPrefixMappingUtils.java
+++ b/jena-core/src/test/java/org/apache/jena/util/TestPrefixMappingUtils.java
@@ -39,7 +39,7 @@ public class TestPrefixMappingUtils {
     }
 
     static Graph create (String data) {
-        Graph graph = GraphMemFactory.createGraphMem() ;
+        Graph graph = GraphMemFactory.createDefaultGraph();
         Model m = ModelFactory.createModelForGraph(graph);
         m.read(new StringReader(data), null, "TTL");
         return graph ;


(jena) 02/06: Move etc/ to src-examples/

Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

andy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git

commit fa7631eb29acf42f457b8f2b95d4c91885f41393
Author: Andy Seaborne <an...@apache.org>
AuthorDate: Mon Jun 2 09:16:21 2025 +0100

    Move etc/ to src-examples/
---
 jena-core/{ => src-examples}/etc/location-mapping.ex   | 0
 jena-core/{ => src-examples}/etc/schemagen_example.rdf | 0
 2 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/jena-core/etc/location-mapping.ex b/jena-core/src-examples/etc/location-mapping.ex
similarity index 100%
rename from jena-core/etc/location-mapping.ex
rename to jena-core/src-examples/etc/location-mapping.ex
diff --git a/jena-core/etc/schemagen_example.rdf b/jena-core/src-examples/etc/schemagen_example.rdf
similarity index 100%
rename from jena-core/etc/schemagen_example.rdf
rename to jena-core/src-examples/etc/schemagen_example.rdf