use of com.adaptris.core.lifecycle.FilteredSharedComponentStart in project interlok by adaptris.
the class SharedComponentListTest method testInterlok_1096.
// FilteredStart was removing connections
// from the underlying list.
@Test
public void testInterlok_1096() throws Exception {
SharedComponentList list = new SharedComponentList();
List<AdaptrisConnection> good = Arrays.asList(new AdaptrisConnection[] { new MockConnection(getName()), new MockConnection(getName() + "_1") });
list.setConnections(new ArrayList<>(good));
FilteredSharedComponentStart starter = new FilteredSharedComponentStart();
starter.addExclude(getName());
starter.addExclude(getName() + "_1");
list.setLifecycleStrategy(starter);
try {
LifecycleHelper.init(list);
LifecycleHelper.start(list);
assertEquals(2, list.getConnections().size());
for (AdaptrisConnection c : good) {
assertEquals(ClosedState.getInstance(), c.retrieveComponentState());
}
} finally {
stop(list);
}
}
Aggregations