Author: rsearls
Date: 2014-06-13 16:48:10 -0400 (Fri, 13 Jun 2014)
New Revision: 18735
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/JBWS2150WsdlContentsTestCaseForked.java
stack/cxf/branches/rsearls/pom.xml
Log:
[JBWS-3801] replaced use of dmr api with ServerConfig#getServerDataDir.
Modified: stack/cxf/branches/rsearls/modules/testsuite/shared-tests/pom.xml
===================================================================
--- stack/cxf/branches/rsearls/modules/testsuite/shared-tests/pom.xml 2014-06-13 20:42:45
UTC (rev 18734)
+++ stack/cxf/branches/rsearls/modules/testsuite/shared-tests/pom.xml 2014-06-13 20:48:10
UTC (rev 18735)
@@ -29,16 +29,6 @@
<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/JBWS2150WsdlContentsTestCaseForked.java
===================================================================
---
stack/cxf/branches/rsearls/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150WsdlContentsTestCaseForked.java 2014-06-13
20:42:45 UTC (rev 18734)
+++
stack/cxf/branches/rsearls/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150WsdlContentsTestCaseForked.java 2014-06-13
20:48:10 UTC (rev 18735)
@@ -22,11 +22,6 @@
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;
@@ -43,7 +38,6 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
-import java.net.InetAddress;
import java.util.HashMap;
import java.util.List;
@@ -59,12 +53,6 @@
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 {
@@ -83,16 +71,9 @@
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);
- }
+ File tmpServerWSDLDir =
(File)getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME, "ServerDataDir");
+ serverWSDLDir = new File(tmpServerWSDLDir, "wsdl");
- serverWSDLDir = getServerWsdlDir();
super.setUp();
}
}
@@ -179,68 +160,6 @@
}
- /**
- * 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();
Modified: stack/cxf/branches/rsearls/pom.xml
===================================================================
--- stack/cxf/branches/rsearls/pom.xml 2014-06-13 20:42:45 UTC (rev 18734)
+++ stack/cxf/branches/rsearls/pom.xml 2014-06-13 20:48:10 UTC (rev 18735)
@@ -111,7 +111,6 @@
<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>
Show replies by date