[jbosstools-commits] JBoss Tools SVN: r30563 - in workspace/adietish: org.jboss.ide.eclipse.as7.deployment.detyped/META-INF and 2 other directories.
jbosstools-commits at lists.jboss.org
jbosstools-commits at lists.jboss.org
Wed Apr 13 13:48:20 EDT 2011
Author: adietish
Date: 2011-04-13 13:48:20 -0400 (Wed, 13 Apr 2011)
New Revision: 30563
Removed:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/jboss-as-cli-7.0.0.Beta3-SNAPSHOT.jar
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/src/org/jboss/ide/eclipse/as7/deployment/detyped/StandaloneDetypedOperations.java
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/StandaloneDetypedOperationsIntegrationTest.java
Modified:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/.classpath
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/META-INF/MANIFEST.MF
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/build.properties
Log:
removed jboss-as-cli jar
Modified: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/.classpath
===================================================================
--- workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/.classpath 2011-04-13 17:45:07 UTC (rev 30562)
+++ workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/.classpath 2011-04-13 17:48:20 UTC (rev 30563)
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="jboss-logging-3.0.0.Beta3.jar"/>
- <classpathentry exported="true" kind="lib" path="jboss-as-cli-7.0.0.Beta3-SNAPSHOT.jar" sourcepath="/jboss-as-cli"/>
<classpathentry exported="true" kind="lib" path="jboss-as-controller-client-7.0.0.Beta3-SNAPSHOT.jar" sourcepath="/jboss-as-controller-client"/>
<classpathentry exported="true" kind="lib" path="jboss-as-protocol-7.0.0.Beta3-SNAPSHOT.jar"/>
<classpathentry exported="true" kind="lib" path="jboss-dmr-1.0.0.Beta5.jar" sourcepath="/home/adietish/jboss-workspaces/jboss-tools/jbosstools-src/jboss-dmr-1.0.0.Beta5-sources.jar"/>
Modified: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/META-INF/MANIFEST.MF
===================================================================
--- workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/META-INF/MANIFEST.MF 2011-04-13 17:45:07 UTC (rev 30562)
+++ workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/META-INF/MANIFEST.MF 2011-04-13 17:48:20 UTC (rev 30563)
@@ -5,18 +5,13 @@
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ClassPath: .,
- jboss-as-cli-7.0.0.Beta3-SNAPSHOT.jar,
jboss-as-controller-client-7.0.0.Beta3-SNAPSHOT.jar,
jboss-as-protocol-7.0.0.Beta3-SNAPSHOT.jar,
jboss-dmr-1.0.0.Beta5.jar,
jboss-marshalling-1.3.0.CR8.jar,
jboss-threads-2.0.0.CR8.jar,
jboss-logging-3.0.0.Beta3.jar
-Export-Package: org.jboss.as.cli,
- org.jboss.as.cli.handlers,
- org.jboss.as.cli.operation,
- org.jboss.as.cli.operation.impl,
- org.jboss.as.cli.operation.parsing,
+Export-Package:
org.jboss.as.controller.client,
org.jboss.as.controller.client.helpers,
org.jboss.as.controller.client.helpers.domain,
Modified: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/build.properties
===================================================================
--- workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/build.properties 2011-04-13 17:45:07 UTC (rev 30562)
+++ workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/build.properties 2011-04-13 17:48:20 UTC (rev 30563)
@@ -2,7 +2,6 @@
output.. = bin/
bin.includes = META-INF/,\
.,\
- jboss-as-cli-7.0.0.Beta3-SNAPSHOT.jar,\
jboss-as-controller-client-7.0.0.Beta3-SNAPSHOT.jar,\
jboss-as-protocol-7.0.0.Beta3-SNAPSHOT.jar,\
jboss-dmr-1.0.0.Beta5.jar,\
Deleted: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/jboss-as-cli-7.0.0.Beta3-SNAPSHOT.jar
===================================================================
(Binary files differ)
Deleted: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/src/org/jboss/ide/eclipse/as7/deployment/detyped/StandaloneDetypedOperations.java
===================================================================
--- workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/src/org/jboss/ide/eclipse/as7/deployment/detyped/StandaloneDetypedOperations.java 2011-04-13 17:45:07 UTC (rev 30562)
+++ workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/src/org/jboss/ide/eclipse/as7/deployment/detyped/StandaloneDetypedOperations.java 2011-04-13 17:48:20 UTC (rev 30563)
@@ -1,176 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, 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.ide.eclipse.as7.deployment.detyped;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.UnknownHostException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.CancellationException;
-
-import org.jboss.as.cli.operation.OperationFormatException;
-import org.jboss.as.cli.operation.OperationRequestBuilder;
-import org.jboss.as.cli.operation.impl.DefaultOperationRequestBuilder;
-import org.jboss.as.controller.client.ModelControllerClient;
-import org.jboss.as.protocol.StreamUtils;
-import org.jboss.dmr.ModelNode;
-
-/**
- * @author André Dietisheim
- */
-public class StandaloneDetypedOperations {
-
- private final List<IDeploymentOperation> deployments = new ArrayList<IDeploymentOperation>();
- private final ModelControllerClient client;
-
- public StandaloneDetypedOperations(String host, int port) throws UnknownHostException {
- client = ModelControllerClient.Factory.create(host, port);
- }
-
- public synchronized StandaloneDetypedOperations deploy(File file) {
- deployments.add(new DeployOperation(file));
- return this;
- }
-
- public synchronized StandaloneDetypedOperations deploy(String name, File file) {
- deployments.add(new DeployOperation(name, file));
- return this;
- }
-
- public synchronized StandaloneDetypedOperations undeploy(String name) {
- deployments.add(new UndeployOperation(name));
- return this;
- }
-
- public synchronized StandaloneDetypedOperations undeploy(File file) {
- deployments.add(new UndeployOperation(file));
- return this;
- }
-
- public synchronized void execute() throws DeployerException {
- try {
- for (IDeploymentOperation operation : deployments) {
- operation.execute();
- }
- } catch (Exception e) {
- throw new DeployerException(e);
- }
- finally {
- dispose();
- }
- }
-
- public void dispose() {
- StreamUtils.safeClose(client);
- }
-
- private class DeployOperation extends FileOperation {
-
- private DeployOperation(File file) {
- super(file);
- }
-
- private DeployOperation(String name, File file) {
- super(name, file);
- }
-
- public void execute() throws OperationFormatException, CancellationException, IOException {
- OperationRequestBuilder builder = new DefaultOperationRequestBuilder();
- builder.setOperationName("deploy");
- builder.addNode("deployment", name);
- ModelNode request = builder.buildRequest();
- ModelNode result = client.execute(request);
- }
- }
-
- private class UndeployOperation extends FileOperation {
-
- private UndeployOperation(File file) {
- super(file);
- }
-
- private UndeployOperation(String name) {
- super(name, null);
- }
-
- public void execute() throws OperationFormatException, CancellationException, IOException {
- DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder();
-
- builder = new DefaultOperationRequestBuilder();
- builder.setOperationName("undeploy");
- builder.addNode("deployment", getName());
-
- ModelNode request = builder.buildRequest();
- ModelNode result = client.execute(request);
-
- // remove
- builder = new DefaultOperationRequestBuilder();
- builder.setOperationName("remove");
- builder.addNode("deployment", getName());
- request = builder.buildRequest();
- result = client.execute(request);
- }
- }
-
- private abstract static class FileOperation extends NamedOperation {
-
- private File file;
-
- private FileOperation(File file) {
- this(null, file);
- }
-
- private FileOperation(String name, File file) {
- super(name);
- this.file = file;
- }
-
- protected File getFile() {
- return file;
- }
-
- protected String getName() {
- if (name != null) {
- return name;
- } else {
- return file.getName();
- }
- }
- }
-
- private abstract static class NamedOperation implements IDeploymentOperation {
-
- protected String name;
-
- private NamedOperation(String name) {
- this.name = name;
- }
- }
-
- private interface IDeploymentOperation {
-
- public void execute() throws Exception;
-
- }
-
-}
Deleted: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/StandaloneDetypedOperationsIntegrationTest.java
===================================================================
--- workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/StandaloneDetypedOperationsIntegrationTest.java 2011-04-13 17:45:07 UTC (rev 30562)
+++ workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/StandaloneDetypedOperationsIntegrationTest.java 2011-04-13 17:48:20 UTC (rev 30563)
@@ -1,126 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, 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.ide.eclipse.as7.deployment.tests;
-
-import static org.junit.Assert.assertTrue;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringWriter;
-import java.net.HttpURLConnection;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.text.MessageFormat;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Platform;
-import org.jboss.ide.eclipse.as7.deployment.DeployerException;
-import org.jboss.ide.eclipse.as7.deployment.detyped.StandaloneDetypedOperations;
-import org.junit.Test;
-import org.osgi.framework.Bundle;
-
-/**
- * @author André Dietisheim
- */
-public class StandaloneDetypedOperationsIntegrationTest {
-
- private static final String WAR_FOLDER = "/wars/";
- private static final String BUNDLE_ID = "org.jboss.ide.eclipse.as7.deployment.tests";
-
- private static final int WEBAPP_RESPONSE_TIMEOUT = 10 * 1024;
-
- private static final String HOST = "localhost";
- private static final int MGMT_PORT = 9999;
- private static final int WEB_PORT = 8080;
-
- @Test
- public void canDeploy() throws Exception {
- StandaloneDetypedOperations deployer = null;
- File warFile = getWarFile("minimalistic.war");
- try {
- deployer = new StandaloneDetypedOperations(HOST, MGMT_PORT);
- quietlyUndeploy(warFile, deployer);
- deployer.deploy(warFile).execute();
-
- String response = getServerResponse(new URL(
- MessageFormat.format(
- "http://{0}:{1}/{2}", HOST, String.valueOf(WEB_PORT), "minimalistic")));
- assertTrue(response.indexOf("minimalistic") >= 0);
-
- } finally {
- quietlyUndeploy(warFile, deployer);
- }
- }
-
- @Test(expected = DeployerException.class)
- public void cannotDeployWarTwice() throws Exception {
- StandaloneDetypedOperations deployer = null;
- File warFile = getWarFile("minimalistic.war");
- try {
- deployer = new StandaloneDetypedOperations(HOST, MGMT_PORT);
- deployer.deploy(warFile).execute();
- deployer.deploy(warFile).execute();
- } finally {
- quietlyUndeploy(warFile, deployer);
- }
- }
-
- private File getWarFile(String name) throws URISyntaxException, IOException {
- Bundle bundle = Platform.getBundle(BUNDLE_ID);
- URL entryUrl = bundle.getEntry(WAR_FOLDER + name);
- return new File(FileLocator.resolve(entryUrl).toURI());
- }
-
- private String getServerResponse(URL url) throws IOException {
- HttpURLConnection connection = (HttpURLConnection) url.openConnection();
- connection.setUseCaches(false);
- connection.setDoInput(true);
- connection.setAllowUserInteraction(false);
- connection.setConnectTimeout(WEBAPP_RESPONSE_TIMEOUT);
- connection.setInstanceFollowRedirects(true);
- connection.setDoOutput(false);
- BufferedInputStream in = new BufferedInputStream(connection.getInputStream());
- return toString(in);
- }
-
- private String toString(InputStream in) throws IOException {
- StringWriter writer = new StringWriter();
- for (int data = -1; ((data = in.read()) != -1);) {
- writer.write(data);
- }
- return writer.toString();
- }
-
- private void quietlyUndeploy(File file, StandaloneDetypedOperations deployer) {
- try {
- if (deployer != null) {
- deployer.undeploy(file).execute();
- deployer.dispose();
- }
- } catch (Exception e) {
- e.printStackTrace();
- // ignore
- }
- }
-}
More information about the jbosstools-commits
mailing list