From 9a87e60f9f7be0bb7166c03f9fc8bce8f8bbec41 Mon Sep 17 00:00:00 2001 From: erik Date: Tue, 13 May 2008 22:24:43 +0000 Subject: [PATCH] Moving around a lot of files to work towards production components. --- .../src/main/java/org/wamblee/system/core/Container.java | 7 ++++--- .../java/org/wamblee/system/core/RequiredInterface.java | 2 +- .../system/core/DefaultRequiredInterfaceTest.java | 9 +++++++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/system/general/src/main/java/org/wamblee/system/core/Container.java b/system/general/src/main/java/org/wamblee/system/core/Container.java index 8075abab..a0130f7c 100644 --- a/system/general/src/main/java/org/wamblee/system/core/Container.java +++ b/system/general/src/main/java/org/wamblee/system/core/Container.java @@ -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 { private Set _componentNames; private CompositeInterfaceRestriction _restriction; private boolean _sealed; - - - public static ProvidedInterface[] filterProvidedServices( + + static ProvidedInterface[] filterProvidedServices( Component aClient, RequiredInterface aRequired, Collection> aProvided, InterfaceRestriction aRestriction) { List result = new ArrayList(); diff --git a/system/general/src/main/java/org/wamblee/system/core/RequiredInterface.java b/system/general/src/main/java/org/wamblee/system/core/RequiredInterface.java index d3a4e522..7f7fc348 100644 --- a/system/general/src/main/java/org/wamblee/system/core/RequiredInterface.java +++ b/system/general/src/main/java/org/wamblee/system/core/RequiredInterface.java @@ -45,5 +45,5 @@ public interface RequiredInterface { * Gets the provider interface. * @return Provider or null if not set. */ - ProvidedInterface getProvider(); + ProvidedInterface getProvider(); } diff --git a/system/general/src/test/java/org/wamblee/system/core/DefaultRequiredInterfaceTest.java b/system/general/src/test/java/org/wamblee/system/core/DefaultRequiredInterfaceTest.java index 1c56070c..972897cc 100644 --- a/system/general/src/test/java/org/wamblee/system/core/DefaultRequiredInterfaceTest.java +++ b/system/general/src/test/java/org/wamblee/system/core/DefaultRequiredInterfaceTest.java @@ -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()); + } } -- 2.31.1