use of org.apache.zeppelin.display.AngularObjectRegistryListener in project zeppelin by apache.
the class BaseInterpreterTest method getIntpContext.
protected InterpreterContext getIntpContext() {
final AtomicInteger onAdd = new AtomicInteger(0);
final AtomicInteger onUpdate = new AtomicInteger(0);
final AtomicInteger onRemove = new AtomicInteger(0);
AngularObjectRegistry registry = new AngularObjectRegistry("intpId", new AngularObjectRegistryListener() {
@Override
public void onAddAngularObject(String interpreterGroupId, AngularObject angularObject) {
onAdd.incrementAndGet();
}
@Override
public void onUpdateAngularObject(String interpreterGroupId, AngularObject angularObject) {
onUpdate.incrementAndGet();
}
@Override
public void onRemoveAngularObject(String interpreterGroupId, AngularObject angularObject) {
onRemove.incrementAndGet();
}
});
AuthenticationInfo authenticationInfo = new AuthenticationInfo("user");
return InterpreterContext.builder().setNoteId("noteId").setNoteName("noteName").setParagraphId("paragraphId").setAuthenticationInfo(authenticationInfo).setAngularObjectRegistry(registry).setInterpreterOut(new InterpreterOutput()).setIntpEventClient(mock(RemoteInterpreterEventClient.class)).build();
}
use of org.apache.zeppelin.display.AngularObjectRegistryListener in project zeppelin by apache.
the class BaseInterpreterTest method getIntpContext.
protected InterpreterContext getIntpContext() {
final AtomicInteger onAdd = new AtomicInteger(0);
final AtomicInteger onUpdate = new AtomicInteger(0);
final AtomicInteger onRemove = new AtomicInteger(0);
AngularObjectRegistry registry = new AngularObjectRegistry("intpId", new AngularObjectRegistryListener() {
@Override
public void onAddAngularObject(String interpreterGroupId, AngularObject angularObject) {
onAdd.incrementAndGet();
}
@Override
public void onUpdateAngularObject(String interpreterGroupId, AngularObject angularObject) {
onUpdate.incrementAndGet();
}
@Override
public void onRemoveAngularObject(String interpreterGroupId, AngularObject angularObject) {
onRemove.incrementAndGet();
}
});
AuthenticationInfo authenticationInfo = new AuthenticationInfo("user");
return InterpreterContext.builder().setNoteId("noteId").setNoteName("noteName").setParagraphId("paragraphId").setAuthenticationInfo(authenticationInfo).setAngularObjectRegistry(registry).setInterpreterOut(new InterpreterOutput()).setIntpEventClient(mock(RemoteInterpreterEventClient.class)).build();
}
Aggregations