Package javax.datagrid

Examples of javax.datagrid.DataGrid


    assertNotNull(dataGrid);
  }

  @Test
  public void testReadWrite() {
    DataGrid dataGrid = new TransientDataGrid();
    String result = dataGrid.write("key", "value");
    assertEquals(result, "value");
    result = dataGrid.read("key");
    assertEquals(result, "value");
    result = dataGrid.take("key");
    assertEquals(result, "value");
    result = dataGrid.read("key");
    assertNull(result);
    result = dataGrid.read("newKey");
    assertNull(result);
  }
View Full Code Here


    assertNull(result);
  }

  @Test
  public void testExpirations() {
    DataGrid dataGrid = new TransientDataGrid();
    String result = dataGrid.write("key", "value", 100);
    assertEquals("value", result);
    result = dataGrid.read("key");
    assertEquals(result, "value");
    sleep(110);
    result = dataGrid.read("key");
    assertNull(result);

    result = dataGrid.write("key", "value", 100);
    assertEquals(result, "value");
    result = dataGrid.read("key");
    assertEquals(result, "value");
    sleep(110);
    result = dataGrid.take("key");
    assertNull(result);
  }
View Full Code Here

    assertNull(result);
  }

  @Test(expectedExceptions = ClassCastException.class)
  public void testCastingProblems() {
    DataGrid dataGrid = new TransientDataGrid();
    String result = dataGrid.write("key", "value");
    Integer r=dataGrid.read("key");
  }
View Full Code Here

    Integer r=dataGrid.read("key");
  }

  @Test
  public void testMapReduce() {
    DataGrid dataGrid = new TransientDataGrid();
    Integer result = dataGrid.map(new Mapper<Integer>() {
      @Override
      public Integer execute() {
        return 1;
      }
    },
View Full Code Here

TOP

Related Classes of javax.datagrid.DataGrid

Copyright © 2018 www.massapicom. 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.