incubator-composer-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r614266 [2/4] - in /incubator/composer/trunk/composer-core/src: main/java/org/apache/composer/core/ main/java/org/apache/composer/core/containers/ main/java/org/apache/composer/core/visitors/ test/java/org/apache/composer/core/ test/java/or...
Date Tue, 22 Jan 2008 17:25:25 GMT
Modified: incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/behaviors/ImplementationHidingTestCase.java
URL: http://svn.apache.org/viewvc/incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/behaviors/ImplementationHidingTestCase.java?rev=614266&r1=614265&r2=614266&view=diff
==============================================================================
--- incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/behaviors/ImplementationHidingTestCase.java (original)
+++ incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/behaviors/ImplementationHidingTestCase.java Tue Jan 22 09:25:16 2008
@@ -38,54 +38,54 @@
 public class ImplementationHidingTestCase extends AbstractComponentFactoryTest{
 
     @Test public void testAddComponentUsesImplementationHidingBehavior() {
-        DefaultContainer pico =
+        DefaultContainer container =
             new DefaultContainer(new ImplementationHiding().wrap(new ConstructorInjection()));
-        pico.addComponent("foo", String.class);
-        ComponentAdapter<?> foo = pico.getComponentAdapter("foo");
+        container.addComponent("foo", String.class);
+        ComponentAdapter<?> foo = container.getComponentAdapter("foo");
         assertEquals(HiddenImplementation.class, foo.getClass());
         assertEquals(ConstructorInjector.class, ((AbstractBehavior) foo).getDelegate().getClass());
     }
 
     @Test public void testAddComponentUsesImplementationHidingBehaviorWithRedundantHideImplProperty() {
-        DefaultContainer pico =
+        DefaultContainer container =
             new DefaultContainer(new ImplementationHiding().wrap(new ConstructorInjection()));
-        pico.change(Characteristics.HIDE_IMPL).addComponent("foo", String.class);
-        ComponentAdapter<?> foo = pico.getComponentAdapter("foo");
+        container.change(Characteristics.HIDE_IMPL).addComponent("foo", String.class);
+        ComponentAdapter<?> foo = container.getComponentAdapter("foo");
         assertEquals(HiddenImplementation.class, foo.getClass());
         assertEquals(ConstructorInjector.class, ((AbstractBehavior) foo).getDelegate().getClass());
     }
 
     @Test public void testAddComponentNoesNotUseImplementationHidingBehaviorWhenNoCachePropertyIsSpecified() {
-        DefaultContainer pico =
+        DefaultContainer container =
             new DefaultContainer(new ImplementationHiding().wrap(new ConstructorInjection()));
-        pico.change(Characteristics.NO_HIDE_IMPL).addComponent("foo", String.class);
-        ComponentAdapter<?> foo = pico.getComponentAdapter("foo");
+        container.change(Characteristics.NO_HIDE_IMPL).addComponent("foo", String.class);
+        ComponentAdapter<?> foo = container.getComponentAdapter("foo");
         assertEquals(ConstructorInjector.class, foo.getClass());
     }
 
     @Test public void testAddAdapterUsesImplementationHidingBehavior() {
-        DefaultContainer pico =
+        DefaultContainer container =
             new DefaultContainer(new ImplementationHiding().wrap(new ConstructorInjection()));
-        pico.addAdapter(new InstanceAdapter("foo", "bar", new NullLifecycleStrategy(), new NullComponentMonitor()));
-        ComponentAdapter<?> foo = pico.getComponentAdapter("foo");
+        container.addAdapter(new InstanceAdapter("foo", "bar", new NullLifecycleStrategy(), new NullComponentMonitor()));
+        ComponentAdapter<?> foo = container.getComponentAdapter("foo");
         assertEquals(HiddenImplementation.class, foo.getClass());
         assertEquals(InstanceAdapter.class, ((AbstractBehavior) foo).getDelegate().getClass());
     }
 
     @Test public void testAddAdapterUsesImplementationHidingBehaviorWithRedundantHideImplProperty() {
-        DefaultContainer pico =
+        DefaultContainer container =
             new DefaultContainer(new ImplementationHiding().wrap(new ConstructorInjection()));
-        pico.change(Characteristics.HIDE_IMPL).addAdapter(new InstanceAdapter("foo", "bar", new NullLifecycleStrategy(), new NullComponentMonitor()));
-        ComponentAdapter<?> foo = pico.getComponentAdapter("foo");
+        container.change(Characteristics.HIDE_IMPL).addAdapter(new InstanceAdapter("foo", "bar", new NullLifecycleStrategy(), new NullComponentMonitor()));
+        ComponentAdapter<?> foo = container.getComponentAdapter("foo");
         assertEquals(HiddenImplementation.class, foo.getClass());
         assertEquals(InstanceAdapter.class, ((AbstractBehavior) foo).getDelegate().getClass());
     }
 
     @Test public void testAddAdapterNoesNotUseImplementationHidingBehaviorWhenNoCachePropertyIsSpecified() {
-        DefaultContainer pico =
+        DefaultContainer container =
             new DefaultContainer(new ImplementationHiding().wrap(new ConstructorInjection()));
-        pico.change(Characteristics.NO_HIDE_IMPL).addAdapter(new InstanceAdapter("foo", "bar", new NullLifecycleStrategy(), new NullComponentMonitor()));
-        ComponentAdapter<?> foo = pico.getComponentAdapter("foo");
+        container.change(Characteristics.NO_HIDE_IMPL).addAdapter(new InstanceAdapter("foo", "bar", new NullLifecycleStrategy(), new NullComponentMonitor()));
+        ComponentAdapter<?> foo = container.getComponentAdapter("foo");
         assertEquals(InstanceAdapter.class, foo.getClass());
     }
 
@@ -125,14 +125,14 @@
     }
 
     @Test public void testLazyInstantiationSideEffectWhenForceOfDelayedInstantiationOfDependantClass() {
-        DefaultContainer pico =
+        DefaultContainer container =
             new DefaultContainer(new ImplementationHiding().wrap(new Caching().wrap(new ConstructorInjection())));
-        pico.addComponent(StringBuilder.class);
-        pico.addComponent(NeedsStringBuilder.class, NeedsStringBuilderImpl.class);
-        pico.addComponent(NeedsNeedsStringBuilder.class);
-        NeedsNeedsStringBuilder nnsb = pico.getComponent(NeedsNeedsStringBuilder.class);
+        container.addComponent(StringBuilder.class);
+        container.addComponent(NeedsStringBuilder.class, NeedsStringBuilderImpl.class);
+        container.addComponent(NeedsNeedsStringBuilder.class);
+        NeedsNeedsStringBuilder nnsb = container.getComponent(NeedsNeedsStringBuilder.class);
         assertNotNull(nnsb);
-        StringBuilder sb = pico.getComponent(StringBuilder.class);
+        StringBuilder sb = container.getComponent(StringBuilder.class);
         assertEquals("", sb.toString()); // not instantiated yet
         nnsb.foo();
         assertEquals("<init>foo()", sb.toString()); // instantiated

Modified: incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/behaviors/InterceptingTestCase.java
URL: http://svn.apache.org/viewvc/incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/behaviors/InterceptingTestCase.java?rev=614266&r1=614265&r2=614266&view=diff
==============================================================================
--- incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/behaviors/InterceptingTestCase.java (original)
+++ incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/behaviors/InterceptingTestCase.java Tue Jan 22 09:25:16 2008
@@ -48,11 +48,11 @@
 
     @Test public void testPreAndPostObservation() {
         final StringBuilder sb = new StringBuilder();
-        DefaultContainer pico = new DefaultContainer(new Intercepting());
-        pico.addComponent(StringBuilder.class, sb);
-        pico.addComponent(Foo.class, FooImpl.class);
+        DefaultContainer container = new DefaultContainer(new Intercepting());
+        container.addComponent(StringBuilder.class, sb);
+        container.addComponent(Foo.class, FooImpl.class);
 
-        Intercepted intercepted = pico.getComponentAdapter(Foo.class).findAdapterOfType(Intercepted.class);
+        Intercepted intercepted = container.getComponentAdapter(Foo.class).findAdapterOfType(Intercepted.class);
         final Intercepted.Controller interceptor = intercepted.getController();
         intercepted.addPreInvocation(Foo.class, new Foo() {
             public void one() {
@@ -74,21 +74,21 @@
             }
         });
 
-        Foo foo = pico.getComponent(Foo.class);
+        Foo foo = container.getComponent(Foo.class);
         assertNotNull(foo);
         foo.one();
         assertEquals("two", foo.two("hello", 99));
         assertEquals("pre-one(),call-one(),addPostInvocation-one(),pre-two('hello',99),call-two('hello',99),addPostInvocation-two('hello',99),", sb.toString());
-        assertEquals("Intercepted:ConstructorInjector-interface org.apache.composer.core.behaviors.InterceptingTestCase$Foo", pico.getComponentAdapter(Foo.class).toString());
+        assertEquals("Intercepted:ConstructorInjector-interface org.apache.composer.core.behaviors.InterceptingTestCase$Foo", container.getComponentAdapter(Foo.class).toString());
     }
 
     @Test public void testPreCanBlockInvocationWithAlternateReturnValue() {
         final StringBuilder sb = new StringBuilder();
-        DefaultContainer pico = new DefaultContainer(new Intercepting());
-        pico.addComponent(Foo.class, FooImpl.class);
-        pico.addComponent(StringBuilder.class, sb);
+        DefaultContainer container = new DefaultContainer(new Intercepting());
+        container.addComponent(Foo.class, FooImpl.class);
+        container.addComponent(StringBuilder.class, sb);
 
-        Intercepted intercepted = pico.getComponentAdapter(Foo.class).findAdapterOfType(Intercepted.class);
+        Intercepted intercepted = container.getComponentAdapter(Foo.class).findAdapterOfType(Intercepted.class);
         final Intercepted.Controller interceptor = intercepted.getController();
         intercepted.addPreInvocation(Foo.class, new Foo() {
             public void one() {
@@ -103,20 +103,20 @@
             }
         });
 
-        Foo foo = pico.getComponent(Foo.class);
+        Foo foo = container.getComponent(Foo.class);
         assertNotNull(foo);
         foo.one();
         assertEquals("isVetoed", foo.two("hello", 99));
         assertEquals("veto-one(),veto-two('hello',99),", sb.toString());
-        assertEquals("Intercepted:ConstructorInjector-interface org.apache.composer.core.behaviors.InterceptingTestCase$Foo", pico.getComponentAdapter(Foo.class).toString());
+        assertEquals("Intercepted:ConstructorInjector-interface org.apache.composer.core.behaviors.InterceptingTestCase$Foo", container.getComponentAdapter(Foo.class).toString());
     }
 
     @Test public void testOverrideOfReturnValue() {
         final StringBuilder sb = new StringBuilder();
-        DefaultContainer pico = new DefaultContainer(new Intercepting());
-        pico.addComponent(Foo.class, FooImpl.class);
-        pico.addComponent(StringBuilder.class, sb);
-        Intercepted intercepted = pico.getComponentAdapter(Foo.class).findAdapterOfType(Intercepted.class);
+        DefaultContainer container = new DefaultContainer(new Intercepting());
+        container.addComponent(Foo.class, FooImpl.class);
+        container.addComponent(StringBuilder.class, sb);
+        Intercepted intercepted = container.getComponentAdapter(Foo.class).findAdapterOfType(Intercepted.class);
         final Intercepted.Controller interceptor = intercepted.getController();
         intercepted.addPreInvocation(Foo.class, new Foo() {
             public void one() {
@@ -141,25 +141,25 @@
             }
         });
 
-        Foo foo = pico.getComponent(Foo.class);
+        Foo foo = container.getComponent(Foo.class);
         assertNotNull(foo);
         foo.one();
         assertEquals("x", foo.two("hello", 99));
         assertEquals("pre-one(),call-one(),override-one(),pre-two('hello',99),call-two('hello',99),override-two('hello',99),", sb.toString());
-        assertEquals("Intercepted:ConstructorInjector-interface org.apache.composer.core.behaviors.InterceptingTestCase$Foo", pico.getComponentAdapter(Foo.class).toString());
+        assertEquals("Intercepted:ConstructorInjector-interface org.apache.composer.core.behaviors.InterceptingTestCase$Foo", container.getComponentAdapter(Foo.class).toString());
     }
 
     @Test public void testNothingHappensIfNoPreOrPost() {
         final StringBuilder sb = new StringBuilder();
-        DefaultContainer pico = new DefaultContainer(new Intercepting());
-        pico.addComponent(Foo.class, FooImpl.class);
-        pico.addComponent(StringBuilder.class, sb);
-        Foo foo = pico.getComponent(Foo.class);
+        DefaultContainer container = new DefaultContainer(new Intercepting());
+        container.addComponent(Foo.class, FooImpl.class);
+        container.addComponent(StringBuilder.class, sb);
+        Foo foo = container.getComponent(Foo.class);
         assertNotNull(foo);
         foo.one();
         assertEquals("two", foo.two("hello", 99));
         assertEquals("call-one(),call-two('hello',99),", sb.toString());
-        assertEquals("Intercepted:ConstructorInjector-interface org.apache.composer.core.behaviors.InterceptingTestCase$Foo", pico.getComponentAdapter(Foo.class).toString());
+        assertEquals("Intercepted:ConstructorInjector-interface org.apache.composer.core.behaviors.InterceptingTestCase$Foo", container.getComponentAdapter(Foo.class).toString());
     }
 
 

Modified: incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/behaviors/OptInCachingTestCase.java
URL: http://svn.apache.org/viewvc/incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/behaviors/OptInCachingTestCase.java?rev=614266&r1=614265&r2=614266&view=diff
==============================================================================
--- incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/behaviors/OptInCachingTestCase.java (original)
+++ incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/behaviors/OptInCachingTestCase.java Tue Jan 22 09:25:16 2008
@@ -42,52 +42,52 @@
     }
 
     @Test public void testAddComponentDoesNotUseCachingBehaviorByDefault() {
-        DefaultContainer pico =
+        DefaultContainer container =
             new DefaultContainer(new OptInCaching().wrap(new ConstructorInjection()));
-        pico.addComponent("foo", String.class);
-        ComponentAdapter foo = pico.getComponentAdapter("foo");
+        container.addComponent("foo", String.class);
+        ComponentAdapter foo = container.getComponentAdapter("foo");
         assertEquals(ConstructorInjector.class, foo.getClass());
     }
 
     @Test public void testAddComponentUsesOptinBehaviorWithRedundantCacheProperty() {
-        DefaultContainer pico =
+        DefaultContainer container =
             new DefaultContainer(new OptInCaching().wrap(new ConstructorInjection()));
-        pico.change(Characteristics.CACHE).addComponent("foo", String.class);
-        ComponentAdapter foo = pico.getComponentAdapter("foo");
+        container.change(Characteristics.CACHE).addComponent("foo", String.class);
+        ComponentAdapter foo = container.getComponentAdapter("foo");
         assertEquals(Cached.class, foo.getClass());
         assertEquals(ConstructorInjector.class, ((AbstractBehavior) foo).getDelegate().getClass());
     }
 
     @Test public void testAddComponentNoesNotUseOptinBehaviorWhenNoCachePropertyIsSpecified() {
-        DefaultContainer pico =
+        DefaultContainer container =
             new DefaultContainer(new OptInCaching().wrap(new ConstructorInjection()));
-        pico.change(Characteristics.NO_CACHE).addComponent("foo", String.class);
-        ComponentAdapter foo = pico.getComponentAdapter("foo");
+        container.change(Characteristics.NO_CACHE).addComponent("foo", String.class);
+        ComponentAdapter foo = container.getComponentAdapter("foo");
         assertEquals(ConstructorInjector.class, foo.getClass());
     }
 
     @Test public void testAddAdapterUsesDoesNotUseCachingBehaviorByDefault() {
-        DefaultContainer pico =
+        DefaultContainer container =
             new DefaultContainer(new OptInCaching().wrap(new ConstructorInjection()));
-        pico.addAdapter(new InstanceAdapter("foo", "bar", new NullLifecycleStrategy(), new NullComponentMonitor()));
-        ComponentAdapter foo = pico.getComponentAdapter("foo");
+        container.addAdapter(new InstanceAdapter("foo", "bar", new NullLifecycleStrategy(), new NullComponentMonitor()));
+        ComponentAdapter foo = container.getComponentAdapter("foo");
         assertEquals(InstanceAdapter.class, foo.getClass());
     }
 
     @Test public void testAddAdapterUsesCachingBehaviorWithHideImplProperty() {
-        DefaultContainer pico =
+        DefaultContainer container =
             new DefaultContainer(new OptInCaching().wrap(new ConstructorInjection()));
-        pico.change(Characteristics.CACHE).addAdapter(new InstanceAdapter("foo", "bar", new NullLifecycleStrategy(), new NullComponentMonitor()));
-        ComponentAdapter foo = pico.getComponentAdapter("foo");
+        container.change(Characteristics.CACHE).addAdapter(new InstanceAdapter("foo", "bar", new NullLifecycleStrategy(), new NullComponentMonitor()));
+        ComponentAdapter foo = container.getComponentAdapter("foo");
         assertEquals(Cached.class, foo.getClass());
         assertEquals(InstanceAdapter.class, ((AbstractBehavior) foo).getDelegate().getClass());
     }
 
     @Test public void testAddAdapterNoesNotUseImplementationHidingBehaviorWhenNoCachePropertyIsSpecified() {
-        DefaultContainer pico =
+        DefaultContainer container =
             new DefaultContainer(new OptInCaching().wrap(new ConstructorInjection()));
-        pico.change(Characteristics.NO_CACHE).addAdapter(new InstanceAdapter("foo", "bar", new NullLifecycleStrategy(), new NullComponentMonitor()));
-        ComponentAdapter foo = pico.getComponentAdapter("foo");
+        container.change(Characteristics.NO_CACHE).addAdapter(new InstanceAdapter("foo", "bar", new NullLifecycleStrategy(), new NullComponentMonitor()));
+        ComponentAdapter foo = container.getComponentAdapter("foo");
         assertEquals(InstanceAdapter.class, foo.getClass());
     }
 

