Author: alessio.soldano(a)jboss.com
Date: 2011-11-09 07:04:39 -0500 (Wed, 09 Nov 2011)
New Revision: 15221
Modified:
stack/native/trunk/modules/testsuite/native-tests/scripts/build-samples-jaxrpc.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/samples/swa/AttachmentProxyTestCase.java
Log:
Fixing swa/mtom failures w/ native stack & AS7
Modified:
stack/native/trunk/modules/testsuite/native-tests/scripts/build-samples-jaxrpc.xml
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/scripts/build-samples-jaxrpc.xml 2011-11-09
11:57:03 UTC (rev 15220)
+++
stack/native/trunk/modules/testsuite/native-tests/scripts/build-samples-jaxrpc.xml 2011-11-09
12:04:39 UTC (rev 15221)
@@ -350,6 +350,9 @@
<include name="webservices.xml"/>
<include name="wsdl/**"/>
</webinf>
+ <manifest>
+ <attribute name="Dependencies"
value="org.jboss.ws.common,javax.mail.api services export,javax.activation.api
services export"/>
+ </manifest>
</war>
<jar
destfile="${tests.output.dir}/test-libs/jaxrpc-samples-mtom-client.jar">
<metainf
dir="${tests.output.dir}/test-resources/jaxrpc/samples/mtom/META-INF">
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/samples/swa/AttachmentProxyTestCase.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/samples/swa/AttachmentProxyTestCase.java 2011-11-09
11:57:03 UTC (rev 15220)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/samples/swa/AttachmentProxyTestCase.java 2011-11-09
12:04:39 UTC (rev 15221)
@@ -23,15 +23,15 @@
import java.awt.Image;
import java.awt.Toolkit;
-import java.io.File;
import java.io.FileInputStream;
import java.net.URL;
import javax.activation.DataHandler;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMultipart;
-import javax.naming.InitialContext;
+import javax.xml.namespace.QName;
import javax.xml.rpc.Service;
+import javax.xml.rpc.ServiceFactory;
import javax.xml.transform.stream.StreamSource;
import junit.framework.Test;
@@ -48,6 +48,8 @@
*/
public class AttachmentProxyTestCase extends JBossWSTest
{
+ public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() +
":8080/jaxrpc-samples-swa";
+ private static final String TARGET_NAMESPACE =
"http://org.jboss.ws/samples/swa";
private static Attachment port;
/** Deploy the test ear */
@@ -62,11 +64,15 @@
if (port == null)
{
- InitialContext iniCtx = getInitialContext();
- Service service =
(Service)iniCtx.lookup("java:comp/env/service/AttachmentService");
- port = (Attachment)service.getPort(Attachment.class);
+ port = getService(Attachment.class, "Attachment",
"AttachmentPort");
}
}
+
+ protected <T> T getService(final Class<T> clazz, final String serviceName,
final String portName) throws Exception {
+ ServiceFactory serviceFactory = ServiceFactory.newInstance();
+ Service service = serviceFactory.createService(new URL(TARGET_ENDPOINT_ADDRESS +
"?wsdl"), new QName(TARGET_NAMESPACE, serviceName));
+ return (T) service.getPort(new QName(TARGET_NAMESPACE, portName), clazz);
+ }
/** Send a multipart message with a text/plain attachment part
*/