You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by am...@apache.org on 2019/05/28 21:24:59 UTC
[cxf-dosgi] 10/16: Fix skipped tests
This is an automated email from the ASF dual-hosted git repository.
amichai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf-dosgi.git
commit 7cc135df4c8e4f120c22d3475eaeff71e03fd410
Author: Amichai Rothman <am...@apache.org>
AuthorDate: Tue May 28 22:01:13 2019 +0300
Fix skipped tests
---
.../common/proxy/ServiceInvocationHandlerTest.java | 1 +
.../ws/PojoConfigurationTypeHandlerTest.java | 22 ++++++++++++++--------
2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/common/src/test/java/org/apache/cxf/dosgi/common/proxy/ServiceInvocationHandlerTest.java b/common/src/test/java/org/apache/cxf/dosgi/common/proxy/ServiceInvocationHandlerTest.java
index 5b60075..bd1b38e 100644
--- a/common/src/test/java/org/apache/cxf/dosgi/common/proxy/ServiceInvocationHandlerTest.java
+++ b/common/src/test/java/org/apache/cxf/dosgi/common/proxy/ServiceInvocationHandlerTest.java
@@ -46,6 +46,7 @@ public class ServiceInvocationHandlerTest {
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) {
diff --git a/provider-ws/src/test/java/org/apache/cxf/dosgi/dsw/handlers/ws/PojoConfigurationTypeHandlerTest.java b/provider-ws/src/test/java/org/apache/cxf/dosgi/dsw/handlers/ws/PojoConfigurationTypeHandlerTest.java
index f234014..0f3db95 100644
--- a/provider-ws/src/test/java/org/apache/cxf/dosgi/dsw/handlers/ws/PojoConfigurationTypeHandlerTest.java
+++ b/provider-ws/src/test/java/org/apache/cxf/dosgi/dsw/handlers/ws/PojoConfigurationTypeHandlerTest.java
@@ -230,12 +230,11 @@ public class PojoConfigurationTypeHandlerTest extends TestCase {
(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 @@ public class PojoConfigurationTypeHandlerTest extends TestCase {
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 class PojoConfigurationTypeHandlerTest extends TestCase {
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 class PojoConfigurationTypeHandlerTest extends TestCase {
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();