}
public void testUpdate() throws Exception {
ToyClock clock = new ToyClock();
Store store = getStoreImpl(clock);
Source source = new SourceImpl("http://example.org/graph-source#");
Model model0 = ModelFactory.createDefaultModel();
model0.read(StoreTest.class.getResource("update-test0.rdf").toString());
FCAGraph graph0 = new FCAGraphImpl(model0);
clock.setTime(new Date());
store.updateGraph(source, graph0);
store = null;
Thread.sleep(2);
store = reGetStoreImpl();
Model model1 = ModelFactory.createDefaultModel();
model1.read(StoreTest.class.getResource("update-test1.rdf").toString());
FCAGraph graph1 = new FCAGraphImpl(model1);
clock.setTime(new Date());
store.updateGraph(new SourceImpl("http://example.org/graph-source#"),
graph1);
FCAGraph graphR = store.getGraphOverTime(
Collections.singleton((Source) new SourceImpl(
"http://example.org/graph-source#"))).getGraph(
new Date());
assertEquals(graph1, graphR);
store = reGetStoreImpl();
graphR = store.getGraphOverTime(
Collections.singleton((Source) new SourceImpl(
"http://example.org/graph-source#"))).getGraph(
new Date());
assertEquals(graph1, graphR);
}