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 93317bc24ceca9fb59b1c15290c67d5b7cc71a83 Author: Andy Seaborne <[email protected]> AuthorDate: Mon Jul 15 09:12:09 2024 +0100 Test jena-text with TDB2 --- .../text/assembler/AbstractTestTextAssembler.java | 32 +++++++++++----------- .../text/assembler/TestTextDatasetAssembler.java | 10 +++---- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/jena-text/src/test/java/org/apache/jena/query/text/assembler/AbstractTestTextAssembler.java b/jena-text/src/test/java/org/apache/jena/query/text/assembler/AbstractTestTextAssembler.java index 4db22e6d6d..46ba9c7dbe 100644 --- a/jena-text/src/test/java/org/apache/jena/query/text/assembler/AbstractTestTextAssembler.java +++ b/jena-text/src/test/java/org/apache/jena/query/text/assembler/AbstractTestTextAssembler.java @@ -25,14 +25,14 @@ import org.apache.jena.rdf.model.Model ; import org.apache.jena.rdf.model.ModelFactory ; import org.apache.jena.rdf.model.RDFNode ; import org.apache.jena.rdf.model.Resource ; -import org.apache.jena.tdb1.assembler.VocabTDB; +import org.apache.jena.tdb2.assembler.VocabTDB2; import org.apache.jena.vocabulary.RDF ; import org.apache.jena.vocabulary.RDFS ; import org.junit.After ; import org.junit.Before ; public abstract class AbstractTestTextAssembler { - + protected static final Model model = ModelFactory.createDefaultModel(); private static final String TESTBASE = "http://example.org/abstractTestTextAssembler/"; protected static final Resource SIMPLE_DATASET_SPEC; @@ -45,9 +45,9 @@ public abstract class AbstractTestTextAssembler { protected static final Resource SIMPLE_ENTITY_MAP_SPEC; protected static final Resource SIMPLE_INDEX_SPEC_LITERAL_DIR; protected static final Resource SIMPLE_INDEX_SPEC_MEM_DIR; - + static { - SIMPLE_ENTITY_MAP_SPEC = + SIMPLE_ENTITY_MAP_SPEC = model.createResource(TESTBASE + "simpleEntityMapSpec") .addProperty(RDF.type, TextVocab.entityMap) .addProperty(TextVocab.pEntityField, "entityField") @@ -62,39 +62,39 @@ public abstract class AbstractTestTextAssembler { ; SIMPLE_DATASET_SPEC = model.createResource(TESTBASE + "simpleDatasetSpec") - .addProperty(RDF.type, VocabTDB.tDatasetTDB) - .addProperty(VocabTDB.pLocation, "target/test/testasm/DB"); - + .addProperty(RDF.type, VocabTDB2.tDatasetTDB) + .addProperty(VocabTDB2.pLocation, "target/test/testasm/DB"); + SIMPLE_INDEX_SPEC = model.createResource(TESTBASE + "simpleIndexSpec") .addProperty(RDF.type, TextVocab.textIndexLucene) .addProperty(TextVocab.pDirectory, model.createResource("file:target/test/testasm/simpleIndexSpec")) .addProperty(TextVocab.pEntityMap, SIMPLE_ENTITY_MAP_SPEC); - + SIMPLE_INDEX_SPEC2 = model.createResource(TESTBASE + "simpleIndexSpec2") .addProperty(RDF.type, TextVocab.textIndexLucene) .addProperty(TextVocab.pDirectory, model.createResource("file:target/test/testasm/simpleIndexSpec2")) .addProperty(TextVocab.pEntityMap, SIMPLE_ENTITY_MAP_SPEC); - + SIMPLE_INDEX_SPEC3 = model.createResource(TESTBASE + "simpleIndexSpec3") .addProperty(RDF.type, TextVocab.textIndexLucene) .addProperty(TextVocab.pDirectory, model.createResource("file:target/test/testasm/simpleIndexSpec3")) .addProperty(TextVocab.pEntityMap, SIMPLE_ENTITY_MAP_SPEC); - + SIMPLE_INDEX_SPEC4 = model.createResource(TESTBASE + "simpleIndexSpec4") .addProperty(RDF.type, TextVocab.textIndexLucene) .addProperty(TextVocab.pDirectory, model.createResource("file:target/test/testasm/simpleIndexSpec4")) .addProperty(TextVocab.pEntityMap, SIMPLE_ENTITY_MAP_SPEC); - + SIMPLE_INDEX_SPEC5 = model.createResource(TESTBASE + "simpleIndexSpec5") .addProperty(RDF.type, TextVocab.textIndexLucene) .addProperty(TextVocab.pDirectory, model.createResource("file:target/test/testasm/simpleIndexSpec5")) .addProperty(TextVocab.pEntityMap, SIMPLE_ENTITY_MAP_SPEC); - + SIMPLE_INDEX_SPEC_QUERY_ANALYZER = model.createResource(TESTBASE + "simpleIndexSpecQueryAnalyzer") .addProperty(RDF.type, TextVocab.textIndexLucene) @@ -116,7 +116,7 @@ public abstract class AbstractTestTextAssembler { .addProperty(TextVocab.pDirectory, model.createLiteral("mem")) .addProperty(TextVocab.pEntityMap, SIMPLE_ENTITY_MAP_SPEC); } - + protected void deleteFiles() { File indexDir; indexDir = new File("target/test/testasm/DB"); if (indexDir.exists()) TextSearchUtil.emptyAndDeleteDirectory(indexDir); @@ -128,14 +128,14 @@ public abstract class AbstractTestTextAssembler { indexDir = new File("target/test/testasm/simpleIndexSpecQueryAnalyzer"); if (indexDir.exists()) TextSearchUtil.emptyAndDeleteDirectory(indexDir); indexDir = new File("target/test/testasm/simpleIndexLiteralDir"); if (indexDir.exists()) TextSearchUtil.emptyAndDeleteDirectory(indexDir); } - + @Before public void before() { deleteFiles(); - + TextSearchUtil.createEmptyIndex(new File("target/test/testasm/DB")); } - + @After public void after() { deleteFiles(); diff --git a/jena-text/src/test/java/org/apache/jena/query/text/assembler/TestTextDatasetAssembler.java b/jena-text/src/test/java/org/apache/jena/query/text/assembler/TestTextDatasetAssembler.java index e2b6b98973..3ec5d84982 100644 --- a/jena-text/src/test/java/org/apache/jena/query/text/assembler/TestTextDatasetAssembler.java +++ b/jena-text/src/test/java/org/apache/jena/query/text/assembler/TestTextDatasetAssembler.java @@ -28,7 +28,7 @@ import org.apache.jena.query.text.* ; import org.apache.jena.query.text.changes.TextQuadAction; import org.apache.jena.rdf.model.Resource ; import org.apache.jena.sys.JenaSystem; -import org.apache.jena.tdb1.assembler.AssemblerTDB; +import org.apache.jena.tdb1.assembler.VocabTDB1; import org.apache.jena.tdb1.sys.TDBInternal; import org.apache.jena.vocabulary.RDF ; import org.junit.After; @@ -49,11 +49,13 @@ public class TestTextDatasetAssembler extends AbstractTestTextAssembler { private static final Resource customTextDocProducerSpec; @BeforeClass public static void clearBefore() { - TDBInternal.reset(); + org.apache.jena.tdb1.sys.TDBInternal.reset(); + org.apache.jena.tdb2.sys.TDBInternal.reset(); } @After public void clearAfter() { - TDBInternal.reset(); + org.apache.jena.tdb1.sys.TDBInternal.reset(); + org.apache.jena.tdb2.sys.TDBInternal.reset(); } @Test @@ -83,8 +85,6 @@ public class TestTextDatasetAssembler extends AbstractTestTextAssembler { static { JenaSystem.init(); - TextAssembler.init(); - AssemblerTDB.init(); spec1 = model.createResource(TESTBASE + "spec1") .addProperty(RDF.type, TextVocab.textDataset)
