Author: adietish
Date: 2011-04-07 08:59:19 -0400 (Thu, 07 Apr 2011)
New Revision: 30414
Added:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/.classpath
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/.project
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/.settings/
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/.settings/org.eclipse.jdt.core.prefs
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/META-INF/
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/META-INF/MANIFEST.MF
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/build.properties
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/Activator.java
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/DeploymentBuilderTest.java
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/wars/
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/wars/gwt-helloworld.war
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/wars/minimalistic.war
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/.classpath
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/.project
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/META-INF/
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/META-INF/MANIFEST.MF
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/build.properties
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/jboss-as-controller-client-7.0.0.Beta3-SNAPSHOT.jar
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/jboss-as-protocol-7.0.0.Beta3-SNAPSHOT.jar
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/jboss-dmr-1.0.0.Beta5.jar
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/jboss-logging-3.0.0.Beta3.jar
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/jboss-marshalling-1.3.0.CR8.jar
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/jboss-threads-2.0.0.CR8.jar
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/shrinkwrap-api-1.0.0-alpha-11.jar
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/Activator.java
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/DeploymentBuilder.java
Log:
initial commit, POC's working
Added: workspace/adietish/org.jboss.ide.eclipse.as7.deployment/.classpath
===================================================================
--- workspace/adietish/org.jboss.ide.eclipse.as7.deployment/.classpath
(rev 0)
+++ workspace/adietish/org.jboss.ide.eclipse.as7.deployment/.classpath 2011-04-07 12:59:19
UTC (rev 30414)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry exported="true" kind="lib"
path="jboss-marshalling-1.3.0.CR8.jar"/>
+ <classpathentry exported="true" kind="lib"
path="jboss-logging-3.0.0.Beta3.jar"/>
+ <classpathentry exported="true" kind="lib"
path="jboss-threads-2.0.0.CR8.jar"/>
+ <classpathentry exported="true" kind="lib"
path="shrinkwrap-api-1.0.0-alpha-11.jar"/>
+ <classpathentry exported="true" kind="lib"
path="jboss-dmr-1.0.0.Beta5.jar"/>
+ <classpathentry exported="true" kind="lib"
path="jboss-as-controller-client-7.0.0.Beta3-SNAPSHOT.jar"
sourcepath="/home/adietish/jboss-workspaces/jboss-tools/jbosstools-src/jboss-as"/>
+ <classpathentry exported="true" kind="lib"
path="jboss-as-protocol-7.0.0.Beta3-SNAPSHOT.jar"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Property changes on: workspace/adietish/org.jboss.ide.eclipse.as7.deployment/.classpath
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: workspace/adietish/org.jboss.ide.eclipse.as7.deployment/.project
===================================================================
--- workspace/adietish/org.jboss.ide.eclipse.as7.deployment/.project
(rev 0)
+++ workspace/adietish/org.jboss.ide.eclipse.as7.deployment/.project 2011-04-07 12:59:19
UTC (rev 30414)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.ide.eclipse.as7.deployment</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Property changes on: workspace/adietish/org.jboss.ide.eclipse.as7.deployment/.project
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: workspace/adietish/org.jboss.ide.eclipse.as7.deployment/META-INF/MANIFEST.MF
===================================================================
--- workspace/adietish/org.jboss.ide.eclipse.as7.deployment/META-INF/MANIFEST.MF
(rev 0)
+++
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/META-INF/MANIFEST.MF 2011-04-07
12:59:19 UTC (rev 30414)
@@ -0,0 +1,19 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Deployment
+Bundle-SymbolicName: org.jboss.ide.eclipse.as7.deployment
+Bundle-Version: 0.0.1.qualifier
+Bundle-Activator: org.jboss.ide.eclipse.as7.deployment.Activator
+Require-Bundle: org.eclipse.core.runtime
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ClassPath: .,
+ 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,
+ shrinkwrap-api-1.0.0-alpha-11.jar,
+ jboss-threads-2.0.0.CR8.jar,
+ jboss-logging-3.0.0.Beta3.jar,
+ jboss-marshalling-1.3.0.CR8.jar
+Export-Package: org.jboss.ide.eclipse.as7.deployment
+Bundle-Vendor: JBoss by Red Hat
Property changes on:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/META-INF/MANIFEST.MF
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: workspace/adietish/org.jboss.ide.eclipse.as7.deployment/build.properties
===================================================================
--- workspace/adietish/org.jboss.ide.eclipse.as7.deployment/build.properties
(rev 0)
+++ workspace/adietish/org.jboss.ide.eclipse.as7.deployment/build.properties 2011-04-07
12:59:19 UTC (rev 30414)
@@ -0,0 +1,11 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ 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,\
+ shrinkwrap-api-1.0.0-alpha-11.jar,\
+ jboss-threads-2.0.0.CR8.jar,\
+ jboss-logging-3.0.0.Beta3.jar,\
+ jboss-marshalling-1.3.0.CR8.jar
Property changes on:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/build.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/jboss-as-controller-client-7.0.0.Beta3-SNAPSHOT.jar
===================================================================
(Binary files differ)
Property changes on:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/jboss-as-controller-client-7.0.0.Beta3-SNAPSHOT.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/jboss-as-protocol-7.0.0.Beta3-SNAPSHOT.jar
===================================================================
(Binary files differ)
Property changes on:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/jboss-as-protocol-7.0.0.Beta3-SNAPSHOT.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: workspace/adietish/org.jboss.ide.eclipse.as7.deployment/jboss-dmr-1.0.0.Beta5.jar
===================================================================
(Binary files differ)
Property changes on:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/jboss-dmr-1.0.0.Beta5.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/jboss-logging-3.0.0.Beta3.jar
===================================================================
(Binary files differ)
Property changes on:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/jboss-logging-3.0.0.Beta3.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/jboss-marshalling-1.3.0.CR8.jar
===================================================================
(Binary files differ)
Property changes on:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/jboss-marshalling-1.3.0.CR8.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/jboss-threads-2.0.0.CR8.jar
===================================================================
(Binary files differ)
Property changes on:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/jboss-threads-2.0.0.CR8.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/shrinkwrap-api-1.0.0-alpha-11.jar
===================================================================
(Binary files differ)
Property changes on:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/shrinkwrap-api-1.0.0-alpha-11.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/Activator.java
===================================================================
---
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/Activator.java
(rev 0)
+++
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/Activator.java 2011-04-07
12:59:19 UTC (rev 30414)
@@ -0,0 +1,30 @@
+package org.jboss.ide.eclipse.as7.deployment;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+
+ private static BundleContext context;
+
+ static BundleContext getContext() {
+ return context;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext bundleContext) throws Exception {
+ Activator.context = bundleContext;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext bundleContext) throws Exception {
+ Activator.context = null;
+ }
+
+}
Property changes on:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/Activator.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/DeploymentBuilder.java
===================================================================
---
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/DeploymentBuilder.java
(rev 0)
+++
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/DeploymentBuilder.java 2011-04-07
12:59:19 UTC (rev 30414)
@@ -0,0 +1,252 @@
+package org.jboss.ide.eclipse.as7.deployment;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+
+import org.jboss.as.controller.client.ModelControllerClient;
+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.DuplicateDeploymentNameException;
+import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentManager;
+import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentPlanResult;
+import org.jboss.as.protocol.StreamUtils;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.ArchivePath;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.container.ResourceContainer;
+import org.jboss.shrinkwrap.api.exporter.ZipExporter;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+
+public class DeploymentBuilder {
+
+ public static final long DEFAULT_TIMEOUT = 15000;
+
+ private ModelControllerClient client;
+ private ServerDeploymentManager manager;
+ private final List<AbstractDeployment> deployments = new
ArrayList<AbstractDeployment>();
+ private long timeout = DEFAULT_TIMEOUT;
+
+ public DeploymentBuilder(String host, int port) throws UnknownHostException {
+ this.client = ModelControllerClient.Factory.create(InetAddress.getByName(host),
port);
+ this.manager = ServerDeploymentManager.Factory.create(client);
+ }
+
+ public DeploymentBuilder add(String name, boolean show, Package... pkgs) {
+ deployments.add(new WarDeployment(name, pkgs, show));
+ return this;
+ }
+
+ public DeploymentBuilder add(File file) {
+ deployments.add(new WarFileDeployment(file));
+ return this;
+ }
+
+ public void deploy() {
+ try {
+ DeploymentPlanBuilder builder = manager.newDeploymentPlan();
+ for (AbstractDeployment deployment : deployments) {
+ deployment.addDeployment(manager, builder);
+ }
+ try {
+ DeploymentPlan plan = builder.build();
+ Future<ServerDeploymentPlanResult> planResult =
manager.execute(plan);
+ planResult.get(timeout, TimeUnit.MILLISECONDS);
+ } finally {
+ cleanup();
+ }
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private void cleanup() {
+ StreamUtils.safeClose(client);
+ }
+
+ private abstract class AbstractDeployment {
+
+ boolean deployed;
+ String deploymentName;
+
+ public synchronized DeploymentPlanBuilder addDeployment(ServerDeploymentManager
manager, DeploymentPlanBuilder builder)
+ throws DuplicateDeploymentNameException, IOException, ExecutionException,
InterruptedException {
+ deploymentName = getFile().getName();
+ System.out.println("Deploying " + deploymentName);
+ return builder.add(deploymentName, getFile()).deploy(deploymentName);
+ }
+
+ public synchronized DeploymentPlanBuilder removeDeployment(DeploymentPlanBuilder
builder) {
+ if (deployed) {
+ System.out.println("Undeploying " + deploymentName);
+ return builder.undeploy(deploymentName).remove(deploymentName);
+ } else {
+ return builder;
+ }
+ }
+
+ protected void addFiles(ResourceContainer<?> archive, File dir, ArchivePath
dest) {
+ for (String name : dir.list()) {
+ File file = new File(dir, name);
+ if (file.isDirectory()) {
+ addFiles(archive, file, ArchivePaths.create(dest, name));
+ } else {
+ archive.addResource(file, ArchivePaths.create(dest, name));
+ }
+ }
+ }
+
+ protected File getSourceMetaInfDir(String archiveName) {
+ String name = "archives/" + archiveName +
"/META-INF/MANIFEST.MF";
+
+ URL url = Thread.currentThread().getContextClassLoader().getResource(name);
+ if (url == null) {
+ throw new IllegalArgumentException("No resource called " +
name);
+ }
+ try {
+ File file = new File(url.toURI());
+ return file.getParentFile();
+ } catch (URISyntaxException e) {
+ throw new RuntimeException("Could not get file for " + url);
+ }
+ }
+
+ protected File getSourceWebInfDir(String archiveName) {
+ String name = "archives/" + archiveName + "/WEB-INF";
+
+ URL url = Thread.currentThread().getContextClassLoader().getResource(name);
+ if (url == null) {
+ return null;
+ }
+ try {
+ return new File(url.toURI());
+ } catch (URISyntaxException e) {
+ throw new RuntimeException("Could not get file for " + url);
+ }
+ }
+
+ protected File getOutputDir() {
+ File file = new File("target");
+ if (!file.exists()) {
+ throw new IllegalStateException("target/ does not exist");
+ }
+ if (!file.isDirectory()) {
+ throw new IllegalStateException("target/ is not a directory");
+ }
+ file = new File(file, "archives");
+ if (file.exists()) {
+ if (!file.isDirectory()) {
+ throw new IllegalStateException("target/archives/ already exists
and is not a directory");
+ }
+ } else {
+ file.mkdir();
+ }
+ return file.getAbsoluteFile();
+ }
+
+ protected File createFile(Archive<?> archive) {
+ File file = new File(getOutputDir(), archive.getName());
+ archive.as(ZipExporter.class).exportZip(file, true);
+ return file;
+ }
+
+ protected abstract File getFile();
+ }
+
+ private class Deployment extends AbstractDeployment {
+ final File realArchive;
+
+ public Deployment(String archiveName, Package[] pkgs, boolean show) {
+
+ ArchivePath metaInf = ArchivePaths.create("META-INF");
+
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class, archiveName);
+ for (Package pkg : pkgs) {
+ archive.addPackage(pkg);
+ }
+
+ File sourceMetaInf = getSourceMetaInfDir(archiveName);
+ addFiles(archive, sourceMetaInf, metaInf);
+
+ System.out.println(archive.toString(show));
+ realArchive = createFile(archive);
+ }
+
+ @Override
+ protected File getFile() {
+ return realArchive;
+ }
+ }
+
+ private class WarDeployment extends AbstractDeployment {
+ final File file;
+
+ public WarDeployment(String archiveName, Package[] pkgs, boolean show) {
+ WebArchive archive = createArchive(archiveName, pkgs);
+ file = createFile(archive);
+ }
+
+ private WebArchive createArchive(String archiveName, Package[] pkgs) {
+ ArchivePath metaInf = ArchivePaths.create("META-INF");
+
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, archiveName);
+ for (Package pkg : pkgs) {
+ archive.addPackage(pkg);
+ }
+
+ File sourceMetaInf = getSourceMetaInfDir(archiveName);
+ addFiles(archive, sourceMetaInf, metaInf);
+
+ File sourceWebInf = getSourceWebInfDir(archiveName);
+ if (sourceWebInf != null) {
+ addFiles(archive, sourceWebInf,
ArchivePaths.create("WEB-INF"));
+ }
+ return archive;
+ }
+
+ @Override
+ protected File getFile() {
+ return file;
+ }
+ }
+
+ private class WarFileDeployment extends AbstractDeployment {
+ final File file;
+
+ public WarFileDeployment(File file) {
+ this.file = file;
+ }
+
+ @Override
+ protected File getFile() {
+ return file;
+ }
+ }
+
+ private class ArbitraryDeployment extends AbstractDeployment {
+ final File realArchive;
+
+ public ArbitraryDeployment(Archive archive, boolean show) {
+
+ ArchivePath metaInf = ArchivePaths.create("META-INF");
+
+ System.out.println(archive.toString(show));
+ realArchive = createFile(archive);
+ }
+
+ @Override
+ protected File getFile() {
+ return realArchive;
+ }
+ }
+}
Property changes on:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/DeploymentBuilder.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/.classpath
===================================================================
--- workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/.classpath
(rev 0)
+++ workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/.classpath 2011-04-07
12:59:19 UTC (rev 30414)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Property changes on:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/.classpath
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/.project
===================================================================
--- workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/.project
(rev 0)
+++ workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/.project 2011-04-07
12:59:19 UTC (rev 30414)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.ide.eclipse.as7.deployment.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Property changes on:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/.project
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/.settings/org.eclipse.jdt.core.prefs
===================================================================
---
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/.settings/org.eclipse.jdt.core.prefs 2011-04-07
12:59:19 UTC (rev 30414)
@@ -0,0 +1,8 @@
+#Thu Apr 07 10:43:42 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Property changes on:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/META-INF/MANIFEST.MF
===================================================================
--- workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/META-INF/MANIFEST.MF
(rev 0)
+++
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/META-INF/MANIFEST.MF 2011-04-07
12:59:19 UTC (rev 30414)
@@ -0,0 +1,11 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Tests
+Bundle-SymbolicName: org.jboss.ide.eclipse.as7.deployment.tests
+Bundle-Version: 1.0.0.qualifier
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Import-Package: org.jboss.ide.eclipse.as7.deployment
+Require-Bundle: org.junit;bundle-version="[4.8.1,5.0.0)",
+ org.eclipse.core.runtime;bundle-version="3.7.0"
+Bundle-ClassPath: wars/,
+ .
Property changes on:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/META-INF/MANIFEST.MF
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/build.properties
===================================================================
--- workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/build.properties
(rev 0)
+++
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/build.properties 2011-04-07
12:59:19 UTC (rev 30414)
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ wars/
Property changes on:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/build.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/Activator.java
===================================================================
---
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/Activator.java
(rev 0)
+++
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/Activator.java 2011-04-07
12:59:19 UTC (rev 30414)
@@ -0,0 +1,30 @@
+package org.jboss.ide.eclipse.as7.deployment.tests;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+
+public class Activator implements BundleActivator {
+
+ private static BundleContext context;
+
+ static BundleContext getContext() {
+ return context;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext bundleContext) throws Exception {
+ Activator.context = bundleContext;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext bundleContext) throws Exception {
+ Activator.context = null;
+ }
+}
Property changes on:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/Activator.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/DeploymentBuilderTest.java
===================================================================
---
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/DeploymentBuilderTest.java
(rev 0)
+++
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/DeploymentBuilderTest.java 2011-04-07
12:59:19 UTC (rev 30414)
@@ -0,0 +1,31 @@
+package org.jboss.ide.eclipse.as7.deployment.tests;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Platform;
+import org.jboss.ide.eclipse.as7.deployment.DeploymentBuilder;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+
+public class DeploymentBuilderTest {
+
+ private static final String HOST = "localhost";
+ private static final int PORT = 9999;
+
+ @Test
+ public void canDeploy() throws URISyntaxException, IOException {
+ File file = getWarFile("minimalistic.war");
+ new DeploymentBuilder(HOST, PORT).add(file).deploy();
+ }
+
+ private File getWarFile(String name) {
+ Bundle bundle =
Platform.getBundle("org.jboss.ide.eclipse.as7.deployment.tests");
+ URL entryUrl = bundle.getEntry("wars/" + name);
+ File file = new File(FileLocator.resolve(entryUrl).toURI());
+
+ }
+}
Property changes on:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/DeploymentBuilderTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/wars/gwt-helloworld.war
===================================================================
(Binary files differ)
Property changes on:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/wars/gwt-helloworld.war
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/wars/minimalistic.war
===================================================================
(Binary files differ)
Property changes on:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/wars/minimalistic.war
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream