You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2006/11/21 22:49:12 UTC

svn commit: r477910 [3/9] - in /tapestry/tapestry5: tapestry-core/trunk/ tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/bindings/ tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/test/ tapestry-core/trunk/src/main/resource...

Copied: tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/LogSourceImplTest.java (from r477721, tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/ioc/internal/LogSourceImplTest.java)
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/LogSourceImplTest.java?view=diff&rev=477910&p1=tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/ioc/internal/LogSourceImplTest.java&r1=477721&p2=tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/LogSourceImplTest.java&r2=477910
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/ioc/internal/LogSourceImplTest.java (original)
+++ tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/LogSourceImplTest.java Tue Nov 21 13:48:47 2006
@@ -12,42 +12,37 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package org.apache.tapestry.ioc.internal;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.tapestry.internal.test.InternalBaseTestCase;
-import org.apache.tapestry.ioc.LogSource;
-import org.apache.tapestry.ioc.internal.LogSourceImpl;
-import org.testng.annotations.Test;
-
-/**
- * 
- */
-public class LogSourceImplTest extends InternalBaseTestCase
-{
-    @Test
-    public void get_by_class()
-    {
-        Class clazz = getClass();
-
-        Log expected = LogFactory.getLog(clazz);
-        LogSource logSource = new LogSourceImpl();
-        Log actual = logSource.getLog(clazz);
-
-        assertSame(actual, expected);
-    }
-
-    @Test
-    public void get_by_name()
-    {
-        String name = "foo.Bar";
-
-        Log expected = LogFactory.getLog(name);
-        LogSource logSource = new LogSourceImpl();
-        Log actual = logSource.getLog(name);
-
-        assertSame(actual, expected);
-
-    }
-}
+package org.apache.tapestry.ioc.internal;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.tapestry.ioc.LogSource;
+import org.testng.annotations.Test;
+
+public class LogSourceImplTest extends IOCInternalTestCase
+{
+    @Test
+    public void get_by_class()
+    {
+        Class clazz = getClass();
+
+        Log expected = LogFactory.getLog(clazz);
+        LogSource logSource = new LogSourceImpl();
+        Log actual = logSource.getLog(clazz);
+
+        assertSame(actual, expected);
+    }
+
+    @Test
+    public void get_by_name()
+    {
+        String name = "foo.Bar";
+
+        Log expected = LogFactory.getLog(name);
+        LogSource logSource = new LogSourceImpl();
+        Log actual = logSource.getLog(name);
+
+        assertSame(actual, expected);
+
+    }
+}

Copied: tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/ModuleImplTest.java (from r477721, tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/ioc/internal/ModuleImplTest.java)
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/ModuleImplTest.java?view=diff&rev=477910&p1=tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/ioc/internal/ModuleImplTest.java&r1=477721&p2=tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/ModuleImplTest.java&r2=477910
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/ioc/internal/ModuleImplTest.java (original)
+++ tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/ModuleImplTest.java Tue Nov 21 13:48:47 2006
@@ -12,311 +12,302 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package org.apache.tapestry.ioc.internal;
-
-import static org.easymock.EasyMock.contains;
-import static org.easymock.EasyMock.isA;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Set;
-
-import org.apache.commons.logging.Log;
-import org.apache.tapestry.internal.test.InternalBaseTestCase;
-import org.apache.tapestry.ioc.Registry;
-import org.apache.tapestry.ioc.RegistryBuilder;
-import org.apache.tapestry.ioc.def.DecoratorDef;
-import org.apache.tapestry.ioc.def.ModuleDef;
-import org.apache.tapestry.ioc.def.ServiceDef;
-import org.apache.tapestry.ioc.internal.DefaultModuleDefImpl;
-import org.apache.tapestry.ioc.internal.InternalRegistry;
-import org.apache.tapestry.ioc.internal.Module;
-import org.apache.tapestry.ioc.internal.ModuleImpl;
-import org.apache.tapestry.ioc.internal.SingletonServiceLifecycle;
+package org.apache.tapestry.ioc.internal;
+
+import static org.easymock.EasyMock.contains;
+import static org.easymock.EasyMock.isA;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.tapestry.ioc.Registry;
+import org.apache.tapestry.ioc.RegistryBuilder;
+import org.apache.tapestry.ioc.def.DecoratorDef;
+import org.apache.tapestry.ioc.def.ModuleDef;
+import org.apache.tapestry.ioc.def.ServiceDef;
 import org.apache.tapestry.ioc.internal.services.ClassFactoryImpl;
