Search in sources :

Example 1 with DefaultDeploymentModelFactory

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();
}
Also used : Bus(org.apache.cxf.Bus) DefaultDeploymentModelFactory(org.jboss.ws.common.deployment.DefaultDeploymentModelFactory) SOAPAddressRewriteMetadata(org.jboss.wsf.spi.metadata.config.SOAPAddressRewriteMetadata) Deployment(org.jboss.wsf.spi.deployment.Deployment) BusLifeCycleManager(org.apache.cxf.buslifecycle.BusLifeCycleManager)

Example 2 with DefaultDeploymentModelFactory

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());
}
Also used : Bus(org.apache.cxf.Bus) DefaultDeploymentModelFactory(org.jboss.ws.common.deployment.DefaultDeploymentModelFactory) SOAPAddressRewriteMetadata(org.jboss.wsf.spi.metadata.config.SOAPAddressRewriteMetadata) Deployment(org.jboss.wsf.spi.deployment.Deployment) BusLifeCycleManager(org.apache.cxf.buslifecycle.BusLifeCycleManager)

Example 3 with DefaultDeploymentModelFactory

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());
}
Also used : Bus(org.apache.cxf.Bus) DefaultDeploymentModelFactory(org.jboss.ws.common.deployment.DefaultDeploymentModelFactory) SOAPAddressRewriteMetadata(org.jboss.wsf.spi.metadata.config.SOAPAddressRewriteMetadata) Deployment(org.jboss.wsf.spi.deployment.Deployment) BusLifeCycleManager(org.apache.cxf.buslifecycle.BusLifeCycleManager)

Example 4 with DefaultDeploymentModelFactory

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();
    }
}
Also used : DDBeans(org.jboss.wsf.stack.cxf.metadata.services.DDBeans) DefaultDeploymentModelFactory(org.jboss.ws.common.deployment.DefaultDeploymentModelFactory) HashMap(java.util.HashMap) JBossWebservicesMetaData(org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData) SOAPAddressRewriteMetadata(org.jboss.wsf.spi.metadata.config.SOAPAddressRewriteMetadata) Deployment(org.jboss.wsf.spi.deployment.Deployment) PolicyEngine(org.apache.cxf.ws.policy.PolicyEngine)

Aggregations

DefaultDeploymentModelFactory (org.jboss.ws.common.deployment.DefaultDeploymentModelFactory)4 Deployment (org.jboss.wsf.spi.deployment.Deployment)4 SOAPAddressRewriteMetadata (org.jboss.wsf.spi.metadata.config.SOAPAddressRewriteMetadata)4 Bus (org.apache.cxf.Bus)3 BusLifeCycleManager (org.apache.cxf.buslifecycle.BusLifeCycleManager)3 HashMap (java.util.HashMap)1 PolicyEngine (org.apache.cxf.ws.policy.PolicyEngine)1 JBossWebservicesMetaData (org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData)1 DDBeans (org.jboss.wsf.stack.cxf.metadata.services.DDBeans)1