X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=system%2Fgeneral%2Fsrc%2Ftest%2Fjava%2Forg%2Fwamblee%2Fsystem%2Fcore%2FDefaultScopeTest.java;h=311694aa304a45635efc12e14cabfa6ba88efda5;hb=f4d446b84fa1a38ed83cd157f79fdb8233822145;hp=7199c6fb4fc6f00f3366ab9159cd0c48d24aae1f;hpb=246a6a94ac725ea202a79591a69530014bf1da5f;p=utils diff --git a/system/general/src/test/java/org/wamblee/system/core/DefaultScopeTest.java b/system/general/src/test/java/org/wamblee/system/core/DefaultScopeTest.java index 7199c6fb..311694aa 100644 --- a/system/general/src/test/java/org/wamblee/system/core/DefaultScopeTest.java +++ b/system/general/src/test/java/org/wamblee/system/core/DefaultScopeTest.java @@ -1,47 +1,65 @@ /* * Copyright 2008 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.core; import junit.framework.TestCase; + +/** + * DOCUMENT ME! + * + * @author $author$ + * @version $Revision$ + */ public class DefaultScopeTest extends TestCase { - - public void testLookup() { - ProvidedInterface provider = new DefaultProvidedInterface("x", Integer.class); - Scope scope = new DefaultScope(new ProvidedInterface[0]); - + /** + * DOCUMENT ME! + */ + public void testLookup() { + ProvidedInterface provider = new DefaultProvidedInterface("x", + Integer.class); + Scope scope = new DefaultScope(new ProvidedInterface[0]); + scope.publishInterface(provider, 100); - assertEquals(100, scope.getInterfaceImplementation(provider, Integer.class).intValue()); + assertEquals(100, + scope.getInterfaceImplementation(provider, Integer.class).intValue()); } - - public void testNestedLookup() { - ProvidedInterface provider1 = new DefaultProvidedInterface("x", Integer.class); - Scope parent = new DefaultScope(new ProvidedInterface[0]); - + + /** + * DOCUMENT ME! + */ + public void testNestedLookup() { + ProvidedInterface provider1 = new DefaultProvidedInterface("x", + Integer.class); + Scope parent = new DefaultScope(new ProvidedInterface[0]); + parent.publishInterface(provider1, 100); - - ProvidedInterface provider2 = new DefaultProvidedInterface("y", String.class); - Scope child = new DefaultScope(new ProvidedInterface[0], parent); - + + ProvidedInterface provider2 = new DefaultProvidedInterface("y", + String.class); + Scope child = new DefaultScope(new ProvidedInterface[0], + parent); + child.publishInterface(provider2, "hallo"); - + assertFalse(provider1.equals(provider2)); - - assertEquals(100, child.getInterfaceImplementation(provider1, Integer.class).intValue()); - assertEquals("hallo", child.getInterfaceImplementation(provider2, String.class)); - } + assertEquals(100, + child.getInterfaceImplementation(provider1, Integer.class).intValue()); + assertEquals("hallo", + child.getInterfaceImplementation(provider2, String.class)); + } }