Package org.apache.marmotta.kiwi.persistence

Examples of org.apache.marmotta.kiwi.persistence.KiWiConnection.commit()


            Assert.assertEquals(ns1, connection.loadNamespaceByUri("http://localhost/ns1/"));
            Assert.assertEquals(ns2, connection.loadNamespaceByPrefix("ns2"));
            Assert.assertEquals(ns2, connection.loadNamespaceByUri("http://localhost/ns2/"));
            Assert.assertThat(Iterations.asList(connection.listNamespaces()),hasItems(ns1,ns2));

            connection.commit();

            // check after transaction commit
            Assert.assertEquals(ns1, connection.loadNamespaceByPrefix("ns1"));
            Assert.assertEquals(ns1, connection.loadNamespaceByUri("http://localhost/ns1/"));
            Assert.assertEquals(ns2, connection.loadNamespaceByPrefix("ns2"));
View Full Code Here


        KiWiConnection connection = persistence.getConnection();
        try {
            Assert.assertThat(connection.getDatabaseTables(),hasItems("nodes","triples","namespaces"));
            Assert.assertEquals(3, connection.getDatabaseVersion());

            connection.commit();
        } finally {
            connection.close();
        }

    }
View Full Code Here

            // needs to be equal, and should also be the identical object!
            Assert.assertEquals(uri,testUri1);
            Assert.assertEquals(uri.getId(), testUri1.getId());

            connection.commit();

            KiWiNode testUri2 = connection.loadNodeById(uri.getId());

            // needs to be equal, and should also be the identical object!
            Assert.assertEquals(uri,testUri2);
View Full Code Here

            // needs to be equal, and should also be the identical object!
            Assert.assertEquals(uri,testUri3);
            Assert.assertEquals(uri.getId(), testUri3.getId());


            connection.commit();

            Assert.assertEquals(1,Iterations.asList(connection.listResources()).size());


            // clear cache and test again
View Full Code Here

            // needs to be equal, but now it should not be the same object!
            Assert.assertEquals(uri,testUri5);
            Assert.assertEquals(uri.getId(), testUri5.getId());

            connection.commit();

            // finally do a test on the nodes table, it should contain exactly one entry
            PreparedStatement checkNodeStmt = connection.getJDBCConnection().prepareStatement("SELECT * FROM nodes");
            ResultSet result = checkNodeStmt.executeQuery();

View Full Code Here

            Assert.assertEquals(uri.getId(), result.getLong("id"));
            Assert.assertEquals(uri.stringValue(),result.getString("svalue"));
            Assert.assertEquals("uri",result.getString("ntype"));

            result.close();
            connection.commit();
        } finally {
            connection.close();
        }

    }
View Full Code Here

            // needs to be equal, and should also be the identical object!
            Assert.assertEquals(bnode,testBNode1);
            Assert.assertEquals(bnode.getId(), testBNode1.getId());

            connection.commit();

            KiWiNode testBNode2 = connection.loadNodeById(bnode.getId());

            // needs to be equal, and should also be the identical object!
            Assert.assertEquals(bnode,testBNode2);
View Full Code Here

            // needs to be equal, and should also be the identical object!
            Assert.assertEquals(bnode,testBNode3);
            Assert.assertEquals(bnode.getId(), testBNode3.getId());


            connection.commit();

            Assert.assertEquals(1,Iterations.asList(connection.listResources()).size());

            // clear cache and test again
            persistence.clearCache();
View Full Code Here

            // needs to be equal, but now it should not be the same object!
            Assert.assertEquals(bnode,testBNode5);
            Assert.assertEquals(bnode.getId(), testBNode5.getId());

            connection.commit();

            // finally do a test on the nodes table, it should contain exactly one entry
            PreparedStatement checkNodeStmt = connection.getJDBCConnection().prepareStatement("SELECT * FROM nodes");
            ResultSet result = checkNodeStmt.executeQuery();

View Full Code Here

            Assert.assertEquals((long)bnode.getId(),result.getLong("id"));
            Assert.assertEquals(bnode.stringValue(),result.getString("svalue"));
            Assert.assertEquals("bnode",result.getString("ntype"));

            result.close();
            connection.commit();
        } finally {
            connection.close();
        }

    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.