EasyMock.replay(dswContext);
String myService = "Hi";
final ServerFactoryBean sfb = createMockServerFactoryBean();
DistributionProviderImpl dp = new DistributionProviderImpl(dswContext);
PojoConfigurationTypeHandler p = new PojoConfigurationTypeHandler(dswContext, dp, handlerProps) {
@Override
ServerFactoryBean createServerFactoryBean(String frontend) {
return sfb;
}
@Override
String[] applyIntents(BundleContext dswContext, BundleContext callingContext,
List<AbstractFeature> features, AbstractEndpointFactory factory, ServiceEndpointDescription sd) {
return new String []{};
}
};
ServiceReference sr = EasyMock.createNiceMock(ServiceReference.class);
BundleContext callingContext = EasyMock.createNiceMock(BundleContext.class);
EasyMock.replay(sr);
EasyMock.replay(callingContext);
Map<String, Object> props = new HashMap<String, Object>();
props.put(Constants.WS_ADDRESS_PROPERTY, "http://alternate_host:80/myString");
ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl(Runnable.class.getName(), props);
assertEquals("Precondition failed", 0, dp.getExposedServices().size());
p.createServer(sr, dswContext, callingContext, sd, String.class, myService);
assertEquals(1, dp.getExposedServices().size());
assertSame(sr, dp.getExposedServices().iterator().next());
Map<String, String> expected = new HashMap<String, String>();
expected.put("service.exported.configs", "org.apache.cxf.ws");
expected.put("org.apache.cxf.ws.address", "http://alternate_host:80/myString");
assertEquals(expected, dp.getExposedProperties(sr));
}