Exemplo n.º 1
0
 @Test
 public void testReadWriteItem() throws IOException {
   Vertex vertex = new VertexImpl(); // "Name", "Description");
   store.writeItem(vertex);
   VertexImpl vertex1 = (VertexImpl) store.readItem(vertex.getId());
   assertEquals(vertex1.name, "Name");
 }
Exemplo n.º 2
0
 @After
 public void tearDown() throws Exception {
   store.shutdown();
   File f = new File(DATA_FILE_NAME);
   boolean success = f.delete();
   assertTrue(success);
 }
Exemplo n.º 3
0
 @Before
 public void setUp() throws Exception {
   StoreConfig config = new StoreConfig();
   config.setDataFileName(DATA_FILE_NAME);
   config.setDataMappedMemorySize(DATA_MAPPED_BUFFER_SIZE);
   config.setInitialFileSize(DATA_FILE_SIZE);
   Kryo kryo = new Kryo();
   kryo.register(VertexImpl.class);
   TypeResolver.registerClass(VertexImpl.class, (byte) 0);
   store = new VertexStore(config, kryo);
   store.start();
 }