use of com.baidu.hugegraph.backend.store.BackendMutation in project incubator-hugegraph by apache.
the class BackendMutationTest method testInsertAndAppendEntry.
@Test
public void testInsertAndAppendEntry() {
BackendMutation mutation = new BackendMutation();
BackendEntry entry1 = constructBackendEntry("1");
BackendEntry entry2 = constructBackendEntry("1", "name", "marko");
mutation.add(entry1, Action.INSERT);
Assert.assertThrows(HugeException.class, () -> {
mutation.add(entry2, Action.APPEND);
});
}
use of com.baidu.hugegraph.backend.store.BackendMutation in project incubator-hugegraph by apache.
the class BackendMutationTest method testDeleteAndDeleteEntry.
@Test
public void testDeleteAndDeleteEntry() {
BackendMutation mutation = new BackendMutation();
BackendEntry entry1 = constructBackendEntry("1");
BackendEntry entry2 = constructBackendEntry("1");
mutation.add(entry1, Action.DELETE);
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.BackendMutation in project incubator-hugegraph by apache.
the class BackendMutationTest method testAppendAndEliminateEntryWithSameEntry.
@Test
public void testAppendAndEliminateEntryWithSameEntry() {
BackendMutation mutation = new BackendMutation();
BackendEntry entry1 = constructBackendEntry("1", "name", "marko");
BackendEntry entry2 = constructBackendEntry("1", "name", "marko");
mutation.add(entry1, Action.APPEND);
mutation.add(entry2, Action.ELIMINATE);
Assert.assertEquals(1, get(mutation, "1").size());
Assert.assertEquals(Action.ELIMINATE, get(mutation, "1").get(0).action());
}
use of com.baidu.hugegraph.backend.store.BackendMutation in project incubator-hugegraph by apache.
the class BackendMutationTest method testAppendAndInsertEntry.
@Test
public void testAppendAndInsertEntry() {
BackendMutation mutation = new BackendMutation();
BackendEntry entry1 = constructBackendEntry("1");
BackendEntry entry2 = constructBackendEntry("1", "name", "marko");
mutation.add(entry1, Action.APPEND);
mutation.add(entry2, Action.INSERT);
Assert.assertEquals(1, get(mutation, "1").size());
Assert.assertEquals(Action.INSERT, get(mutation, "1").get(0).action());
}
use of com.baidu.hugegraph.backend.store.BackendMutation in project incubator-hugegraph by apache.
the class BackendMutationTest method testAppendAndAppendEntryWithSameEntry.
@Test
public void testAppendAndAppendEntryWithSameEntry() {
BackendMutation mutation = new BackendMutation();
BackendEntry entry1 = constructBackendEntry("1", "name", "marko");
BackendEntry entry2 = constructBackendEntry("1", "name", "marko");
mutation.add(entry1, Action.APPEND);
mutation.add(entry2, Action.APPEND);
Assert.assertEquals(1, get(mutation, "1").size());
Assert.assertEquals(Action.APPEND, get(mutation, "1").get(0).action());
}
Aggregations