use of com.tinkerpop.blueprints.util.wrappers.event.listener.StubGraphChangedListener in project blueprints by tinkerpop.
the class EventGraphTest method testMutateInListener.
public void testMutateInListener() {
StubGraphChangedListener listener = new StubGraphChangedListener() {
@Override
public void vertexPropertyChanged(Vertex vertex, String key, Object oldValue, Object setValue) {
if (!"setInListener".equals(key)) {
vertex.setProperty("setInListener", 12345);
}
super.vertexPropertyChanged(vertex, key, oldValue, setValue);
}
};
graph.addListener(listener);
Vertex vertex = createVertex();
vertex.setProperty("test", 123);
assertEquals(12345, vertex.getProperty("setInListener"));
assertEquals(2, listener.vertexPropertyChangedEventRecorded());
}
use of com.tinkerpop.blueprints.util.wrappers.event.listener.StubGraphChangedListener in project blueprints by tinkerpop.
the class EventTransactionalGraphTest method testMutateInListener.
public void testMutateInListener() {
StubGraphChangedListener listener = new StubGraphChangedListener() {
@Override
public void vertexPropertyChanged(Vertex vertex, String key, Object oldValue, Object setValue) {
if (!"setInListener".equals(key)) {
vertex.setProperty("setInListener", 12345);
}
super.vertexPropertyChanged(vertex, key, oldValue, setValue);
}
};
graph.addListener(listener);
Vertex vertex = createVertex();
vertex.setProperty("test", 123);
graph.commit();
assertEquals(12345, vertex.getProperty("setInListener"));
assertEquals(2, listener.vertexPropertyChangedEventRecorded());
}
use of com.tinkerpop.blueprints.util.wrappers.event.listener.StubGraphChangedListener in project blueprints by tinkerpop.
the class EventTransactionalGraphTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
graphChangedListener = new StubGraphChangedListener();
graph = new EventTransactionalGraph<TinkerTransactionalGraph>(TinkerTransactionalGraph.createTinkerGraph());
}
use of com.tinkerpop.blueprints.util.wrappers.event.listener.StubGraphChangedListener in project blueprints by tinkerpop.
the class EventGraphTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
graphChangedListener = new StubGraphChangedListener();
graph = new EventGraph<TinkerGraph>(TinkerGraphFactory.createTinkerGraph());
}
Aggregations