git://wamblee.org
/
utils
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
findbugs
[utils]
/
system
/
general
/
src
/
test
/
java
/
org
/
wamblee
/
system
/
core
/
DefaultScopeTest.java
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 7199c6fb4fc6f00f3366ab9159cd0c48d24aae1f..5ad4dd588a10c0e38f8471d0f9f0ea0b376e28bf 100644
(file)
--- 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,5
+1,5
@@
/*
/*
- * Copyright 200
8
the original author or authors.
+ * Copyright 200
5-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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-17,31
+17,40
@@
package org.wamblee.system.core;
import junit.framework.TestCase;
import junit.framework.TestCase;
+/**
+ *
+ * @author $author$
+ * @version $Revision$
+ */
public class DefaultScopeTest extends TestCase {
public class DefaultScopeTest extends TestCase {
-
- public void testLookup() {
-
ProvidedInterface provider = new DefaultProvidedInterface("x",
Integer.class);
- Scope scope = new DefaultScope(new ProvidedInterface[0]);
-
+ public void testLookup() {
+ ProvidedInterface provider = new DefaultProvidedInterface("x",
+
Integer.class);
+ Scope scope = new DefaultScope(new ProvidedInterface[0]);
+
scope.publishInterface(provider, 100);
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);
+
+ public void testNestedLookup() {
+ ProvidedInterface provider1 = new DefaultProvidedInterface("x",
+ Integer.class);
Scope parent = new DefaultScope(new ProvidedInterface[0]);
Scope parent = new DefaultScope(new ProvidedInterface[0]);
-
+
parent.publishInterface(provider1, 100);
parent.publishInterface(provider1, 100);
-
- ProvidedInterface provider2 = new DefaultProvidedInterface("y", String.class);
+
+ ProvidedInterface provider2 = new DefaultProvidedInterface("y",
+ String.class);
Scope child = new DefaultScope(new ProvidedInterface[0], parent);
Scope child = new DefaultScope(new ProvidedInterface[0], parent);
-
+
child.publishInterface(provider2, "hallo");
child.publishInterface(provider2, "hallo");
-
+
assertFalse(provider1.equals(provider2));
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));
+ }
}
}