You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@jena.apache.org by GitBox <gi...@apache.org> on 2020/12/02 09:03:57 UTC

[GitHub] [jena] rvesse commented on a change in pull request #880: JENA-2006: DatasetGraph prefixes

rvesse commented on a change in pull request #880:
URL: https://github.com/apache/jena/pull/880#discussion_r533996839



##########
File path: jena-integration-tests/src/test/java/org/apache/jena/test/integration/TestDatasetPrefixes.java
##########
@@ -0,0 +1,236 @@
+/*
+ * 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.test.integration;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Arrays;
+import java.util.Collection;
+
+import org.apache.jena.atlas.lib.Creator;
+import org.apache.jena.query.TxnType;
+import org.apache.jena.riot.system.PrefixMap;
+import org.apache.jena.riot.system.Prefixes;
+import org.apache.jena.shared.JenaException;
+import org.apache.jena.sparql.JenaTransactionException;
+import org.apache.jena.sparql.core.DatasetGraph;
+import org.apache.jena.sparql.core.DatasetGraphFactory;
+import org.apache.jena.sparql.core.DatasetGraphMap;
+import org.apache.jena.sparql.core.DatasetGraphMapLink;
+import org.apache.jena.sparql.graph.GraphFactory;
+import org.apache.jena.system.Txn;
+import org.apache.jena.tdb.TDBFactory;
+import org.apache.jena.tdb.transaction.TDBTransactionException;
+import org.apache.jena.tdb2.DatabaseMgr;
+import org.junit.Assume;
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.MethodSorters;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+// Tests go simple -> complex
+// Does not matter ass to their execution, it does help pinpoint what has broken.
+/**
+ * Test of dataset prefixes.
+ * See {@code AbstractTestPrefixMap} for tests of prefix maps in general.
+ */
+
+
+@FixMethodOrder(MethodSorters.JVM)
+@RunWith(Parameterized.class)
+public class TestDatasetPrefixes {
+
+    @Parameters(name = "{index}: {0}")
+    public static Collection<Object[]> data(){
+        Creator<DatasetGraph> c1 = ()->DatasetGraphFactory.createTxnMem();
+        Creator<DatasetGraph> c2 = ()->TDBFactory.createDatasetGraph();
+        Creator<DatasetGraph> c3 = ()->DatabaseMgr.createDatasetGraph();
+        Creator<DatasetGraph> c4 = ()->new DatasetGraphMap();     //DatasetGraphFactory.create();
+        Creator<DatasetGraph> c5 = ()->new DatasetGraphMapLink(GraphFactory.createDefaultGraph()); //DatasetGraphFactory.createGeneral();
+
+        Object[] x1 = { "TIM",  c1 , false, true, true };
+        Object[] x2 = { "TDB1", c2 , true, true, true };
+        Object[] x3 = { "TDB2", c3 , true, true, true };
+        Object[] x4 = { "Map",  c4 , false, false, false };
+        Object[] x5 = { "MapLink", c5 , false, false, false };
+        return Arrays.asList(x1, x2, x3, x4,x5);
+    }
+

Review comment:
       This is a really nice looking new test suite 👍 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org