update to Sesame 2.7.12 test case for a specific Sesame bug (SES-2090)
Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/2b0b8469 Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/2b0b8469 Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/2b0b8469 Branch: refs/heads/ldp Commit: 2b0b84693de18f905f7082b39f457f29d3b775aa Parents: 94b5029 Author: Sebastian Schaffert <[email protected]> Authored: Mon Jul 7 16:56:00 2014 +0200 Committer: Sebastian Schaffert <[email protected]> Committed: Mon Jul 7 16:56:00 2014 +0200 ---------------------------------------------------------------------- .../kiwi/sparql/test/KiWiSparqlUpdateTest.java | 43 ++++++++++++++++++++ parent/pom.xml | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/marmotta/blob/2b0b8469/libraries/kiwi/kiwi-sparql/src/test/java/org/apache/marmotta/kiwi/sparql/test/KiWiSparqlUpdateTest.java ---------------------------------------------------------------------- diff --git a/libraries/kiwi/kiwi-sparql/src/test/java/org/apache/marmotta/kiwi/sparql/test/KiWiSparqlUpdateTest.java b/libraries/kiwi/kiwi-sparql/src/test/java/org/apache/marmotta/kiwi/sparql/test/KiWiSparqlUpdateTest.java index 4e3f20e..da7cd6b 100644 --- a/libraries/kiwi/kiwi-sparql/src/test/java/org/apache/marmotta/kiwi/sparql/test/KiWiSparqlUpdateTest.java +++ b/libraries/kiwi/kiwi-sparql/src/test/java/org/apache/marmotta/kiwi/sparql/test/KiWiSparqlUpdateTest.java @@ -21,11 +21,22 @@ import org.apache.marmotta.kiwi.config.KiWiConfiguration; import org.apache.marmotta.kiwi.sail.KiWiStore; import org.apache.marmotta.kiwi.sparql.sail.KiWiSparqlSail; import org.apache.marmotta.kiwi.test.junit.KiWiDatabaseRunner; +import org.junit.Test; import org.junit.runner.RunWith; +import org.openrdf.model.vocabulary.FOAF; +import org.openrdf.query.MalformedQueryException; +import org.openrdf.query.QueryLanguage; +import org.openrdf.query.Update; +import org.openrdf.query.UpdateExecutionException; +import org.openrdf.query.impl.DatasetImpl; import org.openrdf.query.parser.sparql.SPARQLUpdateTest; import org.openrdf.repository.Repository; +import org.openrdf.repository.RepositoryException; import org.openrdf.repository.sail.SailRepository; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + /** * Run the Sesame SPARQL Update Test Suite. @@ -48,4 +59,36 @@ public class KiWiSparqlUpdateTest extends SPARQLUpdateTest { return new SailRepository(ssail); } + + @Test + public void contextualInsertDeleteData() throws RepositoryException, MalformedQueryException, UpdateExecutionException { + + StringBuilder insert = new StringBuilder(); + insert.append(getNamespaceDeclarations()); + insert.append("INSERT DATA { ex:alice foaf:knows ex:bob. ex:alice foaf:mbox \"[email protected]\" .} "); + + DatasetImpl ds = new DatasetImpl(); + ds.setDefaultInsertGraph(graph2); + ds.addDefaultRemoveGraph(graph2); + + Update operation1 = con.prepareUpdate(QueryLanguage.SPARQL, insert.toString()); + operation1.setDataset(ds); + operation1.execute(); + + + StringBuilder update = new StringBuilder(); + update.append(getNamespaceDeclarations()); + update.append("DELETE DATA { ex:alice foaf:knows ex:bob. ex:alice foaf:mbox \"[email protected]\" .} "); + + Update operation2 = con.prepareUpdate(QueryLanguage.SPARQL, update.toString()); + operation2.setDataset(ds); + + assertTrue(con.hasStatement(alice, FOAF.KNOWS, bob, true, graph2)); + assertTrue(con.hasStatement(alice, FOAF.MBOX, f.createLiteral("[email protected]"), true, graph2)); + operation2.execute(); + + String msg = "statement should have been deleted."; + assertFalse(msg, con.hasStatement(alice, FOAF.KNOWS, bob, true, graph2)); + assertFalse(msg, con.hasStatement(alice, FOAF.MBOX, f.createLiteral("[email protected]"), true, graph2)); + } } http://git-wip-us.apache.org/repos/asf/marmotta/blob/2b0b8469/parent/pom.xml ---------------------------------------------------------------------- diff --git a/parent/pom.xml b/parent/pom.xml index 0b50d01..7aa7356 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -36,7 +36,7 @@ <url>http://marmotta.apache.org</url> <properties> - <sesame.version>2.7.11</sesame.version> + <sesame.version>2.7.12</sesame.version> <junit.version>4.11</junit.version> <weld.version>2.1.Final</weld.version> <weld.core.version>2.1.2.Final</weld.core.version>
