JBoss Tools SVN: r22355 - trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2010-05-27 01:47:54 -0400 (Thu, 27 May 2010)
New Revision: 22355
Modified:
trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/ReconciliationHelper.java
Log:
JBIDE-6357: to trunk
Modified: trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/ReconciliationHelper.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/ReconciliationHelper.java 2010-05-27 00:23:06 UTC (rev 22354)
+++ trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/ReconciliationHelper.java 2010-05-27 05:47:54 UTC (rev 22355)
@@ -340,7 +340,7 @@
if (nearestScopeOrProcess == null)
return;
- TreeIterator iter = nearestScopeOrProcess.eAllContents();
+ TreeIterator<EObject> iter = nearestScopeOrProcess.eAllContents();
while (iter.hasNext()) {
Object object = iter.next();
@@ -390,7 +390,7 @@
if (nearestScopeOrProcess == null)
return;
- TreeIterator iter = nearestScopeOrProcess.eAllContents();
+ TreeIterator<EObject> iter = nearestScopeOrProcess.eAllContents();
while (iter.hasNext()) {
Object object = iter.next();
@@ -398,9 +398,11 @@
if (object instanceof PartnerActivity) {
PartnerActivity partnerAct = (PartnerActivity) object;
Correlations correlations = partnerAct.getCorrelations();
+ if(correlations == null){
+ continue;
+ }
EList<Correlation> list = correlations.getChildren();
for (Correlation correlation : list) {
- CorrelationSet corrSet2 = correlation.getSet();
if (corrSet.equals(correlation.getSet())) {
correlation.getElement().setAttribute(BPELConstants.AT_SET, name);
}
@@ -411,6 +413,9 @@
else if (object instanceof OnMessage) {
OnMessage onMessage = (OnMessage) object;
Correlations correlations = onMessage.getCorrelations();
+ if(correlations == null){
+ continue;
+ }
EList<Correlation> list = correlations.getChildren();
for (Correlation correlation : list) {
if (corrSet.equals(correlation.getSet())) {
@@ -422,6 +427,9 @@
} else if (object instanceof OnEvent) {
OnEvent onEvent = (OnEvent) object;
Correlations correlations = onEvent.getCorrelations();
+ if(correlations == null){
+ continue;
+ }
EList<Correlation> list = correlations.getChildren();
for (Correlation correlation : list) {
if (corrSet.equals(correlation.getSet())) {
@@ -446,7 +454,7 @@
if (nearestScopeOrProcess == null)
return;
- TreeIterator iter = nearestScopeOrProcess.eAllContents();
+ TreeIterator<EObject> iter = nearestScopeOrProcess.eAllContents();
while (iter.hasNext()) {
Object object = iter.next();
@@ -517,7 +525,7 @@
* @param name
*/
private static void updateVariableNameReferencesOnScope(EObject scope, Variable variable, String name) {
- TreeIterator iter = scope.eAllContents();
+ TreeIterator<EObject> iter = scope.eAllContents();
while (iter.hasNext()) {
Object object = iter.next();
14 years, 7 months
JBoss Tools SVN: r22354 - trunk/requirements/jbossas.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-05-26 20:23:06 -0400 (Wed, 26 May 2010)
New Revision: 22354
Modified:
trunk/requirements/jbossas/buildRequirement.xml
Log:
https://jira.jboss.org/browse/JBDS-1202 problems running tests
dependency download changed, no more return.properties files for a while
Modified: trunk/requirements/jbossas/buildRequirement.xml
===================================================================
--- trunk/requirements/jbossas/buildRequirement.xml 2010-05-27 00:11:57 UTC (rev 22353)
+++ trunk/requirements/jbossas/buildRequirement.xml 2010-05-27 00:23:06 UTC (rev 22354)
@@ -11,26 +11,12 @@
<antcall target="build-all" >
<param name="action" value="build.requirement" />
</antcall>
- <echo file="${requirement.root}/jbossas/return.properties">
- jboss32.home=${unzip.dest}/${jboss32.build.name}
- jboss40.home=${unzip.dest}/${jboss40.build.name}
- jboss42.home=${unzip.dest}/${jboss42.build.name}
- jboss50.home=${unzip.dest}/${jboss50.build.name}
- jboss51.home=${unzip.dest}/${jboss51.build.name}
- </echo>
</target>
<target name="download.requirement">
<antcall target="build-all" >
<param name="action" value="download.requirement" />
</antcall>
- <!--echo file="${requirement.root}/jbossas/return.properties">
- jboss32.home=${unzip.dest}/${jboss32.build.name}
- jboss40.home=${unzip.dest}/${jboss40.build.name}
- jboss42.home=${unzip.dest}/${jboss42.build.name}
- jboss50.home=${unzip.dest}/${jboss50.build.name}
- jboss51.home=${unzip.dest}/${jboss51.build.name}
- </echo-->
</target>
<target name="build-all" >
14 years, 7 months
JBoss Tools SVN: r22353 - trunk/archives/tests/org.jboss.ide.eclipse.archives.ui.test/META-INF.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-05-26 20:11:57 -0400 (Wed, 26 May 2010)
New Revision: 22353
Modified:
trunk/archives/tests/org.jboss.ide.eclipse.archives.ui.test/META-INF/MANIFEST.MF
Log:
https://jira.jboss.org/browse/JBDS-1202 problems running tests
no fix archives.ui.test errors in tycho some plug-ins must be explicitly included to be loaded during the test
org.jboss.ide.eclipse.archives.jdt.integration;bundle-version="3.1.0",
org.jboss.ide.eclipse.archives.webtools;bundle-version="2.1.0"
these plug-ins use achives.core extension point to define archives type. If this dependencies are not declared in test plug-in manifest, tests fail with NullPointer exception
Modified: trunk/archives/tests/org.jboss.ide.eclipse.archives.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/archives/tests/org.jboss.ide.eclipse.archives.ui.test/META-INF/MANIFEST.MF 2010-05-26 23:57:31 UTC (rev 22352)
+++ trunk/archives/tests/org.jboss.ide.eclipse.archives.ui.test/META-INF/MANIFEST.MF 2010-05-27 00:11:57 UTC (rev 22353)
@@ -13,7 +13,9 @@
org.eclipse.core.resources;bundle-version="3.5.1",
org.eclipse.core.runtime;bundle-version="3.5.0",
org.jboss.ide.eclipse.archives.core;bundle-version="2.0.0",
- org.eclipse.ui.navigator;bundle-version="3.4.1"
+ org.eclipse.ui.navigator;bundle-version="3.4.1",
+ org.jboss.ide.eclipse.archives.jdt.integration;bundle-version="3.1.0",
+ org.jboss.ide.eclipse.archives.webtools;bundle-version="2.1.0"
Export-Package: org.jboss.ide.eclipse.archives.ui.test,
org.jboss.ide.eclipse.archives.ui.test.preferences,
org.jboss.ide.eclipse.archives.ui.test.views,
14 years, 7 months
JBoss Tools SVN: r22352 - trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/core/ant.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-05-26 19:57:31 -0400 (Wed, 26 May 2010)
New Revision: 22352
Modified:
trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/core/ant/SimpleAntTest.java
Log:
https://jira.jboss.org/browse/JBDS-1202 problems running tests
System.out.printlns were removed
Modified: trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/core/ant/SimpleAntTest.java
===================================================================
--- trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/core/ant/SimpleAntTest.java 2010-05-26 23:54:23 UTC (rev 22351)
+++ trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/core/ant/SimpleAntTest.java 2010-05-26 23:57:31 UTC (rev 22352)
@@ -60,8 +60,6 @@
String eclipseHome = new File(new URL(System.getProperty("eclipse.home.location")).toURI()).getAbsolutePath();
String equinoxJar = FileLocator.getBundleFile(Platform.getBundle("org.eclipse.equinox.common")).getAbsolutePath();
- System.out.println(eclipseHome);
- System.out.println(equinoxJar);
map.put(ECLIPSE_LOC, eclipseHome);
map.put(EQUINOX_JAR, equinoxJar);
map.put(PROJECT_NAME, "SimpleAntTest");
14 years, 7 months
JBoss Tools SVN: r22351 - in trunk/archives/tests/org.jboss.ide.eclipse.archives.ui.test: META-INF and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-05-26 19:54:23 -0400 (Wed, 26 May 2010)
New Revision: 22351
Modified:
trunk/archives/tests/org.jboss.ide.eclipse.archives.ui.test/META-INF/MANIFEST.MF
trunk/archives/tests/org.jboss.ide.eclipse.archives.ui.test/build.properties
Log:
https://jira.jboss.org/browse/JBDS-1202 problems running tests
fix tycho releated errors in archives.ui.test
manifest updated to build test plug-in as jar
Modified: trunk/archives/tests/org.jboss.ide.eclipse.archives.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/archives/tests/org.jboss.ide.eclipse.archives.ui.test/META-INF/MANIFEST.MF 2010-05-26 23:42:11 UTC (rev 22350)
+++ trunk/archives/tests/org.jboss.ide.eclipse.archives.ui.test/META-INF/MANIFEST.MF 2010-05-26 23:54:23 UTC (rev 22351)
@@ -14,7 +14,6 @@
org.eclipse.core.runtime;bundle-version="3.5.0",
org.jboss.ide.eclipse.archives.core;bundle-version="2.0.0",
org.eclipse.ui.navigator;bundle-version="3.4.1"
-Bundle-ClassPath: archives-ui-test.jar
Export-Package: org.jboss.ide.eclipse.archives.ui.test,
org.jboss.ide.eclipse.archives.ui.test.preferences,
org.jboss.ide.eclipse.archives.ui.test.views,
Modified: trunk/archives/tests/org.jboss.ide.eclipse.archives.ui.test/build.properties
===================================================================
--- trunk/archives/tests/org.jboss.ide.eclipse.archives.ui.test/build.properties 2010-05-26 23:42:11 UTC (rev 22350)
+++ trunk/archives/tests/org.jboss.ide.eclipse.archives.ui.test/build.properties 2010-05-26 23:54:23 UTC (rev 22351)
@@ -1,6 +1,5 @@
-output.archives-ui-test.jar = bin/
bin.includes = META-INF/,\
- archives-ui-test.jar,\
- projects/
-source.archives-ui-test.jar = src/
-jars.compile.order = archives-ui-test.jar
+ projects/,\
+ .
+jars.compile.order = .
+source.. = src/
14 years, 7 months
JBoss Tools SVN: r22350 - in trunk/archives/tests/org.jboss.ide.eclipse.archives.test: inputs/ant and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-05-26 19:42:11 -0400 (Wed, 26 May 2010)
New Revision: 22350
Modified:
trunk/archives/tests/org.jboss.ide.eclipse.archives.test/inputs/ant/antTemplate.xml
trunk/archives/tests/org.jboss.ide.eclipse.archives.test/pom.xml
trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/core/ant/SimpleAntTest.java
Log:
https://jira.jboss.org/browse/JBDS-1202 problems running tests
fix tycho releated errors in archives.test
archives.core and archives.test should be unpacked
equinox.common plug-in reference should be calculated different way because now it is in maven repo during the test
Modified: trunk/archives/tests/org.jboss.ide.eclipse.archives.test/inputs/ant/antTemplate.xml
===================================================================
--- trunk/archives/tests/org.jboss.ide.eclipse.archives.test/inputs/ant/antTemplate.xml 2010-05-26 22:44:28 UTC (rev 22349)
+++ trunk/archives/tests/org.jboss.ide.eclipse.archives.test/inputs/ant/antTemplate.xml 2010-05-26 23:42:11 UTC (rev 22350)
@@ -1,12 +1,11 @@
<project>
<property name="eclipse.home" location="${UNIT_TEST_ECLIPSE_LOC}" />
<property name="archives.home" location="${UNIT_TEST_ARCHIVES_HOME}"/>
+ <property name="equinox.jar" location="${EQUINOX_JAR}"/>
<property name="example_variable" value="test" />
<path id="generate-archives-classpath">
- <fileset dir="${eclipse.home}">
- <include name="plugins/org.eclipse.equinox.common_*.jar" />
- </fileset>
+ <pathelement location="${equinox.jar}"/>
<fileset dir="${archives.home}">
<include
name="plugins/org.jboss.ide.eclipse.archives.core**/archivescore.jar" />
Modified: trunk/archives/tests/org.jboss.ide.eclipse.archives.test/pom.xml
===================================================================
--- trunk/archives/tests/org.jboss.ide.eclipse.archives.test/pom.xml 2010-05-26 22:44:28 UTC (rev 22349)
+++ trunk/archives/tests/org.jboss.ide.eclipse.archives.test/pom.xml 2010-05-26 23:42:11 UTC (rev 22350)
@@ -11,4 +11,19 @@
<artifactId>org.jboss.ide.eclipse.archives.test</artifactId>
<version>3.1.0-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.sonatype.tycho</groupId>
+ <artifactId>maven-osgi-test-plugin</artifactId>
+ <configuration>
+ <explodedBundles>
+ <bundle>org.jboss.ide.eclipse.archives.core</bundle>
+ <bundle>org.jboss.ide.eclipse.archives.test</bundle>
+ </explodedBundles>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
</project>
Modified: trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/core/ant/SimpleAntTest.java
===================================================================
--- trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/core/ant/SimpleAntTest.java 2010-05-26 22:44:28 UTC (rev 22349)
+++ trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/core/ant/SimpleAntTest.java 2010-05-26 23:42:11 UTC (rev 22350)
@@ -22,6 +22,7 @@
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
import org.jboss.ide.eclipse.archives.test.ArchivesTest;
import org.jboss.ide.eclipse.archives.test.core.ant.AntLauncher.IProcessListener;
import org.osgi.framework.Bundle;
@@ -31,6 +32,7 @@
protected static final String ARCHIVES_HOME = "${UNIT_TEST_ARCHIVES_HOME}";
protected static final String PROJECT_NAME = "${UNIT_TEST_PROJECT_NAME}";
protected static final String PROJECT_DIR = "${UNIT_TEST_PROJECT_DIR}";
+ protected static final String EQUINOX_JAR = "${EQUINOX_JAR}";
// if running from runtime workbench, set this to true. otherwise its running in a full build
private final static boolean RUNTIME_WORKBENCH = false;
@@ -57,8 +59,11 @@
outputFolder = projectLoc.append("output");
String eclipseHome = new File(new URL(System.getProperty("eclipse.home.location")).toURI()).getAbsolutePath();
-
+ String equinoxJar = FileLocator.getBundleFile(Platform.getBundle("org.eclipse.equinox.common")).getAbsolutePath();
+ System.out.println(eclipseHome);
+ System.out.println(equinoxJar);
map.put(ECLIPSE_LOC, eclipseHome);
+ map.put(EQUINOX_JAR, equinoxJar);
map.put(PROJECT_NAME, "SimpleAntTest");
map.put(ARCHIVES_HOME, RUNTIME_WORKBENCH ? PLUGIN_LOCATION : eclipseHome);
map.put(PROJECT_DIR, projectLoc.toOSString());
14 years, 7 months
JBoss Tools SVN: r22349 - in trunk/archives/tests/org.jboss.ide.eclipse.archives.test: META-INF and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-05-26 18:44:28 -0400 (Wed, 26 May 2010)
New Revision: 22349
Modified:
trunk/archives/tests/org.jboss.ide.eclipse.archives.test/META-INF/MANIFEST.MF
trunk/archives/tests/org.jboss.ide.eclipse.archives.test/build.properties
Log:
https://jira.jboss.org/browse/JBDS-1202 problems running tests
Archives test manifest changed to be archive instead of unpacked archive.
Modified: trunk/archives/tests/org.jboss.ide.eclipse.archives.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/archives/tests/org.jboss.ide.eclipse.archives.test/META-INF/MANIFEST.MF 2010-05-26 22:35:57 UTC (rev 22348)
+++ trunk/archives/tests/org.jboss.ide.eclipse.archives.test/META-INF/MANIFEST.MF 2010-05-26 22:44:28 UTC (rev 22349)
@@ -19,7 +19,6 @@
org.eclipse.jdt.core;bundle-version="3.4.4",
org.jboss.ide.eclipse.archives.jdt.integration;bundle-version="1.0.0"
Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: archivestest.jar
Export-Package: org.jboss.ide.eclipse.archives.test,
org.jboss.ide.eclipse.archives.test.core,
org.jboss.ide.eclipse.archives.test.model,
Modified: trunk/archives/tests/org.jboss.ide.eclipse.archives.test/build.properties
===================================================================
--- trunk/archives/tests/org.jboss.ide.eclipse.archives.test/build.properties 2010-05-26 22:35:57 UTC (rev 22348)
+++ trunk/archives/tests/org.jboss.ide.eclipse.archives.test/build.properties 2010-05-26 22:44:28 UTC (rev 22349)
@@ -1,10 +1,10 @@
output.archivestest.jar = bin/
bin.includes = META-INF/,\
- archivestest.jar,\
output/,\
inputs/,\
expectedOutputs/,\
tmp/,\
plugin.properties
-source.archivestest.jar = src/
-jars.compile.order = archivestest.jar
+jars.compile.order = .
+source.. = src/
+output.. = bin/
14 years, 7 months
JBoss Tools SVN: r22348 - trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-05-26 18:35:57 -0400 (Wed, 26 May 2010)
New Revision: 22348
Added:
trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/TestsPlugin.java
Log:
https://jira.jboss.org/browse/JBDS-1202 problems running tests
ResourceUtils importProject distinguish import form plug-in distributed as jar or unpacked jar
Added: trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/TestsPlugin.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/TestsPlugin.java (rev 0)
+++ trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/TestsPlugin.java 2010-05-26 22:35:57 UTC (rev 22348)
@@ -0,0 +1,23 @@
+/**
+ *
+ */
+package org.jboss.tools.tests;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+
+/**
+ * @author eskimo
+ *
+ */
+public class TestsPlugin extends AbstractUIPlugin {
+
+
+ public static final String ID = "org.jboss.tools.tests";
+ /**
+ *
+ */
+ public TestsPlugin() {
+
+ }
+
+}
Property changes on: trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/TestsPlugin.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 7 months
JBoss Tools SVN: r22347 - trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-05-26 18:34:56 -0400 (Wed, 26 May 2010)
New Revision: 22347
Added:
trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util/Debug.java
Log:
https://jira.jboss.org/browse/JBDS-1202 problems running tests
ResourceUtils importProject distinguish import form plug-in distributed as jar or unpacked jar
Added: trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util/Debug.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util/Debug.java (rev 0)
+++ trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util/Debug.java 2010-05-26 22:34:56 UTC (rev 22347)
@@ -0,0 +1,17 @@
+package org.jboss.tools.test.util;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.tests.TestsPlugin;
+
+public class Debug {
+ public static final boolean DEBUG_IMPORT_OPERATION;
+
+ static {
+ DEBUG_IMPORT_OPERATION = true; //getDebugOption("/debug/importProject");
+ }
+
+ private static boolean getDebugOption(String option) {
+ return "true".equalsIgnoreCase(Platform.getDebugOption(TestsPlugin.ID + option)); //$NON-NLS-1$
+ }
+}
Property changes on: trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util/Debug.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 7 months
JBoss Tools SVN: r22346 - trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-05-26 18:33:15 -0400 (Wed, 26 May 2010)
New Revision: 22346
Modified:
trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util/ResourcesUtils.java
Log:
https://jira.jboss.org/browse/JBDS-1202 problems running tests
ResourceUtils importProject distinguish import form plug-in distributed as jar or unpacked jar
Modified: trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util/ResourcesUtils.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util/ResourcesUtils.java 2010-05-26 21:40:51 UTC (rev 22345)
+++ trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util/ResourcesUtils.java 2010-05-26 22:33:15 UTC (rev 22346)
@@ -17,7 +17,11 @@
import java.io.LineNumberReader;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
@@ -34,7 +38,9 @@
import org.eclipse.core.runtime.Platform;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.IOverwriteQuery;
+import org.eclipse.ui.wizards.datatransfer.FileSystemStructureProvider;
import org.eclipse.ui.wizards.datatransfer.ImportOperation;
+import org.eclipse.ui.wizards.datatransfer.ZipFileStructureProvider;
import org.jboss.tools.tests.ImportProvider;
import org.osgi.framework.Bundle;
@@ -54,7 +60,8 @@
String tplPrjLcStr;
tplPrjLcStr = FileLocator.resolve(bundle.getEntry(templLocation))
.getFile();
- IProject importedPrj = importProjectIntoWorkspace(tplPrjLcStr, new Path(tplPrjLcStr).lastSegment());
+ String protocol = FileLocator.resolve(bundle.getEntry(templLocation)).getProtocol();
+ IProject importedPrj = importProjectIntoWorkspace(tplPrjLcStr, new Path(tplPrjLcStr).lastSegment(),protocol);
return importedPrj;
}
@@ -189,15 +196,20 @@
private static final long IMPORT_DELAY = 1000;
+ static public IProject importProjectIntoWorkspace(String path, String projectName) {
+ return importProjectIntoWorkspace(path, projectName,"file");
+ }
+
/**
* Import project into workspace.
*
* @param path the path
* @param projectName the project name
+ * @param protocol
*/
- static public IProject importProjectIntoWorkspace(String path, String projectName) {
+ static public IProject importProjectIntoWorkspace(String path, String projectName, String protocol) {
- IProject project = null;
+ IProject project = null;
try {
boolean state = ResourcesUtils.setBuildAutomatically(false);
@@ -211,19 +223,33 @@
return ALL;
}
};
-
- ImportProvider importProvider = new ImportProvider();
-
- // need to remove from imported project "svn" files
- List<String> unimportedFiles = new ArrayList<String>();
- unimportedFiles.add(".svn"); //$NON-NLS-1$
-
- importProvider.setUnimportedFiles(unimportedFiles);
-
- // create import operation
- ImportOperation importOp = new ImportOperation(project
- .getFullPath(), new File(path), importProvider, overwrite);
-
+ if(Debug.DEBUG_IMPORT_OPERATION) {
+ System.out.println("[ResourceUtils]:Target Import Location: " + project.getFullPath());
+ System.out.println("[ResourceUtils]:Full path to source: " + path);
+ System.out.println("[ResourceUtils]:Protocol: " + protocol);
+ }
+ ImportOperation importOp = null;
+ if("jar".equals(protocol)) {
+ String pathToZip = path.substring(0,path.indexOf("!"));
+ String zipEntryName = path.substring(path.indexOf("!") + 2, path.length());
+ pathToZip = pathToZip.substring("file:".length());
+ // create import operation
+ if(Debug.DEBUG_IMPORT_OPERATION) {
+ System.out.println("[ResourceUtils]:pathToZip: " + pathToZip);
+ System.out.println("[ResourceUtils]:zipEntryName: " + zipEntryName);
+ }
+ ZipFile zipFile = new ZipFile(pathToZip);
+ ZipFileStructureProvider zipStrProvider = new ZipFileStructureProvider(zipFile);
+ ZipEntry source = getZipEntry(zipStrProvider,zipEntryName);
+ importOp = new ImportOperation(project
+ .getFullPath(), source, zipStrProvider , overwrite);
+ importOp.setFilesToImport(zipStrProvider.getChildren(source));
+ } else {
+ // create import operation
+ importOp = new ImportOperation(project
+ .getFullPath(), new File(path), FileSystemStructureProvider.INSTANCE, overwrite);
+ }
+
// import files just to project folder ( without old structure )
importOp.setCreateContainerStructure(false);
@@ -243,7 +269,28 @@
} catch (CoreException e) {
// TODO Auto-generated catch block
e.printStackTrace();
+ } catch (IOException ex) {
+ ex.printStackTrace();
}
return project;
}
+
+ private static ZipEntry getZipEntry(
+ ZipFileStructureProvider zipStrProvider, String zipEntryName) {
+ String[] entries = zipEntryName.split("/");
+ ZipEntry parent = zipStrProvider.getRoot();
+ for (String string : entries) {
+ List children = zipStrProvider.getChildren(parent);
+ for (Object object : children) {
+ ZipEntry current = (ZipEntry)object;
+ String name = parent== zipStrProvider.getRoot()? string + "/": parent.getName() + string + "/";
+ if(name.equals(current.getName())) {
+ parent = current;
+ break;
+ }
+ }
+
+ }
+ return parent;
+ }
}
14 years, 7 months