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<RequiredInterface> 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);