import org.junit.Before;
import org.junit.Test;
import org.wamblee.xmlrouter.common.Id;
-import org.wamblee.xmlrouter.config.Config;
import org.wamblee.xmlrouter.config.Identifiable;
public class ConfigImplTest {
}
public static final class MyTypeConfig extends ConfigImpl<MyType> {
- public MyTypeConfig(Id<Config> aId) {
+ public MyTypeConfig(String aId) {
super(MyType.class, aId);
}
@Before
public void setUp() {
sequence = new AtomicLong(1L);
- config = new MyTypeConfig(new Id<Config>(CONFIG_TYPE));
+ config = new MyTypeConfig(CONFIG_TYPE);
}
@Test
@Test
public void testEquals() {
- Config<MyType> config1 = new MyTypeConfig(new Id<Config>(CONFIG_TYPE));
+ Config<MyType> config1 = new MyTypeConfig(CONFIG_TYPE);
assertFalse(config1.equals(null));
assertFalse(config1.equals("hello"));
- Config<MyType> config2 = new MyTypeConfig(new Id<Config>(CONFIG_TYPE));
+ Config<MyType> config2 = new MyTypeConfig(CONFIG_TYPE);
assertEquals(config1, config2);
assertEquals(config1.hashCode(), config2.hashCode());
testAdd();
assertEquals(2, config.values().size());
MyTypeConfig copy = new MyTypeConfig(config);
- assertEquals(config.getId(), config.getId());
+ assertEquals(config.getPrefix(), copy.getPrefix());
assertEquals(config, copy);
// verify the copy is not shallow