@SuppressWarnings("unchecked")
@Test
public void testJaxbExtraClass() throws Exception {
ClientFactoryBean cfBean = new ClientFactoryBean();
cfBean.setAddress("http://localhost/Hello");
cfBean.setBus(getBus());
cfBean.setServiceClass(HelloService.class);
Map props = cfBean.getProperties();
if (props == null) {
props = new HashMap<String, Object>();
}
props.put("jaxb.additionalContextClasses",
new Class[] {GreetMe.class, GreetMeOneWay.class});
cfBean.setProperties(props);
Client client = cfBean.create();
assertNotNull(client);
Class[] extraClass = ((JAXBDataBinding)cfBean.getServiceFactory().getDataBinding()).getExtraClass();
assertEquals(extraClass.length, 2);
assertEquals(extraClass[0], GreetMe.class);
assertEquals(extraClass[1], GreetMeOneWay.class);
}