Author: richard.opalka(a)jboss.com
Date: 2008-05-14 12:37:15 -0400 (Wed, 14 May 2008)
New Revision: 7032
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsrm/Helper.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/RMAbstractOneWayTest.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/RMAbstractSecuredOneWayTest.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAbstractReqResTest.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAbstractSecuredReqResTest.java
Log:
refactoring - removed reflection code
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsrm/Helper.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsrm/Helper.java 2008-05-14
14:04:58 UTC (rev 7031)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsrm/Helper.java 2008-05-14
16:37:15 UTC (rev 7032)
@@ -21,7 +21,6 @@
*/
package org.jboss.test.ws.jaxws.wsrm;
-import java.lang.reflect.Method;
import java.net.URI;
import java.net.URISyntaxException;
import javax.xml.ws.BindingProvider;
@@ -84,16 +83,4 @@
}
}
- /**
- * Invokes method using java reflection api
- * @throws Exception if some reflection related problem occurs
- */
- public static Object invokeMethodUsingReflection(String ifaceName, Object object,
String methodName, Class<?>[] parametersSignature, Object[] parameters)
- throws Exception
- {
- Object castedObject = Class.forName(ifaceName).cast(object);
- Method castedObjectMethod = castedObject.getClass().getMethod(methodName,
parametersSignature);
- return castedObjectMethod.invoke(castedObject, parameters);
- }
-
}
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/RMAbstractOneWayTest.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/RMAbstractOneWayTest.java 2008-05-14
14:04:58 UTC (rev 7031)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/RMAbstractOneWayTest.java 2008-05-14
16:37:15 UTC (rev 7032)
@@ -21,12 +21,15 @@
*/
package org.jboss.test.ws.jaxws.wsrm.oneway;
-import static org.jboss.test.ws.jaxws.wsrm.Helper.invokeMethodUsingReflection;
import static org.jboss.test.ws.jaxws.wsrm.Helper.setAddrProps;
import java.net.URL;
+
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
+
+import org.jboss.ws.core.StubExt;
+import org.jboss.ws.extensions.wsrm.api.RMProvider;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.test.ws.jaxws.wsrm.services.OneWayServiceIface;
@@ -49,16 +52,7 @@
URL wsdlURL = new URL(serviceURL + "?wsdl");
Service service = Service.create(wsdlURL, serviceName);
proxy = (OneWayServiceIface)service.getPort(OneWayServiceIface.class);
- if (isIntegrationNative())
- {
- // set up client config to be used - uses jbossws specific API via reflection
- invokeMethodUsingReflection(
- "org.jboss.ws.core.StubExt",
- proxy, "setConfigName",
- new Class[] { String.class, String.class },
- new Object[] {getConfigName(),
"META-INF/wsrm-jaxws-client-config.xml"}
- );
- }
+ ((StubExt)proxy).setConfigName(getConfigName(),
"META-INF/wsrm-jaxws-client-config.xml");
}
public void testOneWayMethods() throws Exception
@@ -69,18 +63,9 @@
proxy.method2("Hello World");
setAddrProps(proxy, "http://useless/action3", serviceURL);
proxy.method3(new String[] {"Hello","World"});
- if (isIntegrationNative())
- {
- // force close sequence - uses jbossws specific API via reflection
- invokeMethodUsingReflection(
- "org.jboss.ws.extensions.wsrm.api.RMProvider",
- proxy, "closeSequence",
- new Class[] {},
- new Object[] {}
- );
- }
+ ((RMProvider)proxy).closeSequence();
}
-
+
public static String getClasspath()
{
return "jaxws-wsrm.war, jaxws-wsrm-client.jar";
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/RMAbstractSecuredOneWayTest.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/RMAbstractSecuredOneWayTest.java 2008-05-14
14:04:58 UTC (rev 7031)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/RMAbstractSecuredOneWayTest.java 2008-05-14
16:37:15 UTC (rev 7032)
@@ -21,13 +21,14 @@
*/
package org.jboss.test.ws.jaxws.wsrm.oneway;
-import static org.jboss.test.ws.jaxws.wsrm.Helper.invokeMethodUsingReflection;
import static org.jboss.test.ws.jaxws.wsrm.Helper.setAddrProps;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import org.jboss.test.ws.jaxws.wsrm.services.SecuredOneWayServiceIface;
+import org.jboss.ws.core.StubExt;
+import org.jboss.ws.extensions.wsrm.api.RMProvider;
import org.jboss.wsf.test.JBossWSTest;
/**
@@ -49,16 +50,7 @@
URL wsdlURL = new URL(serviceURL + "?wsdl");
Service service = Service.create(wsdlURL, serviceName);
proxy =
(SecuredOneWayServiceIface)service.getPort(SecuredOneWayServiceIface.class);
- if (isIntegrationNative())
- {
- // set up client config to be used - uses jbossws specific API via reflection
- invokeMethodUsingReflection(
- "org.jboss.ws.core.StubExt",
- proxy, "setConfigName",
- new Class[] { String.class, String.class },
- new Object[] {getConfigName(),
"META-INF/wsrm-jaxws-client-config.xml"}
- );
- }
+ ((StubExt)proxy).setConfigName(getConfigName(),
"META-INF/wsrm-jaxws-client-config.xml");
}
public void testOneWayMethods() throws Exception
@@ -69,16 +61,7 @@
proxy.method2("Hello World");
setAddrProps(proxy, "http://useless/action3", serviceURL);
proxy.method3(new String[] {"Hello","World"});
- if (isIntegrationNative())
- {
- // force close sequence - uses jbossws specific API via reflection
- invokeMethodUsingReflection(
- "org.jboss.ws.extensions.wsrm.api.RMProvider",
- proxy, "closeSequence",
- new Class[] {},
- new Object[] {}
- );
- }
+ ((RMProvider)proxy).closeSequence();
}
public static String getClasspath()
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAbstractReqResTest.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAbstractReqResTest.java 2008-05-14
14:04:58 UTC (rev 7031)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAbstractReqResTest.java 2008-05-14
16:37:15 UTC (rev 7032)
@@ -21,7 +21,6 @@
*/
package org.jboss.test.ws.jaxws.wsrm.reqres;
-import static org.jboss.test.ws.jaxws.wsrm.Helper.invokeMethodUsingReflection;
import static org.jboss.test.ws.jaxws.wsrm.Helper.setAddrProps;
import java.net.URL;
@@ -34,6 +33,9 @@
import javax.xml.ws.AsyncHandler;
import javax.xml.ws.Response;
import javax.xml.ws.Service;
+
+import org.jboss.ws.core.StubExt;
+import org.jboss.ws.extensions.wsrm.api.RMProvider;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.test.ws.jaxws.wsrm.services.ReqResServiceIface;
@@ -72,16 +74,7 @@
Service service = Service.create(wsdlURL, serviceName);
service.setExecutor(testExecutor);
proxy = (ReqResServiceIface)service.getPort(ReqResServiceIface.class);
- if (isIntegrationNative())
- {
- // set up client config to be used - uses jbossws specific API via
reflection
- invokeMethodUsingReflection(
- "org.jboss.ws.core.StubExt",
- proxy, "setConfigName",
- new Class[] { String.class, String.class },
- new Object[] {getConfigName(),
"META-INF/wsrm-jaxws-client-config.xml"}
- );
- }
+ ((StubExt)proxy).setConfigName(getConfigName(),
"META-INF/wsrm-jaxws-client-config.xml");
}
}
@@ -160,16 +153,7 @@
invokeWebServiceMethod(invocationType);
setAddrProps(proxy, "http://useless/action", serviceURL);
invokeWebServiceMethod(invocationType);
- if (isIntegrationNative())
- {
- // force close sequence - uses jbossws specific API via reflection
- invokeMethodUsingReflection(
- "org.jboss.ws.extensions.wsrm.api.RMProvider",
- proxyObject, "closeSequence",
- new Class[] {},
- new Object[] {}
- );
- }
+ ((RMProvider)proxy).closeSequence();
}
public static String getClasspath()
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAbstractSecuredReqResTest.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAbstractSecuredReqResTest.java 2008-05-14
14:04:58 UTC (rev 7031)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAbstractSecuredReqResTest.java 2008-05-14
16:37:15 UTC (rev 7032)
@@ -21,7 +21,6 @@
*/
package org.jboss.test.ws.jaxws.wsrm.reqres;
-import static org.jboss.test.ws.jaxws.wsrm.Helper.invokeMethodUsingReflection;
import static org.jboss.test.ws.jaxws.wsrm.Helper.setAddrProps;
import java.net.URL;
@@ -35,6 +34,8 @@
import javax.xml.ws.Response;
import javax.xml.ws.Service;
import org.jboss.test.ws.jaxws.wsrm.services.SecuredReqResServiceIface;
+import org.jboss.ws.core.StubExt;
+import org.jboss.ws.extensions.wsrm.api.RMProvider;
import org.jboss.wsf.test.JBossWSTest;
/**
@@ -72,16 +73,7 @@
Service service = Service.create(wsdlURL, serviceName);
service.setExecutor(testExecutor);
proxy =
(SecuredReqResServiceIface)service.getPort(SecuredReqResServiceIface.class);
- if (isIntegrationNative())
- {
- // set up client config to be used - uses jbossws specific API via
reflection
- invokeMethodUsingReflection(
- "org.jboss.ws.core.StubExt",
- proxy, "setConfigName",
- new Class[] { String.class, String.class },
- new Object[] {getConfigName(),
"META-INF/wsrm-jaxws-client-config.xml"}
- );
- }
+ ((StubExt)proxy).setConfigName(getConfigName(),
"META-INF/wsrm-jaxws-client-config.xml");
}
}
@@ -160,16 +152,7 @@
invokeWebServiceMethod(invocationType);
setAddrProps(proxy, "http://useless/action", serviceURL);
invokeWebServiceMethod(invocationType);
- if (isIntegrationNative())
- {
- // force close sequence - uses jbossws specific API via reflection
- invokeMethodUsingReflection(
- "org.jboss.ws.extensions.wsrm.api.RMProvider",
- proxyObject, "closeSequence",
- new Class[] {},
- new Object[] {}
- );
- }
+ ((RMProvider)proxy).closeSequence();
}
public static String getClasspath()