-import org.apache.tapestry.ioc.services.ClassFactory;
-import org.apache.tapestry.ioc.services.RegistryShutdownListener;
-import org.testng.annotations.Test;
-
-/**
- * 
- */
-public class ModuleImplTest extends InternalBaseTestCase
-{
-    @Test
-    public void get_service_by_id_exists()
-    {
-        InternalRegistry registry = newInternalRegistry();
-        Log log = newLog();
-        ClassFactory factory = new ClassFactoryImpl();
-
-        ModuleDef moduleDef = new DefaultModuleDefImpl(ModuleImplTestModule.class, log);
-
-        Module module = new ModuleImpl(registry, moduleDef, log);
-
-        train_getLog(registry, "ioc.test.Upcase", log);
-
-        train_isDebugEnabled(log, true);
-        log.debug("Creating service 'ioc.test.Upcase'.");
-
-        train_getLifecycle(registry, "singleton", new SingletonServiceLifecycle());
-
-        train_newClass(registry, factory, UpcaseService.class);
-
-        registry.addRegistryShutdownListener(isA(RegistryShutdownListener.class));
-
-        train_isDebugEnabled(log, false);
-
-        train_findDecoratorsForService(registry);
-
-        replay();
-
-        UpcaseService service = module.getService("ioc.test.Upcase", UpcaseService.class, module);
-
-        assertEquals(service.upcase("hello"), "HELLO");
-
-        verify();
-    }
-
-    protected final void train_newClass(InternalRegistry registry, ClassFactory factory,
-            Class serviceInterface)
-    {
-        registry.newClass(serviceInterface);
-        setReturnValue(factory.newClass(serviceInterface));
-    }
-
-    @Test
-    public void get_service_by_id_private()
-    {
-        InternalRegistry registry = newInternalRegistry();
-        Log log = newLog();
-        ClassFactory factory = new ClassFactoryImpl();
-
-        ModuleDef moduleDef = new DefaultModuleDefImpl(ModuleImplTestModule.class, log);
-
-        Module module = new ModuleImpl(registry, moduleDef, log);
-
-        train_getLog(registry, "ioc.test.PrivateUpcase", log);
-
-        train_isDebugEnabled(log, false);
-
-        train_getLifecycle(registry, "singleton", new SingletonServiceLifecycle());
-
-        train_newClass(registry, factory, UpcaseService.class);
-
-        registry.addRegistryShutdownListener(isA(RegistryShutdownListener.class));
-
-        train_isDebugEnabled(log, false);
-
-        train_findDecoratorsForService(registry);
-
-        replay();
-
-        UpcaseService service = module.getService(
-                "ioc.test.PrivateUpcase",
-                UpcaseService.class,
-                module);
-
-        assertEquals(service.upcase("hello"), "HELLO");
-
-        verify();
-    }
-
-    @Test
-    public void get_service_by_id_private_wrong_module()
-    {
-        InternalRegistry registry = newInternalRegistry();
-        Log log = newLog();
-
-        ModuleDef moduleDef = new DefaultModuleDefImpl(ModuleImplTestModule.class, log);
-
-        Module module = new ModuleImpl(registry, moduleDef, log);
-
-        replay();
-
-        try
-        {
-            module.getService("ioc.test.PrivateUpcase", UpcaseService.class, null);
-            unreachable();
-        }
-        catch (RuntimeException ex)
-        {
-            assertEquals(
-                    ex.getMessage(),
-                    "Service 'ioc.test.PrivateUpcase' is private, and may not be referenced outside of its containing module.");
-        }
-
-        verify();
-    }
-
-    @Test
-    public void find_service_ids_for_interface()
-    {
-        InternalRegistry registry = newInternalRegistry();
-        Log log = newLog();
-
-        ModuleDef moduleDef = new DefaultModuleDefImpl(ModuleImplTestModule.class, log);
-
-        Module module = new ModuleImpl(registry, moduleDef, log);
-
-        replay();
-
-        Collection<String> ids = module.findServiceIdsForInterface(UpcaseService.class, module);
-
-        assertEquals(ids.size(), 2);
-        assertTrue(ids.contains("ioc.test.Upcase"));
-        assertTrue(ids.contains("ioc.test.PrivateUpcase"));
-
-        ids = module.findServiceIdsForInterface(UpcaseService.class, null);
-        assertEquals(ids.size(), 1);
-        assertTrue(ids.contains("ioc.test.Upcase"));
-
-        verify();
-    }
-
-    @SuppressWarnings("unchecked")
-    @Test
-    public void find_decorator_defs_for_service()
-    {
-        InternalRegistry registry = newInternalRegistry();
-        ServiceDef serviceDef = newServiceDef();
-        DecoratorDef def1 = newDecoratorDef();
-        DecoratorDef def2 = newDecoratorDef();
-        Set<DecoratorDef> rawDefs = newMock(Set.class);
-        Log log = newLog();
-
-        ModuleDef moduleDef = newModuleDef();
-
-        moduleDef.getDecoratorDefs();
-        setReturnValue(rawDefs);
-
-        rawDefs.iterator();
-        setReturnValue(Arrays.asList(def1, def2).iterator());
-
-        train_matches(def1, serviceDef, false);
-        train_matches(def2, serviceDef, true);
-
-        replay();
-
-        Module module = new ModuleImpl(registry, moduleDef, log);
-
-        Set<DecoratorDef> defs = module.findMatchingDecoratorDefs(serviceDef);
-
-        assertEquals(defs.size(), 1);
-        assertTrue(defs.contains(def2));
-
-        verify();
-    }
-
-    @Test
-    public void get_module_id()
-    {
-        InternalRegistry registry = newInternalRegistry();
-        Log log = newLog();
-        ModuleDef def = newModuleDef();
-
-        train_getModuleId(def, "foo.bar");
-
-        replay();
-
-        Module module = new ModuleImpl(registry, def, log);
-
-        assertEquals(module.getModuleId(), "foo.bar");
-
-        verify();
-    }
-
-    @Test
-    public void no_public_constructor_on_module_builder_class()
-    {
-        InternalRegistry registry = newInternalRegistry();
-        Log log = newLog();
-        ModuleDef def = new DefaultModuleDefImpl(PrivateConstructorModule.class, log);
-
-        replay();
-
-        Module module = new ModuleImpl(registry, def, log);
-
-        try
-        {
-            module.getModuleBuilder();
-            unreachable();
-        }
-        catch (RuntimeException ex)
-        {
-            assertEquals(
-                    ex.getMessage(),
-                    "Module builder for module 'private' (class org.apache.tapestry.ioc.internal.PrivateConstructorModule) "
-                            + "does not contain any public constructors.");
-        }
-
-        verify();
-
-    }
-
-    @Test
-    public void too_many_public_constructors_on_module_builder_class()
-    {
-        InternalRegistry registry = newInternalRegistry();
-        Log log = newLog();
-        ModuleDef def = new DefaultModuleDefImpl(ExtraPublicConstructorsModule.class, log);
-        ClassFactory factory = newMock(ClassFactory.class);
-        Module module = new ModuleImpl(registry, def, log);
-
-        log.warn(contains("contains more than one public constructor"));
-
-        train_getService(registry, "tapestry.ioc.ClassFactory", ClassFactory.class, module, factory);
-
-        replay();
-
-        assertTrue(module.getModuleBuilder() instanceof ExtraPublicConstructorsModule);
-
-        verify();
-    }
-
-    private Registry buildRegistry()
-    {
-        RegistryBuilder builder = new RegistryBuilder();
-        builder.add(ModuleImplTestModule.class);
-
-        return builder.build();
-    }
-
-    /** The following tests work better as integration tests. */
-
-    @Test
-    public void integration_tests()
-    {
-        Registry registry = buildRegistry();
-
-        UpcaseService us = registry.getService(UpcaseService.class);
-
-        assertEquals(us.upcase("hello"), "HELLO");
-        assertEquals(
-                us.toString(),
-                "<Proxy for ioc.test.Upcase(org.apache.tapestry.ioc.internal.UpcaseService)>");
-
-        ToStringService ts = registry.getService(ToStringService.class);
-
-        assertEquals(ts.toString(), "<ToStringService: ioc.test.ToString>");
-    }
-
-    @Test
-    public void recursive_singleton_integration_test()
-    {
-        Registry registry = buildRegistry();
-
-        FoeService foe = registry.getService("ioc.test.RecursiveFoe", FoeService.class);
-
-        try
-        {
-            foe.foe();
-            unreachable();
-        }
-        catch (RuntimeException ex)
-        {
-            // The details are checked elsewhere.
-        }
-    }
-
-}
+import org.apache.tapestry.ioc.services.ClassFactory;
+import org.apache.tapestry.ioc.services.RegistryShutdownListener;
+import org.testng.annotations.Test;
+
+public class ModuleImplTest extends IOCInternalTestCase
+{
+    @Test
+    public void get_service_by_id_exists()
+    {
+        InternalRegistry registry = newInternalRegistry();
+        Log log = newLog();
+        ClassFactory factory = new ClassFactoryImpl();
+
+        ModuleDef moduleDef = new DefaultModuleDefImpl(ModuleImplTestModule.class, log);
+
+        Module module = new ModuleImpl(registry, moduleDef, log);
+
+        train_getLog(registry, "ioc.test.Upcase", log);
+
+        train_isDebugEnabled(log, true);
+        log.debug("Creating service 'ioc.test.Upcase'.");
+
+        train_getLifecycle(registry, "singleton", new SingletonServiceLifecycle());
+
+        train_newClass(registry, factory, UpcaseService.class);
+
+        registry.addRegistryShutdownListener(isA(RegistryShutdownListener.class));
+
+        train_isDebugEnabled(log, false);
+
+        train_findDecoratorsForService(registry);
+
+        replay();
+
+        UpcaseService service = module.getService("ioc.test.Upcase", UpcaseService.class, module);
+
+        assertEquals(service.upcase("hello"), "HELLO");
+
+        verify();
+    }
+
+    protected final void train_newClass(InternalRegistry registry, ClassFactory factory,
+            Class serviceInterface)
+    {
+        registry.newClass(serviceInterface);
+        setReturnValue(factory.newClass(serviceInterface));
+    }
+
+    @Test
+    public void get_service_by_id_private()
+    {
+        InternalRegistry registry = newInternalRegistry();
+        Log log = newLog();
+        ClassFactory factory = new ClassFactoryImpl();
+
+        ModuleDef moduleDef = new DefaultModuleDefImpl(ModuleImplTestModule.class, log);
+
+        Module module = new ModuleImpl(registry, moduleDef, log);
+
+        train_getLog(registry, "ioc.test.PrivateUpcase", log);
+
+        train_isDebugEnabled(log, false);
+
+        train_getLifecycle(registry, "singleton", new SingletonServiceLifecycle());
+
+        train_newClass(registry, factory, UpcaseService.class);
+
+        registry.addRegistryShutdownListener(isA(RegistryShutdownListener.class));
+
+        train_isDebugEnabled(log, false);
+
+        train_findDecoratorsForService(registry);
+
+        replay();
+
+        UpcaseService service = module.getService(
+                "ioc.test.PrivateUpcase",
+                UpcaseService.class,
+                module);
+
+        assertEquals(service.upcase("hello"), "HELLO");
+
+        verify();
+    }
+
+    @Test
+    public void get_service_by_id_private_wrong_module()
+    {
+        InternalRegistry registry = newInternalRegistry();
+        Log log = newLog();
+
+        ModuleDef moduleDef = new DefaultModuleDefImpl(ModuleImplTestModule.class, log);
+
+        Module module = new ModuleImpl(registry, moduleDef, log);
+
+        replay();
+
+        try
+        {
+            module.getService("ioc.test.PrivateUpcase", UpcaseService.class, null);
+            unreachable();
+        }
+        catch (RuntimeException ex)
+        {
+            assertEquals(
+                    ex.getMessage(),
+                    "Service 'ioc.test.PrivateUpcase' is private, and may not be referenced outside of its containing module.");
+        }
+
+        verify();
+    }
+
+    @Test
+    public void find_service_ids_for_interface()
+    {
+        InternalRegistry registry = newInternalRegistry();
+        Log log = newLog();
+
+        ModuleDef moduleDef = new DefaultModuleDefImpl(ModuleImplTestModule.class, log);
+
+        Module module = new ModuleImpl(registry, moduleDef, log);
+
+        replay();
+
+        Collection<String> ids = module.findServiceIdsForInterface(UpcaseService.class, module);
+
+        assertEquals(ids.size(), 2);
+        assertTrue(ids.contains("ioc.test.Upcase"));
+        assertTrue(ids.contains("ioc.test.PrivateUpcase"));
+
+        ids = module.findServiceIdsForInterface(UpcaseService.class, null);
+        assertEquals(ids.size(), 1);
+        assertTrue(ids.contains("ioc.test.Upcase"));
+
+        verify();
+    }
+
+    @SuppressWarnings("unchecked")
+    @Test
+    public void find_decorator_defs_for_service()
+    {
+        InternalRegistry registry = newInternalRegistry();
+        ServiceDef serviceDef = newServiceDef();
+        DecoratorDef def1 = newDecoratorDef();
+        DecoratorDef def2 = newDecoratorDef();
+        Set<DecoratorDef> rawDefs = newMock(Set.class);
+        Log log = newLog();
+
+        ModuleDef moduleDef = newModuleDef();
+
+        moduleDef.getDecoratorDefs();
+        setReturnValue(rawDefs);
+
+        rawDefs.iterator();
+        setReturnValue(Arrays.asList(def1, def2).iterator());
+
+        train_matches(def1, serviceDef, false);
+        train_matches(def2, serviceDef, true);
+
+        replay();
+
+        Module module = new ModuleImpl(registry, moduleDef, log);
+
+        Set<DecoratorDef> defs = module.findMatchingDecoratorDefs(serviceDef);
+
+        assertEquals(defs.size(), 1);
+        assertTrue(defs.contains(def2));
+
+        verify();
+    }
+
+    @Test
+    public void get_module_id()
+    {
+        InternalRegistry registry = newInternalRegistry();
+        Log log = newLog();
+        ModuleDef def = newModuleDef();
+
+        train_getModuleId(def, "foo.bar");
+
+        replay();
+
+        Module module = new ModuleImpl(registry, def, log);
+
+        assertEquals(module.getModuleId(), "foo.bar");
+
+        verify();
+    }
+
+    @Test
+    public void no_public_constructor_on_module_builder_class()
+    {
+        InternalRegistry registry = newInternalRegistry();
+        Log log = newLog();
+        ModuleDef def = new DefaultModuleDefImpl(PrivateConstructorModule.class, log);
+
+        replay();
+
+        Module module = new ModuleImpl(registry, def, log);
+
+        try
+        {
+            module.getModuleBuilder();
+            unreachable();
+        }
+        catch (RuntimeException ex)
+        {
+            assertEquals(
+                    ex.getMessage(),
+                    "Module builder for module 'private' (class org.apache.tapestry.ioc.internal.PrivateConstructorModule) "
+                            + "does not contain any public constructors.");
+        }
+
+        verify();
+
+    }
+
+    @Test
+    public void too_many_public_constructors_on_module_builder_class()
+    {
+        InternalRegistry registry = newInternalRegistry();
+        Log log = newLog();
+        ModuleDef def = new DefaultModuleDefImpl(ExtraPublicConstructorsModule.class, log);
+        ClassFactory factory = newMock(ClassFactory.class);
+        Module module = new ModuleImpl(registry, def, log);
+
+        log.warn(contains("contains more than one public constructor"));
+
+        train_getService(registry, "tapestry.ioc.ClassFactory", ClassFactory.class, module, factory);
+
+        replay();
+
+        assertTrue(module.getModuleBuilder() instanceof ExtraPublicConstructorsModule);
+
+        verify();
+    }
+
+    private Registry buildRegistry()
+    {
+        RegistryBuilder builder = new RegistryBuilder();
+        builder.add(ModuleImplTestModule.class);
+
+        return builder.build();
+    }
+
+    /** The following tests work better as integration tests. */
+
+    @Test
+    public void integration_tests()
+    {
+        Registry registry = buildRegistry();
+
+        UpcaseService us = registry.getService(UpcaseService.class);
+
+        assertEquals(us.upcase("hello"), "HELLO");
+        assertEquals(
+                us.toString(),
+                "<Proxy for ioc.test.Upcase(org.apache.tapestry.ioc.internal.UpcaseService)>");
+
+        ToStringService ts = registry.getService(ToStringService.class);
+
+        assertEquals(ts.toString(), "<ToStringService: ioc.test.ToString>");
+    }
+
+    @Test
+    public void recursive_singleton_integration_test()
+    {
+        Registry registry = buildRegistry();
+
+        FoeService foe = registry.getService("ioc.test.RecursiveFoe", FoeService.class);
+
+        try
+        {
+            foe.foe();
+            unreachable();
+        }
+        catch (RuntimeException ex)
+        {
+            // The details are checked elsewhere.
+        }
+    }
+
+}

