@Override public boolean isValid( ServiceAvailable serviceAvailable, ObjectSelection objectSelection ) { ServiceReference ref = module.findService( serviceAvailable.value() ); return ref != null && ref.isAvailable(); } }
@Before @Override public void setUp() throws Exception { super.setUp(); entityFinder = this.moduleInstance.findService( EntityFinder.class ).get(); }
@Test public void showNetwork() throws IOException { final ServiceReference<IndexExporter> indexerService = this.moduleInstance.findService( IndexExporter.class ); final IndexExporter exporter = indexerService.get(); exporter.exportReadableToStream( System.out ); // todo asserts }
@Test public void showNetwork() throws IOException { IndexExporter indexerExporter = moduleInstance.findService( IndexExporter.class ).get(); indexerExporter.exportReadableToStream( System.out ); }
@Test public void showNetwork() throws IOException { IndexExporter indexerExporter = moduleInstance.findService( IndexExporter.class ).get(); indexerExporter.exportReadableToStream( System.out ); }
@Override public void belowLayerVisible() { BelowLayerVisible service = module.findService( BelowLayerVisible.class ).get(); }
@Override public void belowModuleVisible() { BelowModuleVisible service = module.findService( BelowModuleVisible.class ).get(); }
@Override public void aboveLayerVisible() { AboveLayerVisible service = module.findService( AboveLayerVisible.class ).get(); }
@Test public void showNetwork() throws IOException { IndexExporter indexerExporter = moduleInstance.findService( IndexExporter.class ).get(); indexerExporter.exportReadableToStream( System.out ); }
@Before @Override public void setUp() throws Exception { super.setUp(); entityFinder = this.moduleInstance.findService( EntityFinder.class ).get(); }
@Test public void givenServiceWhenInitializingExpectCorrectDeserialization() { ServiceReference<MyService> ref = module.instance().findService( MyService.class ); assertThat( ref, notNullValue() ); assertThat( ref.isAvailable(), equalTo( true ) ); MyService myService = ref.get(); assertThat( myService, notNullValue() ); assertThat( myService.name(), equalTo( "main" ) ); assertThat( myService.hostIp(), equalTo( "12.23.34.45" ) ); assertThat( myService.hostPort(), equalTo( 1234 ) ); }
@Test public void givenFromServiceWhenAccessingModuleApplicationVisibleExpectSuccess() { FromService service = module.findService( FromService.class ).get(); service.moduleApplicationVisible(); }
@Test public void givenFromServiceWhenAccessingBesideLayerVisibleExpectSuccess() { FromService service = module.findService( FromService.class ).get(); service.besideLayerVisible(); }
@Test( expected = NoSuchEntityTypeException.class ) public void givenFromServiceWhenAccessingAboveLayerVisibleExpectException() { FromService service = module.findService( FromService.class ).get(); service.aboveLayerVisible(); }
@Test( expected = NoSuchValueTypeException.class ) public void givenFromServiceWhenAccessingBelowModuleVisibleExpectException() { FromService service = module.findService( FromService.class ).get(); service.belowModuleVisible(); }
@Test( expected = NoSuchValueTypeException.class ) public void givenFromServiceWhenAccessingAboveModuleVisibleExpectException() { FromService service = module.findService( FromService.class ).get(); service.aboveModuleVisible(); }
@Test public void givenFromServiceWhenAccessingBesideApplicationVisibleExpectSuccess() { FromService service = module.findService( FromService.class ).get(); service.besideApplicationVisible(); }
@Test public void givenFromServiceWhenAccessingModuleLayerVisibleExpectSuccess() { FromService service = module.findService( FromService.class ).get(); service.moduleLayerVisible(); }
@Test( expected = NoSuchValueTypeException.class ) public void givenFromServiceWhenAccessingAboveApplicationVisibleExpectException() { FromService service = module.findService( FromService.class ).get(); service.aboveApplicationVisible(); }
@Override public void setUp() throws Exception { super.setUp(); Module storageModule = application.findModule( "Infrastructure Layer", "Storage Module" ); RedisEntityStoreService es = storageModule.findService( RedisEntityStoreService.class ).get(); jedisPool = es.jedisPool(); }