@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"); }
@After public void tearDown() throws Exception { store.shutdown(); File f = new File(DATA_FILE_NAME); boolean success = f.delete(); assertTrue(success); }
@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(); }