git://wamblee.org
/
xmlrouter
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added copying of SingleRouterConfig.
[xmlrouter]
/
impl
/
src
/
test
/
java
/
org
/
wamblee
/
xmlrouter
/
impl
/
CompositeConfigTest.java
diff --git
a/impl/src/test/java/org/wamblee/xmlrouter/impl/CompositeConfigTest.java
b/impl/src/test/java/org/wamblee/xmlrouter/impl/CompositeConfigTest.java
index 1875d4b96d6ab65238eb6b1629a77f22242acaae..9905046d9463998e38f5cb5c4e92cf487b4a3a6a 100644
(file)
--- a/
impl/src/test/java/org/wamblee/xmlrouter/impl/CompositeConfigTest.java
+++ b/
impl/src/test/java/org/wamblee/xmlrouter/impl/CompositeConfigTest.java
@@
-22,7
+22,7
@@
import java.util.List;
import org.junit.Test;
import org.wamblee.xmlrouter.common.Id;
import org.wamblee.xmlrouter.config.Config;
import org.junit.Test;
import org.wamblee.xmlrouter.common.Id;
import org.wamblee.xmlrouter.config.Config;
-import org.wamblee.xmlrouter.config.
Duplicate
Exception;
+import org.wamblee.xmlrouter.config.
Config
Exception;
import org.wamblee.xmlrouter.config.Identifiable;
public class CompositeConfigTest {
import org.wamblee.xmlrouter.config.Identifiable;
public class CompositeConfigTest {
@@
-60,24
+60,23
@@
public class CompositeConfigTest {
@Test
public void testEmptyConfig() {
@Test
public void testEmptyConfig() {
- Config<IntClass> composite = composite("c");
- assertEquals(id("c"), composite.getId());
+ Config<IntClass> composite = composite();
assertTrue(composite.values().isEmpty());
}
@Test(expected = RuntimeException.class)
public void testAddNotAllowed() {
assertTrue(composite.values().isEmpty());
}
@Test(expected = RuntimeException.class)
public void testAddNotAllowed() {
- composite(
"c"
).add(new IntClass(10));
+ composite().add(new IntClass(10));
}
@Test(expected = RuntimeException.class)
public void testRemoveNotAllowed() {
}
@Test(expected = RuntimeException.class)
public void testRemoveNotAllowed() {
- composite(
"c"
).remove(new Id<IntClass>("xxx"));
+ composite().remove(new Id<IntClass>("xxx"));
}
@Test
public void testAddConfig() {
}
@Test
public void testAddConfig() {
- CompositeConfig<IntClass> composite = composite(
"c"
);
+ CompositeConfig<IntClass> composite = composite();
Config<IntClass> c1 = new ConfigImpl(id("c1")) {
@Override
public Identifiable wrap(String aPrefix, Identifiable aT) {
Config<IntClass> c1 = new ConfigImpl(id("c1")) {
@Override
public Identifiable wrap(String aPrefix, Identifiable aT) {
@@
-116,9
+115,9
@@
public class CompositeConfigTest {
assertTrue(values.contains(i4));
}
assertTrue(values.contains(i4));
}
- @Test(expected =
Duplicate
Exception.class)
+ @Test(expected =
Config
Exception.class)
public void testDuplicatesNotAllowed() {
public void testDuplicatesNotAllowed() {
- CompositeConfig<IntClass> composite = composite(
"c"
);
+ CompositeConfig<IntClass> composite = composite();
Config<IntClass> c1 = new ConfigImpl(id("c1")) {
@Override
public Identifiable wrap(String aPrefix, Identifiable aT) {
Config<IntClass> c1 = new ConfigImpl(id("c1")) {
@Override
public Identifiable wrap(String aPrefix, Identifiable aT) {
@@
-137,7
+136,7
@@
public class CompositeConfigTest {
@Test
public void testDuplicateItem() {
@Test
public void testDuplicateItem() {
- CompositeConfig<IntClass> composite = composite(
"c"
);
+ CompositeConfig<IntClass> composite = composite();
Config<IntClass> c1 = new ConfigImpl(id("c1")) {
@Override
public Identifiable wrap(String aPrefix, Identifiable aT) {
Config<IntClass> c1 = new ConfigImpl(id("c1")) {
@Override
public Identifiable wrap(String aPrefix, Identifiable aT) {
@@
-159,15
+158,15
@@
public class CompositeConfigTest {
try {
composite.addConfig(c2);
fail();
try {
composite.addConfig(c2);
fail();
- } catch (
Duplicate
Exception e) {
+ } catch (
Config
Exception e) {
// ok.
}
assertEquals(1, composite.values().size());
assertTrue(composite.values().contains(i1));
}
// ok.
}
assertEquals(1, composite.values().size());
assertTrue(composite.values().contains(i1));
}
- private CompositeConfig<IntClass> composite(
String aId
) {
- return new CompositeConfig<IntClass>(
id(aId)
);
+ private CompositeConfig<IntClass> composite() {
+ return new CompositeConfig<IntClass>();
}
private Id<Config> id(String aId) {
}
private Id<Config> id(String aId) {