public void stop() { try { serviceBundle.stop(); } catch (Exception ex) { if (debug) logger.debug("Unable to cleanly shutdown bundle", ex); } try { if (httpServer instanceof Stoppable) { ((Stoppable) httpServer) .stop(); } } catch (Exception ex) { if (debug) logger.debug("Unable to cleanly shutdown httpServer", ex); } if (systemManager != null) systemManager.serviceShutDown(); }
@After public void tearDown() throws Exception { serviceBundle.stop(); }
@After public void tearDown() { bundle.stop(); }
@After public void tearDown() { bundle.stop(); }
bundle.stop(); } catch (Exception ex) {
@After public void after() { serviceQueue2.stop(); serviceQueue.stop(); serviceBundle.stop(); }
@After public void teardown() { Sys.sleep(100); serviceBundle.stop(); serviceQueue.stop(); eventServiceQueue.stop(); }
@Test //Works public void testWithServiceBundle() { final ServiceBundleBuilder serviceBundleBuilder = ServiceBundleBuilder.serviceBundleBuilder(); final ServiceBundle serviceBundle = serviceBundleBuilder.build().startServiceBundle(); serviceBundle.addServiceObject("foo", new FeedServiceImpl()); final FeedService feedService = serviceBundle.createLocalProxy(FeedService.class, "foo"); final Promise<List<FeedMeta>> listPromise = feedService.listFeeds().asHandler() .invokeAsBlockingPromise(Duration.ofSeconds(30)); ServiceProxyUtils.flushServiceProxy(feedService); final List<FeedMeta> feedMetas = listPromise.asHandler().get(); assertNotNull(feedMetas); assertEquals(1, feedMetas.size()); assertEquals("Hello", feedMetas.get(0).name); serviceBundle.stop(); }
public void stop() { try { serviceBundle.stop(); } catch (Exception ex) { if (debug) logger.debug("Unable to cleanly shutdown bundle", ex); } try { if (httpServer instanceof Stoppable) { ((Stoppable) httpServer) .stop(); } } catch (Exception ex) { if (debug) logger.debug("Unable to cleanly shutdown httpServer", ex); } if (systemManager != null) systemManager.serviceShutDown(); }
public void stop() { try { serviceBundle.stop(); } catch (Exception ex) { if (debug) logger.debug("Unable to cleanly shutdown bundle", ex); } try { if (httpServer instanceof Stoppable) { ((Stoppable) httpServer) .stop(); } } catch (Exception ex) { if (debug) logger.debug("Unable to cleanly shutdown httpServer", ex); } if (systemManager != null) systemManager.serviceShutDown(); }
@Test public void testResponses() throws Exception { call = MethodCallBuilder.methodCallBuilder().setAddress("/foo/adder").setName("add").setBody(Lists.list(1, 2)).build(); serviceBundle.addServiceObject("/adder", adderService); serviceBundle.call(call); serviceBundle.flushSends(); Sys.sleep(1000); responseReceiveQueue = serviceBundle.responses().receiveQueue(); serviceBundle.flush(); Sys.sleep(200); response = responseReceiveQueue.pollWait(); responseBody = response.body(); int sum = Conversions.toInt(responseBody); Assert.assertEquals("Sum should be 3", 3, sum); serviceBundle.stop(); }
@After public void tearDown() throws Exception{ Thread.sleep(100); serviceBundle.stop(); }
bundle.stop(); } catch (Exception ex) {
bundle.stop(); } catch (Exception ex) {
@Test public void testIntegrationWithServiceBundle() throws Exception { mdcForHttpRequestInterceptor = new SetupMdcForHttpRequestInterceptor(Sets.set("foo")); final CaptureRequestInterceptor captureRequestInterceptor = new CaptureRequestInterceptor(); captureRequestInterceptor.before(methodCallBuilder.setName("restMethod").setOriginatingRequest(httpRequest).build()); final ServiceBundle serviceBundle = ServiceBundleBuilder.serviceBundleBuilder() .setBeforeMethodCallOnServiceQueue(BeforeMethodCallChain.beforeMethodCallChain(captureRequestInterceptor, mdcForHttpRequestInterceptor)) .setAfterMethodCallOnServiceQueue(AfterMethodCallChain.afterMethodCallChain(captureRequestInterceptor, mdcForHttpRequestInterceptor)) .setBeforeMethodSent(new ForwardCallMethodInterceptor(new RequestContext())).build().startServiceBundle(); serviceBundle.addServiceObject("my", new MyServiceImpl()); final MyService localProxy = serviceBundle.createLocalProxy(MyService.class, "my"); final AsyncFutureCallback<String> callback = AsyncFutureBuilder.asyncFutureBuilder().build(String.class); localProxy.getRequestURI(callback); localProxy.clientProxyFlush(); assertEquals("/foo", callback.get()); final AsyncFutureCallback<Map<String, String>> callbackMap = AsyncFutureBuilder.asyncFutureBuilder() .buildMap(String.class, String.class); localProxy.getMDC(callbackMap); localProxy.clientProxyFlush(); validate(callbackMap.get()); captureRequestInterceptor.after(null, null); serviceBundle.stop(); }