Moving around a lot of files to work towards production components.
authorerik <erik@77661180-640e-0410-b3a8-9f9b13e6d0e0>
Tue, 13 May 2008 22:24:43 +0000 (22:24 +0000)
committererik <erik@77661180-640e-0410-b3a8-9f9b13e6d0e0>
Tue, 13 May 2008 22:24:43 +0000 (22:24 +0000)
trunk/system/general/src/main/java/org/wamblee/system/core/Container.java
trunk/system/general/src/main/java/org/wamblee/system/core/RequiredInterface.java
trunk/system/general/src/test/java/org/wamblee/system/core/DefaultRequiredInterfaceTest.java

index 8075abab3c7fcc703b5cbcdc9a22c2e105a58096..a0130f7cf3420094198d72b616f3b281a1973987 100644 (file)
@@ -25,6 +25,8 @@ import java.util.Set;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.wamblee.collections.CollectionFilter;
+import org.wamblee.conditions.Condition;
 import org.wamblee.general.Pair;
 
 /**
@@ -40,9 +42,8 @@ public class Container extends AbstractComponent<Scope> {
     private Set<String> _componentNames;
     private CompositeInterfaceRestriction _restriction; 
     private boolean _sealed;
-
-
-    public static ProvidedInterface[] filterProvidedServices(
+   
+    static ProvidedInterface[] filterProvidedServices(
             Component aClient, RequiredInterface aRequired, Collection<Pair<ProvidedInterface,Component>> aProvided,
             InterfaceRestriction aRestriction) {
         List<ProvidedInterface> result = new ArrayList<ProvidedInterface>();
index d3a4e5229483f642be14e8494736f46905f7cd9a..7f7fc348d411b308f6b0fe1c40cb4dd6eb7b0b55 100644 (file)
@@ -45,5 +45,5 @@ public interface RequiredInterface {
         * Gets the provider interface. 
         * @return Provider or null if not set. 
         */
-       ProvidedInterface getProvider(); 
+       ProvidedInterface getProvider();
 }
index 1c56070caba15c70a0a90a3b91f264b56c3b2714..972897cc32e8844bb426dd1ba933e8193c213887 100644 (file)
@@ -38,4 +38,13 @@ public class DefaultRequiredInterfaceTest extends TestCase {
                                new DefaultRequiredInterface("a", new Class[]{ String.class, Integer.class})));
                
        }
+       
+       public void testCopy() { 
+           DefaultRequiredInterface required = new DefaultRequiredInterface("a", new Class[]{ String.class, Integer.class}, true);
+           RequiredInterface copy = required.copy(); 
+           assertTrue(copy instanceof DefaultRequiredInterface); 
+           assertEquals(required.getName(), copy.getName());
+           assertEquals(required.isOptional(), copy.isOptional()); 
+           assertEquals(required.toString(), copy.toString());
+       }
 }