jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [056/100] [abbrv] jena git commit: JENA-1397: Rename java packages
Date Thu, 28 Sep 2017 16:06:08 GMT
http://git-wip-us.apache.org/repos/asf/jena/blob/3d456654/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/nodetable/AbstractTestNodeTable.java
----------------------------------------------------------------------
diff --git a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/nodetable/AbstractTestNodeTable.java b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/nodetable/AbstractTestNodeTable.java
new file mode 100644
index 0000000..dae191b
--- /dev/null
+++ b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/nodetable/AbstractTestNodeTable.java
@@ -0,0 +1,68 @@
+/*
+ * 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.tdb2.store.nodetable;
+
+import static org.junit.Assert.assertEquals ;
+import static org.junit.Assert.assertNotEquals ;
+import static org.junit.Assert.assertNotNull ;
+
+import org.apache.jena.graph.Node ;
+import org.apache.jena.sparql.util.NodeFactoryExtra ;
+import org.apache.jena.tdb2.store.NodeId;
+import org.apache.jena.tdb2.store.nodetable.NodeTable;
+import org.junit.Test ;
+
+public abstract class AbstractTestNodeTable
+{
+    protected abstract NodeTable createEmptyNodeTable() ;
+    
+    protected void testNode(String str) {
+        testNode(NodeFactoryExtra.parseNode(str)) ;
+    }
+
+    protected void testNode(Node n) {
+        NodeTable nt = createEmptyNodeTable() ;
+        writeNode(nt, n) ;
+    }
+
+    protected static void writeNode(NodeTable nt, String str) {
+        writeNode(nt, NodeFactoryExtra.parseNode(str)) ;
+    }
+    
+    protected static void writeNode(NodeTable nt, Node n) {
+        NodeId nodeId = nt.getAllocateNodeId(n) ;
+        assertNotNull(nodeId) ;
+        assertNotEquals(NodeId.NodeDoesNotExist, nodeId) ;
+        assertNotEquals(NodeId.NodeIdAny, nodeId) ;
+
+        Node n2 = nt.getNodeForNodeId(nodeId) ;
+        assertEquals(n, n2) ;
+
+        NodeId nodeId2 = nt.getNodeIdForNode(n) ;
+        assertEquals(nodeId, nodeId2) ;
+    }
+
+    @Test public void nodetable_01()    { testNode("<http://example/x>") ; }
+    @Test public void nodetable_02()    { testNode("1") ; }
+    @Test public void nodetable_03()    { testNode("_:x") ; }
+    @Test public void nodetable_04()    { testNode("'x'") ; }
+    @Test public void nodetable_05()    { testNode("'x'@en") ; }
+    @Test public void nodetable_06()    { testNode("'x'^^<http://example/dt>") ; }
+    @Test public void nodetable_07()    { testNode("'نواف'") ; }
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/3d456654/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/nodetable/TS_NodeTable.java
----------------------------------------------------------------------
diff --git a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/nodetable/TS_NodeTable.java b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/nodetable/TS_NodeTable.java
new file mode 100644
index 0000000..337552c
--- /dev/null
+++ b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/nodetable/TS_NodeTable.java
@@ -0,0 +1,34 @@
+/*
+ * 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.tdb2.store.nodetable;
+
+import org.junit.runner.RunWith ;
+import org.junit.runners.Suite ;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses( {
+    TestNodeTableBase.class
+    , TestNodeTableStoredBase.class
+    , TestNodeTableStored.class
+    , TestNodeTable.class
+})
+public class TS_NodeTable
+{
+
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/3d456654/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/nodetable/TestNodeTable.java
----------------------------------------------------------------------
diff --git a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/nodetable/TestNodeTable.java b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/nodetable/TestNodeTable.java
new file mode 100644
index 0000000..e5c261c
--- /dev/null
+++ b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/nodetable/TestNodeTable.java
@@ -0,0 +1,39 @@
+/*
+ * 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.tdb2.store.nodetable;
+
+import org.apache.jena.dboe.base.file.Location;
+import org.apache.jena.tdb2.junit.BuildTestLib;
+import org.apache.jena.tdb2.setup.StoreParams;
+import org.apache.jena.tdb2.setup.StoreParamsBuilder;
+import org.apache.jena.tdb2.store.nodetable.NodeTable;
+
+public class TestNodeTable extends AbstractTestNodeTable
+{
+    @Override
+    protected NodeTable createEmptyNodeTable()
+    {
+        StoreParams params = 
+            StoreParamsBuilder.create()
+                .nodeId2NodeCacheSize(10)
+                .node2NodeIdCacheSize(10)
+                .nodeMissCacheSize(10).build() ;
+        return BuildTestLib.makeNodeTable(Location.mem(), "test", params) ;
+    }
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/3d456654/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/nodetable/TestNodeTableBase.java
----------------------------------------------------------------------
diff --git a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/nodetable/TestNodeTableBase.java b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/nodetable/TestNodeTableBase.java
new file mode 100644
index 0000000..a850012
--- /dev/null
+++ b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/nodetable/TestNodeTableBase.java
@@ -0,0 +1,41 @@
+/*
+ * 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.tdb2.store.nodetable;
+
+import org.apache.jena.dboe.base.file.Location;
+import org.apache.jena.tdb2.junit.BuildTestLib;
+import org.apache.jena.tdb2.setup.StoreParams;
+import org.apache.jena.tdb2.setup.StoreParamsBuilder;
+import org.apache.jena.tdb2.store.nodetable.NodeTable;
+
+public class TestNodeTableBase extends AbstractTestNodeTable
+{
+    @Override
+    protected NodeTable createEmptyNodeTable()
+    {
+        StoreParams params = 
+            StoreParamsBuilder.create()
+                .nodeId2NodeCacheSize(-1)
+                .node2NodeIdCacheSize(-1)
+                .nodeMissCacheSize(-1).build() ;
+
+        // No cache, no inlining.
+        return BuildTestLib.makeNodeTableBase(Location.mem(), "test", params) ;
+    }
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/3d456654/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/nodetable/TestNodeTableStored.java
----------------------------------------------------------------------
diff --git a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/nodetable/TestNodeTableStored.java b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/nodetable/TestNodeTableStored.java
new file mode 100644
index 0000000..1252319
--- /dev/null
+++ b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/nodetable/TestNodeTableStored.java
@@ -0,0 +1,47 @@
+/*
+ * 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.tdb2.store.nodetable;
+
+import org.apache.jena.atlas.lib.FileOps ;
+import org.apache.jena.dboe.base.file.Location;
+import org.apache.jena.tdb2.ConfigTest;
+import org.apache.jena.tdb2.junit.BuildTestLib;
+import org.apache.jena.tdb2.setup.StoreParams;
+import org.apache.jena.tdb2.setup.StoreParamsBuilder;
+import org.apache.jena.tdb2.store.nodetable.NodeTable;
+
+
+public class TestNodeTableStored extends AbstractTestNodeTable
+{
+    static String base = ConfigTest.getTestingDir() ;
+    static Location location = Location.create(base+"/nodetable-test") ;
+    
+    @Override
+    protected NodeTable createEmptyNodeTable()
+    {
+        FileOps.ensureDir(location.getDirectoryPath());
+        FileOps.clearDirectory(location.getDirectoryPath());
+        StoreParams params = 
+            StoreParamsBuilder.create()
+                .nodeId2NodeCacheSize(10)
+                .node2NodeIdCacheSize(10)
+                .nodeMissCacheSize(10).build() ;
+        return BuildTestLib.makeNodeTable(location, "test", params) ;
+    }
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/3d456654/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/nodetable/TestNodeTableStoredBase.java
----------------------------------------------------------------------
diff --git a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/nodetable/TestNodeTableStoredBase.java b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/nodetable/TestNodeTableStoredBase.java
new file mode 100644
index 0000000..b398bd0
--- /dev/null
+++ b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/nodetable/TestNodeTableStoredBase.java
@@ -0,0 +1,48 @@
+/*
+ * 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.tdb2.store.nodetable;
+
+import org.apache.jena.atlas.lib.FileOps ;
+import org.apache.jena.dboe.base.file.Location;
+import org.apache.jena.tdb2.ConfigTest;
+import org.apache.jena.tdb2.junit.BuildTestLib;
+import org.apache.jena.tdb2.setup.StoreParams;
+import org.apache.jena.tdb2.setup.StoreParamsBuilder;
+import org.apache.jena.tdb2.store.nodetable.NodeTable;
+
+
+public class TestNodeTableStoredBase extends AbstractTestNodeTable
+{
+    
+    static String base = ConfigTest.getTestingDir() ;
+    static Location location = Location.create(base+"/nodetable-test") ;
+    
+    @Override
+    protected NodeTable createEmptyNodeTable()
+    {
+        FileOps.ensureDir(location.getDirectoryPath());
+        FileOps.clearDirectory(location.getDirectoryPath());
+        StoreParams params = 
+            StoreParamsBuilder.create()
+                .nodeId2NodeCacheSize(-1)
+                .node2NodeIdCacheSize(-1)
+                .nodeMissCacheSize(-1).build() ;
+        return BuildTestLib.makeNodeTableBase(location, "test", params) ;
+    }
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/3d456654/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/tupletable/AbstractTestTupleIndex.java
----------------------------------------------------------------------
diff --git a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/tupletable/AbstractTestTupleIndex.java b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/tupletable/AbstractTestTupleIndex.java
new file mode 100644
index 0000000..d630b1c
--- /dev/null
+++ b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/tupletable/AbstractTestTupleIndex.java
@@ -0,0 +1,265 @@
+/*
+ * 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.tdb2.store.tupletable;
+
+import static org.apache.jena.atlas.lib.tuple.TupleFactory.tuple ;
+import static org.apache.jena.tdb2.store.tupletable.NData.*;
+
+import java.util.Iterator ;
+import java.util.Set ;
+
+import org.apache.jena.atlas.iterator.Iter ;
+import static org.junit.Assert.*;
+import org.apache.jena.atlas.lib.tuple.Tuple ;
+import org.apache.jena.tdb2.store.NodeId;
+import org.apache.jena.tdb2.store.tupletable.TupleIndex;
+import org.junit.Test ;
+
+/** Test TupleIndexes (general) */
+public abstract class AbstractTestTupleIndex
+{
+    protected abstract TupleIndex create(String description) ;
+    
+    protected static void add(TupleIndex index, NodeId x1, NodeId x2, NodeId x3)
+    {
+        Tuple<NodeId> tuple = tuple(x1, x2, x3) ;
+        index.add(tuple) ;
+    }
+    
+    @Test public void TupleIndex_1()
+    {
+        TupleIndex index = create("SPO") ;
+        add(index, n1, n2, n3) ;
+    }
+    
+    @Test public void TupleIndexRecordSPO_1()
+    {
+        TupleIndex index = create("SPO") ;
+        add(index, n1, n2, n3) ;
+        
+        Tuple<NodeId> tuple2 = tuple(n1, n2, n3) ;
+        Iterator<Tuple<NodeId>> iter = index.find(tuple2) ;
+        assertTrue(iter.hasNext()) ;
+        iter.next();
+        assertFalse(iter.hasNext()) ;
+    }
+ 
+    @Test public void TupleIndexRecordSPO_2()
+    {
+        TupleIndex index = create("SPO") ;
+        add(index, n1, n2, n3) ;
+        
+        Tuple<NodeId> tuple2 = tuple(n1, n2, null) ;
+        Iterator<Tuple<NodeId>> iter = index.find(tuple2) ;
+        assertTrue(iter.hasNext()) ;
+        iter.next();
+        assertFalse(iter.hasNext()) ;
+    }
+    
+    @Test public void TupleIndexRecordSPO_3()
+    {
+        TupleIndex index = create("SPO") ;
+        add(index, n1, n2, n3) ;
+        
+        Tuple<NodeId> tuple2 = tuple(n1, null, n3) ;
+        Iterator<Tuple<NodeId>> iter = index.find(tuple2) ;
+        assertTrue(iter.hasNext()) ;
+        iter.next();
+        assertFalse(iter.hasNext()) ;
+    }
+    
+    @Test public void TupleIndexRecordSPO_4()
+    {
+        TupleIndex index = create("SPO") ;
+        add(index, n1, n2, n3) ;
+        
+        Tuple<NodeId> tuple2 = tuple(n1, NodeId.NodeIdAny, NodeId.NodeIdAny) ;
+        Iterator<Tuple<NodeId>> iter = index.find(tuple2) ;
+        assertTrue(iter.hasNext()) ;
+        iter.next();
+        assertFalse(iter.hasNext()) ;
+    }
+    
+    @Test public void TupleIndexRecordSPO_5()
+    {
+        TupleIndex index = create("SPO") ;
+        add(index, n1, n2, n3) ;
+        add(index, n1, n2, n4) ;
+        
+        Tuple<NodeId> tuple2 = tuple(n1, n2, n3) ;
+        Iterator<Tuple<NodeId>> iter = index.find(tuple2) ;
+        Set<Tuple<NodeId>> x = Iter.toSet(iter) ;
+        assertEquals(1, x.size()) ;
+        assertTrue(x.contains(tuple(n1, n2, n3))) ;
+        assertFalse(x.contains(tuple(n1, n2, n4))) ;
+    }
+
+    @Test public void TupleIndexRecordSPO_6()
+    {
+        TupleIndex index = create("SPO") ;
+        add(index, n1, n2, n3) ;
+        add(index, n1, n2, n4) ;
+        
+        Tuple<NodeId> tuple2 = tuple(n1, n2, NodeId.NodeIdAny) ;
+        Iterator<Tuple<NodeId>> iter = index.find(tuple2) ;
+        Set<Tuple<NodeId>> x = Iter.toSet(iter) ;
+        assertEquals(2, x.size()) ;
+        assertTrue(x.contains(tuple(n1, n2, n3))) ;
+        assertTrue(x.contains(tuple(n1, n2, n4))) ;
+    }
+
+    @Test public void TupleIndexRecordSPO_7()
+    {
+        TupleIndex index = create("SPO") ;
+        add(index, n1, n2, n3) ;
+        add(index, n1, n2, n4) ;
+        
+        Tuple<NodeId> tuple2 = tuple(n1, NodeId.NodeIdAny, NodeId.NodeIdAny) ;
+        Iterator<Tuple<NodeId>> iter = index.find(tuple2) ;
+        Set<Tuple<NodeId>> x = Iter.toSet(iter) ;
+        assertEquals(2, x.size()) ;
+        assertTrue(x.contains(tuple(n1, n2, n3))) ;
+        assertTrue(x.contains(tuple(n1, n2, n4))) ;
+    }
+
+    @Test public void TupleIndexRecordSPO_8()
+    {
+        TupleIndex index = create("SPO") ;
+        add(index, n1, n2, n3) ;
+        add(index, n2, n3, n4) ;
+
+        {
+            Tuple<NodeId> tuple2 = tuple(n1, NodeId.NodeIdAny, NodeId.NodeIdAny) ;
+            Iterator<Tuple<NodeId>> iter = index.find(tuple2) ;
+            Set<Tuple<NodeId>> x = Iter.toSet(iter) ;
+            assertEquals(1, x.size()) ;
+            assertTrue(x.contains(tuple(n1, n2, n3))) ;
+        }
+
+        {
+            Tuple<NodeId> tuple2 = tuple(n2, NodeId.NodeIdAny, NodeId.NodeIdAny) ;
+            Iterator<Tuple<NodeId>> iter = index.find(tuple2) ;
+            Set<Tuple<NodeId>> x = Iter.toSet(iter) ;
+            assertEquals(1, x.size()) ;
+            assertTrue(x.contains(tuple(n2, n3, n4))) ;
+        }
+    }
+
+    @Test public void TupleIndexRecordPOS_1()
+    {
+        TupleIndex index = create("POS") ;
+        add(index, n1, n2, n3) ;
+        Tuple<NodeId> tuple2 = tuple(n1, n2, n3) ;
+        Iterator<Tuple<NodeId>> iter = index.find(tuple2) ;
+        assertTrue("Can't find tuple", iter.hasNext()) ;
+        iter.next();
+        assertFalse(iter.hasNext()) ;
+    }
+ 
+    @Test public void TupleIndexRecordPOS_2()
+    {
+        TupleIndex index = create("POS") ;
+        add(index, n1, n2, n3) ;
+        
+        Tuple<NodeId> tuple2 = tuple(null, n2, null) ;
+        Iterator<Tuple<NodeId>> iter = index.find(tuple2) ;
+        assertTrue("Can't find tuple",iter.hasNext()) ;
+        iter.next();
+        assertFalse(iter.hasNext()) ;
+    }
+    
+
+    @Test public void TupleIndexRecordPOS_3()
+    {
+        TupleIndex index = create("POS") ;
+        add(index, n1, n2, n3) ;
+        
+        Tuple<NodeId> tuple2 = tuple(null, n2, n3) ;
+        Iterator<Tuple<NodeId>> iter = index.find(tuple2) ;
+        assertTrue("Can't find tuple", iter.hasNext()) ;
+        iter.next();
+        assertFalse(iter.hasNext()) ;
+    }
+
+    @Test public void TupleIndexRecordFindNot_1()
+    {
+        TupleIndex index = create("SPO") ;
+        add(index, n1, n2, n3) ;
+        
+        Tuple<NodeId> tuple2 = tuple(n4, n5, n6) ;
+        Iterator<Tuple<NodeId>> iter = index.find(tuple2) ;
+        assertNotNull(iter) ;
+        assertFalse(iter.hasNext()) ;
+   }
+    
+    @Test public void TupleIndexRecordFindNot_2()
+    {
+        TupleIndex index = create("SPO") ;
+        add(index, n1, n2, n3) ;
+        
+        Tuple<NodeId> tuple2 = tuple(n1, n5, n6) ;
+        Iterator<Tuple<NodeId>> iter = index.find(tuple2) ;
+        assertFalse(iter.hasNext()) ;
+   }
+
+    @Test public void TupleIndexRecordFindNot_3()
+    {
+        TupleIndex index = create("SPO") ;
+        add(index, n1, n2, n3) ;
+        
+        Tuple<NodeId> tuple2 = tuple(n1, null, n6) ;
+        Iterator<Tuple<NodeId>> iter = index.find(tuple2) ;
+        assertFalse(iter.hasNext()) ;
+   }
+
+    @Test public void TupleIndexRecordFindNot_4()
+    {
+        TupleIndex index = create("SPO") ;
+        add(index, n1, n2, n3) ;
+        add(index, n1, n5, n6) ;
+        
+        Tuple<NodeId> tuple2 = tuple(n4, n5, n6) ;
+        Iterator<Tuple<NodeId>> iter = index.find(tuple2) ;
+        assertFalse(iter.hasNext()) ;
+   }
+    
+    @Test public void TupleIndexRecordFindNot_5()
+    {
+        TupleIndex index = create("SPO") ;
+        add(index, n1, n2, n3) ;
+        add(index, n1, n5, n6) ;
+        
+        Tuple<NodeId> tuple2 = tuple(n2, n5, n6) ;
+        Iterator<Tuple<NodeId>> iter = index.find(tuple2) ;
+        assertFalse(iter.hasNext()) ;
+   }
+
+    @Test public void TupleIndexRecordFindNot_6()
+    {
+        TupleIndex index = create("SPO") ;
+        add(index, n1, n2, n3) ;
+        add(index, n4, n5, n6) ;
+        
+        Tuple<NodeId> tuple2 = tuple(n1, null, n6) ;
+        Iterator<Tuple<NodeId>> iter = index.find(tuple2) ;
+        assertFalse(iter.hasNext()) ;
+   }
+
+    
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/3d456654/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/tupletable/NData.java
----------------------------------------------------------------------
diff --git a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/tupletable/NData.java b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/tupletable/NData.java
new file mode 100644
index 0000000..6fc1f20
--- /dev/null
+++ b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/tupletable/NData.java
@@ -0,0 +1,38 @@
+/*
+ * 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.tdb2.store.tupletable;
+
+import org.apache.jena.atlas.lib.BitsLong;
+import org.apache.jena.tdb2.store.NodeId;
+import org.apache.jena.tdb2.store.NodeIdFactory;
+import org.apache.jena.tdb2.store.NodeIdType;
+
+public class NData {
+    public static NodeId n1 = create(1) ;
+    public static NodeId n2 = create(2) ;
+    public static NodeId n3 = create(3) ;
+    public static NodeId n4 = NodeIdFactory.createValue(NodeIdType.XSD_INTEGER, 1);
+    public static NodeId n5 = NodeIdFactory.createValue(NodeIdType.XSD_INTEGER, 2);
+    // -2 as inlined.
+    public static NodeId n6 = NodeIdFactory.createValue(NodeIdType.XSD_INTEGER, BitsLong.clear(-2L, 56, 64));
+    
+    private static NodeId create(long v) {
+        return NodeIdFactory.createPtr(v);
+    }
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/3d456654/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/tupletable/TS_TupleTable.java
----------------------------------------------------------------------
diff --git a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/tupletable/TS_TupleTable.java b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/tupletable/TS_TupleTable.java
new file mode 100644
index 0000000..9384450
--- /dev/null
+++ b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/tupletable/TS_TupleTable.java
@@ -0,0 +1,32 @@
+/*
+ * 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.tdb2.store.tupletable;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses( {
+    TestTupleIndexRecord.class,
+    TestTupleIndexRecordDirect.class,
+    TestTupleTable.class
+} )
+
+public class TS_TupleTable
+{ }

http://git-wip-us.apache.org/repos/asf/jena/blob/3d456654/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/tupletable/TestTupleIndexRecord.java
----------------------------------------------------------------------
diff --git a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/tupletable/TestTupleIndexRecord.java b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/tupletable/TestTupleIndexRecord.java
new file mode 100644
index 0000000..a0a12ea
--- /dev/null
+++ b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/tupletable/TestTupleIndexRecord.java
@@ -0,0 +1,44 @@
+/*
+ * 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.tdb2.store.tupletable;
+
+import org.apache.jena.atlas.lib.tuple.TupleMap ;
+import org.apache.jena.dboe.base.file.FileSet;
+import org.apache.jena.dboe.base.record.RecordFactory;
+import org.apache.jena.dboe.index.IndexParams;
+import org.apache.jena.dboe.index.RangeIndex;
+import org.apache.jena.tdb2.junit.BuildTestLib;
+import org.apache.jena.tdb2.setup.StoreParams;
+import org.apache.jena.tdb2.store.tupletable.TupleIndexRecord;
+import org.apache.jena.tdb2.sys.SystemTDB;
+
+public class TestTupleIndexRecord extends AbstractTestTupleIndex
+{
+    static RecordFactory factory = new RecordFactory(3*SystemTDB.SizeOfNodeId, 0) ;
+    
+    @Override
+    protected TupleIndexRecord create(String description)
+    {
+        IndexParams indexParams = StoreParams.getDftStoreParams() ; 
+        RangeIndex rIdx = BuildTestLib.buildRangeIndex(FileSet.mem(), factory, indexParams) ;
+        TupleMap tmap = TupleMap.create("SPO", description) ;
+        TupleIndexRecord index = new TupleIndexRecord(3, tmap, description, factory, rIdx) ;
+        return index ;
+    }
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/3d456654/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/tupletable/TestTupleIndexRecordDirect.java
----------------------------------------------------------------------
diff --git a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/tupletable/TestTupleIndexRecordDirect.java b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/tupletable/TestTupleIndexRecordDirect.java
new file mode 100644
index 0000000..141e6b5
--- /dev/null
+++ b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/tupletable/TestTupleIndexRecordDirect.java
@@ -0,0 +1,316 @@
+/*
+ * 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.tdb2.store.tupletable;
+
+import static org.apache.jena.atlas.lib.tuple.TupleFactory.tuple ;
+import static org.apache.jena.tdb2.store.tupletable.NData.*;
+
+import java.util.Iterator ;
+import java.util.Set ;
+
+import org.apache.jena.atlas.iterator.Iter ;
+import static org.junit.Assert.*;
+import org.apache.jena.atlas.lib.tuple.Tuple ;
+import org.apache.jena.atlas.lib.tuple.TupleMap ;
+import org.apache.jena.dboe.base.file.FileSet;
+import org.apache.jena.dboe.base.record.RecordFactory;
+import org.apache.jena.dboe.index.IndexParams;
+import org.apache.jena.dboe.index.RangeIndex;
+import org.apache.jena.tdb2.junit.BuildTestLib;
+import org.apache.jena.tdb2.setup.StoreParams;
+import org.apache.jena.tdb2.store.NodeId;
+import org.apache.jena.tdb2.store.tupletable.TupleIndexRecord;
+import org.apache.jena.tdb2.sys.SystemTDB;
+import org.junit.Test ;
+
+public class TestTupleIndexRecordDirect
+{
+    static RecordFactory factory = new RecordFactory(3*SystemTDB.SizeOfNodeId, 0) ;
+    
+    static TupleIndexRecord create(String description)
+    {
+        IndexParams indexParams = StoreParams.getDftStoreParams() ; 
+        RangeIndex rIdx = BuildTestLib.buildRangeIndex(FileSet.mem(), factory, indexParams) ;
+        TupleMap tmap = TupleMap.create("SPO", description) ;
+        TupleIndexRecord index = new TupleIndexRecord(3, tmap, description, factory, rIdx) ;
+        return index ;
+    }
+    
+    static void add(TupleIndexRecord index, NodeId x1, NodeId x2, NodeId x3)
+    {
+        Tuple<NodeId> tuple = tuple(x1, x2, x3) ;
+        index.add(tuple) ;
+    }
+    
+    @Test public void TupleIndexRecord_1()
+    {
+        TupleIndexRecord index = create("SPO") ;
+        add(index, n1, n2, n3) ;
+    }
+    
+    @Test public void TupleIndexRecordSPO_1()
+    {
+        TupleIndexRecord index = create("SPO") ;
+        add(index, n1, n2, n3) ;
+        
+        Tuple<NodeId> tuple2 = tuple(n1, n2, n3) ;
+        Iterator<Tuple<NodeId>> iter = index.findByIndex(tuple2) ;
+        assertTrue(iter.hasNext()) ;
+        iter.next();
+        assertFalse(iter.hasNext()) ;
+    }
+ 
+    @Test public void TupleIndexRecordSPO_2()
+    {
+        TupleIndexRecord index = create("SPO") ;
+        add(index, n1, n2, n3) ;
+        
+        Tuple<NodeId> tuple2 = tuple(n1, n2, null) ;
+        Iterator<Tuple<NodeId>> iter = index.findByIndex(tuple2) ;
+        assertTrue(iter.hasNext()) ;
+        iter.next();
+        assertFalse(iter.hasNext()) ;
+    }
+    
+    @Test public void TupleIndexRecordSPO_3()
+    {
+        TupleIndexRecord index = create("SPO") ;
+        add(index, n1, n2, n3) ;
+        
+        Tuple<NodeId> tuple2 = tuple(n1, null, n3) ;
+        Iterator<Tuple<NodeId>> iter = index.findByIndex(tuple2) ;
+        assertNull(iter) ;
+        iter = index.findOrPartialScan(tuple2) ;
+        assertTrue(iter.hasNext()) ;
+        iter.next();
+        assertFalse(iter.hasNext()) ;
+    }
+    
+    @Test public void TupleIndexRecordSPO_4()
+    {
+        TupleIndexRecord index = create("SPO") ;
+        add(index, n1, n2, n3) ;
+        
+        Tuple<NodeId> tuple2 = tuple(n1, NodeId.NodeIdAny, NodeId.NodeIdAny) ;
+        Iterator<Tuple<NodeId>> iter = index.findByIndex(tuple2) ;
+        assertTrue(iter.hasNext()) ;
+        iter.next();
+        assertFalse(iter.hasNext()) ;
+    }
+    
+    @Test public void TupleIndexRecordSPO_5()
+    {
+        TupleIndexRecord index = create("SPO") ;
+        add(index, n1, n2, n3) ;
+        add(index, n1, n2, n4) ;
+        
+        Tuple<NodeId> tuple2 = tuple(n1, n2, n3) ;
+        Iterator<Tuple<NodeId>> iter = index.findByIndex(tuple2) ;
+        Set<Tuple<NodeId>> x = Iter.toSet(iter) ;
+        assertEquals(1, x.size()) ;
+        assertTrue(x.contains(tuple(n1, n2, n3))) ;
+        assertFalse(x.contains(tuple(n1, n2, n4))) ;
+    }
+
+    @Test public void TupleIndexRecordSPO_6()
+    {
+        TupleIndexRecord index = create("SPO") ;
+        add(index, n1, n2, n3) ;
+        add(index, n1, n2, n4) ;
+        
+        Tuple<NodeId> tuple2 = tuple(n1, n2, NodeId.NodeIdAny) ;
+        Iterator<Tuple<NodeId>> iter = index.findByIndex(tuple2) ;
+        Set<Tuple<NodeId>> x = Iter.toSet(iter) ;
+        assertEquals(2, x.size()) ;
+        assertTrue(x.contains(tuple(n1, n2, n3))) ;
+        assertTrue(x.contains(tuple(n1, n2, n4))) ;
+    }
+
+    @Test public void TupleIndexRecordSPO_7()
+    {
+        TupleIndexRecord index = create("SPO") ;
+        add(index, n1, n2, n3) ;
+        add(index, n1, n2, n4) ;
+        
+        Tuple<NodeId> tuple2 = tuple(n1, NodeId.NodeIdAny, NodeId.NodeIdAny) ;
+        Iterator<Tuple<NodeId>> iter = index.findByIndex(tuple2) ;
+        Set<Tuple<NodeId>> x = Iter.toSet(iter) ;
+        assertEquals(2, x.size()) ;
+        assertTrue(x.contains(tuple(n1, n2, n3))) ;
+        assertTrue(x.contains(tuple(n1, n2, n4))) ;
+    }
+
+    @Test public void TupleIndexRecordSPO_8()
+    {
+        TupleIndexRecord index = create("SPO") ;
+        add(index, n1, n2, n3) ;
+        add(index, n2, n3, n4) ;
+
+        {
+            Tuple<NodeId> tuple2 = tuple(n1, NodeId.NodeIdAny, NodeId.NodeIdAny) ;
+            Iterator<Tuple<NodeId>> iter = index.findByIndex(tuple2) ;
+            Set<Tuple<NodeId>> x = Iter.toSet(iter) ;
+            assertEquals(1, x.size()) ;
+            assertTrue(x.contains(tuple(n1, n2, n3))) ;
+        }
+
+        {
+            Tuple<NodeId> tuple2 = tuple(n2, NodeId.NodeIdAny, NodeId.NodeIdAny) ;
+            Iterator<Tuple<NodeId>> iter = index.findByIndex(tuple2) ;
+            Set<Tuple<NodeId>> x = Iter.toSet(iter) ;
+            assertEquals(1, x.size()) ;
+            assertTrue(x.contains(tuple(n2, n3, n4))) ;
+        }
+    }
+
+    @Test public void TupleIndexRecordPOS_1()
+    {
+        TupleIndexRecord index = create("POS") ;
+        add(index, n1, n2, n3) ;
+        Tuple<NodeId> tuple2 = tuple(n1, n2, n3) ;
+        Iterator<Tuple<NodeId>> iter = index.findByIndex(tuple2) ;
+        assertTrue("Can't find tuple", iter.hasNext()) ;
+        iter.next();
+        assertFalse(iter.hasNext()) ;
+    }
+ 
+    @Test public void TupleIndexRecordPOS_2()
+    {
+        TupleIndexRecord index = create("POS") ;
+        add(index, n1, n2, n3) ;
+        
+        Tuple<NodeId> tuple2 = tuple(null, n2, null) ;
+        Iterator<Tuple<NodeId>> iter = index.findByIndex(tuple2) ;
+        assertTrue("Can't find tuple",iter.hasNext()) ;
+        iter.next();
+        assertFalse(iter.hasNext()) ;
+    }
+    
+
+    @Test public void TupleIndexRecordPOS_3()
+    {
+        TupleIndexRecord index = create("POS") ;
+        add(index, n1, n2, n3) ;
+        
+        Tuple<NodeId> tuple2 = tuple(null, n2, n3) ;
+        Iterator<Tuple<NodeId>> iter = index.findByIndex(tuple2) ;
+        assertTrue("Can't find tuple", iter.hasNext()) ;
+        iter.next();
+        assertFalse(iter.hasNext()) ;
+    }
+
+    @Test public void TupleIndexRecordFindScan_1()
+    {
+        TupleIndexRecord index = create("SPO") ;
+        add(index, n1, n2, n3) ;
+        Tuple<NodeId> tuple2 = tuple(n1, null, n3) ;
+        Iterator<Tuple<NodeId>> iter = index.findByIndex(tuple2) ;
+        assertNull(iter) ;
+        iter = index.findOrPartialScan(tuple2) ;
+        assertTrue(iter.hasNext()) ;
+        iter.next();
+        assertFalse(iter.hasNext()) ;
+    }
+    
+    @Test public void TupleIndexRecordFindScan_2()
+    {
+        TupleIndexRecord index = create("SPO") ;
+        add(index, n1, n2, n3) ;
+        add(index, n1, n2, n4) ;
+        
+        
+        Tuple<NodeId> tuple2 = tuple(null, null, n3) ;
+        Iterator<Tuple<NodeId>> iter = index.findByIndex(tuple2) ;
+        assertNull(iter) ;
+        
+        iter = index.findOrPartialScan(tuple2) ;
+        assertNull(iter) ;
+        
+        iter = index.findOrScan(tuple2) ;
+        assertTrue(iter.hasNext()) ;
+        iter.next();
+        assertFalse(iter.hasNext()) ;
+    }
+    
+    @Test public void TupleIndexRecordFindNot_1()
+    {
+        TupleIndexRecord index = create("SPO") ;
+        add(index, n1, n2, n3) ;
+        
+        Tuple<NodeId> tuple2 = tuple(n4, n5, n6) ;
+        Iterator<Tuple<NodeId>> iter = index.findByIndex(tuple2) ;
+        assertNotNull(iter) ;
+        assertFalse(iter.hasNext()) ;
+   }
+    
+    @Test public void TupleIndexRecordFindNot_2()
+    {
+        TupleIndexRecord index = create("SPO") ;
+        add(index, n1, n2, n3) ;
+        
+        Tuple<NodeId> tuple2 = tuple(n1, n5, n6) ;
+        Iterator<Tuple<NodeId>> iter = index.findByIndex(tuple2) ;
+        assertFalse(iter.hasNext()) ;
+   }
+
+    @Test public void TupleIndexRecordFindNot_3()
+    {
+        TupleIndexRecord index = create("SPO") ;
+        add(index, n1, n2, n3) ;
+        
+        Tuple<NodeId> tuple2 = tuple(n1, null, n6) ;
+        Iterator<Tuple<NodeId>> iter = index.findOrPartialScan(tuple2) ;
+        assertFalse(iter.hasNext()) ;
+   }
+
+    @Test public void TupleIndexRecordFindNot_4()
+    {
+        TupleIndexRecord index = create("SPO") ;
+        add(index, n1, n2, n3) ;
+        add(index, n1, n5, n6) ;
+        
+        Tuple<NodeId> tuple2 = tuple(n4, n5, n6) ;
+        Iterator<Tuple<NodeId>> iter = index.findByIndex(tuple2) ;
+        assertFalse(iter.hasNext()) ;
+   }
+    
+    @Test public void TupleIndexRecordFindNot_5()
+    {
+        TupleIndexRecord index = create("SPO") ;
+        add(index, n1, n2, n3) ;
+        add(index, n1, n5, n6) ;
+        
+        Tuple<NodeId> tuple2 = tuple(n2, n5, n6) ;
+        Iterator<Tuple<NodeId>> iter = index.findByIndex(tuple2) ;
+        assertFalse(iter.hasNext()) ;
+   }
+
+    @Test public void TupleIndexRecordFindNot_6()
+    {
+        TupleIndexRecord index = create("SPO") ;
+        add(index, n1, n2, n3) ;
+        add(index, n4, n5, n6) ;
+        
+        Tuple<NodeId> tuple2 = tuple(n1, null, n6) ;
+        Iterator<Tuple<NodeId>> iter = index.findOrPartialScan(tuple2) ;
+        assertFalse(iter.hasNext()) ;
+   }
+
+    
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/3d456654/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/tupletable/TestTupleTable.java
----------------------------------------------------------------------
diff --git a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/tupletable/TestTupleTable.java b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/tupletable/TestTupleTable.java
new file mode 100644
index 0000000..6a6e336
--- /dev/null
+++ b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/tupletable/TestTupleTable.java
@@ -0,0 +1,154 @@
+/*
+ * 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.tdb2.store.tupletable;
+
+import static org.apache.jena.atlas.lib.tuple.TupleFactory.tuple ;
+import static org.apache.jena.tdb2.store.tupletable.NData.*;
+
+import java.util.Iterator ;
+import java.util.List ;
+
+import org.apache.jena.atlas.iterator.Iter ;
+import static org.junit.Assert.*;
+import org.apache.jena.atlas.lib.tuple.Tuple ;
+import org.apache.jena.dboe.base.record.RecordFactory;
+import org.apache.jena.tdb2.store.NodeId;
+import org.apache.jena.tdb2.store.tupletable.TupleIndex;
+import org.apache.jena.tdb2.store.tupletable.TupleTable;
+import org.apache.jena.tdb2.sys.SystemTDB;
+import org.junit.Test ;
+
+public class TestTupleTable
+{
+    static RecordFactory factory = new RecordFactory(3*SystemTDB.SizeOfNodeId, 0) ;
+    
+    static private TupleTable create()
+    {
+        TupleIndex idxSPO = TestTupleIndexRecordDirect.create("SPO") ;
+        TupleIndex idxPOS = TestTupleIndexRecordDirect.create("POS") ;
+        TupleIndex idxOSP = TestTupleIndexRecordDirect.create("OSP") ;
+        TupleIndex x[] = { idxSPO, idxPOS, idxOSP } ;
+        TupleTable table = new TupleTable(3, x) ;
+        return table ;
+    }
+    
+    static private TupleTable create2()
+    {
+        TupleIndex idxSPO = TestTupleIndexRecordDirect.create("SPO") ;
+        TupleIndex x[] = { idxSPO } ;
+        TupleTable table = new TupleTable(3, x) ;
+        return table ;
+    }
+    
+    static void add(TupleTable table, NodeId x1, NodeId x2, NodeId x3)
+    {
+        Tuple<NodeId> tuple = tuple(x1, x2, x3) ;
+        table.add(tuple) ;
+    }
+    
+    @Test public void create1() { create() ; } 
+    
+    @Test public void createFind1()
+    { 
+        TupleTable table = create() ;
+        add(table, n1, n2, n3) ;
+        // Cast removes compile lint warning.
+        Tuple<NodeId> pat = tuple((NodeId)null, null, null) ;
+        Iterator<Tuple<NodeId>> iter = table.find(pat) ;
+        List<Tuple<NodeId>> x = Iter.toList(iter) ;
+        int z = x.size() ;
+        assertEquals(1, z) ;
+        Tuple<NodeId> e1 = x.get(0) ;
+        assertEquals(tuple(n1, n2, n3) , e1) ;
+    }
+    
+    @Test public void createFind2()
+    { 
+        TupleTable table = create() ;
+        add(table, n1, n2, n3) ;
+        add(table, n1, n2, n4) ;
+
+        Tuple<NodeId> pat = tuple(null, n2, null) ;
+        Iterator<Tuple<NodeId>> iter = table.find(pat) ;
+        assertNotNull(iter) ;
+        List<Tuple<NodeId>> x = Iter.toList(iter) ;
+        int z = x.size() ;
+        assertEquals(2, z) ;
+        
+        Tuple<NodeId> e1 = x.get(0) ;
+        Tuple<NodeId> e2 = x.get(1) ;
+        assertEquals(tuple(n1, n2, n3) , e1) ;
+        assertEquals(tuple(n1, n2, n4) , e2) ;
+    }
+    
+    @Test public void createFind3()
+    { 
+        // test scan
+        TupleTable table = create2() ;
+        add(table, n1, n2, n3) ;
+        add(table, n1, n2, n4) ;
+
+        Tuple<NodeId> pat = tuple(n1, null, n3) ;
+        Iterator<Tuple<NodeId>> iter = table.find(pat) ;
+        assertNotNull(iter) ;
+        List<Tuple<NodeId>> x = Iter.toList(iter) ;
+        int z = x.size() ;
+        assertEquals(1, z) ;
+        
+        Tuple<NodeId> e1 = x.get(0) ;
+        assertEquals(tuple(n1, n2, n3) , e1) ;
+    }
+    
+    @Test public void createFind4()
+    { 
+        // test scan
+        TupleTable table = create2() ;
+        add(table, n1, n2, n3) ;
+        add(table, n1, n2, n4) ;
+
+        Tuple<NodeId> pat = tuple(null, null, n3) ;
+        Iterator<Tuple<NodeId>> iter = table.find(pat) ;
+        assertNotNull(iter) ;
+        List<Tuple<NodeId>> x = Iter.toList(iter) ;
+        int z = x.size() ;
+        assertEquals(1, z) ;
+        
+        Tuple<NodeId> e1 = x.get(0) ;
+        assertEquals(tuple(n1, n2, n3) , e1) ;
+    }
+    
+    @Test public void createFind5()
+    { 
+        // test scan
+        TupleTable table = create2() ;
+        add(table, n1, n2, n3) ;
+        add(table, n1, n2, n4) ;
+
+        Tuple<NodeId> pat = tuple(null, NodeId.NodeIdAny, n3) ;
+        Iterator<Tuple<NodeId>> iter = table.find(pat) ;
+        assertNotNull(iter) ;
+        List<Tuple<NodeId>> x = Iter.toList(iter) ;
+        int z = x.size() ;
+        assertEquals(1, z) ;
+        
+        Tuple<NodeId> e1 = x.get(0) ;
+        assertEquals(tuple(n1, n2, n3) , e1) ;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/3d456654/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/value/TestDoubleNode62.java
----------------------------------------------------------------------
diff --git a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/value/TestDoubleNode62.java b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/value/TestDoubleNode62.java
new file mode 100644
index 0000000..a2a6b0e
--- /dev/null
+++ b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/value/TestDoubleNode62.java
@@ -0,0 +1,123 @@
+/*
+ * 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.tdb2.store.value;
+
+import org.apache.jena.atlas.lib.BitsLong;
+import org.apache.jena.tdb2.store.value.DoubleNode62;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+public class TestDoubleNode62 {
+    @Test public void double_01() { testRoundTripDouble(1d); }
+    @Test public void double_02() { testRoundTripDouble(-1d); }
+    @Test public void double_03() { testRoundTripDouble(-1111111111e50d); }
+    @Test public void double_04() { testRoundTripDouble(1111111111e50d); }
+
+    @Test public void double_05() { testNoEncoding(1e300); }
+    @Test public void double_06() { testNoEncoding(1e100); }
+    @Test public void double_07() { testNoEncoding(1e78); }
+    @Test public void double_08() { testNoEncoding(2e77); }
+    @Test public void double_09() { testRoundTripDouble(1e77); }
+    
+    @Test public void double_10() { testNoEncoding(3e-300); }
+    @Test public void double_11() { testNoEncoding(3e-100); }
+    @Test public void double_12() { testNoEncoding(3e-77); }
+    @Test public void double_13() { testRoundTripDouble(3.5e-77); }
+    @Test public void double_14() { testRoundTripDouble(4e-77); }
+    @Test public void double_15() { testRoundTripDouble(1e-76); }
+    @Test public void double_16() { testRoundTripDouble(1e-75); }
+    
+    @Test public void double_20() { testRoundTripDouble(Double.POSITIVE_INFINITY); }
+    @Test public void double_21() { testRoundTripDouble(Double.NEGATIVE_INFINITY); }
+    @Test public void double_22() { testRoundTripDouble(Double.NaN); }
+    @Test public void double_23() { testNoEncoding(Double.MAX_VALUE); }
+    @Test public void double_24() { testNoEncoding(Double.MIN_NORMAL); }
+    @Test public void double_25() { testNoEncoding(Double.MIN_VALUE); }
+
+    @Test public void double_30() { testRoundTripDouble(DoubleNode62.POSITIVE_INFINITY); }
+    @Test public void double_31() { testRoundTripDouble(DoubleNode62.NEGATIVE_INFINITY); }
+    @Test public void double_32() { testRoundTripDouble(DoubleNode62.NaN); }
+    @Test public void double_33() { testNoEncoding(DoubleNode62.MAX_VALUE); }
+    @Test public void double_34() { testNoEncoding(DoubleNode62.MIN_NORMAL); }
+    @Test public void double_35() { testNoEncoding(DoubleNode62.MIN_VALUE); }
+
+    @Test public void double_40() { sameValue(DoubleNode62.POSITIVE_INFINITY, Double.POSITIVE_INFINITY); }
+    @Test public void double_41() { sameValue(DoubleNode62.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY); }
+    @Test public void double_42() { sameValue(DoubleNode62.NaN, Double.NaN); }
+
+    @Test public void double_50() { testConst(DoubleNode62.POSITIVE_INFINITY_BITS, 0x1ff0000000000000L); }
+    @Test public void double_51() { testConst(DoubleNode62.NEGATIVE_INFINITY_BITS, 0x3ff0000000000000L); }
+    @Test public void double_52() { testConst(DoubleNode62.NaN_BITS, 0x1ff8000000000000L); }
+    @Test public void double_53() { testConst(DoubleNode62.MAX_VALUE_BITS,  0x3fefffffffffffffL); }
+    @Test public void double_54() { testConst(DoubleNode62.MIN_NORMAL_BITS, 0x0010000000000000L); }
+    @Test public void double_55() { testConst(DoubleNode62.MIN_VALUE_BITS,  0x01L); }
+    
+    private void sameValue(double d1, double d2) {
+        // Not d1 == d2 - NaN != NaN 
+        assertEquals(Double.valueOf(d1), Double.valueOf(d2));  
+    }
+    
+    private static void testConst(long x, long expected) {
+        //print(expected);
+        //print(x);
+        assertEquals(expected, x);
+        double d = DoubleNode62.unpack(x);
+        long z = DoubleNode62.pack(d);
+        assertEquals(expected, z);
+    }
+    
+    private void testNoEncoding(double d) {
+        testRoundTripDouble(d, false); 
+    }
+
+    private static void testRoundTripDouble(double d) {
+        testRoundTripDouble(d, true); 
+    }
+    
+    private static void testRoundTripDouble(double d, boolean valid) {
+        //System.out.printf("Double: %.2e\n", d);
+        long x0 = Double.doubleToRawLongBits(d);
+        //print(x0);
+        long x = DoubleNode62.pack(d);
+        //print(x);
+        if ( x == DoubleNode62.NO_ENCODING ) {
+            if ( valid )
+                fail("Expect no encoding");
+            
+            //System.out.println("No encoding");
+            //System.out.println();
+            return;
+        }
+        
+        double d2 = DoubleNode62.unpack(x);
+        
+        Double double1 = d ;
+        Double double2 = d2 ;
+        assertEquals(double1, double2);
+    }
+
+    private static void print(long x) {
+        long z[] = new long[4];
+        for ( int i = 0 ; i < 4 ; i++ ) {
+             z[3-i] = BitsLong.unpack(x, i*16, (i+1)*16) ;
+        }
+        System.out.printf("0x%04X %04X %04X %04X\n", z[0], z[1], z[2], z[3]);
+    }
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/3d456654/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/value/TestNodeIdInline.java
----------------------------------------------------------------------
diff --git a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/value/TestNodeIdInline.java b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/value/TestNodeIdInline.java
new file mode 100644
index 0000000..480e5ff
--- /dev/null
+++ b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/value/TestNodeIdInline.java
@@ -0,0 +1,286 @@
+/*
+ * 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.tdb2.store.value;
+
+import static org.junit.Assert.*;
+import org.apache.jena.datatypes.xsd.XSDDatatype;
+import org.apache.jena.graph.Node;
+import org.apache.jena.graph.NodeFactory;
+import org.apache.jena.sparql.expr.NodeValue;
+import org.apache.jena.sparql.util.NodeFactoryExtra;
+import org.apache.jena.tdb2.store.NodeId;
+import org.junit.Test;
+
+public class TestNodeIdInline
+{
+    @Test public void nodeId_int_01()
+    { test("'1'^^xsd:integer") ; }
+
+    @Test public void nodeId_int_02()
+    { test("2") ; }
+
+    @Test public void nodeId_int_03()
+    { test("'3'^^xsd:int") ; }
+
+    @Test public void nodeId_int_04()
+    { testNoInline("'3'") ; }
+
+    @Test public void nodeId_int_05()
+    { test("-1") ; }
+    
+    @Test public void nodeId_int_06()
+    { test("-180") ; }
+
+    @Test public void nodeId_int_07()
+    { test("01",  "1") ; }
+    
+    @Test public void nodeId_int_08()
+    { test("+01",  "1") ; }
+    
+    @Test public void nodeId_int_09()
+    // More than Long.MAX_VALUE
+    { testNoInline("92233720368547758070") ; }
+
+    // On the edge.
+    
+    static final long X = 1L<<55 ;        // Just too large 
+    static final long Y = -((1L<<55) +1) ;   // Just too small 
+    
+    @Test public void nodeId_int_10()
+    { testNoInline("\""+Long.toString(X)+"\"^^xsd:integer") ; }
+
+    @Test public void nodeId_int_11()
+    { 
+        Node n = NodeValue.makeInteger(X-1).asNode() ;
+        test("\""+Long.toString(X-1)+"\"^^xsd:integer",  n) ; 
+    }
+
+    @Test public void nodeId_int_12()
+    { testNoInline("\""+Long.toString(Y)+"\"^^xsd:integer") ; }
+
+    @Test public void nodeId_int_13()
+    { 
+        Node n = NodeValue.makeInteger(Y+1).asNode() ;
+        test("\""+Long.toString(Y+1)+"\"^^xsd:integer",  n) ; 
+    }
+
+    @Test public void nodeId_int_20()
+    { test("'30'^^xsd:positiveInteger") ; }
+    
+    @Test public void nodeId_int_21()
+    { testNoInline("'300'^^xsd:byte") ; }
+
+    @Test public void nodeId_decimal_1()
+    { test("3.14", "3.14") ; }
+
+    @Test public void nodeId_decimal_2()
+    { testNoInline("123456789.123456789") ; }
+    
+    // Just this once, directly create the Node.
+    @Test public void nodeId_decimal_3()
+    { test("12.89", NodeFactory.createLiteral("12.89", XSDDatatype.XSDdecimal)) ; }
+
+    @Test public void nodeId_decimal_4()
+    { test("-1.0",  "-1.0") ; }
+    
+    // This number has > 47 bits of value : 2412.80478192688
+    @Test public void nodeId_decimal_5()
+    { testNoInline("2412.80478192688") ; }
+    
+    // This number has > 47 bits of value : -2412.80478192688
+    @Test public void nodeId_decimal_6()
+    { testNoInline("-2412.80478192688") ; }
+
+    @Test public void nodeId_decimal_7()
+    { test("'0.00000001'^^xsd:decimal",  
+           NodeFactory.createLiteral("0.00000001", XSDDatatype.XSDdecimal)) ; 
+    }
+
+    @Test public void nodeId_decimal_8()
+    { test("0.00000001", NodeFactory.createLiteral("0.00000001", XSDDatatype.XSDdecimal)) ; }
+
+    @Test public void nodeId_dateTime_01()
+    { test("'2008-04-28T15:36:15+01:00'^^xsd:dateTime") ; }
+
+    @Test public void nodeId_dateTime_02()
+    { test("'2008-04-28T15:36:15Z'^^xsd:dateTime") ; }
+
+    @Test public void nodeId_dateTime_03()
+    { test("'2008-04-28T15:36:15+00:00'^^xsd:dateTime") ; }
+
+    @Test public void nodeId_dateTime_04()
+    { test("'2008-04-28T15:36:15-05:00'^^xsd:dateTime") ; }
+
+    // No timezone.
+    @Test public void nodeId_dateTime_05()
+    { test("'2008-04-28T15:36:15'^^xsd:dateTime") ; }
+
+    // Note the trailing zero - system does not preserve perfect lexical forms. 
+    @Test public void nodeId_dateTime_06()
+    { test("'2008-04-28T15:36:05.450'^^xsd:dateTime", "'2008-04-28T15:36:05.45'^^xsd:dateTime") ; }
+
+    // Old Java bug, now fixed: T24:00:00 not accepted by DatatypeFactory.newXMLGregorianCalendar(lex)
+    // Note the Jena value is an XSDDateTime so it retains the "24"/"00" next day distinction. 
+    @Test public void nodeId_dateTime_07()
+    { test("'2008-04-28T24:00:00'^^xsd:dateTime") ; }
+    
+    // Out of range.
+    @Test public void nodeId_dateTime_08()
+    { testNoInline("'8008-04-28T15:36:05.45'^^xsd:dateTime") ; }
+
+    @Test public void nodeId_dateTime_09()
+    { test("'2008-04-28T15:36:05.001'^^xsd:dateTime") ; }
+    
+    @Test public void nodeId_dateTime_10()
+    { test("'2008-04-28T15:36:05.01'^^xsd:dateTime") ; }
+
+    @Test public void nodeId_dateTime_11()
+    { test("'2008-04-28T15:36:05.1'^^xsd:dateTime") ; }
+
+    // Canonicalization test - fractional seconds.
+    @Test public void nodeId_dateTime_12()
+    { test("'2008-04-28T15:36:05.010'^^xsd:dateTime", "'2008-04-28T15:36:05.01'^^xsd:dateTime") ; }
+
+    @Test public void nodeId_dateTime_13()
+    { test("'2008-04-28T15:36:05.100'^^xsd:dateTime", "'2008-04-28T15:36:05.1'^^xsd:dateTime") ; }
+
+    @Test public void nodeId_dateTime_14()
+    { test("'2012-07-29T20:39:11.100+01:15'^^xsd:dateTime", "'2012-07-29T20:39:11.1+01:15'^^xsd:dateTime") ; }
+
+    @Test public void nodeId_dateTime_15()
+    { test("'2012-07-29T20:39:11.100-01:15'^^xsd:dateTime", "'2012-07-29T20:39:11.1-01:15'^^xsd:dateTime") ; }
+
+    @Test public void nodeId_dateTime_16()
+    { test("'2012-07-29T20:39:11.100+01:30'^^xsd:dateTime", "'2012-07-29T20:39:11.1+01:30'^^xsd:dateTime") ; }
+
+    @Test public void nodeId_dateTime_17()
+    { test("'2012-07-29T20:39:11.100-01:45'^^xsd:dateTime", "'2012-07-29T20:39:11.1-01:45'^^xsd:dateTime") ; }
+
+    @Test public void nodeId_dateTime_18()
+    { test("'2012-07-29T20:39:11.100Z'^^xsd:dateTime", "'2012-07-29T20:39:11.1Z'^^xsd:dateTime") ; }
+
+    @Test public void nodeId_dateTimeStamp_01()
+    { test("'2012-07-29T20:39:11.100Z'^^xsd:dateTimeStamp", "'2012-07-29T20:39:11.1Z'^^xsd:dateTimeStamp") ; }
+
+    
+    @Test public void nodeId_date_1()
+    { test("'2008-04-28Z'^^xsd:date", "'2008-04-28Z'^^xsd:date") ; }
+
+    @Test public void nodeId_date_2()
+    { test("'2008-04-28+00:00'^^xsd:date", "'2008-04-28+00:00'^^xsd:date") ; }
+
+    @Test public void nodeId_date_3()
+    { test("'2008-04-28-05:00'^^xsd:date", "'2008-04-28-05:00'^^xsd:date") ; }
+
+    @Test public void nodeId_date_4()
+    { test("'2008-04-28+02:00'^^xsd:date", "'2008-04-28+02:00'^^xsd:date") ; }
+
+    @Test public void nodeId_date_5()
+    { testNoInline("'8008-04-28'^^xsd:date") ; }
+
+    @Test public void nodeId_date_6()
+    { test("'2012-07-29+06:15'^^xsd:date", "'2012-07-29+06:15'^^xsd:date") ; }
+
+    @Test public void nodeId_date_7()
+    { test("'2012-07-29-06:30'^^xsd:date", "'2012-07-29-06:30'^^xsd:date") ; }
+
+    @Test public void nodeId_boolean_1()
+    { test("'true'^^xsd:boolean", "'true'^^xsd:boolean") ; }
+
+    @Test public void nodeId_boolean_2()
+    { test("'false'^^xsd:boolean", "'false'^^xsd:boolean") ; }
+
+    @Test public void nodeId_boolean_3()
+    { test("'1'^^xsd:boolean", "'true'^^xsd:boolean") ; }
+
+    @Test public void nodeId_boolean_4()
+    { test("'0'^^xsd:boolean", "'false'^^xsd:boolean") ; }
+
+    // Many tests in TestDoubleNode62
+    
+    @Test public void nodeId_double_1()
+    { test("1.0e0", NodeFactory.createLiteral("1.0e0", XSDDatatype.XSDdouble)) ; }
+
+    // Becomes the RDF/SPARQL preferred form - with expooent - for pretty printing.
+    @Test public void nodeId_double_2()
+    { test("'-0001.0'^^xsd:double", NodeFactory.createLiteral("-1.0e0", XSDDatatype.XSDdouble)) ; }
+
+    @Test public void nodeId_double_3()
+    { test("'NaN'^^xsd:double", NodeFactory.createLiteral("NaN", XSDDatatype.XSDdouble)) ; }
+
+    @Test public void nodeId_double_4()
+    { test("'INF'^^xsd:double", NodeFactory.createLiteral("INF", XSDDatatype.XSDdouble)) ; }
+
+    @Test public void nodeId_double_5()
+    { test("'-INF'^^xsd:double", NodeFactory.createLiteral("-INF", XSDDatatype.XSDdouble)) ; }
+
+    @Test public void nodeId_double_6()
+    { test("'1.1E9'^^xsd:double") ; }
+  
+    @Test public void nodeId_double_7()
+    { test("1.1E9") ; }
+    
+    @Test public void nodeId_double_8()
+    { testNoInline("1.1E80") ; }
+    
+    @Test public void nodeId_double_9()
+    { testNoInline("1.1E-80") ; }
+
+    @Test public void nodeId_float_1()
+    { test("'0.0'^^xsd:float") ; }
+
+    @Test public void nodeId_float_2()
+    { test("'0'^^xsd:float", "'0.0'^^xsd:float") ; }
+    
+    @Test public void nodeId_float_3()
+    { testNoInline("'x'^^xsd:float") ; }
+    
+    @Test public void nodeId_float_4()
+    { test("'1.1e1'^^xsd:float", "'11.0'^^xsd:float") ; }
+
+    @Test public void nodeId_float_5()
+    { test("'1.1E9'^^xsd:float") ; }
+
+    private void test(String x) { test(x, x) ; }
+    
+    private void test(String x, String expected) {
+        test(x, NodeFactoryExtra.parseNode(expected)) ;
+    }
+
+    private void testNoInline(String x) {
+        Node n = NodeFactoryExtra.parseNode(x) ;
+        NodeId nodeId = NodeId.inline(n) ;
+        assertNull("Converted NodeId but expected no inline form: "+x, nodeId) ;
+    }
+    
+    private void test(String x, Node correct) {
+        Node n = NodeFactoryExtra.parseNode(x) ;
+        NodeId nodeId = NodeId.inline(n) ;
+        assertNotNull("Expected inlining: "+x, nodeId);
+        
+        boolean b = NodeId.hasInlineDatatype(n) ;
+        assertTrue("Converted NodeId but datatype test was false", b) ;
+        Node n2 = NodeId.extract(nodeId) ;
+        assertNotNull("Expected recovery", n2) ;
+        String s = "("+correct.getLiteralLexicalForm()+","+n2.getLiteralLexicalForm()+")" ;
+        assertTrue("Not same value: "+s, correct.sameValueAs(n2)) ;
+        // Term equality.
+        assertEquals("Not same term", correct, n2) ;
+    }
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/3d456654/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/sys/TS_Sys.java
----------------------------------------------------------------------
diff --git a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/sys/TS_Sys.java b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/sys/TS_Sys.java
new file mode 100644
index 0000000..c2d8818
--- /dev/null
+++ b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/sys/TS_Sys.java
@@ -0,0 +1,34 @@
+/*
+ * 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.tdb2.sys;
+
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses( {
+    TestDatabaseOps.class
+    , TestDatabaseConnection.class
+    , TestSys.class
+    //, TestOps.class
+})
+
+public class TS_Sys
+{}

http://git-wip-us.apache.org/repos/asf/jena/blob/3d456654/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/sys/TestDatabaseConnection.java
----------------------------------------------------------------------
diff --git a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/sys/TestDatabaseConnection.java b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/sys/TestDatabaseConnection.java
new file mode 100644
index 0000000..00d2138
--- /dev/null
+++ b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/sys/TestDatabaseConnection.java
@@ -0,0 +1,70 @@
+/*
+ * 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.tdb2.sys;
+
+import static org.junit.Assert.assertNotSame ;
+import static org.junit.Assert.assertSame ;
+
+import org.apache.jena.atlas.lib.FileOps ;
+import org.apache.jena.dboe.base.file.Location;
+import org.apache.jena.sparql.core.DatasetGraph ;
+import org.apache.jena.tdb2.ConfigTest;
+import org.apache.jena.tdb2.sys.DatabaseConnection;
+import org.apache.jena.tdb2.sys.TDBInternal;
+import org.junit.Test ;
+
+public class TestDatabaseConnection {
+    
+    @Test
+    public void testStoreConnectionTxn1() {
+        TDBInternal.reset() ;
+        // Only do disk things for test that need them (disk takes time!).
+        String DIRx = ConfigTest.getCleanDir() ;
+        Location DIR = Location.create(DIRx);
+        FileOps.clearDirectory(DIRx) ;
+        try {
+            DatasetGraph dg1 = DatabaseConnection.connectCreate(DIR).getDatasetGraph() ;
+            DatasetGraph dg2 = DatabaseConnection.connectCreate(DIR).getDatasetGraph() ;
+            assertSame(dg1, dg2) ;
+        }
+        finally {
+            FileOps.clearDirectory(DIRx) ;
+        }
+    }
+    
+    @Test
+    public void testStoreConnectionTxn2() {
+        // Named memory locations
+        TDBInternal.reset() ;
+        DatasetGraph dg1 = DatabaseConnection.connectCreate(Location.mem("FOO")).getDatasetGraph() ;
+        DatasetGraph dg2 = DatabaseConnection.connectCreate(Location.mem("FOO")).getDatasetGraph() ;
+        assertSame(dg1, dg2) ;
+    }
+    
+    @Test
+    public void testStoreConnectionTxn3() {
+        // Un-named memory locations
+        TDBInternal.reset() ;
+        DatasetGraph dg1 = DatabaseConnection.connectCreate(Location.mem()).getDatasetGraph() ;
+        DatasetGraph dg2 = DatabaseConnection.connectCreate(Location.mem()).getDatasetGraph() ;
+        assertNotSame(dg1, dg2) ;
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/3d456654/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/sys/TestDatabaseOps.java
----------------------------------------------------------------------
diff --git a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/sys/TestDatabaseOps.java b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/sys/TestDatabaseOps.java
new file mode 100644
index 0000000..9956257
--- /dev/null
+++ b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/sys/TestDatabaseOps.java
@@ -0,0 +1,176 @@
+/*
+ * 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.tdb2.sys;
+
+import static org.junit.Assert.* ;
+import static org.junit.Assert.assertFalse ;
+import static org.junit.Assert.assertNotEquals ;
+import static org.junit.Assert.assertTrue ;
+
+import org.apache.commons.io.FileUtils ;
+import org.apache.jena.atlas.lib.FileOps ;
+import org.apache.jena.dboe.base.file.Location;
+import org.apache.jena.dboe.jenax.Txn;
+import org.apache.jena.graph.Graph ;
+import org.apache.jena.graph.Triple ;
+import org.apache.jena.riot.RDFDataMgr ;
+import org.apache.jena.sparql.core.DatasetGraph ;
+import org.apache.jena.sparql.core.Quad ;
+import org.apache.jena.sparql.sse.SSE ;
+import org.apache.jena.tdb2.ConfigTest;
+import org.apache.jena.tdb2.DatabaseMgr;
+import org.apache.jena.tdb2.store.DatasetGraphSwitchable;
+import org.apache.jena.tdb2.store.DatasetGraphTDB;
+import org.apache.jena.tdb2.sys.IOX;
+import org.apache.jena.tdb2.sys.StoreConnection;
+import org.apache.jena.tdb2.sys.TDBInternal;
+import org.junit.After ;
+import org.junit.Before ;
+import org.junit.Test ;
+
+public class TestDatabaseOps
+{
+    static String DIRx = ConfigTest.getCleanDir() ;
+    static Location DIR = Location.create(DIRx);
+    
+    static Quad quad1 = SSE.parseQuad("(_ <s> <p> 1)") ;
+    static Quad quad2 = SSE.parseQuad("(_ _:a <p> 2)") ;
+    static Triple triple1 = quad1.asTriple();
+    static Triple triple2 = quad2.asTriple();
+    static Triple triple3 = SSE.parseTriple("(<s> <q> 3)") ;
+    
+    @Before
+    public void before() {
+        FileUtils.deleteQuietly(IOX.asFile(DIR));
+        FileOps.ensureDir(DIR.getDirectoryPath());
+    }
+
+    @After  
+    public void after() {
+        TDBInternal.reset();
+        FileUtils.deleteQuietly(IOX.asFile(DIR));
+    }
+
+    @Test public void compact_dsg_1() {
+        DatasetGraph dsg = DatabaseMgr.connectDatasetGraph(DIR);
+        DatasetGraphSwitchable dsgs = (DatasetGraphSwitchable)dsg;
+        DatasetGraph dsg1 = dsgs.get();
+        Location loc1 = ((DatasetGraphTDB)dsg1).getLocation();
+        
+        Txn.executeWrite(dsg, ()-> {
+            dsg.add(quad2) ;
+            dsg.add(quad1) ;
+        }) ;
+        DatabaseMgr.compact(dsg);
+        
+        assertFalse(StoreConnection.isSetup(loc1));
+
+        DatasetGraph dsg2 = dsgs.get();
+        Location loc2 = ((DatasetGraphTDB)dsg2).getLocation();
+
+        assertNotEquals(dsg1, dsg2);
+        assertNotEquals(loc1, loc2);
+
+        Txn.executeRead(dsg, ()-> {
+            assertTrue(dsg.contains(quad2)) ;
+            assertTrue(dsg.contains(quad1)) ;
+        }) ;
+        
+        // dsg1 was closed and expelled. We must carefully reopen its storage only.
+        DatasetGraph dsgOld = StoreConnection.connectCreate(loc1).getDatasetGraph();
+        
+        Txn.executeWrite(dsgOld, ()->dsgOld.delete(quad2));
+        Txn.executeRead(dsg,     ()->assertTrue(dsg.contains(quad2)) );
+        Txn.executeRead(dsg2,    ()->assertTrue(dsg2.contains(quad2)) ) ;
+    }
+
+    @Test public void compact_graph_2() {
+        // graphs across compaction.
+        DatasetGraph dsg = DatabaseMgr.connectDatasetGraph(DIR);
+        Graph g = dsg.getDefaultGraph();
+        
+        DatasetGraphSwitchable dsgs = (DatasetGraphSwitchable)dsg;
+        DatasetGraph dsg1 = dsgs.get();
+        Location loc1 = ((DatasetGraphTDB)dsg1).getLocation();
+        
+        Txn.executeWrite(dsg, ()-> {
+            dsg.add(quad2) ;
+            dsg.add(quad1) ;
+        }) ;
+        DatabaseMgr.compact(dsg);
+        Txn.executeRead(dsg, ()-> {
+            assertEquals(2, g.size());
+            assertTrue(g.contains(triple2));
+        }) ;
+        
+        // Check is not attached to the old graph.
+        DatasetGraph dsgOld = StoreConnection.connectCreate(loc1).getDatasetGraph();
+
+        Txn.executeWrite(dsgOld, ()->dsgOld.getDefaultGraph().delete(triple2));
+        Txn.executeRead(dsg,     ()->assertTrue(g.contains(triple2)) );
+        
+        Txn.executeWrite(dsg,    ()->g.add(triple3));
+        Txn.executeRead(dsgOld,  ()->assertFalse(dsgOld.getDefaultGraph().contains(triple3)) );
+    }
+    
+    @Test public void compact_prefixes_3() {
+        // prefixes axcross compaction.
+        DatasetGraph dsg = DatabaseMgr.connectDatasetGraph(DIR);
+        Graph g = dsg.getDefaultGraph();
+        Txn.executeWrite(dsg, ()-> g.getPrefixMapping().setNsPrefix("ex", "http://example/") );
+        
+        DatasetGraphSwitchable dsgs = (DatasetGraphSwitchable)dsg;
+        DatasetGraph dsg1 = dsgs.get();
+        Location loc1 = ((DatasetGraphTDB)dsg1).getLocation();
+        
+        DatabaseMgr.compact(dsg);
+
+        Txn.executeRead(dsg, ()-> {
+            assertEquals("ex", g.getPrefixMapping().getNsURIPrefix("http://example/"));
+            assertEquals("http://example/", g.getPrefixMapping().getNsPrefixURI("ex"));
+        }) ;
+        
+        // Check is not attached to the old graph.
+        DatasetGraph dsgOld = StoreConnection.connectCreate(loc1).getDatasetGraph();
+
+        Txn.executeWrite(dsgOld, ()->dsgOld.getDefaultGraph().getPrefixMapping().removeNsPrefix("ex"));
+        Txn.executeRead(dsg,     ()->assertEquals("http://example/", g.getPrefixMapping().getNsPrefixURI("ex")));
+        
+        Txn.executeWrite(dsg,    ()->g.getPrefixMapping().setNsPrefix("ex2", "http://exampl2/") );
+        Txn.executeRead(dsgOld,  ()->assertNull(dsgOld.getDefaultGraph().getPrefixMapping().getNsPrefixURI("ex")));
+    }
+
+    @Test public void backup_1() {
+        DatasetGraph dsg = DatabaseMgr.connectDatasetGraph(DIR);
+        Txn.executeWrite(dsg, ()-> {
+            dsg.add(quad2) ;
+            dsg.add(quad1) ;
+        }) ;
+        String file1 = DatabaseMgr.backup(dsg);
+        DatasetGraph dsg2 = RDFDataMgr.loadDatasetGraph(file1);
+        Txn.executeRead(dsg, ()-> {
+            assertTrue(dsg.contains(quad1)) ;
+            assertEquals(2, dsg.getDefaultGraph().size());
+            assertTrue(dsg2.getDefaultGraph().isIsomorphicWith(dsg.getDefaultGraph()));
+        }) ;
+        String file2 = DatabaseMgr.backup(dsg);
+        assertNotEquals(file1, file2);
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/3d456654/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/sys/TestOps.java
----------------------------------------------------------------------
diff --git a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/sys/TestOps.java b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/sys/TestOps.java
new file mode 100644
index 0000000..68777b0
--- /dev/null
+++ b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/sys/TestOps.java
@@ -0,0 +1,32 @@
+/*
+ * 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.tdb2.sys;
+
+import org.apache.jena.dboe.base.block.FileMode;
+import org.apache.jena.tdb2.sys.SystemTDB;
+
+public class TestOps
+{
+    public static void setFileMode(FileMode mode)
+    {
+        SystemTDB.internalSetFileMode(mode) ;
+    }
+    
+}
+

http://git-wip-us.apache.org/repos/asf/jena/blob/3d456654/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/sys/TestSys.java
----------------------------------------------------------------------
diff --git a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/sys/TestSys.java b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/sys/TestSys.java
new file mode 100644
index 0000000..f3b4de8
--- /dev/null
+++ b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/sys/TestSys.java
@@ -0,0 +1,34 @@
+/*
+ * 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.tdb2.sys;
+
+
+import static org.junit.Assert.*;
+
+import org.apache.jena.tdb2.TDB2;
+import org.junit.Test ;
+
+public class TestSys
+{
+    @Test public void sys1()
+    {
+        assertNotNull(TDB2.VERSION) ;
+        assertNotNull(TDB2.BUILD_DATE) ;
+    }
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/3d456654/jena-db/jena-tdb2/src/test/java/org/seaborne/tdb2/ConfigTest.java
----------------------------------------------------------------------
diff --git a/jena-db/jena-tdb2/src/test/java/org/seaborne/tdb2/ConfigTest.java b/jena-db/jena-tdb2/src/test/java/org/seaborne/tdb2/ConfigTest.java
deleted file mode 100644
index b65282d..0000000
--- a/jena-db/jena-tdb2/src/test/java/org/seaborne/tdb2/ConfigTest.java
+++ /dev/null
@@ -1,96 +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.seaborne.tdb2;
-
-import org.apache.jena.atlas.lib.FileOps ;
-import org.seaborne.tdb2.sys.SystemTDB ;
-
-public class ConfigTest
-{
-    private static String testingDataRoot = "testing" ;
-    // Place under target
-    private static final String testingDir = "target/tdb-testing" ;
-    private static final String testingDirDB = "target/tdb-testing/DB" ;
-    static boolean nonDeleteableMMapFiles = SystemTDB.isWindows ;
-    
-    static boolean initialized = false ; 
-    
-    private static void init()
-    {
-        FileOps.ensureDir("target") ;
-        FileOps.ensureDir(testingDir) ;
-        FileOps.ensureDir(testingDirDB) ;
-        initialized = true ;
-    }
-    
-    private static int count = 0 ;
-
-    public static void setTestingDataRoot(String dir) { testingDataRoot = dir ; }
-    public static String getTestingDataRoot() { return testingDataRoot ; }
-    
-    /** return a directory */ 
-    public static final String getCleanDir() {
-        init() ;
-        String dir = nonDeleteableMMapFiles ? getTestingDirUnique() : getTestingDirDB() ;
-        FileOps.ensureDir(dir); 
-        FileOps.clearDirectory(dir) ;
-        return dir ;
-    }
-    /** Get a empty directory name that has not been used before in this JVM */
-    
-    private static final String getTestingDirUnique()
-    {
-        init() ;
-    	String dn = testingDir+"/D-"+(++count) ;
-    	FileOps.ensureDir(dn) ;
-    	FileOps.clearDirectory(dn) ;
-    	return dn ; 
-    }
-    
-    public static final String getTestingDir()
-    {
-        init() ;
-        return testingDir ;
-    }
-    
-    public static final void deleteTestingDir()
-    {
-        if ( ! FileOps.exists(testingDir) )
-            return ;
-        deleteTestingDirDB() ;
-        FileOps.clearDirectory(testingDir) ;
-        FileOps.deleteSilent(testingDir) ;
-    }
-
-    public static final String getTestingDirDB()
-    {
-        init() ;
-        FileOps.ensureDir(testingDirDB) ;
-        return testingDirDB ;
-    }
-    
-    public static final void deleteTestingDirDB()
-    {
-        if ( ! FileOps.exists(testingDirDB) )
-            return ;
-        FileOps.clearDirectory(testingDirDB) ;
-        FileOps.deleteSilent(testingDirDB) ;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/3d456654/jena-db/jena-tdb2/src/test/java/org/seaborne/tdb2/TC_TDB.java
----------------------------------------------------------------------
diff --git a/jena-db/jena-tdb2/src/test/java/org/seaborne/tdb2/TC_TDB.java b/jena-db/jena-tdb2/src/test/java/org/seaborne/tdb2/TC_TDB.java
deleted file mode 100644
index aac7ce0..0000000
--- a/jena-db/jena-tdb2/src/test/java/org/seaborne/tdb2/TC_TDB.java
+++ /dev/null
@@ -1,81 +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.seaborne.tdb2;
-
-import org.apache.jena.sparql.engine.optimizer.reorder.ReorderLib ;
-import org.apache.jena.sparql.engine.optimizer.reorder.ReorderTransformation ;
-import org.apache.log4j.Level ;
-import org.apache.log4j.Logger ;
-import org.junit.AfterClass ;
-import org.junit.BeforeClass ;
-import org.junit.runner.RunWith ;
-import org.junit.runners.Suite ;
-import org.seaborne.dboe.base.block.FileMode ;
-import org.seaborne.tdb2.assembler.TS_TDBAssembler ;
-import org.seaborne.tdb2.graph.TS_Graph ;
-import org.seaborne.tdb2.lib.TS_LibTDB ;
-import org.seaborne.tdb2.setup.TS_TDBSetup ;
-import org.seaborne.tdb2.solver.TS_SolverTDB ;
-import org.seaborne.tdb2.store.TS_Store ;
-import org.seaborne.tdb2.store.nodetable.TS_NodeTable ;
-import org.seaborne.tdb2.store.tupletable.TS_TupleTable ;
-import org.seaborne.tdb2.sys.SystemTDB ;
-import org.seaborne.tdb2.sys.TS_Sys ;
-
-// Naming conventions.
-// TS_* - Test sets: collections of testing files (Often Test*)
-// TC_*  - Test collection: sets of TS's and TC's.
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses( {
-    // TDB
-    TS_LibTDB.class
-    , TS_NodeTable.class
-    , TS_TupleTable.class
-    , TS_TDBSetup.class
-    , TS_Store.class
-    , TS_SolverTDB.class
-    , TS_Graph.class
-    , TS_Factory.class
-    , TS_TDBAssembler.class
-    , TS_Sys.class
-} )
-
-public class TC_TDB
-{
-    static {
-        if ( false )
-            SystemTDB.setFileMode(FileMode.direct) ;
-    }
-    static ReorderTransformation dftReorder = null ; 
-        
-    @BeforeClass static public void beforeClass()   
-    {
-        //org.apache.log4j.LogManager.resetConfiguration() ;
-        //org.apache.log4j.PropertyConfigurator.configure("log4j.properties") ;
-        Logger.getLogger("org.apache.jena.tdb.info").setLevel(Level.WARN) ;
-        //Logger.getLogger("org.apache.jena.tdb.exec").setLevel(Level.WARN) ;
-        dftReorder = SystemTDB.defaultReorderTransform ;
-        SystemTDB.defaultReorderTransform = ReorderLib.identity() ;
-    }
-    
-    @AfterClass static public void afterClass() {
-        SystemTDB.defaultReorderTransform = dftReorder ;
-    }
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/3d456654/jena-db/jena-tdb2/src/test/java/org/seaborne/tdb2/TS_Factory.java
----------------------------------------------------------------------
diff --git a/jena-db/jena-tdb2/src/test/java/org/seaborne/tdb2/TS_Factory.java b/jena-db/jena-tdb2/src/test/java/org/seaborne/tdb2/TS_Factory.java
deleted file mode 100644
index cd0f6ee..0000000
--- a/jena-db/jena-tdb2/src/test/java/org/seaborne/tdb2/TS_Factory.java
+++ /dev/null
@@ -1,33 +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.seaborne.tdb2;
-
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses( {
-    TestDatabaseMgr.class
-    , TestTDBFactory.class
-
-})
-
-public class TS_Factory
-{}


Mime
View raw message