use of com.baidu.hugegraph.backend.store.BackendEntry in project incubator-hugegraph by apache.
the class BackendMutationTest method testEliminateAndDeleteEntry.
@Test
public void testEliminateAndDeleteEntry() {
BackendMutation mutation = new BackendMutation();
BackendEntry entry1 = constructBackendEntry("1", "name", "marko");
BackendEntry entry2 = constructBackendEntry("1");
mutation.add(entry1, Action.ELIMINATE);
mutation.add(entry2, Action.DELETE);
Assert.assertEquals(1, get(mutation, "1").size());
Assert.assertEquals(Action.DELETE, get(mutation, "1").get(0).action());
}
use of com.baidu.hugegraph.backend.store.BackendEntry in project incubator-hugegraph by apache.
the class BackendMutationTest method testDeleteAndAppendEntry.
@Test
public void testDeleteAndAppendEntry() {
BackendMutation mutation = new BackendMutation();
BackendEntry entry1 = constructBackendEntry("1");
BackendEntry entry2 = constructBackendEntry("1", "name", "marko");
mutation.add(entry1, Action.DELETE);
Assert.assertThrows(HugeException.class, () -> {
mutation.add(entry2, Action.APPEND);
});
}
use of com.baidu.hugegraph.backend.store.BackendEntry in project incubator-hugegraph by apache.
the class BackendMutationTest method testEliminateAndAppendEntryWithSameId.
@Test
public void testEliminateAndAppendEntryWithSameId() {
BackendMutation mutation = new BackendMutation();
BackendEntry entry1 = constructBackendEntry("1", "name", "marko");
BackendEntry entry2 = constructBackendEntry("1", "city", "Wuhan");
mutation.add(entry1, Action.ELIMINATE);
mutation.add(entry2, Action.APPEND);
Assert.assertEquals(2, get(mutation, "1").size());
Assert.assertEquals(Action.ELIMINATE, get(mutation, "1").get(0).action());
Assert.assertEquals(Action.APPEND, get(mutation, "1").get(1).action());
}
use of com.baidu.hugegraph.backend.store.BackendEntry in project incubator-hugegraph by apache.
the class BackendMutationTest method testDeleteAndEliminateEntry.
@Test
public void testDeleteAndEliminateEntry() {
BackendMutation mutation = new BackendMutation();
BackendEntry entry1 = constructBackendEntry("1");
BackendEntry entry2 = constructBackendEntry("1", "name", "marko");
mutation.add(entry1, Action.DELETE);
Assert.assertThrows(HugeException.class, () -> {
mutation.add(entry2, Action.ELIMINATE);
});
}
use of com.baidu.hugegraph.backend.store.BackendEntry in project incubator-hugegraph by apache.
the class BackendMutationTest method testEliminateAndEliminateEntryWithSameEntry.
@Test
public void testEliminateAndEliminateEntryWithSameEntry() {
BackendMutation mutation = new BackendMutation();
BackendEntry entry1 = constructBackendEntry("1", "name", "marko");
BackendEntry entry2 = constructBackendEntry("1", "name", "marko");
mutation.add(entry1, Action.ELIMINATE);
mutation.add(entry2, Action.ELIMINATE);
Assert.assertEquals(1, get(mutation, "1").size());
Assert.assertEquals(Action.ELIMINATE, get(mutation, "1").get(0).action());
}
Aggregations