use of com.adaptris.core.NullService in project interlok by adaptris.
the class MimeAggregatorTest method testService_MimeSplitter.
@Test
public void testService_MimeSplitter() throws Exception {
// This is a 3 part message, so that should generate 3 split messages; which should generate 4 parts at the end.
AdaptrisMessage msg = MimeJunitHelper.create();
PooledSplitJoinService service = new PooledSplitJoinService();
// The service doesn't actually matter right now.
service.setService(new NullService());
service.setTimeout(new TimeInterval(10L, TimeUnit.SECONDS));
service.setSplitter(new MimePartSplitter());
MimeAggregator aggr = createAggregatorForTests();
aggr.setEncoding("base64");
service.setAggregator(aggr);
execute(service, msg);
BodyPartIterator input = MimeHelper.createBodyPartIterator(msg);
assertEquals(4, input.size());
}
use of com.adaptris.core.NullService in project interlok by adaptris.
the class AdapterManagerTest method testMBean_AddSharedService.
@Test
public void testMBean_AddSharedService() throws Exception {
String adapterName = this.getClass().getSimpleName() + "." + getName();
Adapter adapter = createAdapter(adapterName);
AdapterManager adapterManager = new AdapterManager(adapter);
ObjectName adapterObj = adapterManager.createObjectName();
AdaptrisMarshaller m = DefaultMarshaller.getDefaultMarshaller();
try {
adapterManager.registerMBean();
AdapterManagerMBean amp = JMX.newMBeanProxy(mBeanServer, adapterObj, AdapterManagerMBean.class);
amp.addSharedService(m.marshal(new NullService(getName())));
Adapter marshalledAdapter = (Adapter) m.unmarshal(amp.getConfiguration());
assertEquals(1, marshalledAdapter.getSharedComponents().getServices().size());
assertEquals(getName(), marshalledAdapter.getSharedComponents().getServices().get(0).getUniqueId());
assertTrue(marshalledAdapter.getSharedComponents().getServiceIds().contains(getName()));
} finally {
}
}
use of com.adaptris.core.NullService in project interlok by adaptris.
the class AdapterManagerTest method testMBean_AddAndBindSharedService.
@Test
public void testMBean_AddAndBindSharedService() throws Exception {
String adapterName = this.getClass().getSimpleName() + "." + getName();
Adapter adapter = createAdapter(adapterName);
AdapterManager adapterManager = new AdapterManager(adapter);
ObjectName adapterObj = adapterManager.createObjectName();
AdaptrisMarshaller m = DefaultMarshaller.getDefaultMarshaller();
List<BaseComponentMBean> mBeans = new ArrayList<BaseComponentMBean>();
mBeans.add(adapterManager);
mBeans.addAll(adapterManager.getAllDescendants());
try {
register(mBeans);
adapterManager.requestStart();
AdapterManagerMBean amp = JMX.newMBeanProxy(mBeanServer, adapterObj, AdapterManagerMBean.class);
amp.addAndBindSharedService(m.marshal(new NullService(getName())));
Adapter marshalledAdapter = (Adapter) m.unmarshal(amp.getConfiguration());
assertEquals(1, marshalledAdapter.getSharedComponents().getServices().size());
assertEquals(getName(), marshalledAdapter.getSharedComponents().getServices().get(0).getUniqueId());
assertTrue(amp.getSharedServiceIds().contains(getName()));
assertTrue(amp.containsSharedService(getName()));
} finally {
adapterManager.requestClose();
}
}
use of com.adaptris.core.NullService in project interlok by adaptris.
the class BranchingServiceEnablerTest method testIsBranching.
@Test
public void testIsBranching() throws Exception {
BranchingServiceEnabler s = wrap(new NullService());
assertTrue(s.isBranching());
}
use of com.adaptris.core.NullService in project interlok by adaptris.
the class ServiceCollectionCase method testSize.
@Test
public void testSize() throws Exception {
ServiceCollectionImp sc = createServiceCollection();
sc.add(new NullService(UUID.randomUUID().toString()));
assertEquals(1, sc.size());
}
Aggregations