X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=system%2Fspring%2Fsrc%2Ftest%2Fjava%2Forg%2Fwamblee%2Fsystem%2Fspring%2FSpringComponentTest.java;h=ff3aeb2429dcc82de2c83ffb215bbff06ea6f7a3;hb=0d8d8f24656e585ee75558cfd6a4c661f8f14985;hp=1cc95c11cb640e7c92ca2ab3192b7977880458ee;hpb=da48a523c81e59fe0eac34e43d12937396161f25;p=utils diff --git a/system/spring/src/test/java/org/wamblee/system/spring/SpringComponentTest.java b/system/spring/src/test/java/org/wamblee/system/spring/SpringComponentTest.java index 1cc95c11..ff3aeb24 100644 --- a/system/spring/src/test/java/org/wamblee/system/spring/SpringComponentTest.java +++ b/system/spring/src/test/java/org/wamblee/system/spring/SpringComponentTest.java @@ -44,13 +44,13 @@ public class SpringComponentTest extends TestCase { public static EventTracker EVENT_TRACKER; - private Scope _externalScope; + private Scope externalScope; @Override protected void setUp() throws Exception { super.setUp(); EVENT_TRACKER = new EventTracker(); - _externalScope = new DefaultScope(new ProvidedInterface[0]); + externalScope = new DefaultScope(new ProvidedInterface[0]); } public void testBlackboxSystem() { @@ -59,8 +59,8 @@ public class SpringComponentTest extends TestCase { new HashMap(), new HashMap()); - Scope runtime = system.start(_externalScope); - assertEquals(0, _externalScope.getProvidedInterfaces().size()); + Scope runtime = system.start(externalScope); + assertEquals(0, externalScope.getProvidedInterfaces().size()); system.stop(runtime); } @@ -73,7 +73,7 @@ public class SpringComponentTest extends TestCase { SpringComponent system = new SpringComponent("system", new String[] { HELLO_SERVICE_SPRING_XML }, provided, new HashMap()); - Scope runtime = system.start(_externalScope); + Scope runtime = system.start(externalScope); List services = runtime.getProvidedInterfaces(); assertEquals(1, services.size()); @@ -83,7 +83,7 @@ public class SpringComponentTest extends TestCase { // BUG; Provided services should be made available in the external // scope. - Object service2 = _externalScope.getInterfaceImplementation(provided + Object service2 = externalScope.getInterfaceImplementation(provided .get("helloService"), Object.class); assertSame(service, service2); @@ -102,7 +102,7 @@ public class SpringComponentTest extends TestCase { props.load(new ClassPathResource(PROPERTY_FILE).getInputStream()); system.addProperties(props); - Scope scope = system.start(_externalScope); + Scope scope = system.start(externalScope); // BUG: Hello service was constructed multiple times. Once with the // unprocessed property // and another time with the processed property. @@ -123,7 +123,7 @@ public class SpringComponentTest extends TestCase { props.load(new ClassPathResource(PROPERTY_FILE).getInputStream()); system.addProperties("properties", props); - Scope scope = system.start(_externalScope); + Scope scope = system.start(externalScope); List services = scope.getProvidedInterfaces(); @@ -138,7 +138,7 @@ public class SpringComponentTest extends TestCase { new String[] { HELLO_SERVICE_SPRING_WITH_REQS_XML }, new HashMap(), new HashMap()); - system.start(_externalScope); + system.start(externalScope); } catch (SystemAssemblyException e) { // e.printStackTrace(); return; @@ -208,7 +208,7 @@ public class SpringComponentTest extends TestCase { new String[] { HELLO_SERVICE_SPRING_XML }, provided, new HashMap()); - Scope runtime = system.start(_externalScope); + Scope runtime = system.start(externalScope); List services = runtime.getProvidedInterfaces(); assertEquals(2, services.size()); @@ -218,11 +218,11 @@ public class SpringComponentTest extends TestCase { // BUG; Provided services should be made available in the external // scope. - Object service2 = _externalScope.getInterfaceImplementation(provided + Object service2 = externalScope.getInterfaceImplementation(provided .get("helloService"), Object.class); assertSame(service, service2); - Object floatsvc = _externalScope.getInterfaceImplementation(system + Object floatsvc = externalScope.getInterfaceImplementation(system .getProvidedInterfaces().get(1), Object.class); assertTrue(floatsvc instanceof Float); assertTrue((((Float) floatsvc).floatValue() - 100.345f) < 0.00001);