Skip to content
Permalink
Browse files
Fix skipped tests
  • Loading branch information
Amichai Rothman committed May 28, 2019
1 parent 6818159 commit 7cc135df4c8e4f120c22d3475eaeff71e03fd410
Showing 2 changed files with 15 additions and 8 deletions.
@@ -46,6 +46,7 @@ public void testInvoke() throws Throwable {
assertEquals(5, sih.invoke(null, m, new Object[] {}));
}

@Test
public void testInvokeObjectMethod() throws Throwable {
final List<String> called = new ArrayList<String>();
ServiceInvocationHandler sih = new ServiceInvocationHandler("hi", String.class) {
@@ -230,12 +230,11 @@ public void run() {
(String[])props.get(org.osgi.framework.Constants.OBJECTCLASS));
}

public void t2estCreateServerException() {
public void testCreateServerException() {
BundleContext dswContext = EasyMock.createNiceMock(BundleContext.class);
EasyMock.replay(dswContext);

IntentManager intentManager = EasyMock.createNiceMock(IntentManager.class);
EasyMock.replay(intentManager);
IntentManager intentManager = new IntentManagerImpl();

WsProvider handler = new WsProvider() {
@Override
@@ -247,15 +246,21 @@ protected Endpoint createServerFromFactory(ServerFactoryBean factory, EndpointDe
handler.setHttpServiceManager(dummyHttpServiceManager());
handler.activate(dswContext);

Class[] exportedInterfaces = {Runnable.class};
Map<String, Object> props = new HashMap<String, Object>();
EndpointHelper.addObjectClass(props, exportedInterfaces);

Runnable myService = EasyMock.createMock(Runnable.class);
EasyMock.replay(myService);
try {
handler.exportService(myService, null, props, new Class[] {Runnable.class});
handler.exportService(myService, null, props, exportedInterfaces);
fail("Expected TestException");
} catch (TestException e) {
// Expected
} catch (RuntimeException re) {
if (!(re.getCause() instanceof TestException)) {
fail("Expected TestException");
}
}
}

@@ -337,7 +342,7 @@ public void testCreateEndpointProps() {
assertEquals(new Version("0.0.0"), epd.getPackageVersion("java.lang"));
}

public void t2estCreateJaxWsEndpointWithoutIntents() {
public void testCreateJaxWsEndpointWithoutIntents() {
IMocksControl c = EasyMock.createNiceControl();
BundleContext dswBC = c.createMock(BundleContext.class);

@@ -347,15 +352,16 @@ public void t2estCreateJaxWsEndpointWithoutIntents() {
handler.setHttpServiceManager(dummyHttpServiceManager());
handler.activate(dswBC);

Class<?>[] exportedInterfaces = new Class[] {MyJaxWsEchoService.class};
Map<String, Object> sd = new HashMap<String, Object>();
sd.put(WsConstants.WS_ADDRESS_PROPERTY, "/somewhere");
EndpointHelper.addObjectClass(sd, exportedInterfaces);
BundleContext serviceBC = c.createMock(BundleContext.class);
Object myService = null;
Object myService = c.createMock(MyJaxWsEchoService.class);
c.replay();

Class<?>[] ifaces = new Class[] {MyJaxWsEchoService.class};
ServerEndpoint serverWrapper = (ServerEndpoint)handler.exportService(myService, serviceBC, sd,
ifaces);
exportedInterfaces);
c.verify();

org.apache.cxf.endpoint.Endpoint ep = serverWrapper.getServer().getEndpoint();

0 comments on commit 7cc135d

Please sign in to comment.