Copied: tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/OneShotServiceCreatorTest.java (from r477721, tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/ioc/internal/OneShotServiceCreatorTest.java)
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/OneShotServiceCreatorTest.java?view=diff&rev=477910&p1=tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/ioc/internal/OneShotServiceCreatorTest.java&r1=477721&p2=tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/OneShotServiceCreatorTest.java&r2=477910
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/ioc/internal/OneShotServiceCreatorTest.java (original)
+++ tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/OneShotServiceCreatorTest.java Tue Nov 21 13:48:47 2006
@@ -16,14 +16,11 @@
 
 import java.lang.reflect.Method;
 
-import org.apache.tapestry.internal.test.InternalBaseTestCase;
 import org.apache.tapestry.ioc.ObjectCreator;
 import org.apache.tapestry.ioc.def.ServiceDef;
-import org.apache.tapestry.ioc.internal.OneShotServiceCreator;
-import org.apache.tapestry.ioc.internal.ServiceDefImpl;
 import org.testng.annotations.Test;
 
-public class OneShotServiceCreatorTest extends InternalBaseTestCase
+public class OneShotServiceCreatorTest extends IOCInternalTestCase
 {
     @Test
     public void ensure_only_called_once() throws Exception

Copied: tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/ServiceBuilderMethodInvokerTest.java (from r477721, tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/ioc/internal/ServiceBuilderMethodInvokerTest.java)
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/ServiceBuilderMethodInvokerTest.java?view=diff&rev=477910&p1=tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/ioc/internal/ServiceBuilderMethodInvokerTest.java&r1=477721&p2=tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/ServiceBuilderMethodInvokerTest.java&r2=477910
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/ioc/internal/ServiceBuilderMethodInvokerTest.java (original)
+++ tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/ServiceBuilderMethodInvokerTest.java Tue Nov 21 13:48:47 2006
@@ -12,361 +12,355 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package org.apache.tapestry.ioc.internal;
-
+package org.apache.tapestry.ioc.internal;
+
 import static org.apache.tapestry.ioc.internal.ServiceBuilderMethodInvoker.findParameterizedTypeFromGenericType;
-
-import java.lang.reflect.Method;
-import java.lang.reflect.Type;
-import java.util.Collection;
-import java.util.List;
-
-import org.apache.commons.logging.Log;
-import org.apache.tapestry.internal.test.InternalBaseTestCase;
-import org.apache.tapestry.ioc.ObjectCreator;
-import org.apache.tapestry.ioc.ServiceBuilderResources;
-import org.apache.tapestry.ioc.internal.IOCMessages;
-import org.apache.tapestry.ioc.internal.ServiceBuilderMethodInvoker;
-import org.testng.Assert;
-import org.testng.annotations.Test;
-
-/**
- * 
- */
-public class ServiceBuilderMethodInvokerTest extends InternalBaseTestCase
-{
-    private static final String SERVICE_ID = "ioc.Fie";
-
-    @Test
-    public void noargs_method()
-    {
-        ServiceBuilderMethodFixture fixture = new ServiceBuilderMethodFixture();
-        ServiceBuilderResources resources = newServiceCreatorResources();
-        Log log = newLog();
-
-        fixture._fie = newFieService();
-
-        trainForConstructor(resources, log);
-
-        train_getModuleBuilder(resources, fixture);
-
-        train_isDebugEnabled(log, false);
-
-        replay();
-
-        ObjectCreator sc = new ServiceBuilderMethodInvoker(findMethod(fixture, "build_noargs"),
-                resources);
-
-        Object actual = sc.createObject();
-
-        assertSame(actual, fixture._fie);
-
-        verify();
-    }
-
-    private void trainForConstructor(ServiceBuilderResources resources, Log log)
-    {
-        train_getServiceId(resources, SERVICE_ID);
-
-        train_getServiceLog(resources, log);
-
-        train_getServiceInterface(resources, FieService.class);
-    }
-
-    @Test
-    public void method_with_args()
-    {
-        ServiceBuilderMethodFixture fixture = new ServiceBuilderMethodFixture();
-        Method method = findMethod(fixture, "build_args");
-        ServiceBuilderResources resources = newServiceCreatorResources();
-
-        Log log = newLog();
-
-        fixture._expectedServiceId = SERVICE_ID;
-        fixture._expectedServiceInterface = FieService.class;
-        fixture._expectedServiceResources = resources;
-        fixture._expectedLog = log;
-
-        fixture._fie = newFieService();
-
-        trainForConstructor(resources, log);
-
-        train_getModuleBuilder(resources, fixture);
-
-        train_isDebugEnabled(log, true);
-
-        log.debug(IOCMessages.invokingMethod(method));
-
-        replay();
-
-        ObjectCreator sc = new ServiceBuilderMethodInvoker(method, resources);
-
-        Object actual = sc.createObject();
-
-        assertSame(actual, fixture._fie);
-
-        verify();
-    }
-
-    @Test
-    public void injected_service_method()
-    {
-        ServiceBuilderMethodFixture fixture = new ServiceBuilderMethodFixture();
-        ServiceBuilderResources resources = newServiceCreatorResources();
-        Log log = newLog();
-
-        fixture._fie = newFieService();
-        fixture._expectedFoe = newFoe();
-
-        trainForConstructor(resources, log);
-
-        train_getModuleBuilder(resources, fixture);
-
-        train_getService(resources, "Foe", FoeService.class, fixture._expectedFoe);
-
-        train_isDebugEnabled(log, false);
-
-        replay();
-
-        ObjectCreator sc = new ServiceBuilderMethodInvoker(findMethod(fixture, "build_injected"),
-                resources);
-
-        Object actual = sc.createObject();
-
-        assertSame(actual, fixture._fie);
-
-        verify();
-    }
-
-    @Test
-    public void injected_ordered_collection()
-    {
-        ServiceBuilderMethodFixture fixture = new ServiceBuilderMethodFixture();
-        ServiceBuilderResources resources = newServiceCreatorResources();
-        Log log = newLog();
-
-        fixture._fie = newFieService();
-        fixture._expectedConfiguration = newMock(List.class);
-
-        trainForConstructor(resources, log);
-
-        train_getModuleBuilder(resources, fixture);
-
-        resources.getOrderedConfiguration(Runnable.class);
-        setReturnValue(fixture._expectedConfiguration);
-
-        train_isDebugEnabled(log, false);
-
-        replay();
-
-        ObjectCreator sc = new ServiceBuilderMethodInvoker(findMethod(
-                fixture,
-                "buildWithOrderedConfiguration"), resources);
-
-        Object actual = sc.createObject();
-
-        assertSame(actual, fixture._fie);
-
-        verify();
-
-    }
-
-    @Test
-    public void injected_unordered_collection()
-    {
-        ServiceBuilderMethodFixture fixture = new ServiceBuilderMethodFixture();
-        ServiceBuilderResources resources = newServiceCreatorResources();
-        Log log = newLog();
-
-        fixture._fie = newFieService();
-        fixture._expectedConfiguration = newMock(Collection.class);
-
-        trainForConstructor(resources, log);
-
-        train_getModuleBuilder(resources, fixture);
-
-        resources.getUnorderedConfiguration(Runnable.class);
-        setReturnValue(fixture._expectedConfiguration);
-
-        train_isDebugEnabled(log, false);
-
-        replay();
-
-        ObjectCreator sc = new ServiceBuilderMethodInvoker(findMethod(
-                fixture,
-                "buildWithUnorderedConfiguration"), resources);
-
-        Object actual = sc.createObject();
-
-        assertSame(actual, fixture._fie);
-
-        verify();
-    }
-
-    private FoeService newFoe()
-    {
-        return newFoeService();
-    }
-
-    @Test
-    public void builder_method_returns_null()
-    {
-        ServiceBuilderMethodFixture fixture = new ServiceBuilderMethodFixture();
-        ServiceBuilderResources resources = newServiceCreatorResources();
-        Log log = newLog();
-
-        trainForConstructor(resources, log);
-
-        train_getModuleBuilder(resources, fixture);
-
-        train_isDebugEnabled(log, false);
-
-        replay();
-
-        ObjectCreator sc = new ServiceBuilderMethodInvoker(findMethod(fixture, "build_noargs"),
-                resources);
-
-        try
-        {
-            sc.createObject();
-            unreachable();
-        }
-        catch (RuntimeException ex)
-        {
-            Assert.assertEquals(ex.getMessage(), "Builder method "
-                    + ServiceBuilderMethodFixture.class.getName() + ".build_noargs() "
-                    + "(for service 'ioc.Fie') returned null.");
-        }
-
-        verify();
-    }
-
-    @Test
-    public void builder_method_failed()
-    {
-        ServiceBuilderMethodFixture fixture = new ServiceBuilderMethodFixture();
-        ServiceBuilderResources resources = newServiceCreatorResources();
-        Log log = newLog();
-
-        trainForConstructor(resources, log);
-
-        train_getModuleBuilder(resources, fixture);
-
-        train_isDebugEnabled(log, false);
-
-        replay();
-
-        ObjectCreator sc = new ServiceBuilderMethodInvoker(findMethod(fixture, "build_fail"),
-                resources);
-
-        try
-        {
-            sc.createObject();
-            unreachable();
-        }
-        catch (RuntimeException ex)
-        {
-            assertEquals(ex.getMessage(), "Error invoking service builder method "
-                    + ServiceBuilderMethodFixture.class.getName() + ".build_fail() "
-                    + "(for service 'ioc.Fie'): Method failed.");
-
-            Throwable cause = ex.getCause();
-
-            assertEquals(cause.getMessage(), "Method failed.");
-        }
-
-        verify();
-    }
-
-    @Test
-    public void auto_dependency()
-    {
-        ServiceBuilderMethodFixture fixture = new ServiceBuilderMethodFixture();
-        Method method = findMethod(fixture, "build_auto");
-
-        ServiceBuilderResources resources = newServiceCreatorResources();
-        Log log = newLog();
-
-        fixture._fie = newFieService();
-        fixture._expectedFoe = newFoeService();
-
-        trainForConstructor(resources, log);
-
-        train_getModuleBuilder(resources, fixture);
-
-        train_getService(resources, FoeService.class, fixture._expectedFoe);
-
-        train_isDebugEnabled(log, false);
-
-        replay();
-
-        ObjectCreator sc = new ServiceBuilderMethodInvoker(method, resources);
-
-        Object actual = sc.createObject();
-
-        verify();
-
-        assertSame(actual, fixture._fie);
-    }
-
-    protected final void train_getModuleBuilder(ServiceBuilderResources resources,
-            Object moduleBuilder)
-    {
-        resources.getModuleBuilder();
-        setReturnValue(moduleBuilder);
-    }
-
-    @Test
-    public void parameterized_type_of_generic_parameter()
-    {
-        Method m = findMethod(ServiceBuilderMethodFixture.class, "methodWithParameterizedList");
-
-        assertEquals(m.getParameterTypes()[0], List.class);
-        Type type = m.getGenericParameterTypes()[0];
-
-        assertEquals(type.toString(), "java.util.List<java.lang.Runnable>");
-        assertEquals(findParameterizedTypeFromGenericType(type), Runnable.class);
-    }
-
-    @Test
-    public void parameterized_type_of_nongeneric_parameter()
-    {
-        Method m = findMethod(ServiceBuilderMethodFixture.class, "methodWithList");
-
-        assertEquals(m.getParameterTypes()[0], List.class);
-        Type type = m.getGenericParameterTypes()[0];
-
-        assertEquals(type.toString(), "interface java.util.List");
-        assertEquals(findParameterizedTypeFromGenericType(type), Object.class);
-    }
-
-    @Test
-    public void parameterize_type_for_non_supported_type()
-    {
-        Method m = findMethod(ServiceBuilderMethodFixture.class, "methodWithWildcardList");
-
-        assertEquals(m.getParameterTypes()[0], List.class);
-        Type type = m.getGenericParameterTypes()[0];
-
-        try
-        {
-            findParameterizedTypeFromGenericType(type);
-            unreachable();
-        }
-        catch (IllegalArgumentException ex)
-        {
-            assertEquals(ex.getMessage(), IOCMessages.genericTypeNotSupported(type));
-        }
-    }
-
-    private FoeService newFoeService()
-    {
-        return newMock(FoeService.class);
-    }
-
-    private FieService newFieService()
-    {
-        return newMock(FieService.class);
-    }
-
-}
+
+import java.lang.reflect.Method;
+import java.lang.reflect.Type;
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.commons.logging.Log;
+import org.apache.tapestry.ioc.ObjectCreator;
+import org.apache.tapestry.ioc.ServiceBuilderResources;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+public class ServiceBuilderMethodInvokerTest extends IOCInternalTestCase
+{
+    private static final String SERVICE_ID = "ioc.Fie";
+
+    @Test
+    public void noargs_method()
+    {
+        ServiceBuilderMethodFixture fixture = new ServiceBuilderMethodFixture();
+        ServiceBuilderResources resources = newServiceCreatorResources();
+        Log log = newLog();
+
+        fixture._fie = newFieService();
+
+        trainForConstructor(resources, log);
+
+        train_getModuleBuilder(resources, fixture);
+
+        train_isDebugEnabled(log, false);
+
+        replay();
+
+        ObjectCreator sc = new ServiceBuilderMethodInvoker(findMethod(fixture, "build_noargs"),
+                resources);
+
+        Object actual = sc.createObject();
+
+        assertSame(actual, fixture._fie);
+
+        verify();
+    }
+
+    private void trainForConstructor(ServiceBuilderResources resources, Log log)
+    {
+        train_getServiceId(resources, SERVICE_ID);
+
+        train_getServiceLog(resources, log);
+
+        train_getServiceInterface(resources, FieService.class);
+    }
+
+    @Test
+    public void method_with_args()
+    {
+        ServiceBuilderMethodFixture fixture = new ServiceBuilderMethodFixture();
+        Method method = findMethod(fixture, "build_args");
+        ServiceBuilderResources resources = newServiceCreatorResources();
+
+        Log log = newLog();
+
+        fixture._expectedServiceId = SERVICE_ID;
+        fixture._expectedServiceInterface = FieService.class;
+        fixture._expectedServiceResources = resources;
+        fixture._expectedLog = log;
+
+        fixture._fie = newFieService();
+
+        trainForConstructor(resources, log);
+
+        train_getModuleBuilder(resources, fixture);
+
+        train_isDebugEnabled(log, true);
+
+        log.debug(IOCMessages.invokingMethod(method));
+
+        replay();
+
+        ObjectCreator sc = new ServiceBuilderMethodInvoker(method, resources);
+
+        Object actual = sc.createObject();
+
+        assertSame(actual, fixture._fie);
+
+        verify();
+    }
+
+    @Test
+    public void injected_service_method()
+    {
+        ServiceBuilderMethodFixture fixture = new ServiceBuilderMethodFixture();
+        ServiceBuilderResources resources = newServiceCreatorResources();
+        Log log = newLog();
+
+        fixture._fie = newFieService();
+        fixture._expectedFoe = newFoe();
+
+        trainForConstructor(resources, log);
+
+        train_getModuleBuilder(resources, fixture);
+
+        train_getService(resources, "Foe", FoeService.class, fixture._expectedFoe);
+
+        train_isDebugEnabled(log, false);
+
+        replay();
+
+        ObjectCreator sc = new ServiceBuilderMethodInvoker(findMethod(fixture, "build_injected"),
+                resources);
+
+        Object actual = sc.createObject();
+
+        assertSame(actual, fixture._fie);
+
+        verify();
+    }
+
+    @Test
+    public void injected_ordered_collection()
+    {
+        ServiceBuilderMethodFixture fixture = new ServiceBuilderMethodFixture();
+        ServiceBuilderResources resources = newServiceCreatorResources();
+        Log log = newLog();
+
+        fixture._fie = newFieService();
+        fixture._expectedConfiguration = newMock(List.class);
+
+        trainForConstructor(resources, log);
+
+        train_getModuleBuilder(resources, fixture);
+
+        resources.getOrderedConfiguration(Runnable.class);
+        setReturnValue(fixture._expectedConfiguration);
+
+        train_isDebugEnabled(log, false);
+
+        replay();
+
+        ObjectCreator sc = new ServiceBuilderMethodInvoker(findMethod(
+                fixture,
+                "buildWithOrderedConfiguration"), resources);
+
+        Object actual = sc.createObject();
+
+        assertSame(actual, fixture._fie);
+
+        verify();
+
+    }
+
+    @Test
+    public void injected_unordered_collection()
+    {
+        ServiceBuilderMethodFixture fixture = new ServiceBuilderMethodFixture();
+        ServiceBuilderResources resources = newServiceCreatorResources();
+        Log log = newLog();
+
+        fixture._fie = newFieService();
+        fixture._expectedConfiguration = newMock(Collection.class);
+
+        trainForConstructor(resources, log);
+
+        train_getModuleBuilder(resources, fixture);
+
+        resources.getUnorderedConfiguration(Runnable.class);
+        setReturnValue(fixture._expectedConfiguration);
+
+        train_isDebugEnabled(log, false);
+
+        replay();
+
+        ObjectCreator sc = new ServiceBuilderMethodInvoker(findMethod(
+                fixture,
+                "buildWithUnorderedConfiguration"), resources);
+
+        Object actual = sc.createObject();
+
+        assertSame(actual, fixture._fie);
+
+        verify();
+    }
+
+    private FoeService newFoe()
+    {
+        return newFoeService();
+    }
+
+    @Test
+    public void builder_method_returns_null()
+    {
+        ServiceBuilderMethodFixture fixture = new ServiceBuilderMethodFixture();
+        ServiceBuilderResources resources = newServiceCreatorResources();
+        Log log = newLog();
+
+        trainForConstructor(resources, log);
+
+        train_getModuleBuilder(resources, fixture);
+
+        train_isDebugEnabled(log, false);
+
+        replay();
+
+        ObjectCreator sc = new ServiceBuilderMethodInvoker(findMethod(fixture, "build_noargs"),
+                resources);
+
+        try
+        {
+            sc.createObject();
+            unreachable();
+        }
+        catch (RuntimeException ex)
+        {
+            Assert.assertEquals(ex.getMessage(), "Builder method "
+                    + ServiceBuilderMethodFixture.class.getName() + ".build_noargs() "
+                    + "(for service 'ioc.Fie') returned null.");
+        }
+
+        verify();
+    }
+
+    @Test
+    public void builder_method_failed()
+    {
+        ServiceBuilderMethodFixture fixture = new ServiceBuilderMethodFixture();
+        ServiceBuilderResources resources = newServiceCreatorResources();
+        Log log = newLog();
+
+        trainForConstructor(resources, log);
+
+        train_getModuleBuilder(resources, fixture);
+
+        train_isDebugEnabled(log, false);
+
+        replay();
+
+        ObjectCreator sc = new ServiceBuilderMethodInvoker(findMethod(fixture, "build_fail"),
+                resources);
+
+        try
+        {
+            sc.createObject();
+            unreachable();
+        }
+        catch (RuntimeException ex)
+        {
+            assertEquals(ex.getMessage(), "Error invoking service builder method "
+                    + ServiceBuilderMethodFixture.class.getName() + ".build_fail() "
+                    + "(for service 'ioc.Fie'): Method failed.");
+
+            Throwable cause = ex.getCause();
+
+            assertEquals(cause.getMessage(), "Method failed.");
+        }
+
+        verify();
+    }
+
+    @Test
+    public void auto_dependency()
+    {
+        ServiceBuilderMethodFixture fixture = new ServiceBuilderMethodFixture();
+        Method method = findMethod(fixture, "build_auto");
+
+        ServiceBuilderResources resources = newServiceCreatorResources();
+        Log log = newLog();
+
+        fixture._fie = newFieService();
+        fixture._expectedFoe = newFoeService();
+
+        trainForConstructor(resources, log);
+
+        train_getModuleBuilder(resources, fixture);
+
+        train_getService(resources, FoeService.class, fixture._expectedFoe);
+
+        train_isDebugEnabled(log, false);
+
+        replay();
+
+        ObjectCreator sc = new ServiceBuilderMethodInvoker(method, resources);
+
+        Object actual = sc.createObject();
+
+        verify();
+
+        assertSame(actual, fixture._fie);
+    }
+
+    protected final void train_getModuleBuilder(ServiceBuilderResources resources,
+            Object moduleBuilder)
+    {
+        resources.getModuleBuilder();
+        setReturnValue(moduleBuilder);
+    }
+
+    @Test
+    public void parameterized_type_of_generic_parameter()
+    {
+        Method m = findMethod(ServiceBuilderMethodFixture.class, "methodWithParameterizedList");
+
+        assertEquals(m.getParameterTypes()[0], List.class);
+        Type type = m.getGenericParameterTypes()[0];
+
+        assertEquals(type.toString(), "java.util.List<java.lang.Runnable>");
+        assertEquals(findParameterizedTypeFromGenericType(type), Runnable.class);
+    }
+
+    @Test
+    public void parameterized_type_of_nongeneric_parameter()
+    {
+        Method m = findMethod(ServiceBuilderMethodFixture.class, "methodWithList");
+
+        assertEquals(m.getParameterTypes()[0], List.class);
+        Type type = m.getGenericParameterTypes()[0];
+
+        assertEquals(type.toString(), "interface java.util.List");
+        assertEquals(findParameterizedTypeFromGenericType(type), Object.class);
+    }
+
+    @Test
+    public void parameterize_type_for_non_supported_type()
+    {
+        Method m = findMethod(ServiceBuilderMethodFixture.class, "methodWithWildcardList");
+
+        assertEquals(m.getParameterTypes()[0], List.class);
+        Type type = m.getGenericParameterTypes()[0];
+
+        try
+        {
+            findParameterizedTypeFromGenericType(type);
+            unreachable();
+        }
+        catch (IllegalArgumentException ex)
+        {
+            assertEquals(ex.getMessage(), IOCMessages.genericTypeNotSupported(type));
+        }
+    }
+
+    private FoeService newFoeService()
+    {
+        return newMock(FoeService.class);
+    }
+
+    private FieService newFieService()
+    {
+        return newMock(FieService.class);
+    }
+
+}

Copied: tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/ServiceDecoratorImplTest.java (from r477721, tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/ioc/internal/ServiceDecoratorImplTest.java)
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/ServiceDecoratorImplTest.java?view=diff&rev=477910&p1=tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/ioc/internal/ServiceDecoratorImplTest.java&r1=477721&p2=tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/ServiceDecoratorImplTest.java&r2=477910
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/ioc/internal/ServiceDecoratorImplTest.java (original)
+++ tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/ServiceDecoratorImplTest.java Tue Nov 21 13:48:47 2006
@@ -12,182 +12,176 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package org.apache.tapestry.ioc.internal;
-
-import java.lang.reflect.Method;
-
-import org.apache.commons.logging.Log;
-import org.apache.tapestry.internal.test.InternalBaseTestCase;
-import org.apache.tapestry.ioc.ModuleBuilderSource;
-import org.apache.tapestry.ioc.ServiceResources;
-import org.apache.tapestry.ioc.internal.IOCMessages;
-import org.apache.tapestry.ioc.internal.ServiceDecoratorImpl;
-import org.testng.annotations.Test;
-
-/**
- * 
- */
-public class ServiceDecoratorImplTest extends InternalBaseTestCase
-{
-    private static final String SERVICE_ID = "ioc.Fie";
-
-    private ModuleBuilderSource newSource(final Object builder)
-    {
-        return new ModuleBuilderSource()
-        {
-            public Object getModuleBuilder()
-            {
-                return builder;
-            }
-        };
-    }
-
-    /**
-     * Also, test logging of decorator method invocation.
-     * 
-     * @throws Exception
-     */
-    @Test
-    public void decorator_returns_interceptor() throws Exception
-    {
-        ServiceDecoratorFixture fixture = new ServiceDecoratorFixture();
-        Method m = findMethod(fixture, "decoratorReturnsInterceptor");
-
-        ServiceResources resources = newServiceResources();
-        Log log = newLog();
-        fixture._expectedDelegate = newFieService();
-        fixture._interceptorToReturn = newFieService();
-        ModuleBuilderSource source = newSource(fixture);
-
-        trainForConstructor(resources, log);
-
-        train_isDebugEnabled(log, true);
-
-        log.debug(IOCMessages.invokingMethod(m));
-
-        replay();
-
-        // Check that the delegate gets passed in; check that the return value of the
-        // decorator method is the return value of the ServiceDecorator.
-
-        ServiceDecoratorImpl decorator = new ServiceDecoratorImpl(m, source, resources);
-
-        Object interceptor = decorator.createInterceptor(fixture._expectedDelegate);
-
-        assertSame(interceptor, fixture._interceptorToReturn);
-
-        verify();
-    }
-
-    @Test
-    public void decorator_returns_null_interceptor() throws Exception
-    {
-        ServiceDecoratorFixture fixture = new ServiceDecoratorFixture();
-        ModuleBuilderSource source = newSource(fixture);
-        ServiceResources resources = newServiceResources();
-        Log log = newLog();
-        Object delegate = newFieService();
-
-        trainForConstructor(resources, log);
-
-        train_isDebugEnabled(log, false);
-
-        replay();
-
-        Method m = findMethod(fixture, "decorateReturnNull");
-
-        ServiceDecoratorImpl decorator = new ServiceDecoratorImpl(m, source, resources);
-
-        Object interceptor = decorator.createInterceptor(delegate);
-
-        assertNull(interceptor);
-
-        verify();
-    }
-
-    @Test
-    public void decorator_returns_incorrect_type() throws Exception
-    {
-        ServiceDecoratorFixture fixture = new ServiceDecoratorFixture();
-        ModuleBuilderSource source = newSource(fixture);
-        ServiceResources resources = newServiceResources();
-        Log log = newLog();
-        fixture._expectedDelegate = newFieService();
-        fixture._interceptorToReturn = newMock(FoeService.class);
-
-        Method m = findMethod(fixture, "decoratorUntyped");
-
-        trainForConstructor(resources, log);
-
-        train_isDebugEnabled(log, false);
-
-        log.warn(IOCMessages.decoratorReturnedWrongType(
-                m,
-                SERVICE_ID,
-                fixture._interceptorToReturn,
-                FieService.class), null);
-
-        replay();
-
-        ServiceDecoratorImpl decorator = new ServiceDecoratorImpl(m, source, resources);
-
-        Object interceptor = decorator.createInterceptor(fixture._expectedDelegate);
-
-        assertNull(interceptor);
-
-        verify();
-    }
-
-    @Test
-    public void decorator_method_throws_exception() throws Exception
-    {
-        ServiceDecoratorFixture fixture = new ServiceDecoratorFixture();
-        ModuleBuilderSource source = newSource(fixture);
-        ServiceResources resources = newServiceResources();
-        Log log = newLog();
-        Object delegate = newFieService();
-        fixture._exception = new RuntimeException("Ouch!");
-
-        trainForConstructor(resources, log);
-
-        train_isDebugEnabled(log, false);
-
-        replay();
-
-        Method m = findMethod(fixture, "decoratorThrowsException");
-
-        ServiceDecoratorImpl decorator = new ServiceDecoratorImpl(m, source, resources);
-
-        try
-        {
-            decorator.createInterceptor(delegate);
-            unreachable();
-        }
-        catch (RuntimeException ex)
-        {
-            assertEquals(ex.getMessage(), IOCMessages.decoratorMethodError(m, SERVICE_ID, ex
-                    .getCause()));
-
-            Throwable cause = ex.getCause();
-
-            assertSame(cause, fixture._exception);
-        }
-
-        verify();
-    }
-
-    private FieService newFieService()
-    {
-        return newMock(FieService.class);
-    }
-
-    private void trainForConstructor(ServiceResources resources, Log log)
-    {
-        train_getServiceId(resources, SERVICE_ID);
-
-        train_getServiceInterface(resources, FieService.class);
-
-        train_getServiceLog(resources, log);
-    }
-
-}
+package org.apache.tapestry.ioc.internal;
+
+import java.lang.reflect.Method;
+
+import org.apache.commons.logging.Log;
+import org.apache.tapestry.ioc.ModuleBuilderSource;
+import org.apache.tapestry.ioc.ServiceResources;
+import org.testng.annotations.Test;
+
+public class ServiceDecoratorImplTest extends IOCInternalTestCase
+{
+    private static final String SERVICE_ID = "ioc.Fie";
+
+    private ModuleBuilderSource newSource(final Object builder)
+    {
+        return new ModuleBuilderSource()
+        {
+            public Object getModuleBuilder()
+            {
+                return builder;
+            }
+        };
+    }
+
+    /**
+     * Also, test logging of decorator method invocation.
+     * 
+     * @throws Exception
+     */
+    @Test
+    public void decorator_returns_interceptor() throws Exception
+    {
+        ServiceDecoratorFixture fixture = new ServiceDecoratorFixture();
+        Method m = findMethod(fixture, "decoratorReturnsInterceptor");
+
+        ServiceResources resources = newServiceResources();
+        Log log = newLog();
+        fixture._expectedDelegate = newFieService();
+        fixture._interceptorToReturn = newFieService();
+        ModuleBuilderSource source = newSource(fixture);
+
+        trainForConstructor(resources, log);
+
+        train_isDebugEnabled(log, true);
+
+        log.debug(IOCMessages.invokingMethod(m));
+
+        replay();
+
+        // Check that the delegate gets passed in; check that the return value of the
+        // decorator method is the return value of the ServiceDecorator.
+
+        ServiceDecoratorImpl decorator = new ServiceDecoratorImpl(m, source, resources);
+
+        Object interceptor = decorator.createInterceptor(fixture._expectedDelegate);
+
+        assertSame(interceptor, fixture._interceptorToReturn);
+
+        verify();
+    }
+
+    @Test
+    public void decorator_returns_null_interceptor() throws Exception
+    {
+        ServiceDecoratorFixture fixture = new ServiceDecoratorFixture();
+        ModuleBuilderSource source = newSource(fixture);
+        ServiceResources resources = newServiceResources();
+        Log log = newLog();
+        Object delegate = newFieService();
+
+        trainForConstructor(resources, log);
+
+        train_isDebugEnabled(log, false);
+
+        replay();
+
+        Method m = findMethod(fixture, "decorateReturnNull");
+
+        ServiceDecoratorImpl decorator = new ServiceDecoratorImpl(m, source, resources);
+
+        Object interceptor = decorator.createInterceptor(delegate);
+
+        assertNull(interceptor);
+
+        verify();
+    }
+
+    @Test
+    public void decorator_returns_incorrect_type() throws Exception
+    {
+        ServiceDecoratorFixture fixture = new ServiceDecoratorFixture();
+        ModuleBuilderSource source = newSource(fixture);
+        ServiceResources resources = newServiceResources();
+        Log log = newLog();
+        fixture._expectedDelegate = newFieService();
+        fixture._interceptorToReturn = newMock(FoeService.class);
+
+        Method m = findMethod(fixture, "decoratorUntyped");
+
+        trainForConstructor(resources, log);
+
+        train_isDebugEnabled(log, false);
+
+        log.warn(IOCMessages.decoratorReturnedWrongType(
+                m,
+                SERVICE_ID,
+                fixture._interceptorToReturn,
+                FieService.class), null);
+
+        replay();
+
+        ServiceDecoratorImpl decorator = new ServiceDecoratorImpl(m, source, resources);
+
+        Object interceptor = decorator.createInterceptor(fixture._expectedDelegate);
+
+        assertNull(interceptor);
+
+        verify();
+    }
+
+    @Test
+    public void decorator_method_throws_exception() throws Exception
+    {
+        ServiceDecoratorFixture fixture = new ServiceDecoratorFixture();
+        ModuleBuilderSource source = newSource(fixture);
+        ServiceResources resources = newServiceResources();
+        Log log = newLog();
+        Object delegate = newFieService();
+        fixture._exception = new RuntimeException("Ouch!");
+
+        trainForConstructor(resources, log);
+
+        train_isDebugEnabled(log, false);
+
+        replay();
+
+        Method m = findMethod(fixture, "decoratorThrowsException");
+
+        ServiceDecoratorImpl decorator = new ServiceDecoratorImpl(m, source, resources);
+
+        try
+        {
+            decorator.createInterceptor(delegate);
+            unreachable();
+        }
+        catch (RuntimeException ex)
+        {
+            assertEquals(ex.getMessage(), IOCMessages.decoratorMethodError(m, SERVICE_ID, ex
+                    .getCause()));
+
+            Throwable cause = ex.getCause();
+
+            assertSame(cause, fixture._exception);
+        }
+
+        verify();
+    }
+
+    private FieService newFieService()
+    {
+        return newMock(FieService.class);
+    }
+
+    private void trainForConstructor(ServiceResources resources, Log log)
+    {
+        train_getServiceId(resources, SERVICE_ID);
+
+        train_getServiceInterface(resources, FieService.class);
+
+        train_getServiceLog(resources, log);
+    }
+
+}

Copied: tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/SingletonServiceLifecycleTest.java (from r477721, tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/ioc/internal/SingletonServiceLifecycleTest.java)
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/SingletonServiceLifecycleTest.java?view=diff&rev=477910&p1=tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/ioc/internal/SingletonServiceLifecycleTest.java&r1=477721&p2=tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/SingletonServiceLifecycleTest.java&r2=477910
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/ioc/internal/SingletonServiceLifecycleTest.java (original)
+++ tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/SingletonServiceLifecycleTest.java Tue Nov 21 13:48:47 2006
@@ -12,37 +12,32 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package org.apache.tapestry.ioc.internal;
-
-import org.apache.tapestry.internal.test.InternalBaseTestCase;
-import org.apache.tapestry.ioc.ObjectCreator;
-import org.apache.tapestry.ioc.ServiceLifecycle;
-import org.apache.tapestry.ioc.ServiceResources;
-import org.apache.tapestry.ioc.internal.SingletonServiceLifecycle;
-import org.testng.annotations.Test;
-
-/**
- * 
- */
-public class SingletonServiceLifecycleTest extends InternalBaseTestCase
-{
-    @Test
-    public void test()
-    {
-        ServiceResources resources = newServiceResources();
-        ObjectCreator creator = newObjectCreator();
-        Object expected = new Object();
-
-        train_createObject(creator, expected);
-
-        replay();
-
-        ServiceLifecycle lifecycle = new SingletonServiceLifecycle();
-
-        Object actual = lifecycle.createService(resources, creator);
-
-        assertSame(actual, expected);
-
-        verify();
-    }
-}
+package org.apache.tapestry.ioc.internal;
+
+import org.apache.tapestry.ioc.ObjectCreator;
+import org.apache.tapestry.ioc.ServiceLifecycle;
+import org.apache.tapestry.ioc.ServiceResources;
+import org.testng.annotations.Test;
+
+public class SingletonServiceLifecycleTest extends IOCInternalTestCase
+{
+    @Test
+    public void test()
+    {
+        ServiceResources resources = newServiceResources();
+        ObjectCreator creator = newObjectCreator();
+        Object expected = new Object();
+
+        train_createObject(creator, expected);
+
+        replay();
+
+        ServiceLifecycle lifecycle = new SingletonServiceLifecycle();
+
+        Object actual = lifecycle.createService(resources, creator);
+
+        assertSame(actual, expected);
+
+        verify();
+    }
+}

Copied: tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/ValidatingConfigurationWrapperTest.java (from r477721, tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/ioc/internal/ValidatingConfigurationWrapperTest.java)
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/ValidatingConfigurationWrapperTest.java?view=diff&rev=477910&p1=tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/ioc/internal/ValidatingConfigurationWrapperTest.java&r1=477721&p2=tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/ValidatingConfigurationWrapperTest.java&r2=477910
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/ioc/internal/ValidatingConfigurationWrapperTest.java (original)
+++ tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/ValidatingConfigurationWrapperTest.java Tue Nov 21 13:48:47 2006
@@ -12,99 +12,92 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package org.apache.tapestry.ioc.internal;
-
-import org.apache.commons.logging.Log;
-import org.apache.tapestry.internal.test.InternalBaseTestCase;
-import org.apache.tapestry.ioc.Configuration;
-import org.apache.tapestry.ioc.def.ContributionDef;
-import org.apache.tapestry.ioc.internal.ContributionDefImpl;
-import org.apache.tapestry.ioc.internal.IOCMessages;
-import org.apache.tapestry.ioc.internal.ValidatingConfigurationWrapper;
-import org.testng.annotations.Test;
-
-/**
- * 
- */
-public class ValidatingConfigurationWrapperTest extends InternalBaseTestCase
-{
-    @SuppressWarnings("unchecked")
-    @Test
-    public void valid_contribution()
-    {
-        ContributionDef def = newContributionDef();
-        Log log = newLog();
-        Configuration configuration = newConfiguration();
-        Runnable value = newRunnable();
-
-        configuration.add(value);
-
-        replay();
-
-        Configuration wrapper = new ValidatingConfigurationWrapper("foo.Bar", log, Runnable.class,
-                def, configuration);
-
-        wrapper.add(value);
-
-        verify();
-    }
-
-    @SuppressWarnings("unchecked")
-    @Test
-    public void null_contribution()
-    {
-        Log log = newLog();
-        Configuration configuration = newConfiguration();
-        ContributionDef def = new ContributionDefImpl("foo.Bar",
-                findMethod("contributeUnorderedNull"));
-
-        log.warn(IOCMessages.contributionWasNull("foo.Bar", def));
-
-        replay();
-
-        Configuration wrapper = new ValidatingConfigurationWrapper("foo.Bar", log, Runnable.class,
-                def, configuration);
-
-        wrapper.add(null);
-
-        verify();
-    }
-
-    @SuppressWarnings("unchecked")
-    @Test
-    public void wrong_type_of_contribution()
-    {
-        Log log = newLog();
-        Configuration configuration = newConfiguration();
-        ContributionDef def = new ContributionDefImpl("foo.Bar",
-                findMethod("contributeUnorderedNull"));
-
-        log.warn(IOCMessages.contributionWrongValueType(
-                "foo.Bar",
-                def,
-                String.class,
-                Runnable.class));
-
-        replay();
-
-        Configuration wrapper = new ValidatingConfigurationWrapper("foo.Bar", log, Runnable.class,
-                def, configuration);
-
-        wrapper.add("runnable");
-
-        verify();
-    }
-
-    // Just a placeholder to give the errors something to report about
-
-    public void contributeUnorderedNull()
-    {
-
-    }
-
-    public void contributeWrongType()
-    {
-
-    }
-
-}
+package org.apache.tapestry.ioc.internal;
+
+import org.apache.commons.logging.Log;
+import org.apache.tapestry.ioc.Configuration;
+import org.apache.tapestry.ioc.def.ContributionDef;
+import org.testng.annotations.Test;
+
+public class ValidatingConfigurationWrapperTest extends IOCInternalTestCase
+{
+    @SuppressWarnings("unchecked")
+    @Test
+    public void valid_contribution()
+    {
+        ContributionDef def = newContributionDef();
+        Log log = newLog();
+        Configuration configuration = newConfiguration();
+        Runnable value = newRunnable();
+
+        configuration.add(value);
+
+        replay();
+
+        Configuration wrapper = new ValidatingConfigurationWrapper("foo.Bar", log, Runnable.class,
+                def, configuration);
+
+        wrapper.add(value);
+
+        verify();
+    }
+
+    @SuppressWarnings("unchecked")
+    @Test
+    public void null_contribution()
+    {
+        Log log = newLog();
+        Configuration configuration = newConfiguration();
+        ContributionDef def = new ContributionDefImpl("foo.Bar",
+                findMethod("contributeUnorderedNull"));
+
+        log.warn(IOCMessages.contributionWasNull("foo.Bar", def));
+
+        replay();
+
+        Configuration wrapper = new ValidatingConfigurationWrapper("foo.Bar", log, Runnable.class,
+                def, configuration);
+
+        wrapper.add(null);
+
+        verify();
+    }
+
+    @SuppressWarnings("unchecked")
+    @Test
+    public void wrong_type_of_contribution()
+    {
+        Log log = newLog();
+        Configuration configuration = newConfiguration();
+        ContributionDef def = new ContributionDefImpl("foo.Bar",
+                findMethod("contributeUnorderedNull"));
+
+        log.warn(IOCMessages.contributionWrongValueType(
+                "foo.Bar",
+                def,
+                String.class,
+                Runnable.class));
+
+        replay();
+
+        Configuration wrapper = new ValidatingConfigurationWrapper("foo.Bar", log, Runnable.class,
+                def, configuration);
+
+        wrapper.add("runnable");
+
+        verify();
+    }
+
+    // Just a placeholder to give the errors something to report about
+
+    public void contributeUnorderedNull()
+    {
+
+    }
+
+    public void contributeWrongType()
+    {
+
+    }
+
+}

Copied: tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/ValidatingMappedConfigurationWrapperTest.java (from r477721, tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/ioc/internal/ValidatingMappedConfigurationWrapperTest.java)
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/ValidatingMappedConfigurationWrapperTest.java?view=diff&rev=477910&p1=tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/ioc/internal/ValidatingMappedConfigurationWrapperTest.java&r1=477721&p2=tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/ValidatingMappedConfigurationWrapperTest.java&r2=477910
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/ioc/internal/ValidatingMappedConfigurationWrapperTest.java (original)
+++ tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/ValidatingMappedConfigurationWrapperTest.java Tue Nov 21 13:48:47 2006
@@ -12,185 +12,178 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package org.apache.tapestry.ioc.internal;
-
+package org.apache.tapestry.ioc.internal;
+
 import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newMap;
-
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.logging.Log;
-import org.apache.tapestry.internal.test.InternalBaseTestCase;
-import org.apache.tapestry.ioc.MappedConfiguration;
-import org.apache.tapestry.ioc.def.ContributionDef;
-import org.apache.tapestry.ioc.internal.ContributionDefImpl;
-import org.apache.tapestry.ioc.internal.IOCMessages;
-import org.apache.tapestry.ioc.internal.ValidatingMappedConfigurationWrapper;
-import org.testng.annotations.Test;
-
-/**
- * 
- */
-public class ValidatingMappedConfigurationWrapperTest extends InternalBaseTestCase
-{
-    private static final String SERVICE_ID = "foo.bar.Baz";
-
-    @Test
-    public void proper_key_and_value()
-    {
-        ContributionDef def = newContributionDef();
-        Log log = newLog();
-        Map<Class, ContributionDef> keyToContribution = newMap();
-        MappedConfiguration<Class, Runnable> delegate = newMappedConfiguration();
-
-        Class key = Integer.class;
-        Runnable value = newRunnable();
-
-        delegate.add(key, value);
-
-        replay();
-
-        MappedConfiguration<Class, Runnable> wrapper = new ValidatingMappedConfigurationWrapper<Class, Runnable>(
-                SERVICE_ID, def, log, Class.class, Runnable.class, keyToContribution, delegate);
-
-        wrapper.add(key, value);
-
-        verify();
-
-        assertSame(keyToContribution.get(Integer.class), def);
-    }
-
-    @Test
-    public void duplicate_key()
-    {
-        ContributionDef def1 = newContributionDef("contributionPlaceholder1");
-        ContributionDef def2 = newContributionDef("contributionPlaceholder2");
-        Log log = newLog();
-        Map<Class, ContributionDef> keyToContribution = newMap();
-
-        keyToContribution.put(Integer.class, def1);
-
-        MappedConfiguration<Class, Runnable> delegate = newMappedConfiguration();
-
-        Class key = Integer.class;
-        Runnable value = newRunnable();
-
-        log.warn(IOCMessages.contributionDuplicateKey(SERVICE_ID, def2, def1));
-
-        replay();
-
-        MappedConfiguration<Class, Runnable> wrapper = new ValidatingMappedConfigurationWrapper<Class, Runnable>(
-                SERVICE_ID, def2, log, Class.class, Runnable.class, keyToContribution, delegate);
-
-        wrapper.add(key, value);
-
-        verify();
-
-        assertSame(keyToContribution.get(Integer.class), def1);
-    }
-
-    @Test
-    public void null_key()
-    {
-        ContributionDef def = newContributionDef("contributionPlaceholder1");
-        Log log = newLog();
-        Map<Class, ContributionDef> keyToContribution = newMap();
-        MappedConfiguration<Class, Runnable> delegate = newMappedConfiguration();
-        Runnable value = newRunnable();
-
-        log.warn(IOCMessages.contributionKeyWasNull(SERVICE_ID, def));
-
-        replay();
-
-        MappedConfiguration<Class, Runnable> wrapper = new ValidatingMappedConfigurationWrapper<Class, Runnable>(
-                SERVICE_ID, def, log, Class.class, Runnable.class, keyToContribution, delegate);
-
-        wrapper.add(null, value);
-
-        verify();
-    }
-
-    @SuppressWarnings("unchecked")
-    @Test
-    public void wrong_key_type()
-    {
-        ContributionDef def = newContributionDef("contributionPlaceholder1");
-        Log log = newLog();
-        Map<?, ContributionDef> keyToContribution = newMap();
-        MappedConfiguration delegate = newMappedConfiguration();
-        Runnable value = newRunnable();
-
-        log.warn(IOCMessages.contributionWrongKeyType(SERVICE_ID, def, String.class, Class.class));
-
-        replay();
-
-        MappedConfiguration wrapper = new ValidatingMappedConfigurationWrapper(SERVICE_ID, def,
-                log, Class.class, Runnable.class, keyToContribution, delegate);
-
-        wrapper.add("java.util.List", value);
-
-        verify();
-    }
-
-    @SuppressWarnings("unchecked")
-    @Test
-    public void wrong_value_type()
-    {
-        ContributionDef def = newContributionDef("contributionPlaceholder1");
-        Log log = newLog();
-        Map<?, ContributionDef> keyToContribution = newMap();
-        MappedConfiguration delegate = newMappedConfiguration();
-
-        log.warn(IOCMessages.contributionWrongValueType(
-                SERVICE_ID,
-                def,
-                String.class,
-                Runnable.class));
-
-        replay();
-
-        MappedConfiguration wrapper = new ValidatingMappedConfigurationWrapper(SERVICE_ID, def,
-                log, Class.class, Runnable.class, keyToContribution, delegate);
-
-        wrapper.add(List.class, "do something");
-
-        verify();
-    }
-
-    @Test
-    public void null_value()
-    {
-        ContributionDef def = newContributionDef("contributionPlaceholder1");
-        Log log = newLog();
-        Map<Class, ContributionDef> keyToContribution = newMap();
-        MappedConfiguration<Class, Runnable> delegate = newMappedConfiguration();
-
-        log.warn(IOCMessages.contributionWasNull(SERVICE_ID, def));
-
-        replay();
-
-        MappedConfiguration<Class, Runnable> wrapper = new ValidatingMappedConfigurationWrapper<Class, Runnable>(
-                SERVICE_ID, def, log, Class.class, Runnable.class, keyToContribution, delegate);
-
-        wrapper.add(Integer.class, null);
-
-        verify();
-
-    }
-
-    private ContributionDef newContributionDef(String methodName)
-    {
-        return new ContributionDefImpl(SERVICE_ID, findMethod(methodName));
-    }
-
-    public void contributionPlaceholder1()
-    {
-
-    }
-
-    public void contributionPlaceholder2()
-    {
-
-    }
-
-}
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.tapestry.ioc.MappedConfiguration;
+import org.apache.tapestry.ioc.def.ContributionDef;
+import org.testng.annotations.Test;
+
+public class ValidatingMappedConfigurationWrapperTest extends IOCInternalTestCase
+{
+    private static final String SERVICE_ID = "foo.bar.Baz";
+
+    @Test
+    public void proper_key_and_value()
+    {
+        ContributionDef def = newContributionDef();
+        Log log = newLog();
+        Map<Class, ContributionDef> keyToContribution = newMap();
+        MappedConfiguration<Class, Runnable> delegate = newMappedConfiguration();
+
+        Class key = Integer.class;
+        Runnable value = newRunnable();
+
+        delegate.add(key, value);
+
+        replay();
+
+        MappedConfiguration<Class, Runnable> wrapper = new ValidatingMappedConfigurationWrapper<Class, Runnable>(
+                SERVICE_ID, def, log, Class.class, Runnable.class, keyToContribution, delegate);
+
+        wrapper.add(key, value);
+
+        verify();
+
+        assertSame(keyToContribution.get(Integer.class), def);
+    }
+
+    @Test
+    public void duplicate_key()
+    {
+        ContributionDef def1 = newContributionDef("contributionPlaceholder1");
+        ContributionDef def2 = newContributionDef("contributionPlaceholder2");
+        Log log = newLog();
+        Map<Class, ContributionDef> keyToContribution = newMap();
+
+        keyToContribution.put(Integer.class, def1);
+
+        MappedConfiguration<Class, Runnable> delegate = newMappedConfiguration();
+
+        Class key = Integer.class;
+        Runnable value = newRunnable();
+
+        log.warn(IOCMessages.contributionDuplicateKey(SERVICE_ID, def2, def1));
+
+        replay();
+
+        MappedConfiguration<Class, Runnable> wrapper = new ValidatingMappedConfigurationWrapper<Class, Runnable>(
+                SERVICE_ID, def2, log, Class.class, Runnable.class, keyToContribution, delegate);
+
+        wrapper.add(key, value);
+
+        verify();
+
+        assertSame(keyToContribution.get(Integer.class), def1);
+    }
+
+    @Test
+    public void null_key()
+    {
+        ContributionDef def = newContributionDef("contributionPlaceholder1");
+        Log log = newLog();
+        Map<Class, ContributionDef> keyToContribution = newMap();
+        MappedConfiguration<Class, Runnable> delegate = newMappedConfiguration();
+        Runnable value = newRunnable();
+
+        log.warn(IOCMessages.contributionKeyWasNull(SERVICE_ID, def));
+
+        replay();
+
+        MappedConfiguration<Class, Runnable> wrapper = new ValidatingMappedConfigurationWrapper<Class, Runnable>(
+                SERVICE_ID, def, log, Class.class, Runnable.class, keyToContribution, delegate);
+
+        wrapper.add(null, value);
+
+        verify();
+    }
+
+    @SuppressWarnings("unchecked")
+    @Test
+    public void wrong_key_type()
+    {
+        ContributionDef def = newContributionDef("contributionPlaceholder1");
+        Log log = newLog();
+        Map<?, ContributionDef> keyToContribution = newMap();
+        MappedConfiguration delegate = newMappedConfiguration();
+        Runnable value = newRunnable();
+
+        log.warn(IOCMessages.contributionWrongKeyType(SERVICE_ID, def, String.class, Class.class));
+
+        replay();
+
+        MappedConfiguration wrapper = new ValidatingMappedConfigurationWrapper(SERVICE_ID, def,
+                log, Class.class, Runnable.class, keyToContribution, delegate);
+
+        wrapper.add("java.util.List", value);
+
+        verify();
+    }
+
+    @SuppressWarnings("unchecked")
+    @Test
+    public void wrong_value_type()
+    {
+        ContributionDef def = newContributionDef("contributionPlaceholder1");
+        Log log = newLog();
+        Map<?, ContributionDef> keyToContribution = newMap();
+        MappedConfiguration delegate = newMappedConfiguration();
+
+        log.warn(IOCMessages.contributionWrongValueType(
+                SERVICE_ID,
+                def,
+                String.class,
+                Runnable.class));
+
+        replay();
+
+        MappedConfiguration wrapper = new ValidatingMappedConfigurationWrapper(SERVICE_ID, def,
+                log, Class.class, Runnable.class, keyToContribution, delegate);
+
+        wrapper.add(List.class, "do something");
+
+        verify();
+    }
+
+    @Test
+    public void null_value()
+    {
+        ContributionDef def = newContributionDef("contributionPlaceholder1");
+        Log log = newLog();
+        Map<Class, ContributionDef> keyToContribution = newMap();
+        MappedConfiguration<Class, Runnable> delegate = newMappedConfiguration();
+
+        log.warn(IOCMessages.contributionWasNull(SERVICE_ID, def));
+
+        replay();
+
+        MappedConfiguration<Class, Runnable> wrapper = new ValidatingMappedConfigurationWrapper<Class, Runnable>(
+                SERVICE_ID, def, log, Class.class, Runnable.class, keyToContribution, delegate);
+
+        wrapper.add(Integer.class, null);
+
+        verify();
+
+    }
+
+    private ContributionDef newContributionDef(String methodName)
+    {
+        return new ContributionDefImpl(SERVICE_ID, findMethod(methodName));
+    }
+
+    public void contributionPlaceholder1()
+    {
+
+    }
+
+    public void contributionPlaceholder2()
+    {
+
+    }
+
+}

Copied: tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/ValidatingOrderedConfigurationWrapperTest.java (from r477721, tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/ioc/internal/ValidatingOrderedConfigurationWrapperTest.java)
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/ValidatingOrderedConfigurationWrapperTest.java?view=diff&rev=477910&p1=tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/ioc/internal/ValidatingOrderedConfigurationWrapperTest.java&r1=477721&p2=tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/ValidatingOrderedConfigurationWrapperTest.java&r2=477910
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/ioc/internal/ValidatingOrderedConfigurationWrapperTest.java (original)
+++ tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/ValidatingOrderedConfigurationWrapperTest.java Tue Nov 21 13:48:47 2006
@@ -12,113 +12,106 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package org.apache.tapestry.ioc.internal;
-
-import java.lang.reflect.Method;
-
-import org.apache.commons.logging.Log;
-import org.apache.tapestry.internal.test.InternalBaseTestCase;
-import org.apache.tapestry.ioc.OrderedConfiguration;
-import org.apache.tapestry.ioc.def.ContributionDef;
-import org.apache.tapestry.ioc.internal.ContributionDefImpl;
-import org.apache.tapestry.ioc.internal.IOCMessages;
-import org.apache.tapestry.ioc.internal.ValidatingOrderedConfigurationWrapper;
-import org.testng.annotations.Test;
-
-/**
- * 
- */
-public class ValidatingOrderedConfigurationWrapperTest extends InternalBaseTestCase
-{
-    @Test
-    public void valid_type_long_form()
-    {
-        ContributionDef def = newContributionDef();
-        Log log = newLog();
-        OrderedConfiguration<Runnable> configuration = newOrderedConfiguration();
-        Runnable contribution = newRunnable();
-
-        configuration.add("fred.id", contribution, "after:fred.pre", "before:fred.post");
-
-        replay();
-
-        OrderedConfiguration<Runnable> wrapper = new ValidatingOrderedConfigurationWrapper<Runnable>(
-                "barney.Service", "fred", def, log, Runnable.class, configuration);
-
-        wrapper.add("id", contribution, "after:fred.pre", "before:fred.post");
-
-        verify();
-    }
-
-    @Test
-    public void valid_type_short_form()
-    {
-        ContributionDef def = newContributionDef();
-        Log log = newLog();
-        OrderedConfiguration<Runnable> configuration = newOrderedConfiguration();
-        Runnable contribution = newRunnable();
-
-        configuration.add("fred.id", contribution);
-
-        replay();
-
-        OrderedConfiguration<Runnable> wrapper = new ValidatingOrderedConfigurationWrapper<Runnable>(
-                "barney.Service", "fred", def, log, Runnable.class, configuration);
-
-        wrapper.add("id", contribution);
-
-        verify();
-    }
-
-    @Test
-    public void null_object_passed_through()
-    {
-        ContributionDef def = newContributionDef();
-        Log log = newLog();
-        OrderedConfiguration<Runnable> configuration = newOrderedConfiguration();
-
-        configuration.add("fred.id", null);
-
-        replay();
-
-        OrderedConfiguration<Runnable> wrapper = new ValidatingOrderedConfigurationWrapper<Runnable>(
-                "barney.Service", "fred", def, log, Runnable.class, configuration);
-
-        wrapper.add("id", null);
-
-        verify();
-    }
-
-    @SuppressWarnings("unchecked")
-    @Test
-    public void incorrect_contribution_type_is_passed_through_as_null()
-    {
-        Method method = findMethod("contributeBarneyService");
-
-        ContributionDef def = new ContributionDefImpl("barney.Service", method);
-        Log log = newLog();
-        OrderedConfiguration<Runnable> configuration = newOrderedConfiguration();
-
-        log.warn(IOCMessages.contributionWrongValueType(
-                "barney.Service",
-                def,
-                String.class,
-                Runnable.class));
-
-        configuration.add("fred.id", null);
-
-        replay();
-
-        OrderedConfiguration wrapper = new ValidatingOrderedConfigurationWrapper("barney.Service",
-                "fred", def, log, Runnable.class, configuration);
-
-        wrapper.add("id", "string");
-
-        verify();
-    }
-
-    public void contributeBarneyService(OrderedConfiguration<Runnable> configuration)
-    {
-
-    }
-}
+package org.apache.tapestry.ioc.internal;
+
+import java.lang.reflect.Method;
+
+import org.apache.commons.logging.Log;
+import org.apache.tapestry.ioc.OrderedConfiguration;
+import org.apache.tapestry.ioc.def.ContributionDef;
+import org.testng.annotations.Test;
+
+public class ValidatingOrderedConfigurationWrapperTest extends IOCInternalTestCase
+{
+    @Test
+    public void valid_type_long_form()
+    {
+        ContributionDef def = newContributionDef();
+        Log log = newLog();
+        OrderedConfiguration<Runnable> configuration = newOrderedConfiguration();
+        Runnable contribution = newRunnable();
+
+        configuration.add("fred.id", contribution, "after:fred.pre", "before:fred.post");
+
+        replay();
+
+        OrderedConfiguration<Runnable> wrapper = new ValidatingOrderedConfigurationWrapper<Runnable>(
+                "barney.Service", "fred", def, log, Runnable.class, configuration);
+
+        wrapper.add("id", contribution, "after:fred.pre", "before:fred.post");
+
+        verify();
+    }
+
+    @Test
+    public void valid_type_short_form()
+    {
+        ContributionDef def = newContributionDef();
+        Log log = newLog();
+        OrderedConfiguration<Runnable> configuration = newOrderedConfiguration();
+        Runnable contribution = newRunnable();
+
+        configuration.add("fred.id", contribution);
+
+        replay();
+
+        OrderedConfiguration<Runnable> wrapper = new ValidatingOrderedConfigurationWrapper<Runnable>(
+                "barney.Service", "fred", def, log, Runnable.class, configuration);
+
+        wrapper.add("id", contribution);
+
+        verify();
+    }
+
+    @Test
+    public void null_object_passed_through()
+    {
+        ContributionDef def = newContributionDef();
+        Log log = newLog();
+        OrderedConfiguration<Runnable> configuration = newOrderedConfiguration();
+
+        configuration.add("fred.id", null);
+
+        replay();
+
+        OrderedConfiguration<Runnable> wrapper = new ValidatingOrderedConfigurationWrapper<Runnable>(
+                "barney.Service", "fred", def, log, Runnable.class, configuration);
+
+        wrapper.add("id", null);
+
+        verify();
+    }
+
+    @SuppressWarnings("unchecked")
+    @Test
+    public void incorrect_contribution_type_is_passed_through_as_null()
+    {
+        Method method = findMethod("contributeBarneyService");
+
+        ContributionDef def = new ContributionDefImpl("barney.Service", method);
+        Log log = newLog();
+        OrderedConfiguration<Runnable> configuration = newOrderedConfiguration();
+
+        log.warn(IOCMessages.contributionWrongValueType(
+                "barney.Service",
+                def,
+                String.class,
+                Runnable.class));
+
+        configuration.add("fred.id", null);
+
+        replay();
+
+        OrderedConfiguration wrapper = new ValidatingOrderedConfigurationWrapper("barney.Service",
+                "fred", def, log, Runnable.class, configuration);
+
+        wrapper.add("id", "string");
+
+        verify();
+    }
+
+    public void contributeBarneyService(OrderedConfiguration<Runnable> configuration)
+    {
+
+    }
+}

Copied: tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/services/AbstractIntWrapper.java (from r477721, tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/ioc/internal/services/AbstractIntWrapper.java)
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/services/AbstractIntWrapper.java?view=diff&rev=477910&p1=tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/ioc/internal/services/AbstractIntWrapper.java&r1=477721&p2=tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/services/AbstractIntWrapper.java&r2=477910
==============================================================================
    (empty)

Propchange: tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/services/AbstractIntWrapper.java
------------------------------------------------------------------------------
    cvs2svn:cvs-rev = 1.2

Propchange: tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/services/AbstractIntWrapper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tapestry/tapestry5/tapestry-ioc/trunk/src/test/java/org/apache/tapestry/ioc/internal/services/AbstractIntWrapper.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision