[jbossws-commits] JBossWS SVN: r18732 - in stack/cxf/branches/rsearls: modules/testsuite/shared-tests and 1 other directories.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Fri Jun 13 13:24:11 EDT 2014


Author: rsearls
Date: 2014-06-13 13:24:11 -0400 (Fri, 13 Jun 2014)
New Revision: 18732

Added:
   stack/cxf/branches/rsearls/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150WsdlContentsTestCaseForked.java
   stack/cxf/branches/rsearls/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/TestUtils.java
Modified:
   stack/cxf/branches/rsearls/modules/testsuite/shared-tests/pom.xml
   stack/cxf/branches/rsearls/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150TestCaseForked.java
   stack/cxf/branches/rsearls/pom.xml
Log:
[JBWS-3801] new test to verify soap:address rewrite to wsdl.

Modified: stack/cxf/branches/rsearls/modules/testsuite/shared-tests/pom.xml
===================================================================
--- stack/cxf/branches/rsearls/modules/testsuite/shared-tests/pom.xml	2014-06-12 16:05:44 UTC (rev 18731)
+++ stack/cxf/branches/rsearls/modules/testsuite/shared-tests/pom.xml	2014-06-13 17:24:11 UTC (rev 18732)
@@ -29,6 +29,16 @@
       <scope>runtime</scope> <!-- override scope from parent dependency to make sure tests are not compiled using (JBWS-)CXF classes -->
     </dependency>
     <dependency>
+      <groupId>org.jboss</groupId>
+      <artifactId>jboss-dmr</artifactId>
+      <version>${jboss-dmr-version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.wildfly</groupId>
+      <artifactId>wildfly-controller</artifactId>
+      <version>${jboss.version}</version>
+    </dependency>
+    <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       <scope>test</scope>

Modified: stack/cxf/branches/rsearls/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150TestCaseForked.java
===================================================================
--- stack/cxf/branches/rsearls/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150TestCaseForked.java	2014-06-12 16:05:44 UTC (rev 18731)
+++ stack/cxf/branches/rsearls/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150TestCaseForked.java	2014-06-13 17:24:11 UTC (rev 18732)
@@ -69,6 +69,7 @@
    private static final ObjectName SERVER_CONFIG_OBJECT_NAME = ObjectNameFactory.create("jboss.ws:service=ServerConfig");
    private static final String NAMESPACE = "http://test.jboss.org/addressrewrite";
    private static final String NAMESPACE_IMP = "http://test.jboss.org/addressrewrite/wsdlimp";
+   private TestUtils testUtils = new TestUtils();
 
    protected static class JBWS2150TestSetup extends JBossWSTestSetup {
       
@@ -115,7 +116,7 @@
     */
    public void testRewrite() throws Exception
    {
-      setModifySOAPAddress(true);
+      testUtils.setModifySOAPAddress(true);
       deploy("jaxws-jbws2150.war");
       try
       {
@@ -172,7 +173,7 @@
     */
    public void testRewriteLoadBalancer() throws Exception
    {
-      setModifySOAPAddress(true);
+      testUtils.setModifySOAPAddress(true);
       final String testWebServiceHost = "myloadbalancer.com";
       setWebServiceHost(testWebServiceHost);
       deploy("jaxws-jbws2150.war");
@@ -225,7 +226,7 @@
     */
    public void testAutoRewrite() throws Exception
    {
-      setModifySOAPAddress(true);
+      testUtils.setModifySOAPAddress(true);
       setWebServiceHost(ServerConfig.UNDEFINED_HOSTNAME);
       deploy("jaxws-jbws2150.war");
       try
@@ -271,7 +272,7 @@
     */
    public void testSecureRewrite() throws Exception
    {
-      setModifySOAPAddress(true);
+      testUtils.setModifySOAPAddress(true);
       deploy("jaxws-jbws2150-sec.war");
       try
       {
@@ -319,7 +320,7 @@
     */
    public void testSecureRewriteLoadBalancer() throws Exception
    {
-      setModifySOAPAddress(true);
+      testUtils.setModifySOAPAddress(true);
       final String testWebServiceHost = "myloadbalancer.com";
       setWebServiceHost(testWebServiceHost);
       deploy("jaxws-jbws2150-sec.war");
@@ -372,7 +373,7 @@
     */
    public void testNoRewrite() throws Exception
    {
-      setModifySOAPAddress(false);
+      testUtils.setModifySOAPAddress(false);
       deploy("jaxws-jbws2150.war");
       try
       {
@@ -420,7 +421,7 @@
     */
    public void testRewriteCodeFirst() throws Exception
    {
-      setModifySOAPAddress(true);
+      testUtils.setModifySOAPAddress(true);
       deploy("jaxws-jbws2150-codefirst.war");
       try
       {
@@ -442,7 +443,7 @@
     */
    public void testNoRewriteCodeFirst() throws Exception
    {
-      setModifySOAPAddress(false);
+      testUtils.setModifySOAPAddress(false);
       deploy("jaxws-jbws2150-codefirst.war");
       try
       {
@@ -464,7 +465,7 @@
     */
    public void testRewriteLoadBalancerCodeFirst() throws Exception
    {
-      setModifySOAPAddress(true);
+      testUtils.setModifySOAPAddress(true);
       final String testWebServiceHost = "myloadbalancer.com";
       setWebServiceHost(testWebServiceHost);
       deploy("jaxws-jbws2150-codefirst.war");
@@ -489,7 +490,7 @@
     */
    public void testNoRewriteLoadBalancerCodeFirst() throws Exception
    {
-      setModifySOAPAddress(false);
+      testUtils.setModifySOAPAddress(false);
       final String testWebServiceHost = "myloadbalancer2.com";
       setWebServiceHost(testWebServiceHost);
       deploy("jaxws-jbws2150-codefirst.war");
@@ -513,7 +514,7 @@
     */
    public void testAutoRewriteCodeFirst() throws Exception
    {
-      setModifySOAPAddress(true);
+      testUtils.setModifySOAPAddress(true);
       setWebServiceHost(ServerConfig.UNDEFINED_HOSTNAME);
       deploy("jaxws-jbws2150-codefirst.war");
       try
@@ -528,18 +529,18 @@
          undeploy("jaxws-jbws2150-codefirst.war");
       }
    }
-   
+
    /**
     * Test soap:address rewrite when a path rewrite rule is specified.
-    * 
+    *
     * @throws Exception
     */
    public void testRewriteWithPathRule() throws Exception
    {
-      setModifySOAPAddress(true);
+      testUtils.setModifySOAPAddress(true);
       final String expectedContext = "xx/jaxws-jbws2150";
       final String sedCmd = "s/jaxws-jbws2150/xx\\/jaxws-jbws2150/g";
-      setWebServicePathRewriteRule(sedCmd);
+      testUtils.setWebServicePathRewriteRule(sedCmd);
       deploy("jaxws-jbws2150.war");
       try
       {
@@ -566,7 +567,7 @@
             address = getPortAddress(definition, "InvalidSecureURLService", "InvalidSecureURLPort");
             assertEquals("https://" + serverHost + ":8443/" + expectedContext + "/InvalidSecureURL", address);
 
-            //check wsdl import (which is bound to the endpoint currently serving the wsdl) 
+            //check wsdl import (which is bound to the endpoint currently serving the wsdl)
             assertTrue(getWsdlImportAddress(definition).contains(expectedContext));
          }
       }
@@ -578,15 +579,15 @@
 
    /**
     * Test soap:address rewrite for code-first endpoints when a path rewrite rule is specified
-    * 
+    *
     * @throws Exception
     */
    public void testRewriteCodeFirstPathRule() throws Exception
    {
-      setModifySOAPAddress(true);
+      testUtils.setModifySOAPAddress(true);
       final String expectedContext = "xx/jaxws-jbws2150-codefirst";
       final String sedCmd = "s/jaxws-jbws2150-codefirst/xx\\/jaxws-jbws2150-codefirst/g";
-      setWebServicePathRewriteRule(sedCmd);
+      testUtils.setWebServicePathRewriteRule(sedCmd);
       deploy("jaxws-jbws2150-codefirst.war");
       try
       {
@@ -611,10 +612,10 @@
     */
    public void testAutoRewriteCodeFirstPathRule() throws Exception
    {
-      setModifySOAPAddress(true);
+      testUtils.setModifySOAPAddress(true);
       final String expectedContext = "xx/jaxws-jbws2150-codefirst";
       final String sedCmd = "s/jaxws-jbws2150-codefirst/xx\\/jaxws-jbws2150-codefirst/g";
-      setWebServicePathRewriteRule(sedCmd);
+      testUtils.setWebServicePathRewriteRule(sedCmd);
       setWebServiceHost(ServerConfig.UNDEFINED_HOSTNAME);
       deploy("jaxws-jbws2150-codefirst.war");
       try
@@ -644,10 +645,10 @@
     */
    public void testAutoRewritePathRule() throws Exception
    {
-      setModifySOAPAddress(true);
+      testUtils.setModifySOAPAddress(true);
       final String expectedContext = "xx/jaxws-jbws2150";
       final String sedCmd = "s/jaxws-jbws2150/xx\\/jaxws-jbws2150/g";
-      setWebServicePathRewriteRule(sedCmd);
+      testUtils.setWebServicePathRewriteRule(sedCmd);
       setWebServiceHost(ServerConfig.UNDEFINED_HOSTNAME);
       deploy("jaxws-jbws2150.war");
       try
@@ -710,25 +711,13 @@
       return "localhost".equals(getServerHost());
    }
 
-   private void setModifySOAPAddress(Boolean value) throws Exception
-   {
-      Attribute attr = new Attribute("ModifySOAPAddress", value);
-      getServer().setAttribute(SERVER_CONFIG_OBJECT_NAME, attr);
-   }
-   
    private void setWebServiceHost(String value) throws Exception
    {
       Attribute attr = new Attribute("WebServiceHost", value);
       getServer().setAttribute(SERVER_CONFIG_OBJECT_NAME, attr);
    }
 
-    private void setWebServicePathRewriteRule(String value) throws Exception
-    {
-        Attribute attr = new Attribute("WebServicePathRewriteRule", value);
-        getServer().setAttribute(SERVER_CONFIG_OBJECT_NAME, attr);
-    }
-
-    private ServiceIface getEndpoint(String wsdlLocation, String serviceName) throws Exception
+   private ServiceIface getEndpoint(String wsdlLocation, String serviceName) throws Exception
    {
       List<WebServiceFeature> features =  new LinkedList<WebServiceFeature>();
       if (isIntegrationCXF()) {

Added: stack/cxf/branches/rsearls/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150WsdlContentsTestCaseForked.java
===================================================================
--- stack/cxf/branches/rsearls/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150WsdlContentsTestCaseForked.java	                        (rev 0)
+++ stack/cxf/branches/rsearls/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150WsdlContentsTestCaseForked.java	2014-06-13 17:24:11 UTC (rev 18732)
@@ -0,0 +1,310 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws2150;
+
+import junit.framework.Test;
+import org.jboss.as.controller.client.ModelControllerClient;
+import org.jboss.as.controller.client.OperationBuilder;
+import org.jboss.as.controller.descriptions.ModelDescriptionConstants;
+import org.jboss.dmr.ModelNode;
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.DOMUtils;
+import org.jboss.ws.common.ObjectNameFactory;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.xml.sax.SAXException;
+
+import javax.management.Attribute;
+import javax.management.ObjectName;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.net.InetAddress;
+import java.util.HashMap;
+import java.util.List;
+
+/**
+ * Verify the soap:address is written to the server's on disk wsdl file using
+ * the JBossWS rewrite rule settings.
+ *
+ * User: rsearls
+ * Date: 6/12/14
+ */
+public class JBWS2150WsdlContentsTestCaseForked extends JBossWSTest
+{
+   private static final ObjectName SERVER_CONFIG_OBJECT_NAME =
+      ObjectNameFactory.create("jboss.ws:service=ServerConfig");
+   private TestUtils testUtils = new TestUtils();
+
+   private static final Logger LOGGER = Logger.getLogger(JBWS2150WsdlContentsTestCaseForked.class);
+   private static final int DEFAULT_PORT = 9990;
+   private static InetAddress hostAddress;
+   private static Integer port;
+   private static String protocol;
+   private static File serverWSDLDir;
+
+   protected static class JBWS2150WsdlContentsTestSetup extends JBossWSTestSetup {
+
+      protected static Boolean modifySOAPAddress;
+      protected static String webServiceHost;
+      protected static String webServicePath;
+
+      public JBWS2150WsdlContentsTestSetup() {
+         super(JBWS2150WsdlContentsTestCaseForked.class, null);
+      }
+
+      public void setUp() throws Exception
+      {
+         modifySOAPAddress = (Boolean)getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME, "ModifySOAPAddress");
+         webServiceHost = (String)getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME, "WebServiceHost");
+         webServicePath = (String)getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME, "WebServicePathRewriteRule");
+
+         try {
+            final String host = webServiceHost;
+            hostAddress = host != null ? InetAddress.getByName(host) : InetAddress.getByName("localhost");
+            port = new Integer(DEFAULT_PORT);
+            protocol = "http-remoting";
+         } catch (final IOException e) {
+            LOGGER.fatal(e.getMessage(), e);
+         }
+
+         serverWSDLDir = getServerWsdlDir();
+         super.setUp();
+      }
+   }
+
+   public static Test suite()
+   {
+      return new JBWS2150WsdlContentsTestSetup();
+   }
+
+   public void tearDown() throws Exception
+   {
+      Attribute attr = new Attribute("ModifySOAPAddress", JBWS2150WsdlContentsTestSetup.modifySOAPAddress);
+      getServer().setAttribute(SERVER_CONFIG_OBJECT_NAME, attr);
+      attr = new Attribute("WebServiceHost", JBWS2150WsdlContentsTestSetup.webServiceHost);
+      getServer().setAttribute(SERVER_CONFIG_OBJECT_NAME, attr);
+      attr = new Attribute("WebServicePathRewriteRule", JBWS2150WsdlContentsTestSetup.webServicePath);
+      getServer().setAttribute(SERVER_CONFIG_OBJECT_NAME, attr);
+   }
+
+   /**
+    * Test soap:address rewrite when a path rewrite rule is specified.
+    *
+    * @throws Exception
+    */
+   public void testRewriteWithPathRule() throws Exception
+   {
+      testUtils.setModifySOAPAddress(true);
+      final String expectedContext = "xx/jaxws-jbws2150";
+      final String sedCmd = "s/jaxws-jbws2150/xx\\/jaxws-jbws2150/g";
+      testUtils.setWebServicePathRewriteRule(sedCmd);
+      String archive = "jaxws-jbws2150.war";
+      deploy(archive);
+      try {
+         assertNotNull("Server's (localhost) " + "wsdl directory could not be found.", serverWSDLDir);
+         Document postDoc = getWSDLFromDisk(new File(serverWSDLDir, archive), "Service.wsdl");
+         HashMap<String, String> postSoapAddressMap = getServiceSoapAddresses(postDoc);
+         final String serverHost = getServerHost();
+
+         assertEquals("http://" + serverHost + ":8080/" + expectedContext + "/ValidURL",
+            postSoapAddressMap.get("ValidURLService"));
+
+         assertEquals("http://" + serverHost + ":8080/" + expectedContext + "/InvalidURL",
+            postSoapAddressMap.get("InvalidURLService"));
+
+         assertEquals("https://" + serverHost + ":8443/" + expectedContext + "/ValidSecureURL",
+            postSoapAddressMap.get("ValidSecureURLService"));
+
+         assertEquals("https://" + serverHost + ":8443/" + expectedContext + "/InvalidSecureURL",
+            postSoapAddressMap.get("InvalidSecureURLService"));
+      }
+      finally
+      {
+         undeploy("jaxws-jbws2150.war");
+      }
+   }
+
+   /**
+    * Test soap:address rewrite for code-first endpoints when a path rewrite rule is specified
+    *
+    * @throws Exception
+    */
+   public void testRewriteCodeFirstPathRule() throws Exception
+   {
+      testUtils.setModifySOAPAddress(true);
+      final String expectedContext = "xx/jaxws-jbws2150-codefirst";
+      final String sedCmd = "s/jaxws-jbws2150-codefirst/xx\\/jaxws-jbws2150-codefirst/g";
+      testUtils.setWebServicePathRewriteRule(sedCmd);
+      String archive = "jaxws-jbws2150-codefirst.war";
+      deploy(archive);
+      try
+      {
+         assertNotNull("Server's (localhost) " + "wsdl directory could not be found.", serverWSDLDir);
+         Document postDoc = getWSDLFromDisk(new File(serverWSDLDir, archive), "CodeFirstService.wsdl");
+         HashMap<String, String> postSoapAddressMap = getServiceSoapAddresses(postDoc);
+         final String serverHost = getServerHost();
+
+         assertEquals("http://" + serverHost + ":8080/" + expectedContext + "/CodeFirstService",
+            postSoapAddressMap.get("CodeFirstService"));
+      }
+      finally
+      {
+         undeploy("jaxws-jbws2150-codefirst.war");
+      }
+   }
+
+
+   /**
+    * Retrieve the absolute path to the (localhost's) JBOSS_HOME/standalone/data which will
+    * contain the wsdl dir and wsdl file.
+    * cli cmd to check this setting: /core-service=server-environment:read-attribute(name=data-dir)
+    */
+   private static File getServerWsdlDir() throws Exception{
+
+      final ModelNode request = new ModelNode();
+      request.get(ModelDescriptionConstants.OP).set(ModelDescriptionConstants.READ_ATTRIBUTE_OPERATION);
+      request.get(ModelDescriptionConstants.OP_ADDR)
+         .add(ModelDescriptionConstants.CORE_SERVICE).add("server-environment");
+      request.get(ModelDescriptionConstants.NAME).set("data-dir");
+
+      try {
+         final ModelNode response = applyUpdate(request);
+         String  dataDir = response.get(ModelDescriptionConstants.RESULT).asString();
+         if (dataDir != null) {
+            File dir = new File(dataDir, "wsdl");
+            if (dir.exists()) {
+               return dir;
+            } else {
+               throw new Exception("Directory does not exist: " + dir.getAbsolutePath());
+            }
+         }
+
+      } catch (Exception e) {
+         throw e;
+      }
+      return null;
+   }
+
+
+   private static ModelNode applyUpdate(final ModelNode update) throws Exception {
+      final ModelControllerClient client = newModelControllerClient();
+      try {
+         final ModelNode result = client.execute(new OperationBuilder(update).build());
+         checkResult(result);
+         return result;
+      } finally {
+         client.close();
+      }
+   }
+
+   private static void checkResult(final ModelNode result) throws Exception {
+      if (result.hasDefined(ModelDescriptionConstants.OUTCOME) &&
+         ModelDescriptionConstants.SUCCESS.equals(result.get(ModelDescriptionConstants.OUTCOME).asString())) {
+         if (result.hasDefined(ModelDescriptionConstants.RESULT)) {
+            LOGGER.info(result.get(ModelDescriptionConstants.RESULT));
+         }
+      } else if (result.hasDefined(ModelDescriptionConstants.FAILURE_DESCRIPTION)) {
+         throw new Exception(result.get(ModelDescriptionConstants.FAILURE_DESCRIPTION).toString());
+      } else {
+         throw new Exception("Operation not successful; outcome = " +
+            result.get(ModelDescriptionConstants.OUTCOME));
+      }
+   }
+
+   private static ModelControllerClient newModelControllerClient() throws Exception {
+      return ModelControllerClient.Factory.create(protocol,
+         hostAddress.getHostAddress(), port, null, null, 60000);
+   }
+
+   private Document loadXMLFrom(java.io.InputStream is) throws SAXException, IOException {
+
+      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+      factory.setNamespaceAware(true);
+      DocumentBuilder builder = null;
+      try {
+         builder = factory.newDocumentBuilder();
+      }
+      catch (ParserConfigurationException ex) {
+      }
+      Document doc = builder.parse(is);
+      is.close();
+      return doc;
+   }
+
+
+   /**
+    * Retrieve service name and soap:address location tuple.
+    * @param doc
+    * @return
+    */
+   private HashMap<String, String> getServiceSoapAddresses(Document doc) {
+
+      HashMap<String, String> soapAddresMap = new HashMap<String, String>();
+
+      List<Element> elList = DOMUtils.getChildElementsAsList(doc.getDocumentElement(),
+         "service", true);
+
+      for (Element el : elList) {
+         String serviceName = DOMUtils.getAttributeValue(el, "name");
+         List<Element> childList = DOMUtils.getChildElementsAsList(el, "address", true);
+         if (!childList.isEmpty()) {
+            String loc = childList.get(0).getAttribute("location");
+            soapAddresMap.put(serviceName, loc);
+         }
+      }
+      return soapAddresMap;
+   }
+
+
+   private Document getWSDLFromDisk(File serverWSDLDir, String wsdlName) throws Exception {
+      Document doc = null;
+      FileInputStream fis = null;
+      try {
+         File file = new File(serverWSDLDir, wsdlName);
+         if (file.exists()) {
+            fis = new FileInputStream(file);
+            doc = loadXMLFrom(fis);
+         } else {
+            throw new Exception("File does not exist: " + file.getAbsolutePath());
+         }
+      } catch (Exception e) {
+         throw e;
+      }
+      finally {
+         if (fis != null) {
+            try {
+               fis.close();
+            } catch (IOException e) {
+               // do nothing
+            }
+         }
+      }
+      return doc;
+   }
+
+}

Added: stack/cxf/branches/rsearls/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/TestUtils.java
===================================================================
--- stack/cxf/branches/rsearls/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/TestUtils.java	                        (rev 0)
+++ stack/cxf/branches/rsearls/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/TestUtils.java	2014-06-13 17:24:11 UTC (rev 18732)
@@ -0,0 +1,36 @@
+package org.jboss.test.ws.jaxws.jbws2150;
+
+import org.jboss.ws.common.ObjectNameFactory;
+import org.jboss.wsf.test.JBossWSTestHelper;
+
+import javax.management.Attribute;
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+import javax.naming.NamingException;
+
+/**
+ * User: rsearls
+ * Date: 6/12/14
+ */
+public class TestUtils
+{
+   private static final ObjectName SERVER_CONFIG_OBJECT_NAME = ObjectNameFactory.create("jboss.ws:service=ServerConfig");
+
+   public void setModifySOAPAddress(Boolean value) throws Exception
+   {
+      Attribute attr = new Attribute("ModifySOAPAddress", value);
+      getServer().setAttribute(SERVER_CONFIG_OBJECT_NAME, attr);
+   }
+
+   public void setWebServicePathRewriteRule(String value) throws Exception
+   {
+      Attribute attr = new Attribute("WebServicePathRewriteRule", value);
+      getServer().setAttribute(SERVER_CONFIG_OBJECT_NAME, attr);
+   }
+
+   private MBeanServerConnection getServer() throws NamingException
+   {
+      return JBossWSTestHelper.getServer();
+   }
+
+}

Modified: stack/cxf/branches/rsearls/pom.xml
===================================================================
--- stack/cxf/branches/rsearls/pom.xml	2014-06-12 16:05:44 UTC (rev 18731)
+++ stack/cxf/branches/rsearls/pom.xml	2014-06-13 17:24:11 UTC (rev 18732)
@@ -111,6 +111,7 @@
     <shrinkwrap.version>1.1.3</shrinkwrap.version>
     <jaspi.api.version>1.0.0.Alpha1</jaspi.api.version>
     <javax.inject.version>1</javax.inject.version>
+    <jboss-dmr-version>1.2.0.Final</jboss-dmr-version>
   </properties>
 
 



More information about the jbossws-commits mailing list