@Before public void startServer() throws Exception { // start Node node = LocalNode.newNode(); adam = MockAgentFactory.getAdam(); adam.unlockPrivateKey(adamsPass); node.storeAgent(adam); node.launch(); ServiceAgent testService = ServiceAgent.createServiceAgent(testServiceClass, "a pass"); testService.unlockPrivateKey("a pass"); node.registerReceiver(testService); // start connector logStream = new ByteArrayOutputStream(); connector = new HttpConnector(); connector.setSocketTimeout(10000); connector.setLogStream(new PrintStream(logStream)); connector.start(node); }
@After public void shutDownServer() throws Exception { connector.stop(); node.shutDown(); connector = null; node = null; LocalNode.reset(); System.out.println("Connector-Log:"); System.out.println("--------------"); System.out.println(logStream.toString()); }