/*
- * Copyright 2008 the original author or authors.
- *
+ * Copyright 2005-2010 the original author or authors.
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.wamblee.system.adapters;
-import org.wamblee.system.core.DefaultProvidedInterface;
-import org.wamblee.system.core.ProvidedInterface;
-import org.wamblee.system.core.RequiredInterface;
-import org.wamblee.system.core.RequiredInterfaceComparator;
-
-import org.wamblee.test.AssertionUtils;
-
import java.lang.reflect.Method;
-
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import javax.sql.DataSource;
+import org.wamblee.system.core.DefaultProvidedInterface;
+import org.wamblee.system.core.ProvidedInterface;
+import org.wamblee.system.core.RequiredInterface;
+import org.wamblee.system.core.RequiredInterfaceComparator;
+import org.wamblee.system.core.Scope;
+import org.wamblee.test.AssertionUtils;
+
/**
*
* @author $author$
ProvidedInterface provided = new DefaultProvidedInterface("janse",
String.class);
required.get(0).setProvider(provided);
+ Scope scope = getScope();
scope.publishInterface(provided, "hello");
X5 obj = new X5();
"janse", String.class);
assertTrue(required.get(0).implementedBy(providedString));
required.get(0).setProvider(providedString);
+ Scope scope = getScope();
scope.publishInterface(providedString, "hello");
ProvidedInterface providedInt = new DefaultProvidedInterface("xxx",
"janse", Boolean.class);
assertTrue(required.get(0).implementedBy(providedBoolean));
required.get(0).setProvider(providedBoolean);
+ Scope scope = getScope();
scope.publishInterface(providedBoolean, true);
ProvidedInterface providedString = new DefaultProvidedInterface(
ProvidedInterface provided0 = new DefaultProvidedInterface("janse",
String.class);
required.get(0).setProvider(provided0);
+ Scope scope = getScope();
scope.publishInterface(provided0, "hello");
ProvidedInterface provided1 = new DefaultProvidedInterface("port",
ProvidedInterface provided = new DefaultProvidedInterface("janse",
String.class);
required.get(0).setProvider(provided);
+ final Scope scope = getScope();
scope.publishInterface(provided, "hello");
final X6 obj = new X6();
X5 obj = new X5();
assertNull(obj.getValue());
+ Scope scope = getScope();
config.inject(scope, obj);
assertEquals("bladibla", obj.getValue());
}
assertNull(obj.getHost());
assertNull(obj.getPort());
+ Scope scope = getScope();
config.inject(scope, obj);
assertNull(obj.getHost());
ProvidedInterface provided0 = new DefaultProvidedInterface("janse",
String.class);
required.get(0).setProvider(provided0);
+ Scope scope = getScope();
scope.publishInterface(provided0, "hello");
X6 obj = new X6();
ProvidedInterface provided0 = new DefaultProvidedInterface("janse",
String.class);
required.get(0).setProvider(provided0);
+ Scope scope = getScope();
scope.publishInterface(provided0, "hello");
X6 obj = new X6();
}
public void testAddPrivate() {
- X5 obj = new X5();
final SetterConfiguration config = new SetterConfiguration(X5.class);
AssertionUtils.assertException(new AssertionUtils.ErroneousCode() {
@Override
ProvidedInterface provided0 = new DefaultProvidedInterface("janse",
String.class);
required.get(0).setProvider(provided0);
+ Scope scope = getScope();
scope.publishInterface(provided0, "hello");
X6 obj = new X6();
ProvidedInterface provided0 = new DefaultProvidedInterface("janse",
String.class);
required.get(0).setProvider(provided0);
+ Scope scope = getScope();
scope.publishInterface(provided0, "hello");
X6 obj = new X6();