Author: rob.stryker(a)jboss.com
Date: 2008-06-11 14:43:54 -0400 (Wed, 11 Jun 2008)
New Revision: 8722
Added:
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/.classpath
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/.packages
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/.project
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/.settings/
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/.settings/org.eclipse.jdt.core.prefs
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/.settings/org.eclipse.jst.common.project.facet.core.prefs
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/.settings/org.eclipse.wst.common.component
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/.settings/org.eclipse.wst.common.project.facet.core.xml
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/src/
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/src/main/
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/src/main/java/
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/src/main/java/com/
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/src/main/java/com/acme/
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/src/main/java/com/acme/mx/
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/src/main/java/com/acme/mx/ManagementAgent.java
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/src/main/java/com/acme/mx/ManagementAgentMBean.java
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/src/main/resources/
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/src/main/resources/META-INF/
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/src/main/resources/META-INF/jboss-service.xml
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects/JBIDE2296Test.java
Modified:
branches/jbosstools-2.1.x/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/internal/ModelTruezipBridge.java
Log:
JBIDE-2296
Modified:
branches/jbosstools-2.1.x/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/internal/ModelTruezipBridge.java
===================================================================
---
branches/jbosstools-2.1.x/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/internal/ModelTruezipBridge.java 2008-06-11
18:36:42 UTC (rev 8721)
+++
branches/jbosstools-2.1.x/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/internal/ModelTruezipBridge.java 2008-06-11
18:43:54 UTC (rev 8722)
@@ -244,9 +244,10 @@
boolean exploded = ((IArchive)node).isExploded();
ArchiveDetector detector = exploded ? ArchiveDetector.NULL :
TrueZipUtil.getJarArchiveDetector();
if( parentFile == null ) {
+ // we're a root archive, and so the destination folder must be a real folder
IPath p = node2.getGlobalDestinationPath();
if( p == null ) return null;
- return new File(p.append(node2.getName()).toOSString(), detector);
+ parentFile = new File(p.toOSString(), ArchiveDetector.NULL);
}
return new File(parentFile, node2.getName(), detector);
}
Added:
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/.classpath
===================================================================
---
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/.classpath
(rev 0)
+++
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/.classpath 2008-06-11
18:43:54 UTC (rev 8722)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src/main/resources"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.5.0_12"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.USER_LIBRARY/eap-4.3.0.ga"/>
+ <classpathentry kind="output" path="output/eclipse"/>
+</classpath>
Added:
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/.packages
===================================================================
---
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/.packages
(rev 0)
+++
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/.packages 2008-06-11
18:43:54 UTC (rev 8722)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<packages>
+ <package name="acme-jmx-connector.sar" type="jar"
todir="/JBIDE2296/output/dist" exploded="false"
inWorkspace="true">
+ <fileset dir="/JBIDE2296/output/eclipse" includes="**"
inWorkspace="true" flatten="false">
+ <properties></properties>
+ </fileset>
+ <properties>
+ <property
name="org.jboss.ide.eclipse.as.core.packages.ModuleIDPropertyKey"
value="1209490489170"></property>
+ </properties>
+ </package>
+ <properties></properties>
+</packages>
Added:
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/.project
===================================================================
---
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/.project
(rev 0)
+++
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/.project 2008-06-11
18:43:54 UTC (rev 8722)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>JBIDE2296</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.jboss.ide.eclipse.archives.core.archivesBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.jboss.ide.eclipse.archives.core.archivesNature</nature>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ </natures>
+</projectDescription>
Added:
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/.settings/org.eclipse.jdt.core.prefs
===================================================================
---
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/.settings/org.eclipse.jdt.core.prefs 2008-06-11
18:43:54 UTC (rev 8722)
@@ -0,0 +1,7 @@
+#Tue Apr 29 18:58:36 CEST 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added:
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/.settings/org.eclipse.jst.common.project.facet.core.prefs
===================================================================
---
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/.settings/org.eclipse.jst.common.project.facet.core.prefs
(rev 0)
+++
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/.settings/org.eclipse.jst.common.project.facet.core.prefs 2008-06-11
18:43:54 UTC (rev 8722)
@@ -0,0 +1,4 @@
+#Tue Apr 29 18:58:37 CEST 2008
+classpath.helper/org.eclipse.jdt.launching.JRE_CONTAINER\:\:org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType\:\:jdk1.5.0_12/owners=jst.java\:5.0
+classpath.helper/org.eclipse.jst.server.core.container\:\:org.jboss.ide.eclipse.as.core.server.runtime.runtimeTarget\:\:eap-4.3.0.ga-176976/owners=jst.utility\:1.0
+eclipse.preferences.version=1
Added:
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/.settings/org.eclipse.wst.common.component
===================================================================
---
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/.settings/org.eclipse.wst.common.component
(rev 0)
+++
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/.settings/org.eclipse.wst.common.component 2008-06-11
18:43:54 UTC (rev 8722)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-modules id="moduleCoreId" project-version="1.5.0">
+ <wb-module deploy-name="jmx-connector">
+ <wb-resource deploy-path="/"
source-path="/src/main/java"/>
+ <wb-resource deploy-path="/"
source-path="/src/main/resources"/>
+ </wb-module>
+</project-modules>
Added:
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/.settings/org.eclipse.wst.common.project.facet.core.xml
===================================================================
---
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/.settings/org.eclipse.wst.common.project.facet.core.xml
(rev 0)
+++
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/.settings/org.eclipse.wst.common.project.facet.core.xml 2008-06-11
18:43:54 UTC (rev 8722)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <runtime name="eap-4.3.0.ga-176976"/>
+ <fixed facet="jst.java"/>
+ <fixed facet="jst.utility"/>
+ <installed facet="jst.java" version="5.0"/>
+ <installed facet="jst.utility" version="1.0"/>
+</faceted-project>
Added:
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/src/main/java/com/acme/mx/ManagementAgent.java
===================================================================
---
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/src/main/java/com/acme/mx/ManagementAgent.java
(rev 0)
+++
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/src/main/java/com/acme/mx/ManagementAgent.java 2008-06-11
18:43:54 UTC (rev 8722)
@@ -0,0 +1,118 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, 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 com.acme.mx;
+
+import java.lang.management.ManagementFactory;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.rmi.registry.LocateRegistry;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.management.MBeanServer;
+import javax.management.remote.JMXConnectorServer;
+import javax.management.remote.JMXConnectorServerFactory;
+import javax.management.remote.JMXServiceURL;
+
+import org.jboss.logging.Logger;
+
+/**
+ * ManagementAgent.
+ *
+ * @author <a href="mailto:galder.zamarreno@jboss.com">Galder
Zamarreno</a>
+ */
+public class ManagementAgent implements ManagementAgentMBean
+{
+ private static final Logger log = Logger.getLogger(ManagementAgent.class);
+
+ private static final MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
+
+ private int registryPort;
+
+ private int proxyPort;
+
+ private InetAddress bindAddress;
+
+ private JMXConnectorServer connector;
+
+ public void start() throws Exception
+ {
+ /* Ensure cryptographically strong random number generator used
+ * to choose the object number - see java.rmi.server.ObjID */
+ System.setProperty("java.rmi.server.randomIDs", "true");
+
+ /* Start an RMI registry on given registry port */
+ log.debug("Create RMI registry on port " + registryPort);
+ LocateRegistry.createRegistry(registryPort);
+
+ /* Environment map. */
+ log.debug("Initialize the environment map");
+ Map<String,?> env = new HashMap<String,Object>();
+
+ /* Create an RMI connector server. As specified in the JMXServiceURL the
+ * RMIServer stub will be registered in the RMI registry running in the
+ * given host and given registry and proxy ports, with the name
"jmxrmi".*/
+
+ String host = bindAddress.getHostAddress();
+
+ log.debug("Create an RMI connector server");
+ JMXServiceURL url = new JMXServiceURL("service:jmx:rmi://" + host +
":" +
+ proxyPort + "/jndi/rmi://" + host + ":" + registryPort +
"/jmxrmi");
+ connector = JMXConnectorServerFactory.newJMXConnectorServer(url, env, mbs);
+ connector.start();
+ }
+
+ public void stop() throws Exception
+ {
+ connector.stop();
+ }
+
+ public int getRegistryPort()
+ {
+ return registryPort;
+ }
+
+ public void setRegistryPort(int port)
+ {
+ registryPort = port;
+ }
+
+ public int getProxyPort()
+ {
+ return proxyPort;
+ }
+
+ public void setProxyPort(int port)
+ {
+ proxyPort = port;
+ }
+
+ public String getBindAddress()
+ {
+ return bindAddress.getHostAddress();
+ }
+
+ public void setBindAddress(String host) throws UnknownHostException
+ {
+ bindAddress = InetAddress.getByName(host);
+ }
+}
Added:
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/src/main/java/com/acme/mx/ManagementAgentMBean.java
===================================================================
---
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/src/main/java/com/acme/mx/ManagementAgentMBean.java
(rev 0)
+++
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/src/main/java/com/acme/mx/ManagementAgentMBean.java 2008-06-11
18:43:54 UTC (rev 8722)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, 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 com.acme.mx;
+
+import java.net.UnknownHostException;
+
+/**
+ * ManagementAgentMBean.
+ *
+ * @author <a href="mailto:galder.zamarreno@jboss.com">Galder
Zamarreno</a>
+ */
+public interface ManagementAgentMBean
+{
+ int getRegistryPort();
+
+ void setRegistryPort(int port);
+
+ int getProxyPort();
+
+ void setProxyPort(int port);
+
+ String getBindAddress();
+
+ void setBindAddress(String host) throws UnknownHostException;
+
+ // Lifecycle callbacks
+
+ void start() throws Exception;
+
+ void stop() throws Exception;
+}
Added:
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/src/main/resources/META-INF/jboss-service.xml
===================================================================
---
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/src/main/resources/META-INF/jboss-service.xml
(rev 0)
+++
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/inputs/projects/JBIDE2296/src/main/resources/META-INF/jboss-service.xml 2008-06-11
18:43:54 UTC (rev 8722)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+ <!-- Allows JConsole to be access via user defined registry and proxy ports.
+ This is necessary in order to bypass firewalls doing NAT. Format is:
+
service:jmx:rmi://${bindAddress}:${proxyPort}/jndi/rmi://${bindAddress}:${registryPort}/jmxrmi
+ -->
+ <mbean code="com.acme.mx.ManagementAgent"
name="com.acme:service=ManagementAgent">
+ <attribute
name="BindAddress">${jboss.bind.address}</attribute>
+ <attribute
name="RegistryPort">${com.sun.management.jmxremote.port:21001}</attribute>
+ <attribute
name="ProxyPort">${com.acme.jmxremote.proxy.port:21002}</attribute>
+ </mbean>
+</server>
\ No newline at end of file
Added:
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects/JBIDE2296Test.java
===================================================================
---
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects/JBIDE2296Test.java
(rev 0)
+++
branches/jbosstools-2.1.x/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects/JBIDE2296Test.java 2008-06-11
18:43:54 UTC (rev 8722)
@@ -0,0 +1,37 @@
+package org.jboss.ide.eclipse.archives.test.projects;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.jboss.ide.eclipse.archives.test.ArchivesTest;
+import org.jboss.tools.common.test.util.TestProjectProvider;
+
+public class JBIDE2296Test extends TestCase {
+ private TestProjectProvider provider;
+ private IProject project;
+
+ protected void setUp() throws Exception {
+ provider = new TestProjectProvider(ArchivesTest.PLUGIN_ID,
+ "inputs" + Path.SEPARATOR + "projects" + Path.SEPARATOR +
"JBIDE2296",
+ null, true);
+ project = provider.getProject();
+ project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
+ }
+
+ protected void tearDown() throws Exception {
+ provider.dispose();
+ }
+
+ public void testJBIDE2311() {
+ IPath p = project.getLocation().append("output");
+ File pFile = p.toFile();
+ assertFalse(pFile.isFile());
+ assertTrue(pFile.isDirectory());
+ }
+}