use of org.jboss.ws.common.deployment.DefaultDeploymentModelFactory in project jbossws-cxf by jbossws.
the class BusHolderLifeCycleTestCase method shutdownTestWithNoShutdown.
private static void shutdownTestWithNoShutdown(BusHolder holder) {
Bus bus = holder.getBus();
TestLifeCycleListener listener = new TestLifeCycleListener();
bus.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(listener);
Deployment dep = new DefaultDeploymentModelFactory().newDeployment("testDeployment", null, null);
dep.addAttachment(SOAPAddressRewriteMetadata.class, new SOAPAddressRewriteMetadata(getTestServerConfig(), null));
holder.configure(null, null, null, dep);
assertEquals("preShutdown method on listener shouldn't be called before holder is closed: number of actual calls: " + listener.getCount(), 0, listener.getCount());
holder.close();
}
use of org.jboss.ws.common.deployment.DefaultDeploymentModelFactory in project jbossws-cxf by jbossws.
the class BusHolderLifeCycleTestCase method shutdownTestWithInnerShutdown.
private static void shutdownTestWithInnerShutdown(BusHolder holder) {
Bus bus = holder.getBus();
TestLifeCycleListener listener = new TestLifeCycleListener();
bus.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(listener);
Deployment dep = new DefaultDeploymentModelFactory().newDeployment("testDeployment", null, null);
dep.addAttachment(SOAPAddressRewriteMetadata.class, new SOAPAddressRewriteMetadata(getTestServerConfig(), null));
holder.configure(null, null, null, dep);
bus.shutdown(true);
holder.close();
assertEquals("preShutdown method on listener should be called exactly once; number of actual calls: " + listener.getCount(), 1, listener.getCount());
}
use of org.jboss.ws.common.deployment.DefaultDeploymentModelFactory in project jbossws-cxf by jbossws.
the class BusHolderLifeCycleTestCase method simpleShutdownTest.
private static void simpleShutdownTest(BusHolder holder) {
Bus bus = holder.getBus();
TestLifeCycleListener listener = new TestLifeCycleListener();
bus.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(listener);
Deployment dep = new DefaultDeploymentModelFactory().newDeployment("testDeployment", null, null);
dep.addAttachment(SOAPAddressRewriteMetadata.class, new SOAPAddressRewriteMetadata(getTestServerConfig(), null));
holder.configure(null, null, null, dep);
holder.close();
assertEquals("preShutdown method on listener should be called exactly once; number of actual calls: " + listener.getCount(), 1, listener.getCount());
}
use of org.jboss.ws.common.deployment.DefaultDeploymentModelFactory in project jbossws-cxf by jbossws.
the class BusHolderTest method setupPropertyAndGetAlternativeSelector.
private static String setupPropertyAndGetAlternativeSelector(String alternative) {
JBossWebservicesMetaData wsmd = null;
if (alternative != null) {
Map<String, String> props = new HashMap<String, String>();
props.put(Constants.CXF_POLICY_ALTERNATIVE_SELECTOR_PROP, alternative);
wsmd = new JBossWebservicesMetaData(null, null, null, null, props, null, null);
}
BusHolder holder = new BusHolder(new DDBeans());
try {
Deployment dep = new DefaultDeploymentModelFactory().newDeployment("testDeployment", null, null);
dep.addAttachment(SOAPAddressRewriteMetadata.class, new SOAPAddressRewriteMetadata(getTestServerConfig(), null));
holder.configure(null, null, wsmd, dep);
return holder.getBus().getExtension(PolicyEngine.class).getAlternativeSelector().getClass().getName();
} finally {
holder.close();
}
}
Aggregations