@Test
public void testServers() throws Exception {
ClassPathXmlApplicationContext ctx =
new ClassPathXmlApplicationContext(new String[] {"/org/apache/cxf/jaxrs/spring/servers.xml"});
JAXRSServerFactoryBean sfb = (JAXRSServerFactoryBean)ctx.getBean("simple");
assertEquals("Get a wrong address", "http://localhost:9090/rs", sfb.getAddress());
assertNotNull("The resource classes should not be null", sfb.getResourceClasses());
assertEquals("Get a wrong resource class", BookStore.class, sfb.getResourceClasses().get(0));
assertEquals(new QName("http://books.com", "BookService"),
sfb.getServiceName());
sfb = (JAXRSServerFactoryBean)ctx.getBean("inlineServiceBeans");
assertNotNull("The resource classes should not be null", sfb.getResourceClasses());
assertEquals("Get a wrong resource class", BookStore.class, sfb.getResourceClasses().get(0));
assertEquals("Get a wrong resource class",
BookStoreSubresourcesOnly.class, sfb.getResourceClasses().get(1));
sfb = (JAXRSServerFactoryBean)ctx.getBean("inlineProvider");
assertNotNull("The provider should not be null", sfb.getProviders());
assertEquals("Get a wrong provider size", sfb.getProviders().size(), 3);
verifyJaxbProvider(sfb.getProviders());
sfb = (JAXRSServerFactoryBean)ctx.getBean("moduleServer");
assertNotNull("The resource classes should not be null", sfb.getResourceClasses());
assertEquals("Get a wrong ResourceClasses size", 1, sfb.getResourceClasses().size());
assertEquals("Get a wrong resource class", BookStoreNoAnnotations.class,
sfb.getResourceClasses().get(0));
}