[jbosstools-commits] JBoss Tools SVN: r30531 - in workspace/adietish: org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests and 1 other directory.
jbosstools-commits at lists.jboss.org
jbosstools-commits at lists.jboss.org
Tue Apr 12 15:05:17 EDT 2011
Author: adietish
Date: 2011-04-12 15:05:17 -0400 (Tue, 12 Apr 2011)
New Revision: 30531
Modified:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/StandaloneDeployerIntegrationTest.java
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/StandaloneDeployer.java
Log:
Modified: workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/StandaloneDeployer.java
===================================================================
--- workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/StandaloneDeployer.java 2011-04-12 18:38:41 UTC (rev 30530)
+++ workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/StandaloneDeployer.java 2011-04-12 19:05:17 UTC (rev 30531)
@@ -49,12 +49,10 @@
/**
* Used to deploy/undeploy deployments to a running <b>standalone</b> application server
*
- * TODO Use the real deployment API once that is complete
- *
* @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
+ * @author <a href="adietish at redhat.com">André Dietisheim</a>
*/
-public class StandaloneDeployer implements Closeable {
+public class StandaloneDeployer {
public static final long DEFAULT_TIMEOUT = 15000;
@@ -68,7 +66,7 @@
manager = ServerDeploymentManager.Factory.create(client);
}
- public synchronized void addWarDeployment(File file) {
+ public synchronized void addWar(File file) {
deployments.add(new WarDeployable(file));
}
@@ -123,8 +121,7 @@
this.timeout = timeout;
}
- @Override
- public void close() throws IOException {
+ public void dispose() {
safeClose(client);
}
Modified: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/StandaloneDeployerIntegrationTest.java
===================================================================
--- workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/StandaloneDeployerIntegrationTest.java 2011-04-12 18:38:41 UTC (rev 30530)
+++ workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/StandaloneDeployerIntegrationTest.java 2011-04-12 19:05:17 UTC (rev 30531)
@@ -21,7 +21,6 @@
*/
package org.jboss.ide.eclipse.as7.deployment.tests;
-import static org.jboss.as.protocol.StreamUtils.safeClose;
import static org.junit.Assert.assertTrue;
import java.io.BufferedInputStream;
@@ -37,6 +36,7 @@
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Platform;
import org.jboss.ide.eclipse.as7.deployment.StandaloneDeployer;
+import org.junit.Before;
import org.junit.Test;
import org.osgi.framework.Bundle;
@@ -55,14 +55,20 @@
private static final String HOST = "localhost";
private static final int WEB_PORT = 8080;
+ @Before
+ public void setUp() {
+
+ }
+
+
@Test
public void canDeployUsingDeploymentUtils() throws Exception {
- StandaloneDeployer utils = null;
+ StandaloneDeployer deployer = null;
try {
- utils = new StandaloneDeployer();
+ deployer = new StandaloneDeployer();
File warFile = getWarFile("minimalistic.war");
- utils.addWarDeployment(warFile);
- utils.deploy();
+ deployer.addWar(warFile);
+ deployer.deploy();
String response = getServerResponse(new URL(
MessageFormat.format("http://{0}:{1}/{2}",
@@ -70,8 +76,8 @@
assertTrue(response.indexOf("minimalistic") >= 0);
} finally {
- utils.undeploy();
- safeClose(utils);
+ deployer.undeploy();
+ deployer.dispose();
}
}
More information about the jbosstools-commits
mailing list