Examples of DateFormat


Examples of java.text.DateFormat

    assertEquals(dateFormat.parse("19980920123600000"), previousChanges
        .next());
  }

  public void testFollowingDates() throws Exception {
    DateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmssSSS");
    //ToyClock clock = new ToyClock();
    Store store = getStoreImpl(null);
    String baseURLString = "http://localhost/";
    CannedDataReader.readCannedData(store, new File("testdata"),
        baseURLString);
    GraphOverTime got = store.getGraphOverTime(Collections
        .singleton((Source) new SourceImpl(baseURLString + "danbri")));
    // one milli after last modification
    Iterator<Date> followingChanges = got.followingChanges(dateFormat
        .parse("19980920123559999"));
    // should get last modification
    assertEquals(dateFormat.parse("19980920123600000"), followingChanges
        .next());
    // eralier one
    Date nextDate = followingChanges.next();
    assertEquals(dateFormat.parse("20060920123618661"), nextDate);
  }
View Full Code Here

Examples of java.text.DateFormat

    Date nextDate = followingChanges.next();
    assertEquals(dateFormat.parse("20060920123618661"), nextDate);
  }

  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")));
    // one milli after last modification
    Iterator<Date> followingChanges = got.followingChanges(dateFormat
        .parse("19980920123600000"));
    Date nextDate = followingChanges.next();
    assertEquals(dateFormat.parse("20060920123618661"), nextDate);
  }
View Full Code Here

Examples of java.text.DateFormat

    Date nextDate = followingChanges.next();
    assertEquals(dateFormat.parse("20060920123618661"), nextDate);
  }
 
  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")));
    //filter by a resource present only in the older version
    got = got.filter(Collections.singleton((GroundedNode)new NamedNodeImpl("mailto:danbri@porklips.org")));
    // one milli after last modification
    Iterator<Date> followingChanges = got.followingChanges(dateFormat
        .parse("19980920123600000"));
    assertFalse(followingChanges.hasNext());
    Iterator<Date> previousChanges = got.previousChanges(dateFormat
        .parse("19980920123600000"));
    assertTrue(previousChanges.hasNext());
  }
View Full Code Here

