RemoteInterpreter extends Interpreter { void pushAngularObjectRegistryToRemote(Client client) throws TException { final AngularObjectRegistry angularObjectRegistry = this.getInterpreterGroup() .getAngularObjectRegistry(); if (angularObjectRegistry != null && angularObjectRegistry.getRegistry() != null) { final Map<String, Map<String, AngularObject>> registry = angularObjectRegistry .getRegistry(); logger.info("Push local angular object registry from ZeppelinServer to" + " remote interpreter group {}", this.getInterpreterGroup().getId()); final java.lang.reflect.Type registryType = new TypeToken<Map<String, Map<String, AngularObject>>>() {}.getType(); Gson gson = new Gson(); client.angularRegistryPush(gson.toJson(registry, registryType)); } } RemoteInterpreter(Properties property,
      String noteId,
      String className,
      String interpreterRunner,
      String interpreterPath,
      String localRepoPath,
      int connectTimeout,
      int maxPoolSize,
      RemoteInterpreterProcessListener remoteInterpreterProcessListener);  RemoteInterpreter(Properties property,
      String noteId,
      String className,
      String interpreterRunner,
      String interpreterPath,
      String localRepoPath,
      Map<String, String> env,
      int connectTimeout,
      RemoteInterpreterProcessListener remoteInterpreterProcessListener); @Override String getClassName(); RemoteInterpreterProcess getInterpreterProcess(); synchronized void init(); @Override void open(); @Override void close(); @Override InterpreterResult interpret(String st, InterpreterContext context); @Override void cancel(InterpreterContext context); @Override FormType getFormType(); @Override int getProgress(InterpreterContext context); @Override List<InterpreterCompletion> completion(String buf, int cursor); @Override Scheduler getScheduler();  }
@Test public void should_push_local_angular_repo_to_remote() throws Exception { final Client client = Mockito.mock(Client.class); final RemoteInterpreter intr = new RemoteInterpreter(new Properties(), "noteId", MockInterpreterA.class.getName(), "runner", "path","localRepo", env, 10 * 1000, null); final AngularObjectRegistry registry = new AngularObjectRegistry("spark", null); registry.add("name", "DuyHai DOAN", "nodeId", "paragraphId"); final InterpreterGroup interpreterGroup = new InterpreterGroup("groupId"); interpreterGroup.setAngularObjectRegistry(registry); intr.setInterpreterGroup(interpreterGroup); final java.lang.reflect.Type registryType = new TypeToken<Map<String, Map<String, AngularObject>>>() {}.getType(); final Gson gson = new Gson(); final String expected = gson.toJson(registry.getRegistry(), registryType); intr.pushAngularObjectRegistryToRemote(client); Mockito.verify(client).angularRegistryPush(expected); }