final public Update Copy() throws ParseException { Target src ; Target dest ; boolean silent = false ; jj_consume_token(COPY); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case SILENT: jj_consume_token(SILENT); silent=true ; break; default: jj_la1[47] = jj_gen; ; } src = GraphOrDefault(); jj_consume_token(TO); dest = GraphOrDefault(); {if (true) return new UpdateCopy(src, dest, silent) ;} throw new Error("Missing return statement in function"); }
final public Update Copy() throws ParseException { Target src ; Target dest ; boolean silent = false ; jj_consume_token(COPY); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case SILENT: jj_consume_token(SILENT); silent=true ; break; default: jj_la1[51] = jj_gen; ; } src = GraphOrDefault(); jj_consume_token(TO); dest = GraphOrDefault(); {if (true) return new UpdateCopy(src, dest, silent) ;} throw new Error("Missing return statement in function"); }
@Test public void testCopy() { // Use blank nodes (will expose any problems in serialization when spill occurs) Triple t = new Triple(org.apache.jena.graph.NodeFactory.createBlankNode(),p,o2); Triple t2 = new Triple(org.apache.jena.graph.NodeFactory.createBlankNode(),p,o1); DatasetGraph gStore = getEmptyDatasetGraph() ; // Set the threshold to in order to force spill to disk gStore.getContext().set(ARQ.spillToDiskThreshold, 0L) ; defaultGraphData(gStore, data(triple1, triple2, t)) ; namedGraphData(gStore, graphIRI, data(t2)); UpdateCopy copy = new UpdateCopy(Target.DEFAULT, Target.create(graphIRI)); UpdateAction.execute(copy, gStore); assertFalse(graphEmpty(gStore.getDefaultGraph())) ; assertFalse(graphEmpty(gStore.getGraph(graphIRI))) ; assertTrue(graphContains(gStore.getGraph(graphIRI), triple1)) ; assertTrue(graphContains(gStore.getGraph(graphIRI), triple2)) ; assertTrue(graphContains(gStore.getGraph(graphIRI), t)) ; assertFalse(graphContains(gStore.getGraph(graphIRI), t2)) ; assertTrue(gStore.getDefaultGraph().isIsomorphicWith(gStore.getGraph(graphIRI))); }