Search in sources :

Example 1 with CorbaBindingFactory

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));
}
Also used : SpringBusFactory(org.apache.cxf.bus.spring.SpringBusFactory) CorbaBindingFactory(org.apache.cxf.binding.corba.CorbaBindingFactory) OrbConfig(org.apache.cxf.binding.corba.utils.OrbConfig) BindingFactoryManager(org.apache.cxf.binding.BindingFactoryManager) Properties(java.util.Properties) URL(java.net.URL) Test(org.junit.Test)

Aggregations

URL (java.net.URL)1 Properties (java.util.Properties)1 BindingFactoryManager (org.apache.cxf.binding.BindingFactoryManager)1 CorbaBindingFactory (org.apache.cxf.binding.corba.CorbaBindingFactory)1 OrbConfig (org.apache.cxf.binding.corba.utils.OrbConfig)1 SpringBusFactory (org.apache.cxf.bus.spring.SpringBusFactory)1 Test (org.junit.Test)1