Modified: incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/behaviors/PropertyApplyingTestCase.java
URL: http://svn.apache.org/viewvc/incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/behaviors/PropertyApplyingTestCase.java?rev=614266&r1=614265&r2=614266&view=diff
==============================================================================
--- incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/behaviors/PropertyApplyingTestCase.java (original)
+++ incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/behaviors/PropertyApplyingTestCase.java Tue Jan 22 09:25:16 2008
@@ -207,10 +207,10 @@
     }
 
 
-    @Test public void testPropertiesTidiedUpAfterPicoUsage() {
-        DefaultContainer pico = new DefaultContainer(createComponentFactory());
-        pico.as(Characteristics.PROPERTY_APPLYING).addComponent("foo", Foo.class);
-        Foo foo = (Foo) pico.getComponent("foo");
+    @Test public void testPropertiesTidiedUpAfterContainerUsage() {
+        DefaultContainer container = new DefaultContainer(createComponentFactory());
+        container.as(Characteristics.PROPERTY_APPLYING).addComponent("foo", Foo.class);
+        Foo foo = (Foo) container.getComponent("foo");
     }
 
 
@@ -287,7 +287,7 @@
     }
 
     @Test public void testSetDependenComponentWillBeSetByTheAdapter() {
-        picoContainer.addComponent("b", B.class);
+        containerContainer.addComponent("b", B.class);
         PropertyApplying factory = (PropertyApplying)createComponentFactory();
         Map properties = new HashMap();
 
@@ -302,8 +302,8 @@
                                                                      A.class,
                                                                      (Parameter[])null);
         adapter.setProperties(properties);
-        picoContainer.addAdapter(adapter);
-        A a = picoContainer.getComponent(A.class);
+        containerContainer.addAdapter(adapter);
+        A a = containerContainer.getComponent(A.class);
 
         assertNotNull(a);
         assertNotNull(a.b);
@@ -347,10 +347,10 @@
                                                                      SimpleDateFormat.class,
                                                                      (Parameter[])null);
         adapter.setProperties(properties);
-        picoContainer.addAdapter(adapter);
+        containerContainer.addAdapter(adapter);
 
 
-        SimpleDateFormat dateFormat = picoContainer.getComponent(SimpleDateFormat.class);
+        SimpleDateFormat dateFormat = containerContainer.getComponent(SimpleDateFormat.class);
         assertNotNull(dateFormat);
         assertEquals(false, dateFormat.isLenient());
         assertEquals(new Date(0), dateFormat.get2DigitYearStart());
