use of com.adaptris.core.stubs.MockAllowsRetriesConnection in project interlok by adaptris.
the class AdapterComponentCheckerTest method testCheckInitialised_RetriesConnection.
@Test
public void testCheckInitialised_RetriesConnection() throws Exception {
String adapterName = this.getClass().getSimpleName() + "." + getName();
Adapter adapter = createAdapter(adapterName, 2, 2);
List<BaseComponentMBean> mBeans = createJmxManagers(adapter);
ObjectName objectName = createComponentCheckerObjectName(adapterName);
register(mBeans);
AdapterComponentCheckerMBean manager = JMX.newMBeanProxy(mBeanServer, objectName, AdapterComponentCheckerMBean.class);
manager.checkInitialise(DefaultMarshaller.getDefaultMarshaller().marshal(new MockAllowsRetriesConnection()));
manager.checkInitialise(DefaultMarshaller.getDefaultMarshaller().marshal(new MockAllowsRetriesConnection(1)));
}
use of com.adaptris.core.stubs.MockAllowsRetriesConnection in project interlok by adaptris.
the class AdapterComponentCheckerTest method createConnectedServices.
private String createConnectedServices(String sharedName) throws Exception {
ServiceList nestedList = new ServiceList();
nestedList.add(new StandaloneProducer(new MockAllowsRetriesConnection(6), new NullMessageProducer()));
if (!StringUtils.isEmpty(sharedName)) {
nestedList.add(new StatelessServiceWrapper(new StandaloneProducer(new SharedConnection(sharedName), new NullMessageProducer())));
} else {
nestedList.add(new StatelessServiceWrapper(new StandaloneProducer()));
}
nestedList.add(new AddMetadataService(new ArrayList(Arrays.asList(new MetadataElement[] { new MetadataElement("key", "value") }))));
ServiceList list = new ServiceList();
list.add(nestedList);
list.add(new JdbcServiceList());
return DefaultMarshaller.getDefaultMarshaller().marshal(list);
}
use of com.adaptris.core.stubs.MockAllowsRetriesConnection in project interlok by adaptris.
the class ServiceUtilTest method testRewriteForTesting_RetriesConnection.
@Test
public void testRewriteForTesting_RetriesConnection() throws Exception {
MockAllowsRetriesConnection conn = new MockAllowsRetriesConnection(55);
StandaloneProducer service = new StandaloneProducer(conn, new NullMessageProducer());
StandaloneProducer rewritten = ((StandaloneProducer) rewriteConnectionsForTesting(service));
assertNotSame(conn, rewritten.getConnection());
assertNotSame(55, ((AllowsRetriesConnection) rewritten.getConnection()).getConnectionAttempts());
}
use of com.adaptris.core.stubs.MockAllowsRetriesConnection in project interlok by adaptris.
the class ServiceUtilTest method createConnectedServices.
private String createConnectedServices() throws Exception {
ServiceList nestedList = new ServiceList();
nestedList.add(new StandaloneProducer(new MockAllowsRetriesConnection(6), new NullMessageProducer()));
nestedList.add(new StatelessServiceWrapper(new StandaloneProducer()));
nestedList.add(new AddMetadataService(new ArrayList(Arrays.asList(new MetadataElement[] { new MetadataElement("key", "value") }))));
ServiceList list = new ServiceList();
list.add(nestedList);
list.add(new JdbcServiceList());
return DefaultMarshaller.getDefaultMarshaller().marshal(list);
}
Aggregations