JBossWS SVN: r19454 - container/wildfly82/branches/jbossws-wildfly820/tests-integration/src/main/java/org/jboss/as/webservices/deployer.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-02-13 10:36:55 -0500 (Fri, 13 Feb 2015)
New Revision: 19454
Removed:
container/wildfly82/branches/jbossws-wildfly820/tests-integration/src/main/java/org/jboss/as/webservices/deployer/RemoteDeployer.java
Log:
[JBWS-3668] Removing RemoteDeployer not used anymore
Deleted: container/wildfly82/branches/jbossws-wildfly820/tests-integration/src/main/java/org/jboss/as/webservices/deployer/RemoteDeployer.java
===================================================================
--- container/wildfly82/branches/jbossws-wildfly820/tests-integration/src/main/java/org/jboss/as/webservices/deployer/RemoteDeployer.java 2015-02-13 14:43:07 UTC (rev 19453)
+++ container/wildfly82/branches/jbossws-wildfly820/tests-integration/src/main/java/org/jboss/as/webservices/deployer/RemoteDeployer.java 2015-02-13 15:36:55 UTC (rev 19454)
@@ -1,584 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat, Inc., 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.as.webservices.deployer;
-
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.concurrent.Semaphore;
-
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.NameCallback;
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.callback.UnsupportedCallbackException;
-import javax.security.sasl.RealmCallback;
-import javax.security.sasl.RealmChoiceCallback;
-
-import org.jboss.as.controller.PathAddress;
-import org.jboss.as.controller.client.ModelControllerClient;
-import org.jboss.as.controller.client.OperationBuilder;
-import org.jboss.as.controller.client.helpers.standalone.DeploymentAction;
-import org.jboss.as.controller.client.helpers.standalone.DeploymentPlan;
-import org.jboss.as.controller.client.helpers.standalone.DeploymentPlanBuilder;
-import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentActionResult;
-import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentManager;
-import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentPlanResult;
-import org.jboss.as.controller.operations.common.Util;
-import org.jboss.as.security.Constants;
-import org.jboss.dmr.ModelNode;
-import org.jboss.logging.Logger;
-import org.jboss.wsf.spi.deployer.Deployer;
-
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADD;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ALLOW_RESOURCE_SERVICE_RESTART;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.AUTHENTICATION;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.COMPOSITE;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.FAILURE_DESCRIPTION;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.NAME;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OPERATION_HEADERS;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OUTCOME;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.READ_ATTRIBUTE_OPERATION;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.READ_RESOURCE_OPERATION;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.RELEASE_VERSION;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.REMOVE;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.REQUIRED;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.RESTART;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.RESULT;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ROLLBACK_ON_RUNTIME_FAILURE;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SERVER_IDENTITY;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SHUTDOWN;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SSL;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.STEPS;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SUBSYSTEM;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SUCCESS;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.TRUSTSTORE;
-import static org.jboss.as.security.Constants.CLASSIC;
-import static org.jboss.as.security.Constants.CODE;
-import static org.jboss.as.security.Constants.FLAG;
-import static org.jboss.as.security.Constants.AUTH_MODULE;
-import static org.jboss.as.security.Constants.JASPI;
-import static org.jboss.as.security.Constants.LOGIN_MODULE;
-import static org.jboss.as.security.Constants.LOGIN_MODULE_STACK;
-import static org.jboss.as.security.Constants.LOGIN_MODULE_STACK_REF;
-import static org.jboss.as.security.Constants.MODULE_OPTIONS;
-import static org.jboss.as.security.Constants.SECURITY_DOMAIN;
-
-/**
- * Remote deployer that uses AS7 client deployment API.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- * @author <a href="mailto:alessio.soldano@jboss.com">Alessio Soldano</a>
- * @author <a href="mailto:ema@redhat.com">Jim Ma</a>
- */
-public final class RemoteDeployer implements Deployer {
-
- private static final Logger LOGGER = Logger.getLogger(RemoteDeployer.class);
- private static final int DEFAULT_PORT = 9990;
- private static final String JBWS_DEPLOYER_HOST = "jbossws.deployer.host";
- private static final String JBWS_DEPLOYER_PORT = "jbossws.deployer.port";
- private static final String JBWS_DEPLOYER_PROTOCOL = "jbossws.deployer.protocol";
- private static final String JBWS_DEPLOYER_AUTH_USER = "jbossws.deployer.authentication.username";
- private static final String JBWS_DEPLOYER_AUTH_PWD = "jbossws.deployer.authentication.password";
- private static final String JBWS_DEPLOYER_HTTPS_LISTENER_NAME = "jbws-test-https-listener";
- private static final String JBWS_DEPLOYER_HTTPS_LISTENER_REALM_NAME = "jbws-test-https-realm";
- private static final CallbackHandler callbackHandler = getCallbackHandler();
- private static final int TIMEOUT = 60000;
- private static InetAddress address;
- private static Integer port;
- private static String protocol;
- private final Map<URL, String> url2Id = new HashMap<URL, String>();
- private final Map<String, Integer> securityDomainUsers = new HashMap<String, Integer>(1);
- private final Map<String, Integer> archiveCounters = new HashMap<String, Integer>();
- private final Semaphore httpsConnSemaphore = new Semaphore(1);
-
- private static final String SERVER_IDENTITY_SSL = SERVER_IDENTITY + "." + SSL + ".";
- private static final String AUTHENTICATION_TRUSTORE = AUTHENTICATION + "." + TRUSTSTORE + ".";
-
- static {
- try {
- final String host = System.getProperty(JBWS_DEPLOYER_HOST);
- address = host != null ? InetAddress.getByName(host) : InetAddress.getByName("localhost");
- port = Integer.getInteger(JBWS_DEPLOYER_PORT, DEFAULT_PORT);
- protocol = System.getProperty(JBWS_DEPLOYER_PROTOCOL, "http-remoting");
- } catch (final IOException e) {
- LOGGER.fatal(e.getMessage(), e);
- System.exit(1);
- }
- }
-
- @Override
- public void deploy(final URL archiveURL) throws Exception {
- synchronized (archiveCounters) {
- String k = archiveURL.toString();
- if (archiveCounters.containsKey(k)) {
- int count = archiveCounters.get(k);
- archiveCounters.put(k, (count + 1));
- return;
- } else {
- archiveCounters.put(k, 1);
- }
- final ModelControllerClient client = newModelControllerClient();
- final ServerDeploymentManager deploymentManager = newDeploymentManager(client);
- final DeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan().add(archiveURL).andDeploy();
- final DeploymentPlan plan = builder.build();
- final DeploymentAction deployAction = builder.getLastAction();
- final String uniqueId = deployAction.getDeploymentUnitUniqueName();
- executeDeploymentPlan(plan, deployAction, client, deploymentManager);
- url2Id.put(archiveURL, uniqueId);
- }
- }
-
- @Override
- public void undeploy(final URL archiveURL) throws Exception {
- synchronized (archiveCounters) {
- String k = archiveURL.toString();
- if (archiveCounters.containsKey(k)) {
- int count = archiveCounters.get(k);
- if (count > 1) {
- archiveCounters.put(k, (count - 1));
- return;
- } else {
- archiveCounters.remove(k);
- }
- } else {
- LOGGER.warn("Trying to undeploy archive " + archiveURL + " which is not currently deployed!");
- return;
- }
-
- final String uniqueName = url2Id.get(archiveURL);
- if (uniqueName != null) {
- final ModelControllerClient client = newModelControllerClient();
- final ServerDeploymentManager deploymentManager = newDeploymentManager(client);
- final DeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan();
- final DeploymentPlan plan = builder.undeploy(uniqueName).remove(uniqueName).build();
- final DeploymentAction deployAction = builder.getLastAction();
- try {
- executeDeploymentPlan(plan, deployAction, client, deploymentManager);
- } finally {
- url2Id.remove(archiveURL);
- }
- }
- }
- }
-
- private void executeDeploymentPlan(final DeploymentPlan plan, final DeploymentAction deployAction,
- final ModelControllerClient client, final ServerDeploymentManager deploymentManager) throws Exception {
- try {
- final ServerDeploymentPlanResult planResult = deploymentManager.execute(plan).get();
-
- if (deployAction != null) {
- final ServerDeploymentActionResult actionResult = planResult.getDeploymentActionResult(deployAction.getId());
- if (actionResult != null) {
- final Exception deploymentException = (Exception) actionResult.getDeploymentException();
- if (deploymentException != null)
- throw deploymentException;
- }
- }
- } catch (final Exception e) {
- LOGGER.fatal(e.getMessage(), e);
- throw e;
- } finally {
- client.close();
- deploymentManager.close();
- }
- }
-
- public String getServerVersion() throws Exception {
- final ModelNode request = new ModelNode();
- request.get(OP).set(READ_ATTRIBUTE_OPERATION);
- request.get(OP_ADDR).setEmptyList();
- request.get(NAME).set(RELEASE_VERSION);
-
- final ModelNode response = applyUpdate(request);
- return response.get(RESULT).asString();
- }
-
- @Override
- public void addSecurityDomain(String name, Map<String, String> authenticationOptions) throws Exception {
- synchronized (securityDomainUsers) {
- if (securityDomainUsers.containsKey(name)) {
- int count = securityDomainUsers.get(name);
- securityDomainUsers.put(name, (count + 1));
- return;
- } else {
- securityDomainUsers.put(name, 1);
- }
-
- final List<ModelNode> updates = new ArrayList<ModelNode>();
-
- final ModelNode compositeOp = new ModelNode();
- compositeOp.get(OP).set(COMPOSITE);
- compositeOp.get(OP_ADDR).setEmptyList();
- compositeOp.get(OPERATION_HEADERS, ALLOW_RESOURCE_SERVICE_RESTART).set(true);
-
- ModelNode steps = compositeOp.get(STEPS);
- PathAddress address = PathAddress.pathAddress()
- .append(SUBSYSTEM, "security")
- .append(SECURITY_DOMAIN, name);
- steps.add(Util.createAddOperation(address));
- address = address.append(Constants.AUTHENTICATION, CLASSIC);
- steps.add(Util.createAddOperation(address));
- ModelNode loginModule = Util.createAddOperation(address.append(LOGIN_MODULE, "UsersRoles"));
- loginModule.get(CODE).set("UsersRoles");
- loginModule.get(FLAG).set(REQUIRED);
- loginModule.get(OPERATION_HEADERS).get(ALLOW_RESOURCE_SERVICE_RESTART).set(true);
- final ModelNode moduleOptions = loginModule.get(MODULE_OPTIONS);
- if (authenticationOptions != null) {
- for (final String k : authenticationOptions.keySet()) {
- moduleOptions.add(k, authenticationOptions.get(k));
- }
- }
- steps.add(loginModule);
- updates.add(compositeOp);
-
- applyUpdates(updates);
- }
- }
-
- public void addJaspiSecurityDomain(String name, String loginModuleStackName, Map<String, String> loginModuleOptions,
- String authModuleName, Map<String, String> authModuleOptions) throws Exception {
- synchronized (securityDomainUsers) {
- if (securityDomainUsers.containsKey(name)) {
- int count = securityDomainUsers.get(name);
- securityDomainUsers.put(name, (count + 1));
- return;
- } else {
- securityDomainUsers.put(name, 1);
- }
-
- final List<ModelNode> updates = new ArrayList<ModelNode>();
-
- final ModelNode compositeOp = new ModelNode();
- compositeOp.get(OP).set(COMPOSITE);
- compositeOp.get(OP_ADDR).setEmptyList();
- compositeOp.get(OPERATION_HEADERS, ALLOW_RESOURCE_SERVICE_RESTART).set(true);
-
- ModelNode steps = compositeOp.get(STEPS);
- PathAddress address = PathAddress.pathAddress().append(SUBSYSTEM, "security").append(SECURITY_DOMAIN, name);
- steps.add(Util.createAddOperation(address));
-
- PathAddress parentAddress = address.append(AUTHENTICATION, JASPI);
- steps.add(Util.createAddOperation(parentAddress));
-
- // step 3
- PathAddress loignStackAddress = parentAddress.append(LOGIN_MODULE_STACK, loginModuleStackName);
- ModelNode loginStack = Util.createAddOperation(loignStackAddress);
- steps.add(loginStack);
-
- // step 4
- ModelNode loginModule = Util.createAddOperation(loignStackAddress.append(LOGIN_MODULE, "UsersRoles"));
- loginModule.get(CODE).set("UsersRoles");
- loginModule.get(FLAG).set(REQUIRED);
- loginModule.get(OPERATION_HEADERS).get(ALLOW_RESOURCE_SERVICE_RESTART).set(true);
- final ModelNode moduleOptions = loginModule.get(MODULE_OPTIONS);
- if (loginModuleOptions != null) {
- for (final String k : loginModuleOptions.keySet()) {
- moduleOptions.add(k, loginModuleOptions.get(k));
- }
- }
- steps.add(loginModule);
-
- PathAddress authModule = parentAddress.append(AUTH_MODULE, authModuleName);
- ModelNode authModuleNode = Util.createAddOperation(authModule);
- authModuleNode.get(LOGIN_MODULE_STACK_REF).set(loginModuleStackName);
- authModuleNode.get(CODE).set(authModuleName);
- ModelNode options = authModuleNode.get(MODULE_OPTIONS);
- if (authModuleOptions != null) {
- for (final String k : authModuleOptions.keySet()) {
- options.add(k, authModuleOptions.get(k));
- }
- }
- steps.add(authModuleNode);
-
- updates.add(compositeOp);
-
- applyUpdates(updates);
- }
- }
-
- @Override
- public void removeSecurityDomain(String name) throws Exception {
- synchronized (securityDomainUsers) {
- int count = securityDomainUsers.get(name);
- if (count > 1) {
- securityDomainUsers.put(name, (count - 1));
- return;
- } else {
- securityDomainUsers.remove(name);
- }
-
- final ModelNode op = new ModelNode();
- op.get(OP).set(REMOVE);
- op.get(OP_ADDR).add(SUBSYSTEM, "security");
- op.get(OP_ADDR).add(SECURITY_DOMAIN, name);
- op.get(OPERATION_HEADERS, ALLOW_RESOURCE_SERVICE_RESTART).set(true);
- op.get(OPERATION_HEADERS, ROLLBACK_ON_RUNTIME_FAILURE).set(false);
-
- applyUpdate(op);
- }
- }
-
- public void addHttpsConnector(Map<String, String> options) throws Exception {
- final Map<String, String> sslOptionsMap = new HashMap<String, String>();
- final Map<String, String> truststoreOptionsMap = new HashMap<String, String>();
- if (options != null) {
- for (final Entry<String, String> entry : options.entrySet()) {
- final String k = entry.getKey();
- if (k.startsWith(SERVER_IDENTITY_SSL)) {
- final String key = k.substring(SERVER_IDENTITY_SSL.length());
- sslOptionsMap.put(key, entry.getValue());
- } else if (k.startsWith(AUTHENTICATION_TRUSTORE)) {
- final String key = k.substring(AUTHENTICATION_TRUSTORE.length());
- truststoreOptionsMap.put(key, entry.getValue());
- }
- }
- }
- httpsConnSemaphore.acquire();
- try {
- addSecurityRealm(JBWS_DEPLOYER_HTTPS_LISTENER_REALM_NAME, sslOptionsMap, truststoreOptionsMap);
- final ModelNode composite = Util.getEmptyOperation(COMPOSITE, new ModelNode());
- final ModelNode steps = composite.get(STEPS);
- ModelNode op = createOpNode("subsystem=undertow/server=default-server/https-listener=" + JBWS_DEPLOYER_HTTPS_LISTENER_NAME, "add");
- op.get("socket-binding").set("https");
- op.get("security-realm").set(JBWS_DEPLOYER_HTTPS_LISTENER_REALM_NAME);
- final String verifyClient = "verify-client";
- if (options != null && options.containsKey(verifyClient)) {
- op.get(verifyClient).set(options.get(verifyClient));
- }
- steps.add(op);
- applyUpdate(composite);
- } catch (Exception e) {
- httpsConnSemaphore.release();
- throw e;
- }
- }
-
- private static void addSecurityRealm(String realm, Map<String, String> sslOptions, Map<String, String> truststoreOptions) throws Exception {
- final ModelNode composite = Util.getEmptyOperation(COMPOSITE, new ModelNode());
- final ModelNode steps = composite.get(STEPS);
- ModelNode op = createOpNode("core-service=management/security-realm=" + realm, ADD);
- steps.add(op);
- if (!sslOptions.isEmpty()) {
- ModelNode ssl = createOpNode("core-service=management/security-realm=" + realm + "/server-identity=ssl", ADD);
- for (final Entry<String, String> entry : sslOptions.entrySet()) {
- ssl.get(entry.getKey()).set(entry.getValue());
- }
- steps.add(ssl);
- }
-
- if (!truststoreOptions.isEmpty()) {
- ModelNode truststore = createOpNode("core-service=management/security-realm=" + realm + "/authentication=truststore", ADD);
- for (final Entry<String, String> entry : truststoreOptions.entrySet()) {
- truststore.get(entry.getKey()).set(entry.getValue());
- }
- steps.add(truststore);
- }
- applyUpdate(composite);
- }
-
- public void removeHttpsConnector() throws Exception {
- try {
- ModelNode op = createOpNode("subsystem=undertow/server=default-server/https-listener=" + JBWS_DEPLOYER_HTTPS_LISTENER_NAME, REMOVE);
- op.get(OPERATION_HEADERS, ALLOW_RESOURCE_SERVICE_RESTART).set(true);
- applyUpdate(op);
- op = createOpNode("core-service=management/security-realm=" + JBWS_DEPLOYER_HTTPS_LISTENER_REALM_NAME, REMOVE);
- op.get(OPERATION_HEADERS, ALLOW_RESOURCE_SERVICE_RESTART).set(true);
- applyUpdate(op);
- } finally {
- httpsConnSemaphore.release();
- }
- }
-
- @Override
- public void restart() throws Exception {
- ModelNode op = new ModelNode();
- op.get("operation").set(SHUTDOWN);
- op.get(RESTART).set("true");
- applyUpdate(op);
- waitForServerToRestart(TIMEOUT);
- }
-
- @Override
- public String setSystemProperty(String propName, String propValue) throws Exception {
- if (propName == null || propName.trim().length() == 0) {
- throw new IllegalArgumentException("Empty system property name specified!");
- }
- ModelNode op = createOpNode("system-property=" + propName, READ_RESOURCE_OPERATION);
- String previousValue = null;
- try {
- ModelNode response = applyUpdate(op);
- String rawResult = response.get(RESULT).asString();
- previousValue = rawResult.substring(13, rawResult.length() - 2); //{"value" => "xyz"}
- } catch (Exception e) {
- if (!e.getMessage().contains("WFLYCTL0216") && !e.getMessage().contains("JBAS014807")) {
- throw e;
- }
- }
- if (previousValue != null) {
- op = createOpNode("system-property=" + propName, REMOVE);
- applyUpdate(op);
- }
- if (propValue != null) {
- op = createOpNode("system-property=" + propName, ADD);
- op.get("value").set(propValue);
- applyUpdate(op);
- }
- return previousValue;
- }
-
- private static void applyUpdates(final List<ModelNode> updates) throws Exception {
- for (final ModelNode update : updates) {
- applyUpdate(update);
- }
- }
-
- 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(OUTCOME) && SUCCESS.equals(result.get(OUTCOME).asString())) {
- if (result.hasDefined(RESULT)) {
- LOGGER.info(result.get(RESULT));
- }
- } else if (result.hasDefined(FAILURE_DESCRIPTION)) {
- throw new Exception(result.get(FAILURE_DESCRIPTION).toString());
- } else {
- throw new Exception("Operation not successful; outcome = " + result.get(OUTCOME));
- }
- }
-
- private static CallbackHandler getCallbackHandler() {
- final String username = getSystemProperty(JBWS_DEPLOYER_AUTH_USER, null);
- if (username == null || ("${" + JBWS_DEPLOYER_AUTH_USER + "}").equals(username)) {
- return null;
- }
- String pwd = getSystemProperty(JBWS_DEPLOYER_AUTH_PWD, null);
- if (("${" + JBWS_DEPLOYER_AUTH_PWD + "}").equals(pwd)) {
- pwd = null;
- }
- final String password = pwd;
- return new CallbackHandler() {
- public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
- for (Callback current : callbacks) {
- if (current instanceof NameCallback) {
- NameCallback ncb = (NameCallback) current;
- ncb.setName(username);
- } else if (current instanceof PasswordCallback) {
- PasswordCallback pcb = (PasswordCallback) current;
- pcb.setPassword(password.toCharArray());
- } else if (current instanceof RealmCallback) {
- RealmCallback rcb = (RealmCallback) current;
- rcb.setText(rcb.getDefaultText());
- } else if (current instanceof RealmChoiceCallback) {
- // Ignored but not rejected.
- } else {
- throw new UnsupportedCallbackException(current);
- }
- }
- }
- };
- }
-
- public static ModelNode createOpNode(String address, String operation) {
- ModelNode op = new ModelNode();
- // set address
- ModelNode list = op.get("address").setEmptyList();
- if (address != null) {
- String[] pathSegments = address.split("/");
- for (String segment : pathSegments) {
- String[] elements = segment.split("=");
- list.add(elements[0], elements[1]);
- }
- }
- op.get("operation").set(operation);
- return op;
- }
-
- private void waitForServerToRestart(int timeout) throws Exception {
- Thread.sleep(1000);
- long start = System.currentTimeMillis();
- long now;
- do {
- final ModelControllerClient client = newModelControllerClient(timeout / 10);
- ModelNode operation = new ModelNode();
- operation.get(OP_ADDR).setEmptyList();
- operation.get(OP).set(READ_ATTRIBUTE_OPERATION);
- operation.get(NAME).set("server-state");
- try {
- ModelNode result = client.execute(operation);
- boolean normal = "running".equals(result.get(RESULT).asString());
- if (normal) {
- return;
- }
- } catch (Exception e) {
- //NOOP
- } finally {
- client.close();
- }
- try {
- Thread.sleep(500);
- } catch (InterruptedException e) {
- }
- now = System.currentTimeMillis();
- } while (now - start < timeout);
- throw new Exception("Server did not restart!");
- }
-
- private static String getSystemProperty(final String name, final String defaultValue) {
- PrivilegedAction<String> action = new PrivilegedAction<String>() {
- public String run() {
- return System.getProperty(name, defaultValue);
- }
- };
- return AccessController.doPrivileged(action);
- }
-
- private static ModelControllerClient newModelControllerClient() throws Exception {
- return newModelControllerClient(TIMEOUT);
- }
-
- private static ModelControllerClient newModelControllerClient(int timeout) throws Exception {
- return ModelControllerClient.Factory.create(protocol, address.getHostAddress(), port, callbackHandler, null, timeout);
- }
-
- private static ServerDeploymentManager newDeploymentManager(ModelControllerClient client) throws Exception {
- return ServerDeploymentManager.Factory.create(client);
- }
-}
9 years, 10 months
JBossWS SVN: r19453 - in stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws: jbws1556 and 6 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-02-13 09:43:07 -0500 (Fri, 13 Feb 2015)
New Revision: 19453
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1422/JBWS1422TestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1556/JBWS1556EarTestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1841/JBWS1841TestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/addressing/AddressingStatefulTestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextEJBTestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextJSETestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webparam/WebParamTestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webresult/WebResultTestCase.java
Log:
Bunch of fixes to tests that used CleanupOperation in the past for static references to ports...
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1422/JBWS1422TestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1422/JBWS1422TestCase.java 2015-02-12 16:54:59 UTC (rev 19452)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1422/JBWS1422TestCase.java 2015-02-13 14:43:07 UTC (rev 19453)
@@ -44,8 +44,6 @@
@RunWith(Arquillian.class)
public class JBWS1422TestCase extends JBossWSTest
{
- private static final String TARGET_NAMESPACE = "http://jbws1422.jaxws.ws.test.jboss.org/";
-
@ArquillianResource
private URL baseURL;
@@ -63,7 +61,7 @@
@RunAsClient
public void testDeployment() throws Exception
{
- QName serviceName = new QName(TARGET_NAMESPACE, "JBWS1422Service");
+ QName serviceName = new QName("http://jbws1422.jaxws.ws.test.jboss.org/", "JBWS1422Service");
URL wsdlURL = new URL(baseURL + "/jaxws-jbws1422/JBWS1422Service/IWebsvcImpl?wsdl");
Service service = Service.create(wsdlURL, serviceName);
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1556/JBWS1556EarTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1556/JBWS1556EarTestCase.java 2015-02-12 16:54:59 UTC (rev 19452)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1556/JBWS1556EarTestCase.java 2015-02-13 14:43:07 UTC (rev 19453)
@@ -37,6 +37,8 @@
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
+import org.junit.AfterClass;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -57,7 +59,6 @@
private URL baseURL;
@Deployment(testable = false)
-
public static EnterpriseArchive createDeployment3() {
JavaArchive archive1 = ShrinkWrap.create(JavaArchive.class, "jaxws-jbws1556.jar");
archive1
@@ -74,11 +75,8 @@
return archive;
}
- protected void cleanUp() {
- port = null;
- }
-
- protected void setUp() throws MalformedURLException
+ @Before
+ public void setup() throws MalformedURLException
{
if (port == null)
{
@@ -88,25 +86,26 @@
port = service.getPort(EndpointInterface.class);
}
}
+
+ @AfterClass
+ public static void cleanup() {
+ port = null;
+ }
@Test
@RunAsClient
public void testSimpleAccess() throws Exception
{
- setUp();
String hello = port.helloSimple("hello");
assertEquals("hello", hello);
- cleanUp();
}
@Test
@RunAsClient
public void testComplexAccess() throws Exception
{
- setUp();
UserType req = new UserType("hello");
UserType res = port.helloComplex(req);
assertEquals(req, res);
- cleanUp();
}
}
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1841/JBWS1841TestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1841/JBWS1841TestCase.java 2015-02-12 16:54:59 UTC (rev 19452)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1841/JBWS1841TestCase.java 2015-02-13 14:43:07 UTC (rev 19453)
@@ -37,6 +37,8 @@
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
+import org.junit.AfterClass;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -76,7 +78,8 @@
return archive;
}
- private void cleanUp() {
+ @AfterClass
+ public static void cleanUp() {
port = null;
remote = null;
if (ctx != null) {
@@ -90,63 +93,56 @@
}
}
- protected void setUp() throws Exception {
- URL wsdlURL = new URL(baseURL + "/jaxws-jbws1841/EndpointService/EJB3Bean?wsdl");
- QName serviceName = new QName("http://www.openuri.org/2004/04/HelloWorld", "EndpointService");
- port = Service.create(wsdlURL, serviceName).getPort(EndpointInterface.class);
-
- ctx = getServerInitialContext();
- remote = (StatelessRemote) ctx.lookup("jaxws-jbws1841//" + StatelessBean.class.getSimpleName() + "!" + StatelessRemote.class.getName());
+ @Before
+ public void setup() throws Exception {
+ if (port == null) {
+ URL wsdlURL = new URL(baseURL + "/jaxws-jbws1841/EndpointService/EJB3Bean?wsdl");
+ QName serviceName = new QName("http://www.openuri.org/2004/04/HelloWorld", "EndpointService");
+ port = Service.create(wsdlURL, serviceName).getPort(EndpointInterface.class);
+
+ ctx = getServerInitialContext();
+ remote = (StatelessRemote) ctx.lookup("jaxws-jbws1841//" + StatelessBean.class.getSimpleName() + "!" + StatelessRemote.class.getName());
+ }
}
@Test
@RunAsClient
public void testDirectWSInvocation() throws Exception
{
- setUp();
String result = port.echo("DirectWSInvocation");
assertEquals("DirectWSInvocation", result);
- cleanUp();
}
@Test
@RunAsClient
public void testEJBRelay1() throws Exception
{
- setUp();
String result = remote.echo1("Relay1");
assertEquals("Relay1", result);
- cleanUp();
}
@Test
@RunAsClient
public void testEJBRelay2() throws Exception
{
- setUp();
String result = remote.echo2("Relay2");
assertEquals("Relay2", result);
- cleanUp();
}
@Test
@RunAsClient
public void testEJBRelay3() throws Exception
{
- setUp();
String result = remote.echo3("Relay3");
assertEquals("Relay3", result);
- cleanUp();
}
@Test
@RunAsClient
public void testEJBRelay4() throws Exception
{
- setUp();
String result = remote.echo4("Relay4");
assertEquals("Relay4", result);
- cleanUp();
}
}
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/addressing/AddressingStatefulTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/addressing/AddressingStatefulTestCase.java 2015-02-12 16:54:59 UTC (rev 19452)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/addressing/AddressingStatefulTestCase.java 2015-02-13 14:43:07 UTC (rev 19453)
@@ -49,9 +49,6 @@
@RunWith(Arquillian.class)
public class AddressingStatefulTestCase extends JBossWSTest
{
- private static AddressingPort port1;
- private static AddressingPort port2;
-
@ArquillianResource
private URL baseURL;
@@ -68,49 +65,31 @@
return archive;
}
- protected void setUp() throws Exception {
- super.setUp();
-
+ @Test
+ @RunAsClient
+ public void testItemLifecycle() throws Exception
+ {
URL wsdlURL = new URL(baseURL + "/TestService?wsdl");
QName serviceName = new QName("http://org.jboss.ws/samples/wsaddressing", "TestService");
Service service1 = Service.create(wsdlURL, serviceName);
- port1 = new AddressingPort(service1.getPort(StatefulEndpoint.class, new AddressingFeature(true, true)));
+ AddressingPort port1 = new AddressingPort(service1.getPort(StatefulEndpoint.class, new AddressingFeature(true, true)));
Service service2 = Service.create(wsdlURL, serviceName);
- port2 = new AddressingPort(service2.getPort(StatefulEndpoint.class, new AddressingFeature(true, true)));
- }
-
- @Test
- @RunAsClient
- public void testItemLifecycle() throws Exception
- {
- setUp();
- firstAddItem();
- secondGetItems();
- thirdCheckout();
- }
-
- private void firstAddItem() throws Exception
- {
+ AddressingPort port2 = new AddressingPort(service2.getPort(StatefulEndpoint.class, new AddressingFeature(true, true)));
+
port1.addItem("Ice Cream");
port1.addItem("Ferrari");
port2.addItem("Mars Bar");
port2.addItem("Porsche");
- }
-
- private void secondGetItems() throws Exception
- {
+
String items1 = port1.getItems();
assertEquals("[Ice Cream, Ferrari]", items1);
String items2 = port2.getItems();
assertEquals("[Mars Bar, Porsche]", items2);
- }
-
- private void thirdCheckout() throws Exception
- {
+
port1.checkout();
assertEquals("[]", port1.getItems());
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextEJBTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextEJBTestCase.java 2015-02-12 16:54:59 UTC (rev 19452)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextEJBTestCase.java 2015-02-13 14:43:07 UTC (rev 19453)
@@ -37,6 +37,8 @@
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
+import org.junit.AfterClass;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -65,22 +67,29 @@
return archive;
}
- public void setUp() throws Exception {
- URL wsdlURL = new URL(baseURL + "/jaxws-samples-context?wsdl");
- QName qname = new QName("http://org.jboss.ws/jaxws/context", "EndpointService");
- Service service = Service.create(wsdlURL, qname);
- port = (Endpoint) service.getPort(Endpoint.class);
-
- BindingProvider bp = (BindingProvider) port;
- bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "kermit");
- bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "thefrog");
+ @Before
+ public void setup() throws Exception {
+ if (port == null) {
+ URL wsdlURL = new URL(baseURL + "/jaxws-samples-context?wsdl");
+ QName qname = new QName("http://org.jboss.ws/jaxws/context", "EndpointService");
+ Service service = Service.create(wsdlURL, qname);
+ port = (Endpoint) service.getPort(Endpoint.class);
+
+ BindingProvider bp = (BindingProvider) port;
+ bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "kermit");
+ bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "thefrog");
+ }
}
+
+ @AfterClass
+ public static void clean() {
+ port = null;
+ }
@Test
@RunAsClient
public void testGetWebContext() throws Exception
{
- setUp();
String retStr = port.testGetMessageContext();
assertEquals("pass", retStr);
}
@@ -89,7 +98,6 @@
@RunAsClient
public void testMessageContextProperties() throws Exception
{
- setUp();
String retStr = port.testMessageContextProperties();
assertEquals("pass", retStr);
}
@@ -98,7 +106,6 @@
@RunAsClient
public void testGetUserPrincipal() throws Exception
{
- setUp();
String retStr = port.testGetUserPrincipal();
assertEquals("kermit", retStr);
}
@@ -107,7 +114,6 @@
@RunAsClient
public void testIsUserInRole() throws Exception
{
- setUp();
assertTrue("kermit is my friend", port.testIsUserInRole("friend"));
}
}
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextJSETestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextJSETestCase.java 2015-02-12 16:54:59 UTC (rev 19452)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextJSETestCase.java 2015-02-13 14:43:07 UTC (rev 19453)
@@ -37,6 +37,8 @@
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
+import org.junit.AfterClass;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -67,23 +69,29 @@
return archive;
}
-
- public void setUp() throws Exception {
- URL wsdlURL = new URL(baseURL + "/jaxws-samples-context-jse?wsdl");
- QName qname = new QName("http://org.jboss.ws/jaxws/context", "EndpointService");
- Service service = Service.create(wsdlURL, qname);
- port = (Endpoint) service.getPort(Endpoint.class);
-
- BindingProvider bp = (BindingProvider) port;
- bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "kermit");
- bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "thefrog");
+ @Before
+ public void setup() throws Exception {
+ if (port == null) {
+ URL wsdlURL = new URL(baseURL + "/jaxws-samples-context-jse?wsdl");
+ QName qname = new QName("http://org.jboss.ws/jaxws/context", "EndpointService");
+ Service service = Service.create(wsdlURL, qname);
+ port = (Endpoint) service.getPort(Endpoint.class);
+
+ BindingProvider bp = (BindingProvider) port;
+ bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "kermit");
+ bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "thefrog");
+ }
}
+
+ @AfterClass
+ public static void cleanup() {
+ port = null;
+ }
@Test
@RunAsClient
public void testGetWebContext() throws Exception
{
- setUp();
String retStr = port.testGetMessageContext();
assertEquals("pass", retStr);
}
@@ -92,7 +100,6 @@
@RunAsClient
public void testMessageContextProperties() throws Exception
{
- setUp();
String retStr = port.testMessageContextProperties();
assertEquals("pass", retStr);
}
@@ -101,7 +108,6 @@
@RunAsClient
public void testGetUserPrincipal() throws Exception
{
- setUp();
String retStr = port.testGetUserPrincipal();
assertEquals("kermit", retStr);
}
@@ -110,7 +116,6 @@
@RunAsClient
public void testIsUserInRole() throws Exception
{
- setUp();
assertTrue("kermit is my friend", port.testIsUserInRole("friend"));
}
}
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java 2015-02-12 16:54:59 UTC (rev 19452)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java 2015-02-13 14:43:07 UTC (rev 19453)
@@ -34,6 +34,8 @@
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.wsf.test.JBossWSTest;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -75,15 +77,20 @@
return archive;
}
- protected void setUp() throws Exception {
+ @BeforeClass
+ public static void setup() throws Exception {
data = new DataHandler("Client data", "text/plain");
}
+
+ @AfterClass
+ public static void clean() {
+ data = null;
+ }
@Test
@RunAsClient
public void testBeanAnnotationWithBare() throws Exception
{
- setUp();
Service service = Service.create(new URL(baseURL + "/jaxws-swaref/BareEndpointService/BareEndpoint?wsdl"), bareServiceQName);
BareEndpoint port = service.getPort(BareEndpoint.class);
DocumentPayload response = port.beanAnnotation(new DocumentPayload(data));
@@ -94,7 +101,6 @@
@RunAsClient
public void testBeanAnnotationWithWrapped() throws Exception
{
- setUp();
Service service = Service.create(new URL(baseURL+"/jaxws-swaref/WrappedEndpointService/WrappedEndpoint?wsdl"), wrappedServiceQName);
WrappedEndpoint port = service.getPort(WrappedEndpoint.class);
@@ -106,7 +112,6 @@
@RunAsClient
public void testParameterAnnotationWithWrapped() throws Exception
{
- setUp();
Service service = Service.create(new URL(baseURL+"/jaxws-swaref/WrappedEndpointService/WrappedEndpoint?wsdl"), wrappedServiceQName);
WrappedEndpoint port = service.getPort(WrappedEndpoint.class);
@@ -119,7 +124,6 @@
@RunAsClient
public void testBeanAnnotationWithRPC() throws Exception
{
- setUp();
Service service = Service.create(new URL(baseURL+"/jaxws-swaref/RpcLitEndpointService/RpcLitEndpoint?wsdl"), rpcLitServiceQName);
RpcLitEndpoint port = service.getPort(RpcLitEndpoint.class);
@@ -132,7 +136,6 @@
@RunAsClient
public void testListAnnotationWithWrapped() throws Exception
{
- setUp();
//[JBWS-2708]
Service service = Service.create(new URL(baseURL+"/jaxws-swaref/WrappedEndpointService/WrappedEndpoint?wsdl"), wrappedServiceQName);
WrappedEndpoint port = service.getPort(WrappedEndpoint.class);
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webparam/WebParamTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webparam/WebParamTestCase.java 2015-02-12 16:54:59 UTC (rev 19452)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webparam/WebParamTestCase.java 2015-02-13 14:43:07 UTC (rev 19453)
@@ -35,7 +35,7 @@
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
-import org.junit.After;
+import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -115,8 +115,8 @@
port.securePing(doc, secHeader);
}
- @After
- public void resetPort() {
+ @AfterClass
+ public static void cleanupPort() {
port = null;
}
}
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webresult/WebResultTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webresult/WebResultTestCase.java 2015-02-12 16:54:59 UTC (rev 19452)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webresult/WebResultTestCase.java 2015-02-13 14:43:07 UTC (rev 19453)
@@ -55,8 +55,6 @@
{
private String targetNS = "http://webresult.samples.jaxws.ws.test.jboss.org/";
- private static CustomerService port;
-
@ArquillianResource
private URL baseURL;
@@ -72,23 +70,16 @@
return archive;
}
- public void setUp() throws Exception
- {
- if (port == null)
- {
- QName serviceName = new QName(targetNS, "CustomerServiceService");
- URL wsdlURL = getResourceURL("jaxws/samples/webresult/META-INF/wsdl/CustomerService.wsdl");
-
- Service service = Service.create(wsdlURL, serviceName);
- port = service.getPort(CustomerService.class);
- }
- }
-
@Test
@RunAsClient
public void testLocateCustomer() throws Exception
{
- setUp();
+ QName serviceName = new QName(targetNS, "CustomerServiceService");
+ URL wsdlURL = getResourceURL("jaxws/samples/webresult/META-INF/wsdl/CustomerService.wsdl");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ CustomerService port = service.getPort(CustomerService.class);
+
USAddress addr = new USAddress();
addr.setAddress("Wall Street");
9 years, 10 months
JBossWS SVN: r19452 - stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-02-12 11:54:59 -0500 (Thu, 12 Feb 2015)
New Revision: 19452
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/HandlerAuthInterceptor.java
Log:
Make inner class static
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/HandlerAuthInterceptor.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/HandlerAuthInterceptor.java 2015-02-12 16:54:28 UTC (rev 19451)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/HandlerAuthInterceptor.java 2015-02-12 16:54:59 UTC (rev 19452)
@@ -92,7 +92,7 @@
|| message == ex.getOutFaultMessage();
}
- private class JBossWSHandlerChainInvoker extends HandlerChainInvoker
+ private static class JBossWSHandlerChainInvoker extends HandlerChainInvoker
{
public JBossWSHandlerChainInvoker(@SuppressWarnings("rawtypes") List<Handler> hc, boolean isOutbound)
9 years, 10 months
JBossWS SVN: r19451 - in stack/cxf/trunk/modules/dist: src/main/scripts and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-02-12 11:54:28 -0500 (Thu, 12 Feb 2015)
New Revision: 19451
Modified:
stack/cxf/trunk/modules/dist/pom.xml
stack/cxf/trunk/modules/dist/src/main/scripts/assembly-deploy-artifacts.xml
Log:
Fix to the build to properly work with recent maven-assembly-plugin
Modified: stack/cxf/trunk/modules/dist/pom.xml
===================================================================
--- stack/cxf/trunk/modules/dist/pom.xml 2015-02-12 16:53:42 UTC (rev 19450)
+++ stack/cxf/trunk/modules/dist/pom.xml 2015-02-12 16:54:28 UTC (rev 19451)
@@ -235,6 +235,11 @@
<artifactId>jbossws-wildfly800-server-integration</artifactId>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.jboss.ws</groupId>
+ <artifactId>jbossws-wildfly800-tests-integration</artifactId>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
</profile>
@@ -256,6 +261,11 @@
<artifactId>jbossws-wildfly810-server-integration</artifactId>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.jboss.ws</groupId>
+ <artifactId>jbossws-wildfly810-tests-integration</artifactId>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
</profile>
@@ -277,6 +287,11 @@
<artifactId>jbossws-wildfly820-server-integration</artifactId>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.jboss.ws</groupId>
+ <artifactId>jbossws-wildfly820-tests-integration</artifactId>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
</profile>
Modified: stack/cxf/trunk/modules/dist/src/main/scripts/assembly-deploy-artifacts.xml
===================================================================
--- stack/cxf/trunk/modules/dist/src/main/scripts/assembly-deploy-artifacts.xml 2015-02-12 16:53:42 UTC (rev 19450)
+++ stack/cxf/trunk/modules/dist/src/main/scripts/assembly-deploy-artifacts.xml 2015-02-12 16:54:28 UTC (rev 19451)
@@ -107,7 +107,6 @@
<outputDirectory>deploy-artifacts/lib</outputDirectory>
<unpack>false</unpack>
<includes>
- <include>org.jboss.ws:jbossws-jboss*-tests-integration:jar</include>
<include>org.jboss.ws:jbossws-wildfly*-tests-integration:jar</include>
</includes>
<outputFileNameMapping>${artifact.artifactId}.${artifact.extension}</outputFileNameMapping>
@@ -115,23 +114,10 @@
<useProjectArtifact>false</useProjectArtifact>
</dependencySet>
-
<dependencySet>
<outputDirectory>deploy-artifacts/lib</outputDirectory>
<unpack>false</unpack>
<includes>
- <include>org.wildfly:wildfly-webservices-tests-integration:jar</include>
- </includes>
- <outputFileNameMapping>jbossws-wildfly900-tests-integration.jar</outputFileNameMapping>
- <scope>provided</scope>
- <useProjectArtifact>false</useProjectArtifact>
- </dependencySet>
-
- <dependencySet>
- <outputDirectory>deploy-artifacts/lib</outputDirectory>
- <unpack>false</unpack>
- <includes>
- <include>org.jboss.ws:jbossws-jboss*-server-integration:jar</include>
<include>org.jboss.ws:jbossws-wildfly*-server-integration:jar</include>
<include>org.picketbox:picketbox:jar</include>
</includes>
@@ -144,8 +130,7 @@
<outputDirectory>deploy-artifacts/lib</outputDirectory>
<unpack>false</unpack>
<includes>
- <include>org.jboss.ws.cxf:jbossws-cxf-resources:jar:*:jboss*</include>
- <include>org.jboss.ws.cxf:jbossws-cxf-resources:jar:*:wildfly*</include>
+ <include>org.jboss.ws.cxf:jbossws-cxf-resources:jar:*</include>
</includes>
<outputFileNameMapping>${artifact.artifactId}${dashClassifier}.${artifact.extension}</outputFileNameMapping>
<useProjectArtifact>false</useProjectArtifact>
9 years, 10 months
JBossWS SVN: r19450 - maven/parent/trunk.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-02-12 11:53:42 -0500 (Thu, 12 Feb 2015)
New Revision: 19450
Modified:
maven/parent/trunk/pom.xml
Log:
Move to maven-assembly-plugin 2.5.3
Modified: maven/parent/trunk/pom.xml
===================================================================
--- maven/parent/trunk/pom.xml 2015-02-11 14:21:12 UTC (rev 19449)
+++ maven/parent/trunk/pom.xml 2015-02-12 16:53:42 UTC (rev 19450)
@@ -119,7 +119,7 @@
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
- <version>2.2-beta-5</version>
+ <version>2.5.3</version>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
9 years, 10 months
JBossWS SVN: r19449 - stack/cxf/branches/jbossws-cxf-4.3.x.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-02-11 09:21:12 -0500 (Wed, 11 Feb 2015)
New Revision: 19449
Modified:
stack/cxf/branches/jbossws-cxf-4.3.x/pom.xml
Log:
Use latest jbossws-native
Modified: stack/cxf/branches/jbossws-cxf-4.3.x/pom.xml
===================================================================
--- stack/cxf/branches/jbossws-cxf-4.3.x/pom.xml 2015-02-11 03:21:17 UTC (rev 19448)
+++ stack/cxf/branches/jbossws-cxf-4.3.x/pom.xml 2015-02-11 14:21:12 UTC (rev 19449)
@@ -67,7 +67,7 @@
<jbossws.jboss720.version>4.3.2.Final</jbossws.jboss720.version>
<jbossws.wildfly800.version>4.3.1.Final</jbossws.wildfly800.version>
<jbossws.wildfly810.version>4.3.2.Final</jbossws.wildfly810.version>
- <jbossws.native.version>4.2.0.Final</jbossws.native.version>
+ <jbossws.native.version>4.2.1.Final</jbossws.native.version>
<jboss720.version>7.2.0.Final</jboss720.version>
<wildfly800.version>8.0.0.Final</wildfly800.version>
<wildfly810.version>8.1.0.Final</wildfly810.version>
9 years, 10 months
JBossWS SVN: r19448 - stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/saaj/jbws3857.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2015-02-10 22:21:17 -0500 (Tue, 10 Feb 2015)
New Revision: 19448
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/saaj/jbws3857/MultipartContentTypeTestCase.java
Log:
Fix MultipartContentTypeTestCase
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/saaj/jbws3857/MultipartContentTypeTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/saaj/jbws3857/MultipartContentTypeTestCase.java 2015-02-10 18:05:38 UTC (rev 19447)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/saaj/jbws3857/MultipartContentTypeTestCase.java 2015-02-11 03:21:17 UTC (rev 19448)
@@ -21,53 +21,55 @@
*/
package org.jboss.test.ws.saaj.jbws3857;
-import junit.framework.Test;
-import org.jboss.wsf.test.JBossWSTest;
-import org.jboss.wsf.test.JBossWSTestHelper;
-import org.jboss.wsf.test.JBossWSTestSetup;
-import org.junit.Assert;
+import static org.jboss.wsf.test.JBossWSTestHelper.getTestResourcesDir;
+import java.io.File;
+import java.net.URL;
+
import javax.activation.DataHandler;
import javax.activation.URLDataSource;
import javax.xml.namespace.QName;
-import javax.xml.soap.*;
-import java.io.File;
-import java.net.URL;
-import java.util.LinkedList;
-import java.util.List;
+import javax.xml.soap.AttachmentPart;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPBodyElement;
+import javax.xml.soap.SOAPConnection;
+import javax.xml.soap.SOAPConnectionFactory;
+import javax.xml.soap.SOAPConstants;
+import javax.xml.soap.SOAPMessage;
-import static org.jboss.wsf.test.JBossWSTestHelper.getTestResourcesDir;
-
-/**
- *
- */
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.test.api.ArquillianResource;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestHelper;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+(a)RunWith(Arquillian.class)
public class MultipartContentTypeTestCase extends JBossWSTest
{
private static final String PROJECT_NAME = "reproducer-eap-wrong-multipart";
- private static final String TEST_SERVLET_URL = "http://" + getServerHost() + ":8080/" + PROJECT_NAME + "/testServlet";
private static final String IN_IMG_NAME = "test.png";
-
- public static JBossWSTestHelper.BaseDeployment<?>[] createDeployments() {
- List<JBossWSTestHelper.BaseDeployment<?>> list = new LinkedList<JBossWSTestHelper.BaseDeployment<?>>();
- list.add(new JBossWSTestHelper.WarDeployment("jaxws-jbws3857.war") { {
+ @ArquillianResource
+ private URL baseURL;
+ @Deployment(testable = false)
+ public static WebArchive createDeployments() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-jbws3857.war");
archive
.addManifest()
.addClass(org.jboss.test.ws.saaj.jbws3857.SoapMultipartCheckerServlet.class)
.addAsWebInfResource(new File(getTestResourcesDir() + "/saaj/jbws3857/META-INF/beans.xml"), "classes/META-INF/beans.xml")
.addAsWebInfResource(new File(getTestResourcesDir() + "/saaj/jbws3857/test.png"), "classes/test.png")
.addAsWebInfResource(new File(getTestResourcesDir() + "/saaj/jbws3857/WEB-INF/jboss-web.xml"), "jboss-web.xml")
- .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/saaj/jbws3857/WEB-INF/web.xml"))
- ;
- }
- });
- return list.toArray(new JBossWSTestHelper.BaseDeployment<?>[list.size()]);
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/saaj/jbws3857/WEB-INF/web.xml"));
+ return archive;
}
-
- public static Test suite()
- {
- return new JBossWSTestSetup(MultipartContentTypeTestCase.class, JBossWSTestHelper.writeToFile(createDeployments()));
- }
-
+
+ @Test
+ @RunAsClient
public void testSendMultipartSoapMessage() throws Exception {
final MessageFactory msgFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
final SOAPMessage msg = msgFactory.createMessage();
@@ -82,7 +84,7 @@
final SOAPConnectionFactory conFactory = SOAPConnectionFactory.newInstance();
final SOAPConnection connection = conFactory.createConnection();
- final SOAPMessage response = connection.call(msg, new URL(TEST_SERVLET_URL));
+ final SOAPMessage response = connection.call(msg, new URL("http://" + baseURL.getHost()+ ":" + baseURL.getPort() + "/" + PROJECT_NAME + "/testServlet"));
final String contentTypeWeHaveSent = getBodyElementTextValue(response);
assertContentTypeStarts("multipart/related", contentTypeWeHaveSent);
9 years, 10 months
JBossWS SVN: r19447 - stack/cxf/branches/jbossws-cxf-4.3.x.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-02-10 13:05:38 -0500 (Tue, 10 Feb 2015)
New Revision: 19447
Modified:
stack/cxf/branches/jbossws-cxf-4.3.x/pom.xml
Log:
Move to CXF 2.7.15-SNAPSHOT
Modified: stack/cxf/branches/jbossws-cxf-4.3.x/pom.xml
===================================================================
--- stack/cxf/branches/jbossws-cxf-4.3.x/pom.xml 2015-02-10 17:11:23 UTC (rev 19446)
+++ stack/cxf/branches/jbossws-cxf-4.3.x/pom.xml 2015-02-10 18:05:38 UTC (rev 19447)
@@ -72,7 +72,7 @@
<wildfly800.version>8.0.0.Final</wildfly800.version>
<wildfly810.version>8.1.0.Final</wildfly810.version>
<ejb.api.version>1.0.2.Final</ejb.api.version>
- <cxf.version>2.7.14</cxf.version>
+ <cxf.version>2.7.15-SNAPSHOT</cxf.version>
<cxf.asm.version>3.3.1</cxf.asm.version>
<cxf.xjcplugins.version>2.6.1</cxf.xjcplugins.version>
<jboss.common.core.version>2.2.17.GA</jboss.common.core.version>
9 years, 10 months
JBossWS SVN: r19446 - stack/cxf/trunk.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-02-10 12:11:23 -0500 (Tue, 10 Feb 2015)
New Revision: 19446
Modified:
stack/cxf/trunk/pom.xml
Log:
[JBWS-3868] Prepare for moving to Apache CXF 3.0.4
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2015-02-10 13:37:02 UTC (rev 19445)
+++ stack/cxf/trunk/pom.xml 2015-02-10 17:11:23 UTC (rev 19446)
@@ -73,7 +73,7 @@
<wildfly820.version>8.2.0.Final</wildfly820.version>
<wildfly900.version>9.0.0.Alpha2-SNAPSHOT</wildfly900.version>
<ejb.api.version>1.0.2.Final</ejb.api.version>
- <cxf.version>3.0.3</cxf.version>
+ <cxf.version>3.0.4-SNAPSHOT</cxf.version>
<cxf.asm.version>3.3.1</cxf.asm.version>
<cxf.xjcplugins.version>3.0.2</cxf.xjcplugins.version>
<jboss.common.core.version>2.2.17.GA</jboss.common.core.version>
@@ -103,8 +103,8 @@
<jms.api.version>1.0.1.Final</jms.api.version>
<velocity.version>1.7</velocity.version>
<xerces.version>2.9.1</xerces.version>
- <xmlsec.version>2.0.2</xmlsec.version>
- <wss4j.version>2.0.2</wss4j.version>
+ <xmlsec.version>2.0.3</xmlsec.version>
+ <wss4j.version>2.0.3</wss4j.version>
<wstx.version>4.4.1</wstx.version>
<spring.version>3.2.8.RELEASE</spring.version>
<shrinkwrap.version>1.1.3</shrinkwrap.version>
9 years, 10 months
JBossWS SVN: r19445 - hudson/trunk.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-02-10 08:37:02 -0500 (Tue, 10 Feb 2015)
New Revision: 19445
Modified:
hudson/trunk/ant.properties.example
Log:
Modified: hudson/trunk/ant.properties.example
===================================================================
--- hudson/trunk/ant.properties.example 2015-02-10 13:34:33 UTC (rev 19444)
+++ hudson/trunk/ant.properties.example 2015-02-10 13:37:02 UTC (rev 19445)
@@ -17,7 +17,7 @@
hudson.admin.port=8150
hudson.http.port=8180
-hudson.cxf.url=http://anonsvn.jboss.org/repos/jbossws/stack/cxf/branches/arquillian
+hudson.cxf.url=http://anonsvn.jboss.org/repos/jbossws/stack/cxf/trunk
hudson.jboss800.url=https://github.com/wildfly/wildfly
hudson.jboss800.build=wildfly-8.0.0.Final
9 years, 10 months