Search in sources :

Example 1 with AngularObjectRegistryListener

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();
}
Also used : AtomicInteger(java.util.concurrent.atomic.AtomicInteger) InterpreterOutput(org.apache.zeppelin.interpreter.InterpreterOutput) AngularObject(org.apache.zeppelin.display.AngularObject) AngularObjectRegistryListener(org.apache.zeppelin.display.AngularObjectRegistryListener) AngularObjectRegistry(org.apache.zeppelin.display.AngularObjectRegistry) AuthenticationInfo(org.apache.zeppelin.user.AuthenticationInfo)

Example 2 with AngularObjectRegistryListener

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();
}
Also used : AtomicInteger(java.util.concurrent.atomic.AtomicInteger) InterpreterOutput(org.apache.zeppelin.interpreter.InterpreterOutput) AngularObject(org.apache.zeppelin.display.AngularObject) AngularObjectRegistryListener(org.apache.zeppelin.display.AngularObjectRegistryListener) AngularObjectRegistry(org.apache.zeppelin.display.AngularObjectRegistry) AuthenticationInfo(org.apache.zeppelin.user.AuthenticationInfo)

Aggregations

AtomicInteger (java.util.concurrent.atomic.AtomicInteger)2 AngularObject (org.apache.zeppelin.display.AngularObject)2 AngularObjectRegistry (org.apache.zeppelin.display.AngularObjectRegistry)2 AngularObjectRegistryListener (org.apache.zeppelin.display.AngularObjectRegistryListener)2 InterpreterOutput (org.apache.zeppelin.interpreter.InterpreterOutput)2 AuthenticationInfo (org.apache.zeppelin.user.AuthenticationInfo)2