@@ -358,7 +358,7 @@
 
 
     /** todo Is this test duplicated elsewhere?  --MR */
-    @Test public void testSetBeanPropertiesWithWrongNumberOfParametersThrowsPicoInitializationException() {
+    @Test public void testSetBeanPropertiesWithWrongNumberOfParametersThrowsContainerInitializationException() {
         Object testBean = new Object() {
             public void setMultiValues(String val1, String Val2) {
                 throw new IllegalStateException("Setter should never have been called");
@@ -385,10 +385,10 @@
         properties.put("multiValues", "abcdefg");
         adapter.setProperties(properties);
 
-        picoContainer.addAdapter(adapter);
+        containerContainer.addAdapter(adapter);
 
         try {
-            Object testResult = picoContainer.getComponent("TestBean");
+            Object testResult = containerContainer.getComponent("TestBean");
             fail(
                 "Getting a bad test result through PropertyApplicator should have thrown exception.  Instead got:" +
                 testResult);
@@ -416,11 +416,11 @@
                                                                      SimpleDateFormat.class,
                                                                      (Parameter[])null);
         adapter.setProperties(properties);
-        picoContainer.addAdapter(adapter);
+        containerContainer.addAdapter(adapter);
 
 
         try {
-            SimpleDateFormat dateFormat = picoContainer.getComponent(SimpleDateFormat.class);
+            SimpleDateFormat dateFormat = containerContainer.getComponent(SimpleDateFormat.class);
             fail(
                 "Getting a bad test result through PropertyApplicator should have thrown exception.  Instead got:" +
                 dateFormat);

Modified: incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/behaviors/SynchronizedTestCase.java
URL: http://svn.apache.org/viewvc/incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/behaviors/SynchronizedTestCase.java?rev=614266&r1=614265&r2=614266&view=diff
==============================================================================
--- incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/behaviors/SynchronizedTestCase.java (original)
+++ incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/behaviors/SynchronizedTestCase.java Tue Jan 22 09:25:16 2008
@@ -49,15 +49,15 @@
     final class Runner implements Runnable {
         public RuntimeException exception;
         public Blocker blocker;
-        private final Container pico;
+        private final Container container;
 
-        public Runner(Container pico) {
-            this.pico = pico;
+        public Runner(Container container) {
+            this.container = container;
         }
 
         public void run() {
             try {
-                blocker = (Blocker) pico.getComponent("key");
+                blocker = (Blocker) container.getComponent("key");
             } catch (RuntimeException e) {
                 exception = e;
             }
@@ -75,13 +75,13 @@
     }
 
     private void initTest(ComponentAdapter componentAdapter) throws InterruptedException {
-        DefaultContainer pico = new DefaultContainer();
-        pico.addComponent(this);
-        pico.addAdapter(componentAdapter);
+        DefaultContainer container = new DefaultContainer();
+        container.addComponent(this);
+        container.addAdapter(componentAdapter);
         blockerCounter = 0;
 
         for(int i = 0; i < runner.length; ++i) {
-            runner[i] = new Runner(pico);
+            runner[i] = new Runner(container);
         }
         
         Thread racer[] = new Thread[runner.length];
@@ -138,43 +138,43 @@
     }
 
     public void THIS_NATURALLY_FAILS_testSingletonCreationRace() throws InterruptedException {
-        DefaultContainer pico = new DefaultContainer();
-        pico.addComponent("slow", SlowCtor.class);
-        runConcurrencyTest(pico);
+        DefaultContainer container = new DefaultContainer();
+        container.addComponent("slow", SlowCtor.class);
+        runConcurrencyTest(container);
     }
 
     public void THIS_NATURALLY_FAILS_testSingletonCreationWithSynchronizedAdapter() throws InterruptedException {
-        DefaultContainer pico = new DefaultContainer();
-        pico.addAdapter(new Cached(makeComponentAdapter(new ConstructorInjector("slow", SlowCtor.class, null, new NullComponentMonitor(), new NullLifecycleStrategy(), false))));
-        runConcurrencyTest(pico);
+        DefaultContainer container = new DefaultContainer();
+        container.addAdapter(new Cached(makeComponentAdapter(new ConstructorInjector("slow", SlowCtor.class, null, new NullComponentMonitor(), new NullLifecycleStrategy(), false))));
+        runConcurrencyTest(container);
     }
 
     // This is overkill - an outer sync adapter is enough
     @Test public void testSingletonCreationWithSynchronizedAdapterAndDoubleLocking() throws InterruptedException {
-        DefaultContainer pico = new DefaultContainer();
-        pico.addAdapter(makeComponentAdapter(new Cached(new Synchronized(new ConstructorInjector("slow", SlowCtor.class, null, new NullComponentMonitor(), new NullLifecycleStrategy(), false)))));
-        runConcurrencyTest(pico);
+        DefaultContainer container = new DefaultContainer();
+        container.addAdapter(makeComponentAdapter(new Cached(new Synchronized(new ConstructorInjector("slow", SlowCtor.class, null, new NullComponentMonitor(), new NullLifecycleStrategy(), false)))));
+        runConcurrencyTest(container);
     }
 
     @Test public void testSingletonCreationWithSynchronizedAdapterOutside() throws InterruptedException {
-        DefaultContainer pico = new DefaultContainer();
-        pico.addAdapter(makeComponentAdapter(new Cached(new ConstructorInjector("slow", SlowCtor.class, null, new NullComponentMonitor(), new NullLifecycleStrategy(), false))));
-        runConcurrencyTest(pico);
+        DefaultContainer container = new DefaultContainer();
+        container.addAdapter(makeComponentAdapter(new Cached(new ConstructorInjector("slow", SlowCtor.class, null, new NullComponentMonitor(), new NullLifecycleStrategy(), false))));
+        runConcurrencyTest(container);
     }
 
     @Test public void testSingletonCreationWithSynchronizedAdapterOutsideUsingFactory() throws InterruptedException {
-        DefaultContainer pico = new DefaultContainer(
+        DefaultContainer container = new DefaultContainer(
                 makeBehaviorFactory().wrap(new Caching().wrap(new ConstructorInjection()))
         );
-        pico.addComponent("slow", SlowCtor.class);
-        runConcurrencyTest(pico);
+        container.addComponent("slow", SlowCtor.class);
+        runConcurrencyTest(container);
     }
 
     protected BehaviorFactory makeBehaviorFactory() {
         return new Synchronizing();
     }
 
-    private void runConcurrencyTest(final DefaultContainer pico) throws InterruptedException {
+    private void runConcurrencyTest(final DefaultContainer container) throws InterruptedException {
         int size = 10;
 
         Thread[] threads = new Thread[size];
@@ -186,7 +186,7 @@
             threads[i] = new Thread(new Runnable() {
                 public void run() {
                     try {
-                        out.add(pico.getComponent("slow"));
+                        out.add(container.getComponent("slow"));
                     } catch (Exception e) {
                         // add ex? is e.equals(anotherEOfTheSameType) == true?
                         out.add(new Date()); // add something else to indicate miss

Modified: incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/containers/CommandLineArgumentsContainerTestCase.java
URL: http://svn.apache.org/viewvc/incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/containers/CommandLineArgumentsContainerTestCase.java?rev=614266&r1=614265&r2=614266&view=diff
==============================================================================
--- incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/containers/CommandLineArgumentsContainerTestCase.java (original)
+++ incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/containers/CommandLineArgumentsContainerTestCase.java Tue Jan 22 09:25:16 2008
@@ -114,10 +114,10 @@
 
     @Test public void testUnsatisfiableIfNoSuitableTyesForInjection() {
         CommandLineArgumentsContainer apc = new CommandLineArgumentsContainer(new String[] {"zz=zz"});
-        DefaultContainer pico = new DefaultContainer(apc);
-        pico.as(Characteristics.USE_NAMES).addComponent(NeedsAFew.class);
+        DefaultContainer container = new DefaultContainer(apc);
+        container.as(Characteristics.USE_NAMES).addComponent(NeedsAFew.class);
         try {
-            Object foo = pico.getComponent(NeedsAFew.class);
+            Object foo = container.getComponent(NeedsAFew.class);
             fail();
         } catch (AbstractInjector.UnsatisfiableDependenciesException e) {
             // expetced;
@@ -136,10 +136,10 @@
 
     @Test public void testConstructorInjectionComponentCanDependOnConfig() {
         CommandLineArgumentsContainer apc = new CommandLineArgumentsContainer(new String[] {"a=a", "b=2", "c=true"});
-        DefaultContainer pico = new DefaultContainer(apc);
-        pico.addConfig("zzz","zzz");
-        pico.as(Characteristics.USE_NAMES).addComponent(NeedsAFew.class);
-        NeedsAFew needsAFew = pico.getComponent(NeedsAFew.class);
+        DefaultContainer container = new DefaultContainer(apc);
+        container.addConfig("zzz","zzz");
+        container.as(Characteristics.USE_NAMES).addComponent(NeedsAFew.class);
+        NeedsAFew needsAFew = container.getComponent(NeedsAFew.class);
         assertNotNull(needsAFew);
         assertEquals("a", needsAFew.a);
         assertEquals(2, needsAFew.b);
@@ -166,10 +166,10 @@
 
     @Test public void testSetterInjectionComponentCanDependOnConfig() {
         CommandLineArgumentsContainer apc = new CommandLineArgumentsContainer(new String[] {"a=a", "b=2", "c=true"});
-        DefaultContainer pico = new DefaultContainer(new SetterInjection(), apc);
-        pico.addConfig("zzz","zzz");
-        pico.as(Characteristics.USE_NAMES).addComponent(NeedsAFew2.class);
-        NeedsAFew2 needsAFew = pico.getComponent(NeedsAFew2.class);
+        DefaultContainer container = new DefaultContainer(new SetterInjection(), apc);
+        container.addConfig("zzz","zzz");
+        container.as(Characteristics.USE_NAMES).addComponent(NeedsAFew2.class);
+        NeedsAFew2 needsAFew = container.getComponent(NeedsAFew2.class);
         assertNotNull(needsAFew);
         assertEquals("a", needsAFew.a);
         assertEquals(2, needsAFew.b);
@@ -187,10 +187,10 @@
 
     @Test public void testAnnotatedFieldInjectionComponentCanDependOnConfig() {
         CommandLineArgumentsContainer apc = new CommandLineArgumentsContainer(new String[] {"a=a", "b=2", "c=true"});
-        DefaultContainer pico = new DefaultContainer(new AnnotatedFieldInjection(), apc);
-        pico.addConfig("zzz","zzz");
-        pico.as(Characteristics.USE_NAMES).addComponent(NeedsAFew3.class);
-        NeedsAFew3 needsAFew = pico.getComponent(NeedsAFew3.class);
+        DefaultContainer container = new DefaultContainer(new AnnotatedFieldInjection(), apc);
+        container.addConfig("zzz","zzz");
+        container.as(Characteristics.USE_NAMES).addComponent(NeedsAFew3.class);
+        NeedsAFew3 needsAFew = container.getComponent(NeedsAFew3.class);
         assertNotNull(needsAFew);
         assertEquals("a", needsAFew.a);
         assertEquals(2, needsAFew.b);

Modified: incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/containers/EmptyContainerTestCase.java
URL: http://svn.apache.org/viewvc/incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/containers/EmptyContainerTestCase.java?rev=614266&r1=614265&r2=614266&view=diff
==============================================================================
--- incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/containers/EmptyContainerTestCase.java (original)
+++ incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/containers/EmptyContainerTestCase.java Tue Jan 22 09:25:16 2008
@@ -30,15 +30,15 @@
 public class EmptyContainerTestCase {
 
     @Test public void testReturnValues() {
-        Container pico = new EmptyContainer();
-        assertNull(pico.getComponentAdapter(null, (NameBinding) null));
-        assertNull(pico.getComponentAdapter(null, (NameBinding) null));
-        assertTrue(pico.getComponentAdapters().isEmpty());
-        assertTrue(pico.getComponentAdapters(null).isEmpty());
-        assertNull(pico.getComponent(null));
-        assertNull(pico.getComponent(null));
-        assertTrue(pico.getComponents().isEmpty());
-        assertTrue(pico.getComponents(null).isEmpty());
-        assertNull(pico.getParent());
+        Container container = new EmptyContainer();
+        assertNull(container.getComponentAdapter(null, (NameBinding) null));
+        assertNull(container.getComponentAdapter(null, (NameBinding) null));
+        assertTrue(container.getComponentAdapters().isEmpty());
+        assertTrue(container.getComponentAdapters(null).isEmpty());
+        assertNull(container.getComponent(null));
+        assertNull(container.getComponent(null));
+        assertTrue(container.getComponents().isEmpty());
+        assertTrue(container.getComponents(null).isEmpty());
+        assertNull(container.getParent());
     }
 }

Modified: incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/containers/ImmutableContainerTestCase.java
URL: http://svn.apache.org/viewvc/incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/containers/ImmutableContainerTestCase.java?rev=614266&r1=614265&r2=614266&view=diff
==============================================================================
--- incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/containers/ImmutableContainerTestCase.java (original)
+++ incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/containers/ImmutableContainerTestCase.java Tue Jan 22 09:25:16 2008
@@ -53,34 +53,34 @@
     }
 
     @Test public void testVisitingOfImmutableContainerWorks() {
-        final DefaultContainer pico = new DefaultContainer();
+        final DefaultContainer container = new DefaultContainer();
         Object foo = new Object();
-        final ComponentAdapter componentAdapter = pico.addComponent(foo).getComponentAdapter(foo.getClass(), (NameBinding) null);
+        final ComponentAdapter componentAdapter = container.addComponent(foo).getComponentAdapter(foo.getClass(), (NameBinding) null);
 
         final ContainerVisitor fooVisitor = mockery.mock(ContainerVisitor.class);
         mockery.checking(new Expectations() {{
-            one(fooVisitor).visitContainer(with(same(pico)));
+            one(fooVisitor).visitContainer(with(same(container)));
         	one(fooVisitor).visitComponentAdapter(with(same(componentAdapter)));
         }});
-        Container ipc = new ImmutableContainer(pico);
+        Container ipc = new ImmutableContainer(container);
         ipc.accept(fooVisitor);
     }
 
     @Test public void testProxyEquals() throws Exception {
-        DefaultContainer pico = new DefaultContainer();
-        Container ipc = new ImmutableContainer(pico);
+        DefaultContainer container = new DefaultContainer();
+        Container ipc = new ImmutableContainer(container);
         assertEquals(ipc, ipc);
-        assertEquals(ipc, new ImmutableContainer(pico));
+        assertEquals(ipc, new ImmutableContainer(container));
     }
 
     @Test public void testHashCodeIsSame() throws Exception {
-        DefaultContainer pico = new DefaultContainer();
-        assertEquals(pico.hashCode(), new ImmutableContainer(pico).hashCode());
+        DefaultContainer container = new DefaultContainer();
+        assertEquals(container.hashCode(), new ImmutableContainer(container).hashCode());
     }
     
     @Test public void testDoesNotEqualsToNull() {
-        DefaultContainer pico = new DefaultContainer();
-        Container ipc = new ImmutableContainer(pico);
+        DefaultContainer container = new DefaultContainer();
+        Container ipc = new ImmutableContainer(container);
         assertFalse(ipc.equals(null));
     }
 }

Modified: incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/defaults/CollectionComponentParameterTestCase.java
URL: http://svn.apache.org/viewvc/incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/defaults/CollectionComponentParameterTestCase.java?rev=614266&r1=614265&r2=614266&view=diff
==============================================================================
--- incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/defaults/CollectionComponentParameterTestCase.java (original)
+++ incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/defaults/CollectionComponentParameterTestCase.java Tue Jan 22 09:25:16 2008
@@ -71,32 +71,32 @@
 		CollectionComponentParameter ccp = new CollectionComponentParameter();
 		final ComponentAdapter componentAdapter = mockery
 				.mock(ComponentAdapter.class);
-		final Container picoContainer = mockery.mock(Container.class);
+		final Container containerContainer = mockery.mock(Container.class);
 		mockery.checking(new Expectations() {
 			{
 				atLeast(1).of(componentAdapter).getComponentKey();
 				will(returnValue("x"));
-				one(picoContainer).getComponentAdapters();
+				one(containerContainer).getComponentAdapters();
 				will(returnValue(new HashSet()));
-				one(picoContainer).getComponentAdapters(
+				one(containerContainer).getComponentAdapters(
 						with(equal(String.class)));
 				will(returnValue(Arrays.asList(new InstanceAdapter("y",
 						"Hello", new NullLifecycleStrategy(),
 						new NullComponentMonitor()), new InstanceAdapter("z",
 						"World", new NullLifecycleStrategy(),
 						new NullComponentMonitor()))));
-				one(picoContainer).getComponent(with(equal("z")));
+				one(containerContainer).getComponent(with(equal("z")));
 				will(returnValue("World"));
-				one(picoContainer).getComponent(with(equal("y")));
+				one(containerContainer).getComponent(with(equal("y")));
 				will(returnValue("Hello"));
-				one(picoContainer).getParent();
+				one(containerContainer).getParent();
 				will(returnValue(null));
 			}
 		});
 		List expected = Arrays.asList("Hello", "World");
 		Collections.sort(expected);
 		List actual = Arrays.asList((Object[]) ccp.resolveInstance(
-				picoContainer, componentAdapter, String[].class,
+				containerContainer, componentAdapter, String[].class,
 				null, false, null));
 		Collections.sort(actual);
 		assertEquals(expected, actual);
@@ -217,10 +217,10 @@
 
 	@Test
 	public void testShouldNotInstantiateCollectionForUngenericCollectionParameters() {
-		MutableContainer pico = getDefaultContainer();
-		pico.addComponent(UngenericCollectionBowl.class);
+		MutableContainer container = getDefaultContainer();
+		container.addComponent(UngenericCollectionBowl.class);
 		try {
-			pico.getComponent(UngenericCollectionBowl.class);
+			container.getComponent(UngenericCollectionBowl.class);
 			fail();
 		} catch (AbstractInjector.UnsatisfiableDependenciesException e) {
 			// expected
@@ -241,10 +241,10 @@
 
 	@Test
 	public void testShouldFailWhenThereAreNoComponentsToPutInTheArray() {
-		MutableContainer pico = getDefaultContainer();
-		pico.addComponent(AnotherGenericCollectionBowl.class);
+		MutableContainer container = getDefaultContainer();
+		container.addComponent(AnotherGenericCollectionBowl.class);
 		try {
-			pico.getComponent(AnotherGenericCollectionBowl.class);
+			container.getComponent(AnotherGenericCollectionBowl.class);
 			fail();
 		} catch (AbstractInjector.UnsatisfiableDependenciesException e) {
 			// expected
@@ -253,11 +253,11 @@
 
 	@Test
 	public void testAllowsEmptyArraysIfEspeciallySet() {
-		MutableContainer pico = getDefaultContainer();
-		pico.addComponent(AnotherGenericCollectionBowl.class,
+		MutableContainer container = getDefaultContainer();
+		container.addComponent(AnotherGenericCollectionBowl.class,
 				AnotherGenericCollectionBowl.class,
 				ComponentParameter.ARRAY_ALLOW_EMPTY);
-		AnotherGenericCollectionBowl bowl = pico
+		AnotherGenericCollectionBowl bowl = container
 				.getComponent(AnotherGenericCollectionBowl.class);
 		assertNotNull(bowl);
 		assertEquals(0, bowl.strings.length);
@@ -280,13 +280,13 @@
 
 	@Test
 	public void testWillOmitSelfFromCollection() {
-		MutableContainer pico = getDefaultContainer();
-		pico.addComponent(SimpleTouchable.class);
-		pico.addComponent(TouchableObserver.class);
-		Touchable observer = pico.getComponent(TouchableObserver.class);
+		MutableContainer container = getDefaultContainer();
+		container.addComponent(SimpleTouchable.class);
+		container.addComponent(TouchableObserver.class);
+		Touchable observer = container.getComponent(TouchableObserver.class);
 		assertNotNull(observer);
 		observer.touch();
-		SimpleTouchable touchable = pico.getComponent(SimpleTouchable.class);
+		SimpleTouchable touchable = container.getComponent(SimpleTouchable.class);
 		assertTrue(touchable.wasTouched);
 	}
 
@@ -344,52 +344,52 @@
 
 	@Test
 	public void testDifferentCollectiveTypesAreResolved() {
-		MutableContainer pico = new DefaultContainer();
+		MutableContainer container = new DefaultContainer();
 		CollectionComponentParameter parameter = new CollectionComponentParameter(
 				Fish.class, true);
-		pico.addComponent(DependsOnAll.class, DependsOnAll.class, parameter,
+		container.addComponent(DependsOnAll.class, DependsOnAll.class, parameter,
 				parameter, parameter, parameter, parameter, parameter);
-		assertNotNull(pico.getComponent(DependsOnAll.class));
+		assertNotNull(container.getComponent(DependsOnAll.class));
 	}
 
 	@Test
 	public void testVerify() {
-		MutableContainer pico = new DefaultContainer();
+		MutableContainer container = new DefaultContainer();
 		CollectionComponentParameter parameterNonEmpty = CollectionComponentParameter.ARRAY;
-		pico.addComponent(Shark.class);
-		parameterNonEmpty.verify(pico, null, Fish[].class, null, false, null);
+		container.addComponent(Shark.class);
+		parameterNonEmpty.verify(container, null, Fish[].class, null, false, null);
 		try {
 			parameterNonEmpty
-					.verify(pico, null, Cod[].class, null, false, null);
-			fail("(PicoCompositionException expected");
+					.verify(container, null, Cod[].class, null, false, null);
+			fail("(ContainerCompositionException expected");
 		} catch (CompositionException e) {
 			assertTrue(e.getMessage().indexOf(Cod.class.getName()) > 0);
 		}
 		CollectionComponentParameter parameterEmpty = CollectionComponentParameter.ARRAY_ALLOW_EMPTY;
-		parameterEmpty.verify(pico, null, Fish[].class, null, false, null);
-		parameterEmpty.verify(pico, null, Cod[].class, null, false, null);
+		parameterEmpty.verify(container, null, Fish[].class, null, false, null);
+		parameterEmpty.verify(container, null, Cod[].class, null, false, null);
 	}
 
 	// PICO-243 : this test will fail if executed on jdk1.3 without
 	// commons-collections
 	@Test
 	public void testOrderOfElementsOfAnArrayDependencyIsPreserved() {
-		MutableContainer pico = new DefaultContainer();
-		pico.addComponent("first", "first");
-		pico.addComponent("second", "second");
-		pico.addComponent("third", "third");
-		pico.addComponent("fourth", "fourth");
-		pico.addComponent("fifth", "fifth");
-		pico.addComponent(Truc.class);
+		MutableContainer container = new DefaultContainer();
+		container.addComponent("first", "first");
+		container.addComponent("second", "second");
+		container.addComponent("third", "third");
+		container.addComponent("fourth", "fourth");
+		container.addComponent("fifth", "fifth");
+		container.addComponent(Truc.class);
 
-		final List strings = pico.getComponents(String.class);
+		final List strings = container.getComponents(String.class);
 		assertEquals("first", strings.get(0));
 		assertEquals("second", strings.get(1));
 		assertEquals("third", strings.get(2));
 		assertEquals("fourth", strings.get(3));
 		assertEquals("fifth", strings.get(4));
 
-		pico.getComponent(Truc.class);
+		container.getComponent(Truc.class);
 	}
 
 	public static final class Truc {

Modified: incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/defaults/ComponentKeysTestCase.java
URL: http://svn.apache.org/viewvc/incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/defaults/ComponentKeysTestCase.java?rev=614266&r1=614265&r2=614266&view=diff
==============================================================================
--- incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/defaults/ComponentKeysTestCase.java (original)
+++ incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/defaults/ComponentKeysTestCase.java Tue Jan 22 09:25:16 2008
@@ -34,26 +34,26 @@
 public class ComponentKeysTestCase {
 	
     @Test public void testComponensRegisteredWithClassKeyTakePrecedenceOverOthersWhenThereAreMultipleImplementations() throws Exception {
-        DefaultContainer pico = new DefaultContainer();
-        pico.addComponent("default", SimpleTouchable.class);
+        DefaultContainer container = new DefaultContainer();
+        container.addComponent("default", SimpleTouchable.class);
 
         /**
          * By using a class as key, this should take precedence over the other Touchable
          */
-        pico.addComponent(Touchable.class, DecoratedTouchable.class, new ComponentParameter("default"));
+        container.addComponent(Touchable.class, DecoratedTouchable.class, new ComponentParameter("default"));
 
-        Touchable touchable = pico.getComponent(Touchable.class);
+        Touchable touchable = container.getComponent(Touchable.class);
         assertEquals(DecoratedTouchable.class, touchable.getClass());
     }
 
     @Test public void testComponentAdapterResolutionIsFirstLookedForByClassKeyToTheTopOfTheContainerHierarchy() {
-        DefaultContainer pico = new DefaultContainer();
-        pico.addComponent("default", SimpleTouchable.class);
+        DefaultContainer container = new DefaultContainer();
+        container.addComponent("default", SimpleTouchable.class);
 
         // Use the List variant instead, so we get better test coverage.
-        pico.addComponent(Touchable.class, DecoratedTouchable.class, new ComponentParameter("default"));
+        container.addComponent(Touchable.class, DecoratedTouchable.class, new ComponentParameter("default"));
 
-        DefaultContainer grandChild = new DefaultContainer(new DefaultContainer(new DefaultContainer(pico)));
+        DefaultContainer grandChild = new DefaultContainer(new DefaultContainer(new DefaultContainer(container)));
 
         Touchable touchable = grandChild.getComponent(Touchable.class);
         assertEquals(DecoratedTouchable.class, touchable.getClass());
@@ -61,10 +61,10 @@
     }
 
     @Test public void testComponentKeysFromParentCannotConfuseTheChild() throws Exception {
-        DefaultContainer pico = new DefaultContainer();
-        pico.addComponent("test", SimpleTouchable.class);
+        DefaultContainer container = new DefaultContainer();
+        container.addComponent("test", SimpleTouchable.class);
 
-        DefaultContainer child = new DefaultContainer(pico);
+        DefaultContainer child = new DefaultContainer(container);
 
         child.addComponent("test", DependsOnTouchable.class);
 

Modified: incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/defaults/ComposerExceptionsTestCase.java
URL: http://svn.apache.org/viewvc/incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/defaults/ComposerExceptionsTestCase.java?rev=614266&r1=614265&r2=614266&view=diff
==============================================================================
--- incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/defaults/ComposerExceptionsTestCase.java (original)
+++ incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/defaults/ComposerExceptionsTestCase.java Tue Jan 22 09:25:16 2008
@@ -40,7 +40,7 @@
 import org.apache.composer.core.monitors.AbstractComponentMonitor;
 
 /**
- * Unit tests for the several PicoException classes.
+ * Unit tests for the several ContainerException classes.
  */
 public class ComposerExceptionsTestCase {
 
@@ -51,10 +51,10 @@
     final void executeTestOfStandardException(final Class clazz) {
         final ComponentAdapter componentAdapter = new ConstructorInjector(clazz, clazz, null, new AbstractComponentMonitor(),
                                                                           new NullLifecycleStrategy(), false);
-        DefaultContainer pico = new DefaultContainer();
-        pico.addComponent(MESSAGE);
+        DefaultContainer container = new DefaultContainer();
+        container.addComponent(MESSAGE);
         try {
-            final Exception exception = (Exception) componentAdapter.getComponentInstance(pico);
+            final Exception exception = (Exception) componentAdapter.getComponentInstance(container);
             assertEquals(MESSAGE, exception.getMessage());
         } catch (final AbstractInjector.UnsatisfiableDependenciesException ex) {
             final Set<Object> set = new HashSet<Object>();
@@ -64,10 +64,10 @@
             }
             assertTrue(set.contains(Throwable.class));
         }
-        pico = new DefaultContainer();
-        pico.addComponent(THROWABLE);
+        container = new DefaultContainer();
+        container.addComponent(THROWABLE);
         try {
-            final ComposerException exception = (ComposerException) componentAdapter.getComponentInstance(pico);
+            final ComposerException exception = (ComposerException) componentAdapter.getComponentInstance(container);
             assertSame(THROWABLE, exception.getCause());
         } catch (final AbstractInjector.UnsatisfiableDependenciesException ex) {
             final Set<Object> set = new HashSet<Object>();
@@ -77,17 +77,17 @@
             }
             assertTrue(set.contains(String.class));
         }
-        pico.addComponent(MESSAGE);
-        final ComposerException exception = (ComposerException) componentAdapter.getComponentInstance(pico);
+        container.addComponent(MESSAGE);
+        final ComposerException exception = (ComposerException) componentAdapter.getComponentInstance(container);
         assertEquals(MESSAGE, exception.getMessage());
         assertSame(THROWABLE, exception.getCause());
     }
 
-    @Test public void testPicoInitializationException() {
+    @Test public void testContainerInitializationException() {
         executeTestOfStandardException(CompositionException.class);
     }
 
-    @Test public void testPicoInitializationExceptionWithDefaultConstructor() {
+    @Test public void testContainerInitializationExceptionWithDefaultConstructor() {
         TestException e = new TestException(null);
         assertNull(e.getMessage());
         assertNull(e.getCause());

Modified: incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/defaults/DefaultComponentRegistryTestCase.java
URL: http://svn.apache.org/viewvc/incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/defaults/DefaultComponentRegistryTestCase.java?rev=614266&r1=614265&r2=614266&view=diff
==============================================================================
--- incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/defaults/DefaultComponentRegistryTestCase.java (original)
+++ incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/defaults/DefaultComponentRegistryTestCase.java Tue Jan 22 09:25:16 2008
@@ -35,63 +35,63 @@
 import org.apache.composer.core.testmodel.Touchable;
 
 public class DefaultComponentRegistryTestCase {
-    private DefaultContainer picoContainer;
+    private DefaultContainer containerContainer;
 
     @Before
     public void setUp() throws Exception {
-        picoContainer = new DefaultContainer();
+        containerContainer = new DefaultContainer();
     }
 
     @Test public void testRegisterComponent() throws CompositionException {
         ComponentAdapter componentAdapter = createComponentAdapter();
-        picoContainer.addAdapter(componentAdapter);
-        assertTrue(picoContainer.getComponentAdapters().contains(componentAdapter));
+        containerContainer.addAdapter(componentAdapter);
+        assertTrue(containerContainer.getComponentAdapters().contains(componentAdapter));
     }
 
     @Test public void testUnregisterComponent() throws CompositionException {
         ComponentAdapter componentAdapter = createComponentAdapter();
-        picoContainer.addAdapter(componentAdapter);
-        picoContainer.removeComponent(Touchable.class);
-        assertFalse(picoContainer.getComponentAdapters().contains(componentAdapter));
+        containerContainer.addAdapter(componentAdapter);
+        containerContainer.removeComponent(Touchable.class);
+        assertFalse(containerContainer.getComponentAdapters().contains(componentAdapter));
     }
 
     @Test public void testCannotInstantiateAnUnregisteredComponent() throws CompositionException {
         ComponentAdapter componentAdapter = createComponentAdapter();
-        picoContainer.addAdapter(componentAdapter);
-        picoContainer.getComponents();
-        picoContainer.removeComponent(Touchable.class);
+        containerContainer.addAdapter(componentAdapter);
+        containerContainer.getComponents();
+        containerContainer.removeComponent(Touchable.class);
 
-        assertTrue(picoContainer.getComponents().isEmpty());
+        assertTrue(containerContainer.getComponents().isEmpty());
     }
 
     @Test public void testCanInstantiateReplacedComponent() throws CompositionException {
         ComponentAdapter componentAdapter = createComponentAdapter();
-        picoContainer.addAdapter(componentAdapter);
-        picoContainer.getComponents();
-        picoContainer.removeComponent(Touchable.class);
+        containerContainer.addAdapter(componentAdapter);
+        containerContainer.getComponents();
+        containerContainer.removeComponent(Touchable.class);
 
-        picoContainer.addComponent(Touchable.class, AlternativeTouchable.class);
+        containerContainer.addComponent(Touchable.class, AlternativeTouchable.class);
 
         assertEquals("Container should container 1 addComponent",
-                1, picoContainer.getComponents().size());
+                1, containerContainer.getComponents().size());
     }
 
     @Test public void testUnregisterAfterInstantiateComponents() throws CompositionException {
         ComponentAdapter componentAdapter = createComponentAdapter();
-        picoContainer.addAdapter(componentAdapter);
-        picoContainer.getComponents();
-        picoContainer.removeComponent(Touchable.class);
-        assertNull(picoContainer.getComponent(Touchable.class));
+        containerContainer.addAdapter(componentAdapter);
+        containerContainer.getComponents();
+        containerContainer.removeComponent(Touchable.class);
+        assertNull(containerContainer.getComponent(Touchable.class));
     }
 
     @Test public void testReplacedInstantiatedComponentHasCorrectClass() throws CompositionException {
         ComponentAdapter componentAdapter = createComponentAdapter();
-        picoContainer.addAdapter(componentAdapter);
-        picoContainer.getComponents();
-        picoContainer.removeComponent(Touchable.class);
+        containerContainer.addAdapter(componentAdapter);
+        containerContainer.getComponents();
+        containerContainer.removeComponent(Touchable.class);
 
-        picoContainer.addComponent(Touchable.class, AlternativeTouchable.class);
-        Object component = picoContainer.getComponents().iterator().next();
+        containerContainer.addComponent(Touchable.class, AlternativeTouchable.class);
+        Object component = containerContainer.getComponents().iterator().next();
 
         assertEquals(AlternativeTouchable.class, component.getClass());
     }

Modified: incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/defaults/DefaultContainerLifecycleTestCase.java
URL: http://svn.apache.org/viewvc/incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/defaults/DefaultContainerLifecycleTestCase.java?rev=614266&r1=614265&r2=614266&view=diff
==============================================================================
--- incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/defaults/DefaultContainerLifecycleTestCase.java (original)
+++ incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/defaults/DefaultContainerLifecycleTestCase.java Tue Jan 22 09:25:16 2008
@@ -69,13 +69,13 @@
 	
     @Test public void testOrderOfInstantiationShouldBeDependencyOrder() throws Exception {
 
-        DefaultContainer pico = new DefaultContainer();
-        pico.addComponent("recording", StringBuffer.class);
-        pico.addComponent(Four.class);
-        pico.addComponent(Two.class);
-        pico.addComponent(One.class);
-        pico.addComponent(Three.class);
-        final List componentInstances = pico.getComponents();
+        DefaultContainer container = new DefaultContainer();
+        container.addComponent("recording", StringBuffer.class);
+        container.addComponent(Four.class);
+        container.addComponent(Two.class);
+        container.addComponent(One.class);
+        container.addComponent(Three.class);
+        final List componentInstances = container.getComponents();
 
         // instantiation - would be difficult to do these in the wrong order!!
         assertEquals("Incorrect Order of Instantiation", One.class, componentInstances.get(1).getClass());
@@ -122,10 +122,10 @@
     }
 
     @Test public void testStartStartShouldFail() throws Exception {
-        DefaultContainer pico = new DefaultContainer();
-        pico.start();
+        DefaultContainer container = new DefaultContainer();
+        container.start();
         try {
-            pico.start();
+            container.start();
             fail("Should have failed");
         } catch (IllegalStateException e) {
             // expected;
@@ -133,11 +133,11 @@
     }
 
     @Test public void testStartStopStopShouldFail() throws Exception {
-        DefaultContainer pico = new DefaultContainer();
-        pico.start();
-        pico.stop();
+        DefaultContainer container = new DefaultContainer();
+        container.start();
+        container.stop();
         try {
-            pico.stop();
+            container.stop();
             fail("Should have failed");
         } catch (IllegalStateException e) {
             // expected;
@@ -145,12 +145,12 @@
     }
 
     @Test public void testStartStopDisposeDisposeShouldFail() throws Exception {
-        DefaultContainer pico = new DefaultContainer();
-        pico.start();
-        pico.stop();
-        pico.dispose();
+        DefaultContainer container = new DefaultContainer();
+        container.start();
+        container.stop();
+        container.dispose();
         try {
-            pico.dispose();
+            container.dispose();
             fail("Should have barfed");
         } catch (IllegalStateException e) {
             // expected;
@@ -195,19 +195,19 @@
     }
 
     @Test public void testStartStopOfDaemonizedThread() throws Exception {
-        DefaultContainer pico = new DefaultContainer(new Caching());
-        pico.addComponent(FooRunnable.class);
+        DefaultContainer container = new DefaultContainer(new Caching());
+        container.addComponent(FooRunnable.class);
 
-        pico.getComponents();
-        pico.start();
+        container.getComponents();
+        container.start();
         Thread.sleep(100);
-        pico.stop();
+        container.stop();
 
-        FooRunnable foo = pico.getComponent(FooRunnable.class);
+        FooRunnable foo = container.getComponent(FooRunnable.class);
         assertEquals(1, foo.runCount());
-        pico.start();
+        container.start();
         Thread.sleep(100);
-        pico.stop();
+        container.stop();
         assertEquals(2, foo.runCount());
     }
 
@@ -265,31 +265,31 @@
     }
 
     @Test public void testOnlyStartableComponentsAreStartedOnStart() {
-        MutableContainer pico = new DefaultContainer(new Caching());
-        pico.addComponent("recording", StringBuffer.class);
-        pico.addComponent(One.class);
-        pico.addComponent(NotStartable.class);
-        pico.start();
-        pico.stop();
-        pico.dispose();
-        assertEquals("<OneOne>!One", pico.getComponent("recording").toString());
+        MutableContainer container = new DefaultContainer(new Caching());
+        container.addComponent("recording", StringBuffer.class);
+        container.addComponent(One.class);
+        container.addComponent(NotStartable.class);
+        container.start();
+        container.stop();
+        container.dispose();
+        assertEquals("<OneOne>!One", container.getComponent("recording").toString());
     }
 
     @Test public void testShouldFailOnStartAfterDispose() {
-        MutableContainer pico = new DefaultContainer();
-        pico.dispose();
+        MutableContainer container = new DefaultContainer();
+        container.dispose();
         try {
-            pico.start();
+            container.start();
             fail();
         } catch (IllegalStateException expected) {
         }
     }
 
     @Test public void testShouldFailOnStopAfterDispose() {
-        MutableContainer pico = new DefaultContainer();
-        pico.dispose();
+        MutableContainer container = new DefaultContainer();
+        container.dispose();
         try {
-            pico.stop();
+            container.stop();
             fail();
         } catch (IllegalStateException expected) {
         }
@@ -298,12 +298,12 @@
     @Test public void testShouldStackContainersLast() {
         // this is merely a code coverage test - but it doesn't seem to cover the StackContainersAtEndComparator
         // fully. oh well.
-        MutableContainer pico = new DefaultContainer(new Caching());
-        pico.addComponent(ArrayList.class);
-        pico.addComponent(DefaultContainer.class);
-        pico.addComponent(HashMap.class);
-        pico.start();
-        DefaultContainer childContainer = pico.getComponent(DefaultContainer.class);
+        MutableContainer container = new DefaultContainer(new Caching());
+        container.addComponent(ArrayList.class);
+        container.addComponent(DefaultContainer.class);
+        container.addComponent(HashMap.class);
+        container.start();
+        DefaultContainer childContainer = container.getComponent(DefaultContainer.class);
         // it should be started too
         try {
             childContainer.start();
@@ -332,15 +332,15 @@
                 return true;
             }
         };
-        MutableContainer pico = new DefaultContainer( new AdaptingInjection(), strategy, null );
+        MutableContainer container = new DefaultContainer( new AdaptingInjection(), strategy, null );
 
         StringBuffer sb = new StringBuffer();
 
-        pico.addComponent(sb);
+        container.addComponent(sb);
 
-        pico.start();
-        pico.stop();
-        pico.dispose();
+        container.start();
+        container.stop();
+        container.dispose();
 
         assertEquals("start>stop>dispose>", sb.toString());
     }
@@ -366,15 +366,15 @@
             }
         };
         MutableContainer parent = new DefaultContainer(strategy, null);
-        MutableContainer pico = parent.makeChildContainer();
+        MutableContainer container = parent.makeChildContainer();
 
         StringBuffer sb = new StringBuffer();
 
-        pico.addComponent(sb);
+        container.addComponent(sb);
 
-        pico.start();
-        pico.stop();
-        pico.dispose();
+        container.start();
+        container.stop();
+        container.dispose();
 
         assertEquals("start>stop>dispose>", sb.toString());
     }
@@ -394,7 +394,7 @@
         dpc.addComponent("bar", s2);
         try {
             dpc.start();
-            fail("PicoLifecylceException expected");
+            fail("ContainerLifecylceException expected");
         } catch (LifecycleException e) {
             assertEquals("I do not want to start myself", e.getCause().getMessage());
         }
@@ -485,14 +485,14 @@
 
         try {
             dpc.start();
-            fail("PicoLifecylceException expected");
+            fail("ContainerLifecylceException expected");
         } catch (RuntimeException e) {
             dpc.stop();
         }
 
     }
 
-    @Test public void testStartedComponentsCanBeStoppedIfSomeComponentsFailToStartEvenInAPicoHierarchy() {
+    @Test public void testStartedComponentsCanBeStoppedIfSomeComponentsFailToStartEvenInAContainerHierarchy() {
 
     	final Startable s1 = mockery.mock(Startable.class, "s1");
         final Startable s2 = mockery.mock(Startable.class, "s2");
@@ -511,7 +511,7 @@
 
         try {
             dpc.start();
-            fail("PicoLifecylceException expected");
+            fail("ContainerLifecylceException expected");
         } catch (RuntimeException e) {
             dpc.stop();
         }

Modified: incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/defaults/GenericsTestCase.java
URL: http://svn.apache.org/viewvc/incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/defaults/GenericsTestCase.java?rev=614266&r1=614265&r2=614266&view=diff
==============================================================================
--- incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/defaults/GenericsTestCase.java (original)
+++ incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/defaults/GenericsTestCase.java Tue Jan 22 09:25:16 2008
@@ -31,22 +31,22 @@
     }
 
     /*
-    private MutableContainer pico;
+    private MutableContainer container;
     private Shark shark;
     private Cod cod;
     private Bowl bowl;
 
     protected void setUp() throws Exception {
-        pico = new DefaultContainer();
+        container = new DefaultContainer();
 
         shark = new Shark();
         cod = new Cod();
 
-        pico.addAdapter("shark", shark);
-        pico.addAdapter(cod);
-        pico.addAdapter(Bowl.class);
+        container.addAdapter("shark", shark);
+        container.addAdapter(cod);
+        container.addAdapter(Bowl.class);
 
-        bowl = (Bowl) pico.getComponent(Bowl.class);
+        bowl = (Bowl) container.getComponent(Bowl.class);
     }
 
     public static interface Fish {
@@ -117,9 +117,9 @@
     }
 
     @Test public void testShouldNotInstantiateCollectionForUngenericCollectionParameters() {
-        pico.addAdapter(UngenericCollectionBowl.class);
+        container.addAdapter(UngenericCollectionBowl.class);
         try {
-            pico.getComponent(UngenericCollectionBowl.class);
+            container.getComponent(UngenericCollectionBowl.class);
             fail();
         } catch (UnsatisfiableDependenciesException e) {
             // expected
@@ -132,9 +132,9 @@
     }
 
     @Test public void testShouldNotInstantiateMapForUngenericMapParameters() {
-        pico.addAdapter(UngenericMapBowl.class);
+        container.addAdapter(UngenericMapBowl.class);
         try {
-            pico.getComponent(UngenericMapBowl.class);
+            container.getComponent(UngenericMapBowl.class);
             fail();
         } catch (UnsatisfiableDependenciesException e) {
             // expected
@@ -154,8 +154,8 @@
     }
 
     @Test public void testShouldInstantiateAmptyCollectionForAnotherGenericCollection() {
-        pico.addAdapter(AnotherGenericCollectionBowl.class);
-        AnotherGenericCollectionBowl anotherGenericCollectionBowl = (AnotherGenericCollectionBowl) pico.getComponent(AnotherGenericCollectionBowl.class);
+        container.addAdapter(AnotherGenericCollectionBowl.class);
+        AnotherGenericCollectionBowl anotherGenericCollectionBowl = (AnotherGenericCollectionBowl) container.getComponent(AnotherGenericCollectionBowl.class);
         assertEquals(0, anotherGenericCollectionBowl.getStrings().size());
     }
 */

Modified: incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/defaults/NoneOfTheseTestsAffectCoverageMeaningTheyCouldGoTestCase.java
URL: http://svn.apache.org/viewvc/incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/defaults/NoneOfTheseTestsAffectCoverageMeaningTheyCouldGoTestCase.java?rev=614266&r1=614265&r2=614266&view=diff
==============================================================================
--- incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/defaults/NoneOfTheseTestsAffectCoverageMeaningTheyCouldGoTestCase.java (original)
+++ incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/defaults/NoneOfTheseTestsAffectCoverageMeaningTheyCouldGoTestCase.java Tue Jan 22 09:25:16 2008
@@ -43,12 +43,12 @@
 
     //TODO - move to AbstractComponentRegistryTestCase
     @Test public void testGetComponentSpecification() throws CompositionException {
-        DefaultContainer pico = new DefaultContainer();
+        DefaultContainer container = new DefaultContainer();
 
-        assertNull(pico.getComponentAdapter(Touchable.class, (NameBinding) null));
-        pico.addComponent(SimpleTouchable.class);
-        assertNotNull(pico.getComponentAdapter(SimpleTouchable.class, (NameBinding) null));
-        assertNotNull(pico.getComponentAdapter(Touchable.class,(NameBinding)  null));
+        assertNull(container.getComponentAdapter(Touchable.class, (NameBinding) null));
+        container.addComponent(SimpleTouchable.class);
+        assertNotNull(container.getComponentAdapter(SimpleTouchable.class, (NameBinding) null));
+        assertNotNull(container.getComponentAdapter(Touchable.class,(NameBinding)  null));
     }
 
 
@@ -58,14 +58,14 @@
     {
         SimpleTouchable Touchable1 = new SimpleTouchable();
         SimpleTouchable Touchable2 = new SimpleTouchable();
-        DefaultContainer pico = new DefaultContainer();
-        pico.addComponent("Touchable1", Touchable1);
-        pico.addComponent("Touchable2", Touchable2);
-        pico.addComponent("fred1", DependsOnTouchable.class, new ComponentParameter("Touchable1"));
-        pico.addComponent("fred2", DependsOnTouchable.class, new ComponentParameter("Touchable2"));
+        DefaultContainer container = new DefaultContainer();
+        container.addComponent("Touchable1", Touchable1);
+        container.addComponent("Touchable2", Touchable2);
+        container.addComponent("fred1", DependsOnTouchable.class, new ComponentParameter("Touchable1"));
+        container.addComponent("fred2", DependsOnTouchable.class, new ComponentParameter("Touchable2"));
 
-        DependsOnTouchable fred1 = (DependsOnTouchable) pico.getComponent("fred1");
-        DependsOnTouchable fred2 = (DependsOnTouchable) pico.getComponent("fred2");
+        DependsOnTouchable fred1 = (DependsOnTouchable) container.getComponent("fred1");
+        DependsOnTouchable fred2 = (DependsOnTouchable) container.getComponent("fred2");
 
         assertFalse(fred1 == fred2);
         assertSame(Touchable1, fred1.getTouchable());
@@ -74,46 +74,46 @@
 
     //TODO - move
     @Test public void testRegistrationByName() throws Exception {
-        DefaultContainer pico = new DefaultContainer();
+        DefaultContainer container = new DefaultContainer();
 
         Webster one = new Webster(new ArrayList());
         Touchable two = new SimpleTouchable();
 
-        pico.addComponent("one", one);
-        pico.addComponent("two", two);
+        container.addComponent("one", one);
+        container.addComponent("two", two);
 
-        assertEquals("Wrong number of comps in the internals", 2, pico.getComponents().size());
+        assertEquals("Wrong number of comps in the internals", 2, container.getComponents().size());
 
-        assertEquals("Looking up one Touchable", one, pico.getComponent("one"));
-        assertEquals("Looking up two Touchable", two, pico.getComponent("two"));
+        assertEquals("Looking up one Touchable", one, container.getComponent("one"));
+        assertEquals("Looking up two Touchable", two, container.getComponent("two"));
 
-        assertTrue("Object one the same", one == pico.getComponent("one"));
-        assertTrue("Object two the same", two == pico.getComponent("two"));
+        assertTrue("Object one the same", one == container.getComponent("one"));
+        assertTrue("Object two the same", two == container.getComponent("two"));
 
-        assertEquals("Lookup of unknown key should return null", null, pico.getComponent("unknown"));
+        assertEquals("Lookup of unknown key should return null", null, container.getComponent("unknown"));
     }
 
     @Test public void testRegistrationByNameAndClassWithResolving() throws Exception {
-        DefaultContainer pico = new DefaultContainer();
+        DefaultContainer container = new DefaultContainer();
 
-        pico.addComponent(List.class, new ArrayList());
-        pico.addComponent("one", Webster.class);
-        pico.addComponent("two", SimpleTouchable.class);
+        container.addComponent(List.class, new ArrayList());
+        container.addComponent("one", Webster.class);
+        container.addComponent("two", SimpleTouchable.class);
 
-        assertEquals("Wrong number of comps in the internals", 3, pico.getComponents().size());
+        assertEquals("Wrong number of comps in the internals", 3, container.getComponents().size());
 
-        assertNotNull("Object one the same", pico.getComponent("one"));
-        assertNotNull("Object two the same", pico.getComponent("two"));
+        assertNotNull("Object one the same", container.getComponent("one"));
+        assertNotNull("Object two the same", container.getComponent("two"));
 
-        assertNull("Lookup of unknown key should return null", pico.getComponent("unknown"));
+        assertNull("Lookup of unknown key should return null", container.getComponent("unknown"));
     }
 
     @Test public void testDuplicateRegistrationWithTypeAndObject() throws CompositionException {
-        DefaultContainer pico = new DefaultContainer();
+        DefaultContainer container = new DefaultContainer();
 
-        pico.addComponent(SimpleTouchable.class);
+        container.addComponent(SimpleTouchable.class);
         try {
-            pico.addComponent(SimpleTouchable.class, new SimpleTouchable());
+            container.addComponent(SimpleTouchable.class, new SimpleTouchable());
             fail("Should have barfed with dupe registration");
         } catch (CompositionException e) {
             // expected
@@ -124,10 +124,10 @@
 
 
     @Test public void testComponentRegistrationMismatch() throws CompositionException {
-        MutableContainer pico = new DefaultContainer();
+        MutableContainer container = new DefaultContainer();
 
         try {
-            pico.addComponent(List.class, SimpleTouchable.class);
+            container.addComponent(List.class, SimpleTouchable.class);
         } catch (ClassCastException e) {
             // not worded in message
             assertTrue(e.getMessage().indexOf(List.class.getName()) > 0);
@@ -172,45 +172,45 @@
     }
 
     @Test public void testParameterCanBePassedToConstructor() throws Exception {
-        DefaultContainer pico = new DefaultContainer();
-        pico.addComponent(Animal.class,
+        DefaultContainer container = new DefaultContainer();
+        container.addComponent(Animal.class,
                 Dino.class,
                 new ConstantParameter("bones"));
 
-        Animal animal = pico.getComponent(Animal.class);
+        Animal animal = container.getComponent(Animal.class);
         assertNotNull("Component not null", animal);
         assertEquals("bones", animal.getFood());
     }
 
     @Test public void testParameterCanBePrimitive() throws Exception {
-        DefaultContainer pico = new DefaultContainer();
-        pico.addComponent(Animal.class, Dino2.class, new ConstantParameter(22));
+        DefaultContainer container = new DefaultContainer();
+        container.addComponent(Animal.class, Dino2.class, new ConstantParameter(22));
 
-        Animal animal = pico.getComponent(Animal.class);
+        Animal animal = container.getComponent(Animal.class);
         assertNotNull("Component not null", animal);
         assertEquals("22", animal.getFood());
     }
 
     @Test public void testMultipleParametersCanBePassed() throws Exception {
-        DefaultContainer pico = new DefaultContainer();
-        pico.addComponent(Animal.class, Dino3.class, new ConstantParameter("a"),
+        DefaultContainer container = new DefaultContainer();
+        container.addComponent(Animal.class, Dino3.class, new ConstantParameter("a"),
                 new ConstantParameter("b"));
 
-        Animal animal = pico.getComponent(Animal.class);
+        Animal animal = container.getComponent(Animal.class);
         assertNotNull("Component not null", animal);
         assertEquals("ab", animal.getFood());
 
     }
 
     @Test public void testParametersCanBeMixedWithComponentsCanBePassed() throws Exception {
-        DefaultContainer pico = new DefaultContainer();
-        pico.addComponent(Touchable.class, SimpleTouchable.class);
-        pico.addComponent(Animal.class, Dino4.class, new ConstantParameter("a"),
+        DefaultContainer container = new DefaultContainer();
+        container.addComponent(Touchable.class, SimpleTouchable.class);
+        container.addComponent(Animal.class, Dino4.class, new ConstantParameter("a"),
                 new ConstantParameter(3),
                 new ConstantParameter("b"),
                 ComponentParameter.DEFAULT);
 
-        Animal animal = pico.getComponent(Animal.class);
+        Animal animal = container.getComponent(Animal.class);
         assertNotNull("Component not null", animal);
         assertEquals("a3b org.apache.composer.core.testmodel.SimpleTouchable", animal.getFood());
     }

Modified: incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/defaults/UserQuestionTestCase.java
URL: http://svn.apache.org/viewvc/incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/defaults/UserQuestionTestCase.java?rev=614266&r1=614265&r2=614266&view=diff
==============================================================================
--- incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/defaults/UserQuestionTestCase.java (original)
+++ incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/defaults/UserQuestionTestCase.java Tue Jan 22 09:25:16 2008
@@ -49,11 +49,11 @@
             this.bla = cheeseMap;
         }
 
-        public Object getComponentInstance(Container pico) throws CompositionException {
+        public Object getComponentInstance(Container container) throws CompositionException {
             return bla.get("cheese");
         }
 
-        public void verify(Container pico) {
+        public void verify(Container container) {
         }
 
         public String getDescriptor() {
@@ -92,18 +92,18 @@
     @Test public void testOmeletteCanHaveDifferentCheeseWithAFunnyComponentAdapter() {
         Map<String,Cheese> cheeseMap = new HashMap<String,Cheese>();
 
-        MutableContainer pico = new DefaultContainer(new ConstructorInjection());
-        pico.addComponent(Omelette.class);
-        pico.addAdapter(new CheeseAdapter("scott", Gouda.class, cheeseMap));
+        MutableContainer container = new DefaultContainer(new ConstructorInjection());
+        container.addComponent(Omelette.class);
+        container.addAdapter(new CheeseAdapter("scott", Gouda.class, cheeseMap));
 
         Cheese gouda = new Gouda();
         cheeseMap.put("cheese", gouda);
-        Omelette goudaOmelette = pico.getComponent(Omelette.class);
+        Omelette goudaOmelette = container.getComponent(Omelette.class);
         assertSame(gouda, goudaOmelette.getCheese());
 
         Cheese roquefort = new Roquefort();
         cheeseMap.put("cheese", roquefort);
-        Omelette roquefortOmelette = pico.getComponent(Omelette.class);
+        Omelette roquefortOmelette = container.getComponent(Omelette.class);
         assertSame(roquefort, roquefortOmelette.getCheese());
     }
 
@@ -156,16 +156,16 @@
     }
 
     @Test public void testMoreWeirdness() {
-        MutableContainer pico = new DefaultContainer();
+        MutableContainer container = new DefaultContainer();
         Map<String,String> map = new HashMap<String,String>();
-        pico.addComponent(map);
+        container.addComponent(map);
         // See class level javadoc in DefaultContainer - about precedence.
-        pico.addComponent(InterfaceX.class, Something.class);
-        pico.addComponent(Disabled.class);
-        pico.addComponent(Enabled.class);
-        pico.addComponent(NeedsInterfaceX.class);
+        container.addComponent(InterfaceX.class, Something.class);
+        container.addComponent(Disabled.class);
+        container.addComponent(Enabled.class);
+        container.addComponent(NeedsInterfaceX.class);
 
-        NeedsInterfaceX needsInterfaceX = pico.getComponent(NeedsInterfaceX.class);
+        NeedsInterfaceX needsInterfaceX = container.getComponent(NeedsInterfaceX.class);
         assertEquals("Disabled", needsInterfaceX.getIt());
         map.put("enabled", "blah");
         assertEquals("Enabled", needsInterfaceX.getIt());
@@ -189,12 +189,12 @@
     }
 
     @Test public void testJohnTalOne() {
-        MutableContainer picoContainer = new DefaultContainer();
+        MutableContainer containerContainer = new DefaultContainer();
 
-        picoContainer.addComponent("ABC", ABCImpl.class);
-        picoContainer.addComponent("DEF", DEFImpl.class);
+        containerContainer.addComponent("ABC", ABCImpl.class);
+        containerContainer.addComponent("DEF", DEFImpl.class);
 
-        assertEquals(ABCImpl.class, picoContainer.getComponent("ABC").getClass());
+        assertEquals(ABCImpl.class, containerContainer.getComponent("ABC").getClass());
     }
 
     public static interface Foo {
@@ -231,12 +231,12 @@
     }
 
     @Test public void testShouldBeAbleShareSameReferenceForDifferentTypes() {
-        MutableContainer pico = new DefaultContainer();
-        pico.as(Characteristics.CACHE).addComponent(FooBar.class);
-        pico.addComponent(NeedsFoo.class);
-        pico.addComponent(NeedsBar.class);
-        NeedsFoo needsFoo = pico.getComponent(NeedsFoo.class);
-        NeedsBar needsBar = pico.getComponent(NeedsBar.class);
+        MutableContainer container = new DefaultContainer();
+        container.as(Characteristics.CACHE).addComponent(FooBar.class);
+        container.addComponent(NeedsFoo.class);
+        container.addComponent(NeedsBar.class);
+        NeedsFoo needsFoo = container.getComponent(NeedsFoo.class);
+        NeedsBar needsBar = container.getComponent(NeedsBar.class);
         assertSame(needsFoo.getFoo(), needsBar.getBar());
     }
 

Modified: incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/defaults/XStreamSerialisationTestCase.java
URL: http://svn.apache.org/viewvc/incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/defaults/XStreamSerialisationTestCase.java?rev=614266&r1=614265&r2=614266&view=diff
==============================================================================
--- incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/defaults/XStreamSerialisationTestCase.java (original)
+++ incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/defaults/XStreamSerialisationTestCase.java Tue Jan 22 09:25:16 2008
@@ -35,38 +35,38 @@
 public final class XStreamSerialisationTestCase {
     private final XStream xStream = new XStream(new XppDriver());
 
-    @Test public void testShouldBeAbleToSerialiseEmptyPico() {
+    @Test public void testShouldBeAbleToSerialiseEmptyContainer() {
         if (JVM.is14()) {
-            MutableContainer pico = new DefaultContainer();
-            String picoXml = xStream.toXML(pico);
-            Container serializedPico = (Container) xStream.fromXML(picoXml);
+            MutableContainer container = new DefaultContainer();
+            String containerXml = xStream.toXML(container);
+            Container serializedContainer = (Container) xStream.fromXML(containerXml);
 
-            assertEquals(0, serializedPico.getComponents().size());
+            assertEquals(0, serializedContainer.getComponents().size());
         }
     }
 
-    @Test public void testShouldBeAbleToSerialisePicoWithUninstantiatedComponents() {
+    @Test public void testShouldBeAbleToSerialiseContainerWithUninstantiatedComponents() {
         if (JVM.is14()) {
-            MutableContainer pico = new DefaultContainer();
-            pico.addComponent(SimpleTouchable.class);
-            pico.addComponent(DependsOnTouchable.class);
-            String picoXml = xStream.toXML(pico);
-            Container serializedPico = (Container) xStream.fromXML(picoXml);
+            MutableContainer container = new DefaultContainer();
+            container.addComponent(SimpleTouchable.class);
+            container.addComponent(DependsOnTouchable.class);
+            String containerXml = xStream.toXML(container);
+            Container serializedContainer = (Container) xStream.fromXML(containerXml);
 
-            assertEquals(2, serializedPico.getComponents().size());
+            assertEquals(2, serializedContainer.getComponents().size());
         }
     }
 
-    @Test public void testShouldBeAbleToSerialisePicoWithInstantiatedComponents() {
+    @Test public void testShouldBeAbleToSerialiseContainerWithInstantiatedComponents() {
         if (JVM.is14()) {
-            MutableContainer pico = new DefaultContainer();
-            pico.addComponent(SimpleTouchable.class);
-            pico.addComponent(DependsOnTouchable.class);
-            pico.getComponents();
-            String picoXml = xStream.toXML(pico);
-            Container serializedPico = (Container) xStream.fromXML(picoXml);
+            MutableContainer container = new DefaultContainer();
+            container.addComponent(SimpleTouchable.class);
+            container.addComponent(DependsOnTouchable.class);
+            container.getComponents();
+            String containerXml = xStream.toXML(container);
+            Container serializedContainer = (Container) xStream.fromXML(containerXml);
 
-            assertEquals(2, serializedPico.getComponents().size());
+            assertEquals(2, serializedContainer.getComponents().size());
         }
     }
 }



Mime
View raw message