You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2007/03/14 18:47:17 UTC

svn commit: r518235 [2/2] - in /tapestry/tapestry5: tapestry-core/trunk/src/main/java/org/apache/tapestry/annotations/ tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/base/ tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/com...

Copied: tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/AliasImplTest.java (from r517898, tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/InfrastructureImplTest.java)
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/AliasImplTest.java?view=diff&rev=518235&p1=tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/InfrastructureImplTest.java&r1=517898&p2=tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/AliasImplTest.java&r2=518235
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/InfrastructureImplTest.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/AliasImplTest.java Wed Mar 14 10:47:14 2007
@@ -22,29 +22,29 @@
 import org.apache.tapestry.internal.test.InternalBaseTestCase;
 import org.apache.tapestry.ioc.ObjectProvider;
 import org.apache.tapestry.ioc.ServiceLocator;
-import org.apache.tapestry.services.Infrastructure;
-import org.apache.tapestry.services.InfrastructureManager;
+import org.apache.tapestry.services.Alias;
+import org.apache.tapestry.services.AliasManager;
 import org.testng.annotations.Test;
 
-public class InfrastructureImplTest extends InternalBaseTestCase
+public class AliasImplTest extends InternalBaseTestCase
 {
     private Map<String, Object> _emptyMap = Collections.emptyMap();
 
     @Test
     public void mode_not_set_when_resolution_requested()
     {
-        InfrastructureManager manager = newInfrastructureManager();
-        InfrastructureManager overridesManager = newInfrastructureManager();
+        AliasManager manager = newAliasManager();
+        AliasManager overridesManager = newAliasManager();
         ServiceLocator locator = newServiceLocator();
 
         replay();
 
-        Infrastructure infra = new InfrastructureImpl(manager, overridesManager);
+        Alias alias = new AliasImpl(manager, overridesManager);
 
-        // Do not assume that infra and provider are the same;
+        // Do not assume that alias and provider are the same;
         // that's an implementation choice.
 
-        ObjectProvider provider = infra.getObjectProvider();
+        ObjectProvider provider = alias.getObjectProvider();
 
         try
         {
@@ -53,47 +53,47 @@
         }
         catch (RuntimeException ex)
         {
-            assertEquals(ex.getMessage(), ServicesMessages.infrastructureModeNotSet());
+            assertEquals(ex.getMessage(), ServicesMessages.aliasModeNotSet());
         }
 
         verify();
     }
 
-    protected final InfrastructureManager newInfrastructureManager()
+    protected final AliasManager newAliasManager()
     {
-        return newMock(InfrastructureManager.class);
+        return newMock(AliasManager.class);
     }
 
     @Test
     public void resolve_object_within_mode()
     {
-        String infrastructureProperty = "myrunnable";
+        String property = "myrunnable";
         String mode = "papyrus";
 
-        InfrastructureManager manager = newInfrastructureManager();
-        InfrastructureManager overridesManager = newInfrastructureManager();
+        AliasManager manager = newAliasManager();
+        AliasManager overridesManager = newAliasManager();
 
         ServiceLocator locator = newServiceLocator();
         Runnable r = newRunnable();
 
         Map<String, Object> configuration = newMap();
-        configuration.put(infrastructureProperty, r);
+        configuration.put(property, r);
 
-        train_getContributionsForMode(manager, mode, configuration);
-        train_getContributionsForMode(overridesManager, mode, _emptyMap);
+        getAliasesForMode(manager, mode, configuration);
+        getAliasesForMode(overridesManager, mode, _emptyMap);
 
         replay();
 
-        Infrastructure infra = new InfrastructureImpl(manager, overridesManager);
+        Alias alias = new AliasImpl(manager, overridesManager);
 
-        infra.setMode(mode);
+        alias.setMode(mode);
 
         // Do not assume that infra and provider are the same;
         // that's an implementation choice.
 
-        ObjectProvider provider = infra.getObjectProvider();
+        ObjectProvider provider = alias.getObjectProvider();
 
-        Runnable actual = provider.provide(infrastructureProperty, Runnable.class, locator);
+        Runnable actual = provider.provide(property, Runnable.class, locator);
 
         assertSame(actual, r);
 
@@ -103,34 +103,34 @@
     @Test
     public void overrides_manager_has_precendence()
     {
-        String infrastructureProperty = "myrunnable";
+        String property = "myrunnable";
         String mode = "papyrus";
 
-        InfrastructureManager manager = newInfrastructureManager();
-        InfrastructureManager overridesManager = newInfrastructureManager();
+        AliasManager manager = newAliasManager();
+        AliasManager overridesManager = newAliasManager();
 
         ServiceLocator locator = newServiceLocator();
         Runnable masterRunnable = newRunnable();
         Runnable overrideRunnable = newRunnable();
 
         Map<String, Object> masterConfiguration = newMap();
-        masterConfiguration.put(infrastructureProperty, masterRunnable);
+        masterConfiguration.put(property, masterRunnable);
 
         Map<String, Object> overrideConfiguration = newMap();
-        overrideConfiguration.put(infrastructureProperty, overrideRunnable);
+        overrideConfiguration.put(property, overrideRunnable);
 
-        train_getContributionsForMode(manager, mode, masterConfiguration);
-        train_getContributionsForMode(overridesManager, mode, overrideConfiguration);
+        getAliasesForMode(manager, mode, masterConfiguration);
+        getAliasesForMode(overridesManager, mode, overrideConfiguration);
 
         replay();
 
-        Infrastructure infra = new InfrastructureImpl(manager, overridesManager);
+        Alias alias = new AliasImpl(manager, overridesManager);
 
-        infra.setMode(mode);
+        alias.setMode(mode);
 
-        ObjectProvider provider = infra.getObjectProvider();
+        ObjectProvider provider = alias.getObjectProvider();
 
-        Runnable actual = provider.provide(infrastructureProperty, Runnable.class, locator);
+        Runnable actual = provider.provide(property, Runnable.class, locator);
 
         assertSame(actual, overrideRunnable);
 
@@ -144,27 +144,27 @@
         String property = "myrunnable";
         String mode = "clay";
 
-        InfrastructureManager manager = newInfrastructureManager();
-        InfrastructureManager overridesManager = newInfrastructureManager();
+        AliasManager manager = newAliasManager();
+        AliasManager overridesManager = newAliasManager();
         ServiceLocator locator = newServiceLocator();
         Runnable r = newRunnable();
 
         Map<String, Object> configuration = newMap();
         configuration.put(property, r);
 
-        train_getContributionsForMode(manager, mode, configuration);
-        train_getContributionsForMode(overridesManager, mode, _emptyMap);
+        getAliasesForMode(manager, mode, configuration);
+        getAliasesForMode(overridesManager, mode, _emptyMap);
 
         replay();
 
-        Infrastructure infra = new InfrastructureImpl(manager, overridesManager);
+        Alias alias = new AliasImpl(manager, overridesManager);
 
-        infra.setMode(mode);
+        alias.setMode(mode);
 
         // Do not assume that infra and provider are the same;
         // that's an implementation choice.
 
-        ObjectProvider provider = infra.getObjectProvider();
+        ObjectProvider provider = alias.getObjectProvider();
 
         Runnable actual1 = provider.provide(property, Runnable.class, locator);
         Runnable actual2 = provider.provide(property, Runnable.class, locator);
@@ -180,8 +180,8 @@
     {
         String mode = "clay";
 
-        InfrastructureManager manager = newInfrastructureManager();
-        InfrastructureManager overridesManager = newInfrastructureManager();
+        AliasManager manager = newAliasManager();
+        AliasManager overridesManager = newAliasManager();
         ServiceLocator locator = newServiceLocator();
 
         Map<String, Object> configuration = newMap();
@@ -190,16 +190,16 @@
         configuration.put("barney", this);
         configuration.put("wilma", this);
 
-        train_getContributionsForMode(manager, mode, configuration);
-        train_getContributionsForMode(overridesManager, mode, _emptyMap);
+        getAliasesForMode(manager, mode, configuration);
+        getAliasesForMode(overridesManager, mode, _emptyMap);
 
         replay();
 
-        Infrastructure infra = new InfrastructureImpl(manager, overridesManager);
+        Alias alias = new AliasImpl(manager, overridesManager);
 
-        infra.setMode(mode);
+        alias.setMode(mode);
 
-        ObjectProvider provider = infra.getObjectProvider();
+        ObjectProvider provider = alias.getObjectProvider();
 
         try
         {
@@ -210,7 +210,7 @@
         {
             assertEquals(
                     ex.getMessage(),
-                    "No infrastructure property 'someexpression' has been configured. Configured properties are: barney, fred, wilma.");
+                    "No alias property 'someexpression' has been configured. Configured properties are: barney, fred, wilma.");
         }
 
         verify();
@@ -223,27 +223,27 @@
         String property = "myrunnable";
         String mode = "papyrus";
 
-        InfrastructureManager manager = newInfrastructureManager();
-        InfrastructureManager overridesManager = newInfrastructureManager();
+        AliasManager manager = newAliasManager();
+        AliasManager overridesManager = newAliasManager();
         ServiceLocator locator = newServiceLocator();
         Runnable r = newRunnable();
 
         Map<String, Object> configuration = newMap();
         configuration.put(property, r);
 
-        train_getContributionsForMode(manager, mode, configuration);
-        train_getContributionsForMode(overridesManager, mode, _emptyMap);
+        getAliasesForMode(manager, mode, configuration);
+        getAliasesForMode(overridesManager, mode, _emptyMap);
 
         replay();
 
-        Infrastructure infra = new InfrastructureImpl(manager, overridesManager);
+        Alias alias = new AliasImpl(manager, overridesManager);
 
-        infra.setMode(mode);
+        alias.setMode(mode);
 
         // Do not assume that infra and provider are the same;
         // that's an implementation choice.
 
-        ObjectProvider provider = infra.getObjectProvider();
+        ObjectProvider provider = alias.getObjectProvider();
 
         try
         {
@@ -252,7 +252,7 @@
         }
         catch (RuntimeException ex)
         {
-            assertEquals(ex.getMessage(), ServicesMessages.infrastructurePropertyWrongType(
+            assertEquals(ex.getMessage(), ServicesMessages.aliasPropertyWrongType(
                     property,
                     r,
                     UpdateListenerHub.class));
@@ -260,11 +260,5 @@
 
         verify();
 
-    }
-
-    protected final void train_getContributionsForMode(InfrastructureManager manager, String mode,
-            Map<String, Object> configuration)
-    {
-        expect(manager.getContributionsForMode(mode)).andReturn(configuration);
     }
 }

Copied: tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/AliasManagerImplTest.java (from r517898, tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/InfrastructureManagerImplTest.java)
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/AliasManagerImplTest.java?view=diff&rev=518235&p1=tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/InfrastructureManagerImplTest.java&r1=517898&p2=tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/AliasManagerImplTest.java&r2=518235
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/InfrastructureManagerImplTest.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/AliasManagerImplTest.java Wed Mar 14 10:47:14 2007
@@ -1,4 +1,4 @@
-// Copyright 2006 The Apache Software Foundation
+// Copyright 2006, 2007 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -12,120 +12,117 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package org.apache.tapestry.internal.services;
-
+package org.apache.tapestry.internal.services;
+
 import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newList;
-
-import java.util.Collection;
-import java.util.Map;
-
-import org.apache.commons.logging.Log;
-import org.apache.tapestry.internal.test.InternalBaseTestCase;
-import org.apache.tapestry.services.InfrastructureContribution;
-import org.apache.tapestry.services.InfrastructureManager;
-import org.testng.annotations.Test;
-
-/**
- * 
- */
-public class InfrastructureManagerImplTest extends InternalBaseTestCase
-{
-    @Test
-    public void no_conflict()
-    {
-        Log log = newLog();
-
-        replay();
-
-        Collection<InfrastructureContribution> configuration = buildConfiguration();
-
-        InfrastructureManager manager = new InfrastructureManagerImpl(log, configuration);
-
-        Map<String, Object> map = manager.getContributionsForMode("foo");
-
-        assertEquals(map.size(), 2);
-        assertEquals(map.get("fred"), "FRED");
-        assertEquals(map.get("barney"), "BARNEY");
-
-        verify();
-    }
-
-    @Test
-    public void first_entry_wins_on_conflict()
-    {
-        Log log = newLog();
-
-        log
-                .warn("Contribution FRED-CONFLICT (as 'fred') duplicates existing contribution FRED and has been ignored.");
-
-        replay();
-
-        Collection<InfrastructureContribution> configuration = buildConfiguration();
-        configuration.add(new InfrastructureContribution("fred", "FRED-CONFLICT"));
-
-        InfrastructureManager manager = new InfrastructureManagerImpl(log, configuration);
-
-        Map<String, Object> map = manager.getContributionsForMode("foo");
-
-        assertEquals(map.size(), 2);
-        assertEquals(map.get("fred"), "FRED");
-        assertEquals(map.get("barney"), "BARNEY");
-
-        verify();
-    }
-
-    @Test
-    public void contributions_to_other_modes_are_ignored()
-    {
-        Log log = newLog();
-
-        replay();
-
-        Collection<InfrastructureContribution> configuration = buildConfiguration();
-
-        configuration.add(new InfrastructureContribution("barney", "bar", "BARNEY2"));
-
-        InfrastructureManager manager = new InfrastructureManagerImpl(log, configuration);
-
-        Map<String, Object> map = manager.getContributionsForMode("foo");
-
-        assertEquals(map.size(), 2);
-        assertEquals(map.get("fred"), "FRED");
-        assertEquals(map.get("barney"), "BARNEY");
-
-        verify();
-    }
-
-    @Test
-    public void mode_specific_contribution_overrides_general_contribution()
-    {
-        Log log = newLog();
-
-        replay();
-
-        Collection<InfrastructureContribution> configuration = buildConfiguration();
-
-        configuration.add(new InfrastructureContribution("fred", "foo", "FRED-OVERRIDE"));
-
-        InfrastructureManager manager = new InfrastructureManagerImpl(log, configuration);
-
-        Map<String, Object> map = manager.getContributionsForMode("foo");
-
-        assertEquals(map.size(), 2);
-        assertEquals(map.get("fred"), "FRED-OVERRIDE");
-        assertEquals(map.get("barney"), "BARNEY");
-
-        verify();
-
-    }
-
-    private Collection<InfrastructureContribution> buildConfiguration()
-    {
-        Collection<InfrastructureContribution> configuration = newList();
-
-        configuration.add(new InfrastructureContribution("fred", "FRED"));
-        configuration.add(new InfrastructureContribution("barney", "foo", "BARNEY"));
-
-        return configuration;
-    }
-}
+
+import java.util.Collection;
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.tapestry.internal.test.InternalBaseTestCase;
+import org.apache.tapestry.services.AliasContribution;
+import org.apache.tapestry.services.AliasManager;
+import org.testng.annotations.Test;
+
+public class AliasManagerImplTest extends InternalBaseTestCase
+{
+    @Test
+    public void no_conflict()
+    {
+        Log log = newLog();
+
+        replay();
+
+        Collection<AliasContribution> configuration = buildConfiguration();
+
+        AliasManager manager = new AliasManagerImpl(log, configuration);
+
+        Map<String, Object> map = manager.getAliasesForMode("foo");
+
+        assertEquals(map.size(), 2);
+        assertEquals(map.get("fred"), "FRED");
+        assertEquals(map.get("barney"), "BARNEY");
+
+        verify();
+    }
+
+    @Test
+    public void first_entry_wins_on_conflict()
+    {
+        Log log = newLog();
+
+        log
+                .warn("Contribution FRED-CONFLICT (as 'fred') duplicates existing contribution FRED and has been ignored.");
+
+        replay();
+
+        Collection<AliasContribution> configuration = buildConfiguration();
+        configuration.add(new AliasContribution("fred", "FRED-CONFLICT"));
+
+        AliasManager manager = new AliasManagerImpl(log, configuration);
+
+        Map<String, Object> map = manager.getAliasesForMode("foo");
+
+        assertEquals(map.size(), 2);
+        assertEquals(map.get("fred"), "FRED");
+        assertEquals(map.get("barney"), "BARNEY");
+
+        verify();
+    }
+
+    @Test
+    public void contributions_to_other_modes_are_ignored()
+    {
+        Log log = newLog();
+
+        replay();
+
+        Collection<AliasContribution> configuration = buildConfiguration();
+
+        configuration.add(new AliasContribution("barney", "bar", "BARNEY2"));
+
+        AliasManager manager = new AliasManagerImpl(log, configuration);
+
+        Map<String, Object> map = manager.getAliasesForMode("foo");
+
+        assertEquals(map.size(), 2);
+        assertEquals(map.get("fred"), "FRED");
+        assertEquals(map.get("barney"), "BARNEY");
+
+        verify();
+    }
+
+    @Test
+    public void mode_specific_contribution_overrides_general_contribution()
+    {
+        Log log = newLog();
+
+        replay();
+
+        Collection<AliasContribution> configuration = buildConfiguration();
+
+        configuration.add(new AliasContribution("fred", "foo", "FRED-OVERRIDE"));
+
+        AliasManager manager = new AliasManagerImpl(log, configuration);
+
+        Map<String, Object> map = manager.getAliasesForMode("foo");
+
+        assertEquals(map.size(), 2);
+        assertEquals(map.get("fred"), "FRED-OVERRIDE");
+        assertEquals(map.get("barney"), "BARNEY");
+
+        verify();
+
+    }
+
+    private Collection<AliasContribution> buildConfiguration()
+    {
+        Collection<AliasContribution> configuration = newList();
+
+        configuration.add(new AliasContribution("fred", "FRED"));
+        configuration.add(new AliasContribution("barney", "foo", "BARNEY"));
+
+        return configuration;
+    }
+}

Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/BeanModelSourceImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/BeanModelSourceImplTest.java?view=diff&rev=518235&r1=518234&r2=518235
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/BeanModelSourceImplTest.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/BeanModelSourceImplTest.java Wed Mar 14 10:47:14 2007
@@ -36,7 +36,7 @@
     @BeforeClass
     public void setup()
     {
-        _source = getObject("infrastructure:BeanModelSource", BeanModelSource.class);
+        _source = getObject("alias:BeanModelSource", BeanModelSource.class);
     }
 
     @AfterClass

Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/ComponentEventImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/ComponentEventImplTest.java?view=diff&rev=518235&r1=518234&r2=518235
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/ComponentEventImplTest.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/ComponentEventImplTest.java Wed Mar 14 10:47:14 2007
@@ -1,4 +1,4 @@
-// Copyright 2006 The Apache Software Foundation
+// Copyright 2006, 2007 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -30,7 +30,7 @@
     @BeforeClass
     public void setup_coercer()
     {
-        _coercer = getObject("infrastructure:TypeCoercer", TypeCoercer.class);
+        _coercer = getObject("alias:TypeCoercer", TypeCoercer.class);
     }
 
     @AfterClass

Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/ComponentInstantiatorSourceImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/ComponentInstantiatorSourceImplTest.java?view=diff&rev=518235&r1=518234&r2=518235
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/ComponentInstantiatorSourceImplTest.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/ComponentInstantiatorSourceImplTest.java Wed Mar 14 10:47:14 2007
@@ -38,7 +38,7 @@
 import org.apache.tapestry.ioc.RegistryBuilder;
 import org.apache.tapestry.ioc.services.PropertyAccess;
 import org.apache.tapestry.runtime.Component;
-import org.apache.tapestry.services.Infrastructure;
+import org.apache.tapestry.services.Alias;
 import org.apache.tapestry.services.TapestryModule;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
@@ -278,7 +278,7 @@
 
         _registry = builder.build();
 
-        _registry.getService("Infrastructure", Infrastructure.class).setMode("servlet");
+        _registry.getService("Alias", Alias.class).setMode("servlet");
 
         _source = _registry.getService(ComponentInstantiatorSource.class);
         _access = _registry.getService(PropertyAccess.class);

Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/PropertyConduitSourceImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/PropertyConduitSourceImplTest.java?view=diff&rev=518235&r1=518234&r2=518235
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/PropertyConduitSourceImplTest.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/PropertyConduitSourceImplTest.java Wed Mar 14 10:47:14 2007
@@ -32,7 +32,7 @@
     @BeforeClass
     public void setup()
     {
-        _source = getObject("infrastructure:PropertyConduitSource", PropertyConduitSource.class);
+        _source = getObject("alias:PropertyConduitSource", PropertyConduitSource.class);
     }
 
     @AfterClass

Copied: tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/services/AliasContributionTest.java (from r517898, tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/services/InfrastructureContributionTest.java)
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/services/AliasContributionTest.java?view=diff&rev=518235&p1=tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/services/InfrastructureContributionTest.java&r1=517898&p2=tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/services/AliasContributionTest.java&r2=518235
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/services/InfrastructureContributionTest.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/services/AliasContributionTest.java Wed Mar 14 10:47:14 2007
@@ -1,4 +1,4 @@
-// Copyright 2006 The Apache Software Foundation
+// Copyright 2006, 2007 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -12,45 +12,42 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package org.apache.tapestry.services;
-
+package org.apache.tapestry.services;
+
 import org.apache.tapestry.ioc.test.TestBase;
-import org.testng.annotations.Test;
-
-/**
- * 
- */
-public class InfrastructureContributionTest extends TestBase
-{
-    @Test
-    public void default_for_mode()
-    {
-        InfrastructureContribution ic = new InfrastructureContribution("fred", this);
-
-        assertEquals("fred", ic.getName());
-        assertEquals("", ic.getMode());
-        assertSame(ic.getObject(), this);
-    }
-
-    @Test
-    public void specific_mode()
-    {
-        InfrastructureContribution ic = new InfrastructureContribution("fred", "mode", this);
-
-        assertEquals("fred", ic.getName());
-        assertEquals("mode", ic.getMode());
-        assertSame(ic.getObject(), this);
-    }
-
-    @Test
-    public void to_string()
-    {
-        InfrastructureContribution ic = new InfrastructureContribution("fred", "FRED");
-
-        assertEquals(ic.toString(), "<InfrastructureContribution: fred FRED>");
-
-        ic = new InfrastructureContribution("fred", "servlet", "FRED");
-
-        assertEquals(ic.toString(), "<InfrastructureContribution: fred mode:servlet FRED>");
-    }
-}
+import org.testng.annotations.Test;
+
+public class AliasContributionTest extends TestBase
+{
+    @Test
+    public void default_for_mode()
+    {
+        AliasContribution ic = new AliasContribution("fred", this);
+
+        assertEquals("fred", ic.getName());
+        assertEquals("", ic.getMode());
+        assertSame(ic.getObject(), this);
+    }
+
+    @Test
+    public void specific_mode()
+    {
+        AliasContribution ic = new AliasContribution("fred", "mode", this);
+
+        assertEquals("fred", ic.getName());
+        assertEquals("mode", ic.getMode());
+        assertSame(ic.getObject(), this);
+    }
+
+    @Test
+    public void to_string()
+    {
+        AliasContribution ic = new AliasContribution("fred", "FRED");
+
+        assertEquals(ic.toString(), "<AliasContribution: fred FRED>");
+
+        ic = new AliasContribution("fred", "servlet", "FRED");
+
+        assertEquals(ic.toString(), "<AliasContribution: fred mode:servlet FRED>");
+    }
+}

Modified: tapestry/tapestry5/tapestry-hibernate/trunk/src/main/java/org/apache/tapestry/hibernate/HibernateModule.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-hibernate/trunk/src/main/java/org/apache/tapestry/hibernate/HibernateModule.java?view=diff&rev=518235&r1=518234&r2=518235
==============================================================================
--- tapestry/tapestry5/tapestry-hibernate/trunk/src/main/java/org/apache/tapestry/hibernate/HibernateModule.java (original)
+++ tapestry/tapestry5/tapestry-hibernate/trunk/src/main/java/org/apache/tapestry/hibernate/HibernateModule.java Wed Mar 14 10:47:14 2007
@@ -26,8 +26,8 @@
 import org.apache.tapestry.ioc.annotations.Lifecycle;
 import org.apache.tapestry.ioc.services.PropertyShadowBuilder;
 import org.apache.tapestry.ioc.services.ThreadCleanupHub;
+import org.apache.tapestry.services.AliasContribution;
 import org.apache.tapestry.services.ApplicationGlobals;
-import org.apache.tapestry.services.InfrastructureContribution;
 import org.hibernate.Session;
 import org.hibernate.Transaction;
 
@@ -52,7 +52,7 @@
      * scanned for annotated entity classes.
      */
     public static void contributeHibernateSessionSource(Configuration<String> configuration,
-            @Inject("infrastructure:ApplicationGlobals")
+            @Inject("alias:ApplicationGlobals")
             ApplicationGlobals globals)
     {
         configuration.add(globals.getApplicationRootPackage() + ".entities");
@@ -101,12 +101,11 @@
      * Contributes the "session" property (type {@link Session}), the Hibernate Session for the
      * current request.
      */
-    public static void contributeInfrastructure(
-            Configuration<InfrastructureContribution> configuration,
+    public static void contributeAlias(Configuration<AliasContribution> configuration,
 
-            @InjectService("Session")
-            Session session)
+    @InjectService("Session")
+    Session session)
     {
-        configuration.add(new InfrastructureContribution("session", session));
+        configuration.add(new AliasContribution("session", session));
     }
 }

Modified: tapestry/tapestry5/tapestry-ioc/trunk/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-ioc/trunk/src/site/apt/index.apt?view=diff&rev=518235&r1=518234&r2=518235
==============================================================================
--- tapestry/tapestry5/tapestry-ioc/trunk/src/site/apt/index.apt (original)
+++ tapestry/tapestry5/tapestry-ioc/trunk/src/site/apt/index.apt Wed Mar 14 10:47:14 2007
@@ -40,7 +40,8 @@
     
   * Spring has a simple map/list/value configuration scheme, but it is not distributed; it is part of a single bean definition. 
     HiveMind and Tapestry 5 IoC allow service configuration to be assembled from multiple modules. This is very important
-    for seamless extensibility of the framework.
+    for seamless extensibility of the framework, with zero configuration (just drop the module into the classpath and 
+    everything hooks together).
   
 * Why Not HiveMind?
 

Modified: tapestry/tapestry5/tapestry-ioc/trunk/src/site/apt/module.apt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-ioc/trunk/src/site/apt/module.apt?view=diff&rev=518235&r1=518234&r2=518235
==============================================================================
--- tapestry/tapestry5/tapestry-ioc/trunk/src/site/apt/module.apt (original)
+++ tapestry/tapestry5/tapestry-ioc/trunk/src/site/apt/module.apt Wed Mar 14 10:47:14 2007
@@ -126,8 +126,8 @@
   then the service implementation will be needed. Creating service implementations
   requires the module builder instance ... that's a recursive reference. 
   
-  Another common example would be using @Inject("infrastructure:<property>") when the module being constructed
-  contributes into the tapestry.Infrastructure service's configuration. Here, to resolve the contribution, Tapestry
+  Another common example would be using @Inject("alias:<property>") when the module being constructed
+  contributes into the Alias service's configuration. Here, to resolve the contribution, Tapestry
   needs an instance of the module builder class even as it is trying to invoke the module builder's constructor.
   
   Tapestry detects these scenarios and throws a runtime exception to prevent an endless loop.

Modified: tapestry/tapestry5/tapestry-ioc/trunk/src/site/apt/provider.apt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-ioc/trunk/src/site/apt/provider.apt?view=diff&rev=518235&r1=518234&r2=518235
==============================================================================
--- tapestry/tapestry5/tapestry-ioc/trunk/src/site/apt/provider.apt (original)
+++ tapestry/tapestry5/tapestry-ioc/trunk/src/site/apt/provider.apt Wed Mar 14 10:47:14 2007
@@ -17,7 +17,7 @@
   understands the expression.
   
   In practice, @InjectService("Foo") and @Inject("service:Foo") work identically,
-  Here, the provider prefix is "service" and the expression
+  Here, the provider prefix is "service" and the expression (interprested as a service id)
   is "Foo".
   
 * service provider
@@ -25,11 +25,11 @@
   As outlined above, the service provider interprets the expression as
   a service id.
   
-* infrastructure provider
+* alias provider
 
   The tapestry module (provided by the {{{http://tapestry.apache.org/tapestry5/tapestry-core/}tapestry-core library}}) provides the
-  {{{http://tapestry.apache.org/tapestry5/tapestry-core/guide/infrastructure.html}infrastructure}} object provider, which to allow
-  for various forms of overrides.
+  {{{http://tapestry.apache.org/tapestry5/tapestry-core/guide/alias.html}alias}} object provider, which exists to allow
+  for various forms of service overrides.
     
 * default provider  
   

Modified: tapestry/tapestry5/tapestry-spring/trunk/src/main/java/org/apache/tapestry/spring/SpringModule.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-spring/trunk/src/main/java/org/apache/tapestry/spring/SpringModule.java?view=diff&rev=518235&r1=518234&r2=518235
==============================================================================
--- tapestry/tapestry5/tapestry-spring/trunk/src/main/java/org/apache/tapestry/spring/SpringModule.java (original)
+++ tapestry/tapestry5/tapestry-spring/trunk/src/main/java/org/apache/tapestry/spring/SpringModule.java Wed Mar 14 10:47:14 2007
@@ -29,7 +29,7 @@
      * {@link WebApplicationContext}.
      */
     public static ObjectProvider buildSpringObjectProvider(Log log,
-            @Inject("service:WebApplicationContext")
+            @InjectService("WebApplicationContext")
             WebApplicationContext context)
     {
         return new SpringObjectProvider(log, context);
@@ -41,7 +41,7 @@
      * href="http://static.springframework.org/spring/docs/1.2.x/reference/beans.html#context-create">standard
      * way</a> (which involves adding a listener to the web.xml deployment descriptor).
      */
-    public static WebApplicationContext build(@Inject("infrastructure:context")
+    public static WebApplicationContext build(@Inject("alias:context")
     Context context)
     {
         WebApplicationContext springContext = null;