コード例 #1
0
ファイル: NodeTest.java プロジェクト: busjaeger/uiuc
  /**
   * Executes a sequence of steps to verify values are in fact stored, retrieved, and removed. The
   * invocations are performed via all different nodes in the system to gain some confidence about
   * the Chord implementation.
   *
   * @throws NodeLeftException
   */
  @Test
  public void testInsert() throws RemoteException, NodeLeftException {
    byte[] test = "hello world".getBytes();

    KeyValueStore kvs = node0.getKeyValueStore();
    kvs.put(test, test);

    kvs = node1.getKeyValueStore();
    Assert.assertArrayEquals(test, (byte[]) kvs.get(test));

    kvs = node2.getKeyValueStore();
    kvs.remove(test);

    kvs = node3.getKeyValueStore();
    Assert.assertNull(kvs.get(test));
  }