protected String[] getApplicationContextFiles() {
return new String[]{"org/apache/camel/component/cxf/spring/CxfRsServerFactoryBeans.xml"};
}
public void testCxfRsServerFactoryBean() {
SpringJAXRSServerFactoryBean sfb1 = (SpringJAXRSServerFactoryBean) ctx.getBean("rsServer1");
assertEquals("Get a wrong address", sfb1.getAddress(), "http://localhost:9000/server1");
List<Class> resource1Classes = sfb1.getResourceClasses();
assertEquals("Get a wrong size of resouceClasses", resource1Classes.size(), 1);
assertEquals("Get a wrong resource class", resource1Classes.get(0), CustomerService.class);
SpringJAXRSServerFactoryBean sfb2 = (SpringJAXRSServerFactoryBean) ctx.getBean("rsServer2");
assertEquals("Get a wrong address", sfb2.getAddress(), "http://localhost:9000/server2");
sfb2.getResourceClasses();
List<Class> resource2Classes = sfb2.getResourceClasses();
assertEquals("Get a wrong size of resouceClasses", resource2Classes.size(), 1);
assertEquals("Get a wrong resource class", resource2Classes.get(0), CustomerService.class);
}