Search in sources :

Example 11 with UpdateProcessor

use of org.apache.jena.update.UpdateProcessor in project jena by apache.

the class TestServerReadOnly method update_readonly.

@Test()
public void update_readonly() {
    FusekiTest.exec404(() -> {
        UpdateRequest update = UpdateFactory.create("INSERT DATA {}");
        UpdateProcessor proc = UpdateExecutionFactory.createRemote(update, serviceUpdate());
        proc.execute();
    });
}
Also used : UpdateRequest(org.apache.jena.update.UpdateRequest) UpdateProcessor(org.apache.jena.update.UpdateProcessor) Test(org.junit.Test)

Example 12 with UpdateProcessor

use of org.apache.jena.update.UpdateProcessor in project jena by apache.

the class TestDatasets method setup.

@Before
public void setup() {
    UpdateRequest up = UpdateFactory.create(TestDatasets.data);
    UpdateProcessor processor = UpdateExecutionFactory.create(up, this.dsg);
    processor.execute();
}
Also used : UpdateRequest(org.apache.jena.update.UpdateRequest) UpdateProcessor(org.apache.jena.update.UpdateProcessor) Before(org.junit.Before)

Example 13 with UpdateProcessor

use of org.apache.jena.update.UpdateProcessor in project jena by apache.

the class AbstractTestUpdateGraph method testDeleteData1.

@Test
public void testDeleteData1() {
    DatasetGraph gStore = getEmptyDatasetGraph();
    defaultGraphData(gStore, graph1);
    QuadDataAcc acc = new QuadDataAcc();
    acc.addTriple(triple2);
    UpdateDataDelete delete = new UpdateDataDelete(acc);
    UpdateProcessor uProc = UpdateExecutionFactory.create(delete, gStore);
    uProc.execute();
    assertFalse(graphEmpty(gStore.getDefaultGraph()));
    assertTrue(graphContains(gStore.getDefaultGraph(), triple1));
    assertFalse(graphContains(gStore.getDefaultGraph(), triple2));
}
Also used : UpdateProcessor(org.apache.jena.update.UpdateProcessor) DatasetGraph(org.apache.jena.sparql.core.DatasetGraph) Test(org.junit.Test)

Example 14 with UpdateProcessor

use of org.apache.jena.update.UpdateProcessor in project jena by apache.

the class AbstractTestUpdateGraph method testDeleteData2.

@Test
public void testDeleteData2() {
    DatasetGraph gStore = getEmptyDatasetGraph();
    defaultGraphData(gStore, graph1);
    QuadDataAcc acc = new QuadDataAcc();
    acc.addTriple(triple1);
    UpdateDataDelete delete = new UpdateDataDelete(acc);
    UpdateProcessor uProc = UpdateExecutionFactory.create(delete, gStore);
    uProc.execute();
    assertTrue(graphEmpty(gStore.getDefaultGraph()));
    assertFalse(graphContains(gStore.getDefaultGraph(), triple1));
}
Also used : UpdateProcessor(org.apache.jena.update.UpdateProcessor) DatasetGraph(org.apache.jena.sparql.core.DatasetGraph) Test(org.junit.Test)

Example 15 with UpdateProcessor

use of org.apache.jena.update.UpdateProcessor in project jena by apache.

the class AbstractTestUpdateGraph method testInsertData1.

@Test
public void testInsertData1() {
    DatasetGraph gStore = getEmptyDatasetGraph();
    defaultGraphData(gStore, graph1);
    QuadDataAcc acc = new QuadDataAcc();
    acc.addTriple(triple2);
    UpdateDataInsert insert = new UpdateDataInsert(acc);
    UpdateProcessor uProc = UpdateExecutionFactory.create(insert, gStore);
    uProc.execute();
    assertFalse(graphEmpty(gStore.getDefaultGraph()));
    assertTrue(graphContains(gStore.getDefaultGraph(), triple1));
    assertTrue(graphContains(gStore.getDefaultGraph(), triple2));
}
Also used : UpdateProcessor(org.apache.jena.update.UpdateProcessor) DatasetGraph(org.apache.jena.sparql.core.DatasetGraph) Test(org.junit.Test)

Aggregations

UpdateProcessor (org.apache.jena.update.UpdateProcessor)16 UpdateRequest (org.apache.jena.update.UpdateRequest)7 Test (org.junit.Test)7 DatasetGraph (org.apache.jena.sparql.core.DatasetGraph)3 UpdateDrop (org.apache.jena.sparql.modify.request.UpdateDrop)3 Update (org.apache.jena.update.Update)3 SQLException (java.sql.SQLException)1 SQLFeatureNotSupportedException (java.sql.SQLFeatureNotSupportedException)1 After (org.junit.After)1 Before (org.junit.Before)1