use of org.apache.cxf.binding.corba.CorbaBindingFactory in project cxf by apache.
the class CorbaBindingFactoryConfigurerTest method testOrbConfiguration.
@Test
public void testOrbConfiguration() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL cxfConfig = null;
cxfConfig = ClassLoaderUtils.getResource("corba_binding_factory_configurer.xml", this.getClass());
bus = bf.createBus(cxfConfig);
BusFactory.setDefaultBus(bus);
BindingFactoryManager bfm = bus.getExtension(BindingFactoryManager.class);
CorbaBindingFactory factory = (CorbaBindingFactory) bfm.getBindingFactory("http://cxf.apache.org/bindings/corba");
OrbConfig orbConfig = factory.getOrbConfig();
assertNotNull("CorbaBindingFactoryConfigurer is null", orbConfig);
Properties props = orbConfig.getOrbProperties();
assertNotNull("probs is null", props);
assertTrue("prob1 is not equal to value1", "value1".equals(props.get("prop1")));
assertTrue("prob2 is not equal to value2", "value2".equals(props.get("prop2")));
assertTrue("ORBClass is not equal to MyORBImpl", "com.orbimplco.MyORBImpl".equals(props.get("org.omg.CORBA.ORBClass")));
assertTrue("ORBSingletonClass is not equal to MyORBSingleton", "com.orbimplco.MyORBSingleton".equals(props.get("org.omg.CORBA.ORBSingletonClass")));
List<String> orbArgs = orbConfig.getOrbArgs();
assertNotNull("orbArgs is null", orbArgs);
String domainNameId = orbArgs.get(0);
assertTrue("domainNameId is not equal to -ORBdomain_name", "-ORBdomain_name".equals(domainNameId));
String domainNameValue = orbArgs.get(1);
assertTrue("domainNameValue is not equal to test-domain", "test-domain".equals(domainNameValue));
String configDomainsDirId = orbArgs.get(2);
assertTrue("configDomainsDirId is not equal to -ORBconfig_domains_dir", "-ORBconfig_domains_dir".equals(configDomainsDirId));
String configDomainsDirValue = orbArgs.get(3);
assertTrue("configDomainsDirValue is not equal to src/test/resources", "src/test/resources".equals(configDomainsDirValue));
String orbNameId = orbArgs.get(4);
assertTrue("orbNameId is not equal to -ORBname", "-ORBname".equals(orbNameId));
String orbNameValue = orbArgs.get(5);
assertTrue("orbNameValue is not equal to test", "test".equals(orbNameValue));
}
Aggregations