samples/componentinjection/test/org/apidesign/component/InjectionViaServiceLoaderTest.java
changeset 132 3bc4c54f4bcc
parent 84 33aa60b18830
child 153 b5cbb797ec0a
     1.1 --- a/samples/componentinjection/test/org/apidesign/component/InjectionViaServiceLoaderTest.java	Sat Jun 14 09:53:45 2008 +0200
     1.2 +++ b/samples/componentinjection/test/org/apidesign/component/InjectionViaServiceLoaderTest.java	Sat Jun 14 09:56:12 2008 +0200
     1.3 @@ -14,7 +14,8 @@
     1.4      @BeforeClass
     1.5      public static void setUpClass() throws Exception {
     1.6          // this is a support for "dynamic" registration of any class
     1.7 -        // into the global pool of Lookup.getDefault() and java.util.ServiceLoader
     1.8 +        // into the global pool of Lookup.getDefault() and 
     1.9 +        // java.util.ServiceLoader
    1.10          // either in @BeforeClass or @Before register 
    1.11          // classes of the mock instances that you want your code 
    1.12          // to find
    1.13 @@ -25,16 +26,23 @@
    1.14      public void singleSlot() {
    1.15          InjectionSlot result = InjectionViaServiceLoader.singleSlot();
    1.16          assertNotNull("Some result found", result);
    1.17 -        assertEquals("The first is ImplOne", ImplOne.class, result.getClass());
    1.18 +        assertEquals(
    1.19 +            "The first is ImplOne", ImplOne.class, result.getClass()
    1.20 +        );
    1.21      }
    1.22  
    1.23      @Test
    1.24      public void multiSlot() {
    1.25 -        Iterator<? extends InjectionSlot> it = InjectionViaServiceLoader.multiSlot().iterator();
    1.26 +        Iterator<? extends InjectionSlot> it = 
    1.27 +            InjectionViaServiceLoader.multiSlot().iterator();
    1.28          assertTrue("Has at least one", it.hasNext());
    1.29 -        assertEquals("The first is ImplOne", ImplOne.class, it.next().getClass());
    1.30 +        assertEquals(
    1.31 +            "The first is ImplOne", ImplOne.class, it.next().getClass()
    1.32 +        );
    1.33          assertTrue("Has two", it.hasNext());
    1.34 -        assertEquals("The second is ImplTwo", ImplTwo.class, it.next().getClass());
    1.35 +        assertEquals(
    1.36 +            "The second is ImplTwo", ImplTwo.class, it.next().getClass()
    1.37 +        );
    1.38          assertFalse("No other instance registered", it.hasNext());
    1.39      }
    1.40