Author: richard.opalka(a)jboss.com
Date: 2007-11-28 13:03:42 -0500 (Wed, 28 Nov 2007)
New Revision: 5140
Added:
stack/native/trunk/src/test/resources/jaxws/wsrm/properties/RMAbstractOneWayTest.properties
stack/native/trunk/src/test/resources/jaxws/wsrm/properties/RMAbstractReqResTest.properties
Removed:
stack/native/trunk/src/test/resources/jaxws/wsrm/properties/RMAddressableOneWayTestCase.properties
stack/native/trunk/src/test/resources/jaxws/wsrm/properties/RMAddressableReqResTestCase.properties
stack/native/trunk/src/test/resources/jaxws/wsrm/properties/RMAnonymousOneWayTestCase.properties
stack/native/trunk/src/test/resources/jaxws/wsrm/properties/RMAnonymousReqResTestCase.properties
Modified:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/RMAbstractOneWayTest.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/RMAddressableOneWayTestCase.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/RMAnonymousOneWayTestCase.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAbstractReqResTest.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAddressableReqResTestCase.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAnonymousReqResTestCase.java
Log:
refactoring - removing duplicities
Modified:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/RMAbstractOneWayTest.java
===================================================================
---
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/RMAbstractOneWayTest.java 2007-11-28
17:37:19 UTC (rev 5139)
+++
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/RMAbstractOneWayTest.java 2007-11-28
18:03:42 UTC (rev 5140)
@@ -23,7 +23,11 @@
import static org.jboss.test.ws.jaxws.wsrm.Helper.*;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
import java.net.URL;
+import java.util.Properties;
import java.util.concurrent.TimeUnit;
import javax.xml.namespace.QName;
@@ -44,15 +48,33 @@
*/
public abstract class RMAbstractOneWayTest extends JBossWSTest
{
+ private static final Properties props = new Properties();
+ private final boolean emulatorOn =
Boolean.parseBoolean((String)props.get("emulator"));
+ private final String serviceURL = "http://" + getServerHost() +
":" + props.getProperty("port") +
props.getProperty("path");
+
private String targetNS = "http://wsrm.jaxws.ws.test.jboss.org/";
private OneWayServiceIface proxy;
+ static
+ {
+ // load test properties
+ File propertiesFile = new
File("resources/jaxws/wsrm/properties/RMAbstractOneWayTest.properties");
+ try
+ {
+ props.load(new FileInputStream(propertiesFile));
+ }
+ catch (IOException ignore)
+ {
+ ignore.printStackTrace();
+ }
+ }
+
@Override
protected void setUp() throws Exception
{
super.setUp();
QName serviceName = new QName(targetNS, "OneWayService");
- URL wsdlURL = new URL(getServiceURL() + "?wsdl");
+ URL wsdlURL = new URL(serviceURL + "?wsdl");
Service service = Service.create(wsdlURL, serviceName);
proxy = (OneWayServiceIface)service.getPort(OneWayServiceIface.class);
}
@@ -65,19 +87,19 @@
if (true) return; // disable WS-RM tests - they cause regression in hudson
RMSequence sequence = null;
- if (isEmulatorOn())
+ if (emulatorOn)
{
RMProvider wsrmProvider = (RMProvider)proxy;
sequence = wsrmProvider.createSequence(getAddressingType(),
RMSequenceType.SIMPLEX);
System.out.println("Created sequence with id=" +
sequence.getOutboundId());
}
- setAddrProps(proxy, "http://useless/action1", getServiceURL());
+ setAddrProps(proxy, "http://useless/action1", serviceURL);
proxy.method1();
- setAddrProps(proxy, "http://useless/action2", getServiceURL());
+ setAddrProps(proxy, "http://useless/action2", serviceURL);
proxy.method2("Hello World");
- setAddrProps(proxy, "http://useless/action3", getServiceURL());
+ setAddrProps(proxy, "http://useless/action3", serviceURL);
proxy.method3(new String[] {"Hello","World"});
- if (isEmulatorOn())
+ if (emulatorOn)
{
if (!sequence.isCompleted(1000, TimeUnit.MILLISECONDS)) {
fail("Sequence not completed within specified time amount");
@@ -87,8 +109,11 @@
}
}
+ public static String getClasspath()
+ {
+ return props.getProperty("archives");
+ }
+
protected abstract RMAddressingType getAddressingType();
- protected abstract boolean isEmulatorOn();
- protected abstract String getServiceURL();
}
Modified:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/RMAddressableOneWayTestCase.java
===================================================================
---
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/RMAddressableOneWayTestCase.java 2007-11-28
17:37:19 UTC (rev 5139)
+++
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/RMAddressableOneWayTestCase.java 2007-11-28
18:03:42 UTC (rev 5140)
@@ -21,11 +21,6 @@
*/
package org.jboss.test.ws.jaxws.wsrm.oneway;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.Properties;
-
import junit.framework.Test;
import org.jboss.ws.extensions.wsrm.api.RMAddressingType;
@@ -41,27 +36,9 @@
public final class RMAddressableOneWayTestCase extends RMAbstractOneWayTest
{
- private static final Properties props = new Properties();
- private final boolean emulatorOn =
Boolean.parseBoolean((String)props.get("emulator"));
- private final String serviceURL = "http://" + getServerHost() +
":" + props.getProperty("port") +
props.getProperty("path");
-
- static
- {
- // load test properties
- File propertiesFile = new
File("resources/jaxws/wsrm/properties/RMAddressableOneWayTestCase.properties");
- try
- {
- props.load(new FileInputStream(propertiesFile));
- }
- catch (IOException ignore)
- {
- ignore.printStackTrace();
- }
- }
-
public static Test suite()
{
- return new JBossWSTestSetup(RMAddressableOneWayTestCase.class,
props.getProperty("archives"));
+ return new JBossWSTestSetup(RMAddressableOneWayTestCase.class, getClasspath());
}
public final RMAddressingType getAddressingType()
@@ -69,14 +46,4 @@
return RMAddressingType.ADDRESSABLE;
}
- public final boolean isEmulatorOn()
- {
- return this.emulatorOn;
- }
-
- public final String getServiceURL()
- {
- return this.serviceURL;
- }
-
}
Modified:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/RMAnonymousOneWayTestCase.java
===================================================================
---
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/RMAnonymousOneWayTestCase.java 2007-11-28
17:37:19 UTC (rev 5139)
+++
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/RMAnonymousOneWayTestCase.java 2007-11-28
18:03:42 UTC (rev 5140)
@@ -41,43 +41,14 @@
public final class RMAnonymousOneWayTestCase extends RMAbstractOneWayTest
{
- private static final Properties props = new Properties();
- private final boolean emulatorOn =
Boolean.parseBoolean((String)props.get("emulator"));
- private final String serviceURL = "http://" + getServerHost() +
":" + props.getProperty("port") +
props.getProperty("path");
-
- static
- {
- // load test properties
- File propertiesFile = new
File("resources/jaxws/wsrm/properties/RMAnonymousOneWayTestCase.properties");
- try
- {
- props.load(new FileInputStream(propertiesFile));
- }
- catch (IOException ignore)
- {
- ignore.printStackTrace();
- }
- }
-
public static Test suite()
{
- return new JBossWSTestSetup(RMAnonymousOneWayTestCase.class,
props.getProperty("archives"));
+ return new JBossWSTestSetup(RMAnonymousOneWayTestCase.class, getClasspath());
}
-
public final RMAddressingType getAddressingType()
{
return RMAddressingType.ANONYMOUS;
}
-
- public final boolean isEmulatorOn()
- {
- return this.emulatorOn;
- }
-
- public final String getServiceURL()
- {
- return this.serviceURL;
- }
}
Modified:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAbstractReqResTest.java
===================================================================
---
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAbstractReqResTest.java 2007-11-28
17:37:19 UTC (rev 5139)
+++
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAbstractReqResTest.java 2007-11-28
18:03:42 UTC (rev 5140)
@@ -23,7 +23,11 @@
import static org.jboss.test.ws.jaxws.wsrm.Helper.*;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
import java.net.URL;
+import java.util.Properties;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
@@ -50,10 +54,27 @@
{
private static final String HELLO_WORLD_MSG = "Hello World";
private static final String TARGET_NS = "http://org.jboss.ws/jaxws/wsrm";
+ private static final Properties props = new Properties();
+ private final String serviceURL = "http://" + getServerHost() +
":" + props.getProperty("port") +
props.getProperty("path");
+ private final boolean emulatorOn =
Boolean.parseBoolean((String)props.get("emulator"));
private Exception handlerException;
private boolean asyncHandlerCalled;
private ReqResServiceIface proxy;
+ static
+ {
+ // load test properties
+ File propertiesFile = new
File("resources/jaxws/wsrm/properties/RMAbstractReqResTest.properties");
+ try
+ {
+ props.load(new FileInputStream(propertiesFile));
+ }
+ catch (IOException ioe)
+ {
+ ioe.printStackTrace();
+ }
+ }
+
private enum InvocationType
{
SYNC, ASYNC, ASYNC_FUTURE
@@ -67,7 +88,7 @@
if (proxy == null)
{
QName serviceName = new QName(TARGET_NS, "ReqResService");
- URL wsdlURL = new URL(getServiceURL() + "?wsdl");
+ URL wsdlURL = new URL(serviceURL + "?wsdl");
Service service = Service.create(wsdlURL, serviceName);
proxy = (ReqResServiceIface)service.getPort(ReqResServiceIface.class);
}
@@ -148,20 +169,20 @@
if (true) return; // disable WS-RM tests - they cause regression in hudson
RMSequence sequence = null;
- if (isEmulatorOn())
+ if (emulatorOn)
{
RMProvider wsrmProvider = (RMProvider)proxyObject;
sequence = wsrmProvider.createSequence(getAddressingType(),
RMSequenceType.DUPLEX);
System.out.println("Created sequence with outbound id=" +
sequence.getOutboundId());
System.out.println("Created sequence with inbound id=" +
sequence.getInboundId());
}
- setAddrProps(proxy, "http://useless/action", getServiceURL());
+ setAddrProps(proxy, "http://useless/action", serviceURL);
invokeWebServiceMethod(invocationType);
- setAddrProps(proxy, "http://useless/action", getServiceURL());
+ setAddrProps(proxy, "http://useless/action", serviceURL);
invokeWebServiceMethod(invocationType);
- setAddrProps(proxy, "http://useless/action", getServiceURL());
+ setAddrProps(proxy, "http://useless/action", serviceURL);
invokeWebServiceMethod(invocationType);
- if (isEmulatorOn())
+ if (emulatorOn)
{
if (!sequence.isCompleted(1000, TimeUnit.MILLISECONDS)) {
sequence.discard();
@@ -172,8 +193,11 @@
}
}
+ public static String getClasspath()
+ {
+ return props.getProperty("archives");
+ }
+
protected abstract RMAddressingType getAddressingType();
- protected abstract boolean isEmulatorOn();
- protected abstract String getServiceURL();
}
Modified:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAddressableReqResTestCase.java
===================================================================
---
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAddressableReqResTestCase.java 2007-11-28
17:37:19 UTC (rev 5139)
+++
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAddressableReqResTestCase.java 2007-11-28
18:03:42 UTC (rev 5140)
@@ -21,11 +21,6 @@
*/
package org.jboss.test.ws.jaxws.wsrm.reqres;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.Properties;
-
import junit.framework.Test;
import org.jboss.ws.extensions.wsrm.api.RMAddressingType;
@@ -41,27 +36,9 @@
public final class RMAddressableReqResTestCase extends RMAbstractReqResTest
{
- private static final Properties props = new Properties();
- private final String serviceURL = "http://" + getServerHost() +
":" + props.getProperty("port") +
props.getProperty("path");
- private final boolean emulatorOn =
Boolean.parseBoolean((String)props.get("emulator"));
-
- static
- {
- // load test properties
- File propertiesFile = new
File("resources/jaxws/wsrm/properties/RMAddressableReqResTestCase.properties");
- try
- {
- props.load(new FileInputStream(propertiesFile));
- }
- catch (IOException ioe)
- {
- ioe.printStackTrace();
- }
- }
-
public static Test suite()
{
- return new JBossWSTestSetup(RMAddressableReqResTestCase.class,
props.getProperty("archives"));
+ return new JBossWSTestSetup(RMAddressableReqResTestCase.class, getClasspath());
}
public final RMAddressingType getAddressingType()
@@ -69,14 +46,4 @@
return RMAddressingType.ADDRESSABLE;
}
- public final boolean isEmulatorOn()
- {
- return this.emulatorOn;
- }
-
- public final String getServiceURL()
- {
- return this.serviceURL;
- }
-
}
Modified:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAnonymousReqResTestCase.java
===================================================================
---
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAnonymousReqResTestCase.java 2007-11-28
17:37:19 UTC (rev 5139)
+++
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAnonymousReqResTestCase.java 2007-11-28
18:03:42 UTC (rev 5140)
@@ -21,11 +21,6 @@
*/
package org.jboss.test.ws.jaxws.wsrm.reqres;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.Properties;
-
import junit.framework.Test;
import org.jboss.ws.extensions.wsrm.api.RMAddressingType;
@@ -41,27 +36,9 @@
public final class RMAnonymousReqResTestCase extends RMAbstractReqResTest
{
- private static final Properties props = new Properties();
- private final String serviceURL = "http://" + getServerHost() +
":" + props.getProperty("port") +
props.getProperty("path");
- private final boolean emulatorOn =
Boolean.parseBoolean((String)props.get("emulator"));
-
- static
- {
- // load test properties
- File propertiesFile = new
File("resources/jaxws/wsrm/properties/RMAnonymousReqResTestCase.properties");
- try
- {
- props.load(new FileInputStream(propertiesFile));
- }
- catch (IOException ioe)
- {
- ioe.printStackTrace();
- }
- }
-
public static Test suite()
{
- return new JBossWSTestSetup(RMAnonymousReqResTestCase.class,
props.getProperty("archives"));
+ return new JBossWSTestSetup(RMAnonymousReqResTestCase.class, getClasspath());
}
public final RMAddressingType getAddressingType()
@@ -69,14 +46,4 @@
return RMAddressingType.ANONYMOUS;
}
- public final boolean isEmulatorOn()
- {
- return this.emulatorOn;
- }
-
- public final String getServiceURL()
- {
- return this.serviceURL;
- }
-
}
Added:
stack/native/trunk/src/test/resources/jaxws/wsrm/properties/RMAbstractOneWayTest.properties
===================================================================
---
stack/native/trunk/src/test/resources/jaxws/wsrm/properties/RMAbstractOneWayTest.properties
(rev 0)
+++
stack/native/trunk/src/test/resources/jaxws/wsrm/properties/RMAbstractOneWayTest.properties 2007-11-28
18:03:42 UTC (rev 5140)
@@ -0,0 +1,7 @@
+port=8080
+#path=/jaxws-wsrm/OneWayService
+path=/jaxws-wsrm-one-way-emulator/OneWayService
+#archives=jaxws-wsrm.war, jaxws-wsrm-client.jar
+archives=jaxws-wsrm-one-way-emulator.war, jaxws-wsrm-client.jar
+emulator=true
+
Added:
stack/native/trunk/src/test/resources/jaxws/wsrm/properties/RMAbstractReqResTest.properties
===================================================================
---
stack/native/trunk/src/test/resources/jaxws/wsrm/properties/RMAbstractReqResTest.properties
(rev 0)
+++
stack/native/trunk/src/test/resources/jaxws/wsrm/properties/RMAbstractReqResTest.properties 2007-11-28
18:03:42 UTC (rev 5140)
@@ -0,0 +1,7 @@
+port=8080
+#path=/jaxws-wsrm/ReqResService
+path=/jaxws-wsrm-req-res-emulator/ReqResService
+#archives=jaxws-wsrm.war, jaxws-wsrm-client.jar
+archives=jaxws-wsrm-req-res-emulator.war, jaxws-wsrm-client.jar
+emulator=true
+
Deleted:
stack/native/trunk/src/test/resources/jaxws/wsrm/properties/RMAddressableOneWayTestCase.properties
===================================================================
---
stack/native/trunk/src/test/resources/jaxws/wsrm/properties/RMAddressableOneWayTestCase.properties 2007-11-28
17:37:19 UTC (rev 5139)
+++
stack/native/trunk/src/test/resources/jaxws/wsrm/properties/RMAddressableOneWayTestCase.properties 2007-11-28
18:03:42 UTC (rev 5140)
@@ -1,7 +0,0 @@
-port=8080
-#path=/jaxws-wsrm/OneWayService
-path=/jaxws-wsrm-one-way-emulator/OneWayService
-#archives=jaxws-wsrm.war, jaxws-wsrm-client.jar
-archives=jaxws-wsrm-one-way-emulator.war, jaxws-wsrm-client.jar
-emulator=true
-
Deleted:
stack/native/trunk/src/test/resources/jaxws/wsrm/properties/RMAddressableReqResTestCase.properties
===================================================================
---
stack/native/trunk/src/test/resources/jaxws/wsrm/properties/RMAddressableReqResTestCase.properties 2007-11-28
17:37:19 UTC (rev 5139)
+++
stack/native/trunk/src/test/resources/jaxws/wsrm/properties/RMAddressableReqResTestCase.properties 2007-11-28
18:03:42 UTC (rev 5140)
@@ -1,7 +0,0 @@
-port=8080
-#path=/jaxws-wsrm/ReqResService
-path=/jaxws-wsrm-req-res-emulator/ReqResService
-#archives=jaxws-wsrm.war, jaxws-wsrm-client.jar
-archives=jaxws-wsrm-req-res-emulator.war, jaxws-wsrm-client.jar
-emulator=true
-
Deleted:
stack/native/trunk/src/test/resources/jaxws/wsrm/properties/RMAnonymousOneWayTestCase.properties
===================================================================
---
stack/native/trunk/src/test/resources/jaxws/wsrm/properties/RMAnonymousOneWayTestCase.properties 2007-11-28
17:37:19 UTC (rev 5139)
+++
stack/native/trunk/src/test/resources/jaxws/wsrm/properties/RMAnonymousOneWayTestCase.properties 2007-11-28
18:03:42 UTC (rev 5140)
@@ -1,7 +0,0 @@
-port=8080
-#path=/jaxws-wsrm/OneWayService
-path=/jaxws-wsrm-one-way-emulator/OneWayService
-#archives=jaxws-wsrm.war, jaxws-wsrm-client.jar
-archives=jaxws-wsrm-one-way-emulator.war, jaxws-wsrm-client.jar
-emulator=true
-
Deleted:
stack/native/trunk/src/test/resources/jaxws/wsrm/properties/RMAnonymousReqResTestCase.properties
===================================================================
---
stack/native/trunk/src/test/resources/jaxws/wsrm/properties/RMAnonymousReqResTestCase.properties 2007-11-28
17:37:19 UTC (rev 5139)
+++
stack/native/trunk/src/test/resources/jaxws/wsrm/properties/RMAnonymousReqResTestCase.properties 2007-11-28
18:03:42 UTC (rev 5140)
@@ -1,7 +0,0 @@
-port=8080
-#path=/jaxws-wsrm/ReqResService
-path=/jaxws-wsrm-req-res-emulator/ReqResService
-#archives=jaxws-wsrm.war, jaxws-wsrm-client.jar
-archives=jaxws-wsrm-req-res-emulator.war, jaxws-wsrm-client.jar
-emulator=true
-