Example #1
0
 @Test
 public void testGraph_write() throws GraphException, SQLException, JSONException {
   writeToGraph();
   assertEquals(CAPACITY, graph.capacity());
   assertEquals(CAPACITY, graph.occupied());
   assertEquals(0, graph.available());
   assertEquals(0, graph.recycled());
 }
Example #2
0
  @Test
  public void testClearAllGraphData()
      throws JSONException, GraphException, InterruptedException, SQLException {
    testGraph();

    graph.clear();

    assertEquals(0, graph.occupied());
    assertEquals(CAPACITY, graph.capacity());
    assertEquals(CAPACITY, graph.available());
  }
Example #3
0
  @Test
  public void testGraph_delete() throws GraphException, SQLException, JSONException {
    testGraph_write();

    for (int i = 0; i < CAPACITY; i++) {
      graph.delete(String.valueOf(i));
      assertNull(graph.read(String.valueOf(i)));
    }

    assertEquals(CAPACITY, graph.capacity());
    assertEquals(0, graph.occupied());
    assertEquals(CAPACITY, graph.available());
    assertEquals(CAPACITY, graph.recycled());
  }
Example #4
0
 @Test
 public void testGraph() throws JSONException, GraphException, InterruptedException, SQLException {
   writeToGraph();
   assertEquals(CAPACITY, graph.occupied());
 }