Package com.hp.hpl.jena.gvs.impl.util

Examples of com.hp.hpl.jena.gvs.impl.util.ToyClock


   *
   * @return
   * @throws Exception
   */
  public void testBorderTime() throws Exception {
    ToyClock clock = new ToyClock();
    Store store = getStoreImpl(clock);
    Source source = new SourceImpl("http://example.org/graph-source");
    FCAGraph[] graphs = new FCAGraph[2];
    graphs[0] = new FCAGraphImpl(
        modelWithStatements("_a dc:subject _b"));
    graphs[1] = new FCAGraphImpl(
        modelWithStatements("http://example.org/ dc:author 'foo'"));
    clock.setTime(new W3CDateFormat()
    .parse("2006-05-01T16:30:00Z"));
    store.updateGraph(source, graphs[0]);
    Date date2 = new W3CDateFormat().parse("2006-05-01T16:32:00Z");
    clock.setTime(date2);
    store.updateGraph(source, graphs[1]);
    Set<Source> sourceSet = new HashSet<Source>();
    sourceSet.add(source);
    FCAGraph retrievedGraph = store.getGraphOverTime(sourceSet).getGraph(
        new W3CDateFormat().parse("2006-05-01T16:30:00Z"));
View Full Code Here


          .toArray(new FCAGraph[graphList.size()]));
    }
  }

  public void testFromFiles10io() throws Exception {
    ToyClock clock = new ToyClock();
    Store store = getStoreImpl(clock);
    Source source = new SourceImpl("http://example.org/graph-source");
    FCAGraph orig = getGraphFromResource("test10-m0.rdf");
    clock.setTime(new Date());
    store.assertGraph(source, orig);
    FCAGraph retrived = store.getGraphOverTime(Collections.singleton(source))
        .getGraph(new Date());
    assertEquals(orig, retrived);
  }
View Full Code Here

          .toArray(new FCAGraph[graphList.size()]));
    }
  }

  public void testFromFiles13() throws Exception {
    ToyClock clock = new ToyClock();
    Store store = getStoreImpl(clock);
    Source source = new SourceImpl("http://example.org/graph-source");
    FCAGraph orig = getGraphFromResource("test13.rdf");
    clock.setTime(new Date());
    store.assertGraph(source, orig);
    FCAGraph retrived = store.getGraphOverTime(Collections.singleton(source))
        .getGraph(new Date());
    assertEquals(orig, retrived);
  }
View Full Code Here

        .getGraph(new Date());
    assertEquals(orig, retrived);
  }

  public void testFromFiles14() throws Exception {
    ToyClock clock = new ToyClock();
    Store store = getStoreImpl(clock);
    Source source = new SourceImpl("http://example.org/graph-source");
    FCAGraph orig = getGraphFromResource("test14.rdf");
    clock.setTime(new Date());
    store.assertGraph(source, orig);
    FCAGraph retrived = store.getGraphOverTime(Collections.singleton(source))
        .getGraph(new Date());
    assertEquals(orig, retrived);
  }
View Full Code Here

          .toArray(new FCAGraph[graphList.size()]));
    }
  }

  protected void performTestsWithGraphs(FCAGraph[] graphs) {
    ToyClock clock = new ToyClock();
    Store store = getStoreImpl(clock);
    Source source = new SourceImpl("http://example.org/graph-source");
    TimedGraphSequence tgs = TimedGraphSequence
        .getSequenceWithRandomDates(graphs);
    for (int i = 0; i < tgs.getSize(); i++) {
      clock.setTime(tgs.getDate(i));
      store.updateGraph(source, tgs.getGraph(i));
    }
    assertTrue(compareAllVersions(store, source, tgs));
    assertTrue(compareVersionAtRandomDate(store, source, tgs));
  }
View Full Code Here

    return store;
  }

  public void testPreviousDates() throws Exception {
    DateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmssSSS");
    ToyClock clock = new ToyClock();
    Store store = getStoreImpl(clock);
    String baseURLString = "http://localhost/";
    CannedDataReader.readCannedData(store, new File("testdata"),
        baseURLString);
    GraphOverTime got = store.getGraphOverTime(Collections
View Full Code Here

  }

  // 20061006 changed as interface spec changed
  public void testPreviousDates2() throws Exception {
    DateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmssSSS");
    ToyClock clock = new ToyClock();
    Store store = getStoreImpl(clock);
    String baseURLString = "http://localhost/";
    CannedDataReader.readCannedData(store, new File("testdata"),
        baseURLString);
    GraphOverTime got = store.getGraphOverTime(Collections
View Full Code Here

  }

  public void testFollowingDates2() throws Exception {
    DateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmssSSS");
    //ToyClock clock = new ToyClock();
    Store store = getStoreImpl(new ToyClock());
    String baseURLString = "http://localhost/";
    CannedDataReader.readCannedData(store, new File("testdata"),
        baseURLString);
    GraphOverTime got = store.getGraphOverTime(Collections
        .singleton((Source) new SourceImpl(baseURLString + "danbri")));
View Full Code Here

  }
 
  public void notyettestGOTFilter() throws Exception {
    DateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmssSSS");
    //ToyClock clock = new ToyClock();
    Store store = getStoreImpl(new ToyClock());
    String baseURLString = "http://localhost/";
    CannedDataReader.readCannedData(store, new File("testdata"),
        baseURLString);
    GraphOverTime got = store.getGraphOverTime(Collections
        .singleton((Source) new SourceImpl(baseURLString + "danbri")));
View Full Code Here

   * a second addition of the identical graph, must not cause a new
   * modification date
   */
  public void testAddingTheSame() throws Exception {
    DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
    ToyClock clock = new ToyClock();
    Store store = getStoreImpl(clock);
    Model model = modelWithStatements("_a dc:subject 'hello'; _a http://xmlns.com/foaf/0.1/mbox 'm'; _a http://xmlns.com/foaf/0.1/mbox 'n'");
    Date date1 = dateFormat.parse("20050607");
    Date date2 = dateFormat.parse("20060912");
    FCAGraph graph = new FCAGraphImpl(model);
    Source source = new SourceImpl("http://example.org/graph-source");
    clock.setTime(date1);
    store.updateGraph(source, graph);
    clock.setTime(date2);
    store.updateGraph(source, graph);;
    GraphOverTime got = store.getGraphOverTime(Collections
        .singleton(source));
    Iterator<Date> followingChanges = got.followingChanges(dateFormat
        .parse("20060101"));
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.gvs.impl.util.ToyClock

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.