예제 #1
0
 protected void restartServer() throws Exception {
   shellServer.shutdown();
   db.shutdown();
   db = newDb();
   remotelyAvailableOnPort = null;
   shellServer = newServer(db);
   shellClient = newShellClient(shellServer);
 }
예제 #2
0
 private void shutdownIfNecessary(ShellServer server) {
   try {
     if (!hasBeenShutdown.compareAndSet(false, true)) {
       server.shutdown();
     }
   } catch (RemoteException e) {
     throw new RuntimeException(e);
   }
 }
예제 #3
0
 @After
 public void doAfter() throws Exception {
   if (tx != null) {
     finishTx(false);
   }
   shellClient.shutdown();
   shellServer.shutdown();
   db.shutdown();
 }
예제 #4
0
 protected Node getCurrentNode() throws RemoteException, ShellException {
   Serializable current =
       shellServer.interpretVariable(shellClient.getId(), Variables.CURRENT_KEY);
   int nodeId = parseInt(current.toString().substring(1));
   try (Transaction tx = db.beginTx()) {
     Node nodeById = db.getNodeById(nodeId);
     tx.success();
     return nodeById;
   }
 }
예제 #5
0
 @After
 public void doAfter() throws Exception {
   server.shutdown();
   db.shutdown();
 }
예제 #6
0
 public void executeCommand(ShellServer server, ShellClient client, String command)
     throws Exception {
   CollectingOutput output = new CollectingOutput();
   server.interpretLine(client.getId(), command, output);
 }
예제 #7
0
 protected void makeServerRemotelyAvailable() throws RemoteException {
   if (remotelyAvailableOnPort == null) {
     remotelyAvailableOnPort = findFreePort();
     shellServer.makeRemotelyAvailable(remotelyAvailableOnPort, SimpleAppServer.DEFAULT_NAME);
   }
 }