use of com.adaptris.core.NullService in project interlok by adaptris.
the class RetryFromJettyTest method testExecuteQuietly.
@Test
public void testExecuteQuietly() throws Exception {
AdaptrisMessage msg = AdaptrisMessageFactory.getDefaultInstance().newMessage();
NullService s1 = new NullService();
ThrowExceptionService s2 = new ThrowExceptionService(new ConfiguredException("failure"));
try {
start(s1, s2);
RetryFromJetty.executeQuietly(s1, msg);
RetryFromJetty.executeQuietly(s2, msg);
} finally {
stop(s1, s2);
}
}
use of com.adaptris.core.NullService in project interlok by adaptris.
the class SharedServiceConfigurationCheckerTest method testServiceExist.
@Test
public void testServiceExist() throws Exception {
BootstrapProperties mockBootProperties = new MockBootProperties(createAdapterConfig(new NullService("SharedNullService"), new SharedService("SharedNullService")));
ConfigurationCheckReport report = checker.performConfigCheck(mockBootProperties);
assertTrue(report.isCheckPassed());
assertNotNull(report.toString());
}
use of com.adaptris.core.NullService in project interlok by adaptris.
the class SharedServiceConfigurationCheckerTest method testServiceInServiceCollectionExist.
@Test
public void testServiceInServiceCollectionExist() throws Exception {
BootstrapProperties mockBootProperties = new MockBootProperties(createAdapterConfig(new NullService("SharedNullService"), new ServiceList(new SharedService("SharedNullService"))));
ConfigurationCheckReport report = checker.performConfigCheck(mockBootProperties);
assertTrue(report.isCheckPassed());
assertNotNull(report.toString());
}
use of com.adaptris.core.NullService in project interlok by adaptris.
the class AdapterManagerTest method testMBean_RemoveSharedComponent.
@Test
public void testMBean_RemoveSharedComponent() throws Exception {
String adapterName = this.getClass().getSimpleName() + "." + getName();
Adapter adapter = createAdapter(adapterName);
adapter.getSharedComponents().addService(new NullService(NullService.class.getCanonicalName()));
adapter.getSharedComponents().addConnection(new NullConnection(NullConnection.class.getCanonicalName()));
AdapterManager adapterManager = new AdapterManager(adapter);
ObjectName adapterObj = adapterManager.createObjectName();
AdaptrisMarshaller m = DefaultMarshaller.getDefaultMarshaller();
try {
adapterManager.registerMBean();
AdapterManagerMBean amp = JMX.newMBeanProxy(mBeanServer, adapterObj, AdapterManagerMBean.class);
assertTrue(amp.removeSharedComponent(NullService.class.getCanonicalName()));
assertFalse(amp.removeSharedComponent("HelloWorld"));
Adapter marshalledAdapter = (Adapter) m.unmarshal(amp.getConfiguration());
assertEquals(0, marshalledAdapter.getSharedComponents().getServices().size());
assertTrue(amp.removeSharedComponent(NullConnection.class.getCanonicalName()));
marshalledAdapter = (Adapter) m.unmarshal(amp.getConfiguration());
assertEquals(0, marshalledAdapter.getSharedComponents().getConnections().size());
} finally {
}
}
use of com.adaptris.core.NullService in project interlok by adaptris.
the class AdapterManagerTest method testMBean_RemoveSharedService.
@Test
public void testMBean_RemoveSharedService() throws Exception {
String adapterName = this.getClass().getSimpleName() + "." + getName();
Adapter adapter = createAdapter(adapterName);
adapter.getSharedComponents().addService(new NullService(getName()));
AdapterManager adapterManager = new AdapterManager(adapter);
ObjectName adapterObj = adapterManager.createObjectName();
AdaptrisMarshaller m = DefaultMarshaller.getDefaultMarshaller();
try {
adapterManager.registerMBean();
AdapterManagerMBean amp = JMX.newMBeanProxy(mBeanServer, adapterObj, AdapterManagerMBean.class);
assertTrue(amp.removeSharedService(getName()));
assertFalse(amp.removeSharedService("HelloWorld"));
Adapter marshalledAdapter = (Adapter) m.unmarshal(amp.getConfiguration());
assertEquals(0, marshalledAdapter.getSharedComponents().getServices().size());
} finally {
}
}
Aggregations