From: erik Date: Sun, 15 Nov 2009 10:41:14 +0000 (+0000) Subject: (no commit message) X-Git-Tag: wamblee-utils-0.2~1^2~54 X-Git-Url: http://wamblee.org/gitweb/?a=commitdiff_plain;h=a591aaa9ada684cf47656f405f5b88b95657ecf0;p=utils --- diff --git a/system/general/src/test/java/org/wamblee/system/adapters/SetterConfigurationTest.java b/system/general/src/test/java/org/wamblee/system/adapters/SetterConfigurationTest.java index 382beb36..34f06a38 100644 --- a/system/general/src/test/java/org/wamblee/system/adapters/SetterConfigurationTest.java +++ b/system/general/src/test/java/org/wamblee/system/adapters/SetterConfigurationTest.java @@ -317,6 +317,28 @@ public class SetterConfigurationTest extends AdapterTestCase { assertEquals("hello", obj.getHost()); assertNull(obj.getPort()); } + + public void testRemoveByMethodObject() throws NoSuchMethodException { + SetterConfiguration config = new SetterConfiguration(X6.class).initAllSetters(); + config.remove(X6.class.getMethod("setPort", Integer.class)); + List required = config.getRequiredInterfaces(); + Collections.sort(required, new RequiredInterfaceComparator()); + assertEquals(1, required.size()); + assertEquals("setHost", required.get(0).getName()); + + ProvidedInterface provided0 = new DefaultProvidedInterface("janse", + String.class); + required.get(0).setProvider(provided0); + _scope.publishInterface(provided0, "hello"); + + X6 obj = new X6(); + assertNull(obj.getHost()); + assertNull(obj.getPort()); + + config.inject(_scope, obj); + assertEquals("hello", obj.getHost()); + assertNull(obj.getPort()); + } public void testRemoveNonExisting() { final SetterConfiguration config = new SetterConfiguration(X6.class);