Examples of java.text.DateFormat

  /*
   * 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"));
    assertFalse(followingChanges.hasNext());
  }
View Full Code Here

Examples of java.text.DateFormat

        .parse("20060101"));
    assertFalse(followingChanges.hasNext());
  }
 
  public void testFGNodeMerging() throws Exception {
    DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
    ToyClock clock = new ToyClock();
    Store store = getStoreImpl(clock);
    Model model1 = modelWithStatements("_a dc:subject 'hello'; _a http://xmlns.com/foaf/0.1/mbox_sha1sum '49f9f8e38c3144e19e09c3e5fa10170242d1360f'");
    Model model2 = modelWithStatements("_a dc:subject 'hullo'; _a http://xmlns.com/foaf/0.1/mbox_sha1sum '49f9f8e38c3144e19e09c3e5fa10170242d1360f'");

    Date date1 = dateFormat.parse("20050607");
    Date date2 = dateFormat.parse("20060912");
    FCAGraph graph1 = new FCAGraphImpl(model1);
    FCAGraph graph2 = new FCAGraphImpl(model2);
    Source source = new SourceImpl("http://example.org/graph-source");
    clock.setTime(date1);
    store.updateGraph(source, graph1);
    store = reGetStoreImpl();
    source = new SourceImpl("http://example.org/graph-source");
    clock.setTime(date2);
    store.assertGraph(source, graph2);
    FCAGraph graphR  = store.getGraphOverTime(Collections.singleton(source)).getGraph(dateFormat.parse("20060913"));
    JenaUtil.getModelFromGraph(graphR).write(System.out);
  }
View Full Code Here

Examples of java.text.DateFormat

    JenaUtil.getModelFromGraph(graphR).write(System.out);
  }
 
  //FIX BaseStoreImp revokegraph
  public void notYetTestPartialFGNodeRevoke() throws Exception {
    DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
    ToyClock clock = new ToyClock();
    Store store = getStoreImpl(clock);
    Model model1 = modelWithStatements("_a dc:subject 'hello'; _a http://xmlns.com/foaf/0.1/mbox \"foo\"; _a http://xmlns.com/foaf/0.1/mbox_sha1sum '49f9f8e38c3144e19e09c3e5fa10170242d1360f'");
    Model model2 = modelWithStatements("_a dc:subject 'hello'; _a http://xmlns.com/foaf/0.1/mbox_sha1sum '49f9f8e38c3144e19e09c3e5fa10170242d1360f'");

    Date date1 = dateFormat.parse("20050607");
    Date date2 = dateFormat.parse("20060912");
    FCAGraph graph1 = new FCAGraphImpl(model1);
    FCAGraph graph2 = new FCAGraphImpl(model2);
    Source source = new SourceImpl("http://example.org/graph-source");
    clock.setTime(date1);
    store.updateGraph(source, graph1);
    store = reGetStoreImpl();
    clock.setTime(date2);
    store.revokeGraph(source, graph2);
    FCAGraph graphR  = store.getGraphOverTime(Collections.singleton(source)).getGraph(dateFormat.parse("20060913"));
    JenaUtil.getModelFromGraph(graphR).write(System.out);
  }
View Full Code Here

Examples of java.text.DateFormat

    FCAGraph graphR  = store.getGraphOverTime(Collections.singleton(source)).getGraph(dateFormat.parse("20060913"));
    JenaUtil.getModelFromGraph(graphR).write(System.out);
  }
 
  public void testPartialFGNodeRevoke2() throws Exception {
    DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
    ToyClock clock = new ToyClock();
    Store store = getStoreImpl(clock);
    Model model1 = modelWithStatements("_a dc:subject 'sub1'; _a dc:subject 'hello'; _a http://xmlns.com/foaf/0.1/mbox_sha1sum '49f9f8e38c3144e19e09c3e5fa10170242d1360f'");
    Model model1b = modelWithStatements("_a http://xmlns.com/foaf/0.1/mbox \"foo\"; _a http://xmlns.com/foaf/0.1/mbox_sha1sum '49f9f8e38c3144e19e09c3e5fa10170242d1360f'");
    Model model2 = modelWithStatements("_a dc:subject 'hello'; _a http://xmlns.com/foaf/0.1/mbox_sha1sum '49f9f8e38c3144e19e09c3e5fa10170242d1360f'");

    Date date1 = dateFormat.parse("20050607");
    Date date1b = dateFormat.parse("20050608");
    Date date2 = dateFormat.parse("20060912");
    FCAGraph graph1 = new FCAGraphImpl(model1);
    FCAGraph graph1b = new FCAGraphImpl(model1b);
    FCAGraph graph2 = new FCAGraphImpl(model2);
    Source source = new SourceImpl("http://example.org/graph-source");
    clock.setTime(date1);
    store.updateGraph(source, graph1);
    clock.setTime(date1b);
    store.assertGraph(source, graph1b);
    store = reGetStoreImpl();
    clock.setTime(date2);
    store.revokeGraph(source, graph2);
    FCAGraph graphR  = store.getGraphOverTime(Collections.singleton(source)).getGraph(dateFormat.parse("20060913"));
    //no exception retrieving graph containing fg-node that doesn't exist the same way as wehn stuff was added
    assertTrue(true);
    JenaUtil.getModelFromGraph(graphR).write(System.out);
  }
View Full Code Here

Examples of java.text.DateFormat

    assertTrue(true);
    JenaUtil.getModelFromGraph(graphR).write(System.out);
  }
 
  public void testTransactions1() throws Exception {
    DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
    ToyClock clock = new ToyClock();
    Store store = getStoreImpl(clock);
    Model model = modelWithStatements("_a dc:subject 'sub1'; _a dc:subject 'hello'; _a http://xmlns.com/foaf/0.1/knows http://example.org/");
    Source source = new SourceImpl("http://example.org/graph-source");
    Date date1 = dateFormat.parse("20050607");
    Date date2 = dateFormat.parse("20050608");
    Date date3 = dateFormat.parse("20060912");
    clock.setTime(date1);
    store.assertGraph(source, new FCAGraphImpl(model));
    clock.setTime(date2);
    store.perform(source, new StoreTransaction() {
View Full Code Here

Examples of java.text.DateFormat

    Graph retrieved = store.getGraphOverTime(Collections.singleton(source)).getGraph(date3);
    assertEquals(0, retrieved.size());
  }
 
  public void testTransactions2() throws Exception {
    DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
    ToyClock clock = new ToyClock();
    Store store = getStoreImpl(clock);
    Model model1 = modelWithStatements("_a dc:subject 'sub1'; _a dc:subject 'hello'; _a http://xmlns.com/foaf/0.1/knows http://example.org/");
    Model model2 = modelWithStatements("_b dc:subject 'sub2'; _b dc:subject 'hello'; _b http://xmlns.com/foaf/0.1/knows http://example.org/");
    final FCAGraph graph2 = new FCAGraphImpl(model2);
    Source source = new SourceImpl("http://example.org/graph-source");
    Date date1 = dateFormat.parse("20050607");
    Date date2 = dateFormat.parse("20050608");
    Date date3 = dateFormat.parse("20060912");
    clock.setTime(date1);
    store.assertGraph(source, new FCAGraphImpl(model1));
    store.assertGraph(source, graph2);
    clock.setTime(date2);
    store.perform(source, new StoreTransaction() {
View Full Code Here

Examples of java.text.DateFormat

    Graph retrieved = store.getGraphOverTime(Collections.singleton(source)).getGraph(date3);
    assertEquals(graph2, retrieved);
  }
 
  public void testTransactions3() throws Exception {
    DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
    ToyClock clock = new ToyClock();
    Store store = getStoreImpl(clock);
    Model model1 = modelWithStatements("_a dc:subject 'sub1'; _a dc:subject 'hello'; _a http://xmlns.com/foaf/0.1/knows http://example.org/; _c dc:subject 'foo'");
    final FCAGraph graph1 = new FCAGraphImpl(model1);
    Model model2 = modelWithStatements("_b dc:subject 'sub2'; _b dc:subject 'hello'; _b http://xmlns.com/foaf/0.1/knows http://example.org/");
    final FCAGraph graph2 = new FCAGraphImpl(model2);
    Source source = new SourceImpl("http://example.org/graph-source");
    Date date1 = dateFormat.parse("20050607");
    Date date2 = dateFormat.parse("20050608");
    Date date3 = dateFormat.parse("20060912");
    clock.setTime(date1);
    store.assertGraph(source, graph1);
    store.assertGraph(source, graph1);
    store.assertGraph(source, graph2);
    clock.setTime(date2);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.