/** * Test helps PUTs some data, verifies that it is visible, DELETEs the data, * and then verifies that it is gone. * * @param format * The interchange format. */ protected void doDeleteWithPostTest(final RDFFormat format) throws Exception { doInsertWithBodyTest("POST", 23, /*requestPath,*/ format); assertEquals(23, countAll()); doDeleteWithBody(/*requestPath,*/ 23, format); // No solutions (assuming a told triple kb or quads kb w/o axioms). assertEquals(0, countAll()); }
protected void doDeleteWithBody( /* final String servlet, */final int ntriples, final RDFFormat format) throws Exception { final byte[] data = genNTRIPLES(ntriples, format); final RemoveOp remove = new RemoveOp(data, format); assertEquals(ntriples, m_repo.remove(remove)); }
/** * Test of POST w/ BODY having data to be loaded. */ protected void doInsertWithBodyTest(final String method, final int ntriples, /*final String servlet,*/ final RDFFormat format) throws Exception { final byte[] data = genNTRIPLES(ntriples, format); // final File file = File.createTempFile("bigdata-testnssclient", ".data"); /* * Only for testing. Clients should use AddOp(File, RDFFormat). */ final AddOp add = new AddOp(data, format); assertEquals(ntriples, m_repo.add(add)); // Verify the expected #of statements in the store. { final String queryStr = "select * where {?s ?p ?o}"; final IPreparedTupleQuery query = m_repo.prepareTupleQuery(queryStr); assertEquals(ntriples, countResults(query.evaluate())); } }
/** * Compare two graphs for equality. * <p> * Note: This is not very efficient if the {@link Graph} implementations are * not indexed. * <p> * Note: This does not handle equality testing with blank nodes (it does not * test for isomorphic graphs). * * @param expected * @param actual */ static protected void assertSameGraph(final Graph expected, final Graph actual) { for (Statement s : expected) { if (!actual.contains(s)) fail("Expecting: " + s); } assertEquals("size", expected.size(), actual.size()); }
/** * Test helps PUTs some data, verifies that it is visible, DELETEs the data, * and then verifies that it is gone. * * @param format * The interchange format. */ protected void doDeleteWithPostTest(final RDFFormat format) throws Exception { doInsertWithBodyTest("POST", 23, /*requestPath,*/ format); assertEquals(23, countAll()); doDeleteWithBody(/*requestPath,*/ 23, format); // No solutions (assuming a told triple kb or quads kb w/o axioms). assertEquals(0, countAll()); }
protected void doDeleteWithBody( /* final String servlet, */final int ntriples, final RDFFormat format) throws Exception { final byte[] data = genNTRIPLES(ntriples, format); final RemoveOp remove = new RemoveOp(data, format); assertEquals(ntriples, m_repo.remove(remove)); }
/** * Test of POST w/ BODY having data to be loaded. */ protected void doInsertWithBodyTest(final String method, final int ntriples, /*final String servlet,*/ final RDFFormat format) throws Exception { final byte[] data = genNTRIPLES(ntriples, format); // final File file = File.createTempFile("bigdata-testnssclient", ".data"); /* * Only for testing. Clients should use AddOp(File, RDFFormat). */ final AddOp add = new AddOp(data, format); assertEquals(ntriples, m_repo.add(add)); // Verify the expected #of statements in the store. { final String queryStr = "select * where {?s ?p ?o}"; final IPreparedTupleQuery query = m_repo.prepareTupleQuery(queryStr); assertEquals(ntriples, countResults(query.evaluate())); } }
/** * Compare two graphs for equality. * <p> * Note: This is not very efficient if the {@link Graph} implementations are * not indexed. * <p> * Note: This does not handle equality testing with blank nodes (it does not * test for isomorphic graphs). * * @param expected * @param actual */ static protected void assertSameGraph(final Graph expected, final Graph actual) { for (Statement s : expected) { if (!actual.contains(s)) fail("Expecting: " + s); } assertEquals("size", expected.size(), actual.size()); }