use of org.apache.cxf.Bus in project cxf by apache.
the class SpringBusFactoryTest method testCustomFileName.
@Test
public void testCustomFileName() {
String cfgFile = "org/apache/cxf/bus/spring/resources/bus-overwrite.xml";
Bus bus = new SpringBusFactory().createBus(cfgFile, true);
checkCustomerConfiguration(bus);
}
use of org.apache.cxf.Bus in project cxf by apache.
the class SpringBusFactoryTest method testCustomFileURLFromSystemProperty.
@Test
public void testCustomFileURLFromSystemProperty() {
URL cfgFileURL = this.getClass().getResource("resources/bus-overwrite.xml");
System.setProperty(Configurer.USER_CFG_FILE_PROPERTY_URL, cfgFileURL.toString());
Bus bus = new SpringBusFactory().createBus((String) null, true);
checkCustomerConfiguration(bus);
System.clearProperty(Configurer.USER_CFG_FILE_PROPERTY_URL);
}
use of org.apache.cxf.Bus in project cxf by apache.
the class SpringBusFactoryTest method testJsr250.
@Test
public void testJsr250() {
Bus bus = new SpringBusFactory().createBus("org/apache/cxf/bus/spring/testjsr250.xml");
TestExtension te = bus.getExtension(TestExtension.class);
assertTrue("@PostConstruct annotated method has not been called.", te.postConstructMethodCalled);
assertTrue("@PreDestroy annoated method has been called already.", !te.preDestroyMethodCalled);
bus.shutdown(true);
assertTrue("@PreDestroy annotated method has not been called.", te.preDestroyMethodCalled);
}
use of org.apache.cxf.Bus in project cxf by apache.
the class SpringBusFactoryTest method testDefault.
@Test
public void testDefault() {
Bus bus = new SpringBusFactory().createBus();
assertNotNull(bus);
BindingFactoryManager bfm = bus.getExtension(BindingFactoryManager.class);
assertNotNull("No binding factory manager", bfm);
assertNotNull("No configurer", bus.getExtension(Configurer.class));
assertNotNull("No resource manager", bus.getExtension(ResourceManager.class));
assertNotNull("No destination factory manager", bus.getExtension(DestinationFactoryManager.class));
assertNotNull("No conduit initiator manager", bus.getExtension(ConduitInitiatorManager.class));
assertNotNull("No phase manager", bus.getExtension(PhaseManager.class));
assertNotNull("No workqueue manager", bus.getExtension(WorkQueueManager.class));
assertNotNull("No lifecycle manager", bus.getExtension(BusLifeCycleManager.class));
assertNotNull("No service registry", bus.getExtension(ServerRegistry.class));
try {
bfm.getBindingFactory("http://cxf.apache.org/unknown");
} catch (BusException ex) {
// expected
}
assertEquals("Unexpected interceptors", 0, bus.getInInterceptors().size());
assertEquals("Unexpected interceptors", 0, bus.getInFaultInterceptors().size());
assertEquals("Unexpected interceptors", 0, bus.getOutInterceptors().size());
assertEquals("Unexpected interceptors", 0, bus.getOutFaultInterceptors().size());
}
use of org.apache.cxf.Bus in project cxf by apache.
the class SpringBusFactoryTest method testPhases.
@Test
public void testPhases() {
Bus bus = new SpringBusFactory().createBus();
PhaseManager cxfPM = bus.getExtension(PhaseManager.class);
PhaseManager defaultPM = new PhaseManagerImpl();
SortedSet<Phase> cxfPhases = cxfPM.getInPhases();
SortedSet<Phase> defaultPhases = defaultPM.getInPhases();
assertEquals(defaultPhases.size(), cxfPhases.size());
assertTrue(cxfPhases.equals(defaultPhases));
cxfPhases = cxfPM.getOutPhases();
defaultPhases = defaultPM.getOutPhases();
assertEquals(defaultPhases.size(), cxfPhases.size());
assertTrue(cxfPhases.equals(defaultPhases));
}
Aggregations