コード例 #1
0
  public final void testDropResourceRoot() throws Exception {

    Collection author = this.dbColl.getChildCollection("vcl-data/author");
    Collection vcoll = this.dbColl.getChildCollection("vcl-data/myvc");

    int size = vcoll.getResourceCount();

    Resource res = author.getResource("author.4.manuel.xml");

    author.removeResource(res);

    assertEquals(size - 1, vcoll.getResourceCount());
  }
コード例 #2
0
  public final void testDropResourceSubset() throws Exception {

    Collection article = this.dbColl.getChildCollection("vcl-data/article");

    int size = article.getResourceCount();

    Resource r = article.getResource("article.from.manuel.xml");

    // Just do it if the resource exists.
    if (r != null) {
      article.removeResource(r);
      assertEquals(size - 1, article.getResourceCount());
    }
  }
コード例 #3
0
  public final void testStoreResourceSubset() throws Exception {

    Collection article = this.dbColl.getChildCollection("vcl-data/article");
    Collection vcoll = this.dbColl.getChildCollection("vcl-data/myvc");

    int size = vcoll.getResourceCount();

    SixdmlResource res =
        (SixdmlResource)
            article.createResource("article.from.manuel.xml", SixdmlResource.RESOURCE_TYPE);
    res.setContentAsDOM(
        DocumentBuilderFactoryImpl.newInstance()
            .newDocumentBuilder()
            .parse("data/vcl-data/article.from.manuel.xml"));

    article.storeResource(res);

    assertEquals(size, vcoll.getResourceCount());
  }
コード例 #4
0
  /*
  public final void testDropResourceRoot() throws Exception {

      Collection author = this.dbColl.getChildCollection("vcl-data/author");

      author.removeResource(author.getResource("author.3.hjb.xml"));
  }

  public final void testDropResourceSub() throws Exception {

      Collection article = this.dbColl.getChildCollection("vcl-data/article");

      article.removeResource(article.getResource("article.patent.1.xml"));
  }
  */
  public final void testStoreResourceRoot() throws Exception {

    Collection author = this.dbColl.getChildCollection("vcl-data/author");
    Collection vcoll = this.dbColl.getChildCollection("vcl-data/myvc");

    int size = vcoll.getResourceCount();

    SixdmlResource res =
        (SixdmlResource) author.createResource("author.4.manuel.xml", SixdmlResource.RESOURCE_TYPE);
    res.setContentAsDOM(
        DocumentBuilderFactoryImpl.newInstance()
            .newDocumentBuilder()
            .parse("data/vcl-data/author.4.manuel.xml"));

    author.storeResource(res);
  }