Package org.hivedb.meta.persistence

Examples of org.hivedb.meta.persistence.NodeDao.loadAll()


  @Test
  public void testCreate() throws Exception {
    int count = getHive().getNodes().size();
    NodeDao dao = new NodeDao(getDataSource(getConnectString(getHiveDatabaseName())));
    assertEquals(count, dao.loadAll().size());

    Node full = createFullyPopulatedNode();
    Node minimal = createMinimalNode();

    dao.create(full);
View Full Code Here


    Node minimal = createMinimalNode();

    dao.create(full);
    dao.create(minimal);

    List<Node> nodes = dao.loadAll();
    assertEquals(2 + count, nodes.size());

    Node fetchedFull = null;
    Node fetchedMinimal = null;
View Full Code Here

  @Test
  public void testUpdate() {
    int count = getHive().getNodes().size();
    NodeDao dao = new NodeDao(getDataSource(getConnectString(getHiveDatabaseName())));
    assertEquals(count, dao.loadAll().size());

    Node full = createFullyPopulatedNode();
    Node minimal = createMinimalNode();

    dao.create(full);
View Full Code Here

    minimal.setPassword("maximus");

    dao.update(full);
    dao.update(minimal);

    List<Node> nodes = dao.loadAll();
    assertEquals(2 + count, nodes.size());

    Node fetchedFull = null;
    Node fetchedMinimal = null;
View Full Code Here

  @Test
  public void testDelete() {
    int count = getHive().getNodes().size();
    NodeDao dao = new NodeDao(getDataSource(getConnectString(getHiveDatabaseName())));
    assertEquals(count, dao.loadAll().size());

    Node full = createFullyPopulatedNode();
    Node minimal = createMinimalNode();

    dao.create(full);
View Full Code Here

    Node minimal = createMinimalNode();

    dao.create(full);
    dao.create(minimal);

    List<Node> nodes = dao.loadAll();
    assertEquals(count + 2, nodes.size());
    for (Node n : nodes)
      dao.delete(n);

    assertEquals(0, dao.loadAll().size());
View Full Code Here

    List<Node> nodes = dao.loadAll();
    assertEquals(count + 2, nodes.size());
    for (Node n : nodes)
      dao.delete(n);

    assertEquals(0, dao.loadAll().size());
  }

  public Node createFullyPopulatedNode() {
    Node node = createMinimalNode();
    node.setName("full node");
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.