JBoss Tools SVN: r17480 - trunk/examples/plugins/org.jboss.tools.project.examples.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-09-08 16:40:03 -0400 (Tue, 08 Sep 2009)
New Revision: 17480
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/plugin.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-4544
JBoss Tools/Project Examples item has been added to Examples category
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/plugin.xml
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/plugin.xml 2009-09-08 20:30:44 UTC (rev 17479)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/plugin.xml 2009-09-08 20:40:03 UTC (rev 17480)
@@ -15,6 +15,18 @@
category="org.jboss.ide.eclipse.ui.wizards"
icon="icons/examples_wiz.gif">
</wizard>
+ <wizard
+ category="org.eclipse.ui.Examples/org.jboss.tools.project.examples.category"
+ class="org.jboss.tools.project.examples.wizard.NewProjectExamplesWizard"
+ icon="icons/examples_wiz.gif"
+ id="org.jboss.tools.project.examples.wizard.NewProjectExamplesWizard"
+ name="%Project_Examples_wizard">
+ </wizard>
+ <category
+ id="org.jboss.tools.project.examples.category"
+ name="%JBoss_Tools_category"
+ parentCategory="org.eclipse.ui.Examples">
+ </category>
</extension>
<extension
point="org.eclipse.ui.commands">
14 years, 8 months
JBoss Tools SVN: r17479 - in trunk/common: plugins/org.jboss.tools.common/src/org/jboss/tools/common and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-09-08 16:30:44 -0400 (Tue, 08 Sep 2009)
New Revision: 17479
Added:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/zip/
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/zip/DefaultZipEntryVisitor.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/zip/IZipEntryVisitor.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/zip/UnzipOperation.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/zip/ZipArchive.java
trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/zip/
trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/zip/test/
trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/zip/test/UnzipOperationTest.java
trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/zip/test/ZipAllTests.java
trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/zip/test/ZipArchiveTest.java
trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/zip/test/ZipBaseTest.java
Modified:
trunk/common/plugins/org.jboss.tools.common/META-INF/MANIFEST.MF
trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/test/CommonAllTests.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3628
Unzip support is added. It is required to give a way to extract templates from seam plug-in to use them in seam faceted project.
All zip utils are in org.jboss.tools.common.zip package and have 98% coverage by JUnit tests in org.jboss.tools.common.zip.test package. JUnit tests included in common.test test suite.
Modified: trunk/common/plugins/org.jboss.tools.common/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/META-INF/MANIFEST.MF 2009-09-08 16:05:15 UTC (rev 17478)
+++ trunk/common/plugins/org.jboss.tools.common/META-INF/MANIFEST.MF 2009-09-08 20:30:44 UTC (rev 17479)
@@ -145,5 +145,6 @@
org.jboss.tools.common.reporting,
org.jboss.tools.common.text,
org.jboss.tools.common.util,
- org.jboss.tools.common.xml
+ org.jboss.tools.common.xml,
+ org.jboss.tools.common.zip
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Added: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/zip/DefaultZipEntryVisitor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/zip/DefaultZipEntryVisitor.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/zip/DefaultZipEntryVisitor.java 2009-09-08 20:30:44 UTC (rev 17479)
@@ -0,0 +1,14 @@
+package org.jboss.tools.common.zip;
+
+import java.io.IOException;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+public class DefaultZipEntryVisitor implements IZipEntryVisitor {
+
+ public void visiteDirectoryEntry(ZipFile zipFIle, ZipEntry dir) throws IOException {
+ }
+
+ public void visiteFileEntry(ZipFile zipFile, ZipEntry file) throws IOException {
+ }
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/zip/DefaultZipEntryVisitor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/zip/IZipEntryVisitor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/zip/IZipEntryVisitor.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/zip/IZipEntryVisitor.java 2009-09-08 20:30:44 UTC (rev 17479)
@@ -0,0 +1,10 @@
+package org.jboss.tools.common.zip;
+
+import java.io.IOException;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+public interface IZipEntryVisitor {
+ void visiteDirectoryEntry (ZipFile zipFIle, ZipEntry dir) throws IOException;
+ void visiteFileEntry (ZipFile zipFile, ZipEntry file) throws IOException;
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/zip/IZipEntryVisitor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/zip/UnzipOperation.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/zip/UnzipOperation.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/zip/UnzipOperation.java 2009-09-08 20:30:44 UTC (rev 17479)
@@ -0,0 +1,93 @@
+package org.jboss.tools.common.zip;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+public class UnzipOperation {
+
+ File zipFile;
+
+ public static final int BUFFER_SIZE = 1024*4;
+
+ public UnzipOperation(String zipFile) {
+ this(new File(zipFile));
+ }
+
+ public UnzipOperation(File zipFile) {
+ this.zipFile = zipFile;
+ }
+
+ public void execute(File destination) throws IOException {
+ ZipArchive archive = new ZipArchive(zipFile);
+ archive.acceptVisitor(new UnzipEntryVisitor(destination));
+ }
+
+ public void execute(String destination) throws IOException {
+ execute(new File(destination));
+ }
+
+ public void execute(File destination,String filter) throws IOException {
+ ZipArchive archive = new ZipArchive(zipFile);
+ archive.acceptVisitor(new FilteredZipEntryVisitor(filter,new UnzipEntryVisitor(destination)));
+ }
+
+ public void execute(String destination,String filter) throws IOException {
+ execute(new File(destination,filter));
+ }
+
+ public static class FilteredZipEntryVisitor implements IZipEntryVisitor{
+
+ private String filter;
+ private IZipEntryVisitor visitor;
+
+ public FilteredZipEntryVisitor(String filter, IZipEntryVisitor visitor) {
+ this.filter = filter;
+ this.visitor = visitor;
+ }
+
+ public void visiteDirectoryEntry(ZipFile zipFile, ZipEntry dir) throws IOException {
+ if(dir.getName().matches(filter)) {
+ visitor.visiteDirectoryEntry(zipFile, dir);
+ }
+ }
+
+ public void visiteFileEntry(ZipFile zipFile, ZipEntry file) throws IOException {
+ if(file.getName().matches(filter)) {
+ visitor.visiteFileEntry(zipFile, file);
+ }
+ }
+ }
+
+ public static class UnzipEntryVisitor implements IZipEntryVisitor {
+
+ private File destination;
+
+ public UnzipEntryVisitor(File destination) {
+ this.destination = destination;
+ }
+
+ public void visiteDirectoryEntry(ZipFile zipFIle, ZipEntry dir) throws IOException {
+ File entryDir = new File(destination,dir.getName());
+ entryDir.mkdirs();
+ }
+
+ public void visiteFileEntry(ZipFile zipFile, ZipEntry file) throws IOException {
+ File outputFile = new File(destination,file.getName());
+ outputFile.getParentFile().mkdirs();
+ outputFile.createNewFile();
+ BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(outputFile),BUFFER_SIZE);
+ BufferedInputStream in = new BufferedInputStream(zipFile.getInputStream(file));
+ byte[] buff = new byte[BUFFER_SIZE];
+ int n = -1;
+ while((n = in.read(buff,0,buff.length))>-1) {
+ out.write(buff, 0, n);
+ }
+ out.flush();
+ }
+ }
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/zip/UnzipOperation.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/zip/ZipArchive.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/zip/ZipArchive.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/zip/ZipArchive.java 2009-09-08 20:30:44 UTC (rev 17479)
@@ -0,0 +1,52 @@
+package org.jboss.tools.common.zip;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Enumeration;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+public class ZipArchive {
+
+ File file = null;
+
+ public ZipArchive(String file) {
+ this(new File(file));
+ }
+
+ public ZipArchive(File file) {
+ this.file = file;
+ }
+
+ public void acceptVisitor(IZipEntryVisitor visitor) throws IOException{
+ ZipFile zipFile = null;
+ zipFile = new ZipFile(this.file);
+ acceptVisitor(zipFile, visitor);
+ }
+
+ public static void acceptVisitor(ZipFile zipFile, IZipEntryVisitor visitor) throws IOException {
+ try {
+ Enumeration<? extends ZipEntry> entries = zipFile.entries();
+ while(entries.hasMoreElements()) {
+ ZipEntry entry = entries.nextElement();
+ if(entry.isDirectory()) {
+ visitor.visiteDirectoryEntry(zipFile, entry);
+ } else {
+ visitor.visiteFileEntry(zipFile, entry);
+ }
+ }
+ } finally {
+ if(zipFile!=null) {
+ try {
+ zipFile.close();
+ } catch (IOException e) {
+ // Nothing to do with that
+ }
+ }
+ }
+ }
+
+ public String getAbsolutePath() {
+ return file.getAbsolutePath();
+ }
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/zip/ZipArchive.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/test/CommonAllTests.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/test/CommonAllTests.java 2009-09-08 16:05:15 UTC (rev 17478)
+++ trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/test/CommonAllTests.java 2009-09-08 20:30:44 UTC (rev 17479)
@@ -18,6 +18,7 @@
import org.jboss.tools.common.util.test.HttpUtilTest;
import org.jboss.tools.common.xml.test.SAXValidatorTest;
import org.jboss.tools.common.xml.test.XMLUtilitiesTest;
+import org.jboss.tools.common.zip.test.ZipAllTests;
public class CommonAllTests extends TestCase {
public static final String PLUGIN_ID = "org.jboss.tools.common.test";
@@ -30,6 +31,7 @@
suite.addTestSuite(SAXValidatorTest.class);
suite.addTestSuite(ProblemReportingHelperTest.class);
suite.addTestSuite(CommonPluginTest.class);
+ suite.addTestSuite(ZipAllTests.class);
return suite;
}
}
\ No newline at end of file
Added: trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/zip/test/UnzipOperationTest.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/zip/test/UnzipOperationTest.java (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/zip/test/UnzipOperationTest.java 2009-09-08 20:30:44 UTC (rev 17479)
@@ -0,0 +1,44 @@
+package org.jboss.tools.common.zip.test;
+
+import java.io.File;
+import java.io.IOException;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Platform;
+import org.jboss.tools.common.zip.UnzipOperation;
+
+public class UnzipOperationTest extends ZipBaseTest {
+
+ private static final String ORG_PACKAGE_FILTER = "org.*";
+
+ public void testUnzipOperationExecuteFile() throws IOException {
+ UnzipOperation unzip = new UnzipOperation(getZip().getAbsolutePath());
+ File destination = new File(getTemp(),Long.toString(System.currentTimeMillis()));
+ destination.mkdirs();
+ unzip.execute(destination);
+ }
+
+ public void testUnzipOperationExecuteFileString() throws IOException {
+ UnzipOperation unzip = new UnzipOperation(getZip().getAbsolutePath());
+ File destination = new File(getTemp(),Long.toString(System.currentTimeMillis()));
+ destination.mkdirs();
+ unzip.execute(destination,ORG_PACKAGE_FILTER);
+ }
+
+ public void testUnzipOperationExecuteString() throws IOException {
+ UnzipOperation unzip = new UnzipOperation(getZip());
+ File destination = new File(getTemp(),Long.toString(System.currentTimeMillis()));
+ destination.mkdirs();
+ unzip.execute(destination.getAbsolutePath());
+ }
+
+ public void testUnzipOperationExecuteStringString() throws IOException {
+ UnzipOperation unzip = new UnzipOperation(getZip());
+ File destination = new File(getTemp(),Long.toString(System.currentTimeMillis()));
+ destination.mkdirs();
+ unzip.execute(destination.getAbsolutePath(),ORG_PACKAGE_FILTER);
+ }
+
+}
Property changes on: trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/zip/test/UnzipOperationTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/zip/test/ZipAllTests.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/zip/test/ZipAllTests.java (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/zip/test/ZipAllTests.java 2009-09-08 20:30:44 UTC (rev 17479)
@@ -0,0 +1,16 @@
+package org.jboss.tools.common.zip.test;
+
+import org.jboss.tools.common.zip.ZipArchive;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+public class ZipAllTests extends TestCase {
+ public static Test suite() {
+ TestSuite allTests = new TestSuite("org.jboss.tools.common.zip test suite");
+ allTests.addTestSuite(UnzipOperationTest.class);
+ allTests.addTestSuite(ZipArchiveTest.class);
+ return allTests;
+ }
+}
Property changes on: trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/zip/test/ZipAllTests.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/zip/test/ZipArchiveTest.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/zip/test/ZipArchiveTest.java (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/zip/test/ZipArchiveTest.java 2009-09-08 20:30:44 UTC (rev 17479)
@@ -0,0 +1,98 @@
+/**
+ *
+ */
+package org.jboss.tools.common.zip.test;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipException;
+import java.util.zip.ZipFile;
+
+import org.eclipse.core.internal.localstore.Bucket.Visitor;
+import org.jboss.tools.common.zip.DefaultZipEntryVisitor;
+import org.jboss.tools.common.zip.IZipEntryVisitor;
+import org.jboss.tools.common.zip.UnzipOperation;
+import org.jboss.tools.common.zip.ZipArchive;
+
+import junit.framework.TestCase;
+
+/**
+ * @author eskimo
+ *
+ */
+public class ZipArchiveTest extends ZipBaseTest {
+
+ /**
+ * Test method for {@link org.jboss.tools.common.zip.ZipArchive#ZipArchive(java.lang.String)}.
+ */
+ public void testZipArchiveString() {
+ ZipArchive archive = new ZipArchive(getZip().getAbsolutePath());
+ assertEquals(getZip().getAbsolutePath(),archive.getAbsolutePath());
+ }
+
+ /**
+ * Test method for {@link org.jboss.tools.common.zip.ZipArchive#ZipArchive(java.io.File)}.
+ */
+ public void testZipArchiveFile() {
+ ZipArchive archive = new ZipArchive(getZip());
+ assertEquals(getZip().getAbsolutePath(),archive.getAbsolutePath());
+ }
+
+ /**
+ * Test method for {@link org.jboss.tools.common.zip.ZipArchive#acceptVisitor(org.jboss.tools.common.zip.IZipEntryVisitor)}.
+ */
+ public void testAcceptVisitor() throws IOException{
+ ZipArchive archive = new ZipArchive(getZip());
+ ZipVisitor visitor = new ZipVisitor();
+ archive.acceptVisitor(new UnzipOperation.FilteredZipEntryVisitor("META-INF.*", visitor));
+ assertTrue(visitor.isDirVisited() && visitor.isFileVisited());
+
+ ZipArchive.acceptVisitor(new ZipFileWrapper(getZip()),visitor);
+ }
+
+ public class ZipVisitor extends DefaultZipEntryVisitor {
+
+ boolean dirVisited = false;
+ boolean fileVisited = false;
+
+ public boolean isDirVisited() {
+ return dirVisited;
+ }
+
+ public boolean isFileVisited() {
+ return fileVisited;
+ }
+
+ @Override
+ public void visiteDirectoryEntry(ZipFile zipFIle, ZipEntry dir)
+ throws IOException {
+ super.visiteDirectoryEntry(zipFIle, dir);
+ this.dirVisited = true;
+ }
+
+ @Override
+ public void visiteFileEntry(ZipFile zipFile, ZipEntry file)
+ throws IOException {
+ super.visiteFileEntry(zipFile, file);
+ this.fileVisited = true;
+ }
+ }
+
+ /**
+ * @author eskimo
+ *
+ */
+ public class ZipFileWrapper extends ZipFile {
+
+ public ZipFileWrapper(File file) throws ZipException, IOException {
+ super(file);
+ }
+
+ @Override
+ public void close() throws IOException {
+ super.close();
+ throw new IOException("Fake error");
+ }
+ }
+}
Property changes on: trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/zip/test/ZipArchiveTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/zip/test/ZipBaseTest.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/zip/test/ZipBaseTest.java (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/zip/test/ZipBaseTest.java 2009-09-08 20:30:44 UTC (rev 17479)
@@ -0,0 +1,37 @@
+package org.jboss.tools.common.zip.test;
+
+import java.io.File;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Platform;
+
+import junit.framework.TestCase;
+
+public class ZipBaseTest extends TestCase {
+
+ public static final String JAVA_IO_TMPDIR = "java.io.tmpdir";
+ public static final String ORG_ECLIPSE_CORE_RUNTIME_ID = "org.eclipse.core.runtime";
+
+ private File zip;
+ private File temp;
+
+ @Override
+ protected void setUp() throws Exception {
+ zip = FileLocator.getBundleFile(Platform.getBundle(ORG_ECLIPSE_CORE_RUNTIME_ID));
+ temp = new File(System.getProperty(JAVA_IO_TMPDIR));
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ zip = null;
+ temp = null;
+ }
+
+ public File getZip() {
+ return zip;
+ }
+
+ public File getTemp() {
+ return temp;
+ }
+}
Property changes on: trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/zip/test/ZipBaseTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 8 months
JBoss Tools SVN: r17478 - trunk/esb/plugins/org.jboss.tools.esb.project.core/META-INF.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-09-08 12:05:15 -0400 (Tue, 08 Sep 2009)
New Revision: 17478
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/META-INF/MANIFEST.MF
Log:
JBIDE-4854 - ugh missed another file. doh
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/META-INF/MANIFEST.MF 2009-09-08 15:58:54 UTC (rev 17477)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/META-INF/MANIFEST.MF 2009-09-08 16:05:15 UTC (rev 17478)
@@ -29,7 +29,8 @@
org.eclipse.jem.util,
org.eclipse.wst.common.emfworkbench.integration,
org.eclipse.emf.ecore,
- org.jboss.ide.eclipse.as.classpath.core
+ org.jboss.ide.eclipse.as.classpath.core,
+ org.jboss.ide.eclipse.as.wtp.core;bundle-version="1.0.0"
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %providerName
Export-Package: org.jboss.tools.esb.core,
14 years, 8 months
JBoss Tools SVN: r17476 - in trunk: as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-09-08 11:53:22 -0400 (Tue, 08 Sep 2009)
New Revision: 17476
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/ModuleExportOperation.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/META-INF/MANIFEST.MF
trunk/esb/plugins/org.jboss.tools.esb.project.ui/META-INF/MANIFEST.MF
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/export/ESBComponentExportOperation.java
Log:
JBIDE-4854
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/META-INF/MANIFEST.MF 2009-09-08 15:33:00 UTC (rev 17475)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/META-INF/MANIFEST.MF 2009-09-08 15:53:22 UTC (rev 17476)
@@ -15,7 +15,12 @@
org.eclipse.jst.j2ee;bundle-version="1.1.300",
org.eclipse.wst.common.project.facet.core;bundle-version="1.4.0",
org.eclipse.jem.util;bundle-version="2.0.200",
- org.eclipse.wst.web;bundle-version="1.1.300"
+ org.eclipse.wst.web;bundle-version="1.1.300",
+ org.eclipse.wst.common.frameworks;bundle-version="1.1.300",
+ org.eclipse.jst.common.frameworks;bundle-version="1.1.300",
+ org.eclipse.core.commands;bundle-version="3.5.0",
+ org.eclipse.jst.server.core;bundle-version="1.2.0",
+ org.eclipse.jdt.core;bundle-version="3.5.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Export-Package: org.jboss.ide.eclipse.as.wtp.core.modules,
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/ModuleExportOperation.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/ModuleExportOperation.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/ModuleExportOperation.java 2009-09-08 15:53:22 UTC (rev 17476)
@@ -0,0 +1,431 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.jboss.ide.eclipse.as.wtp.core.vcf;
+
+import static org.eclipse.jst.j2ee.datamodel.properties.IJ2EEComponentExportDataModelProperties.ARCHIVE_DESTINATION;
+import static org.eclipse.jst.j2ee.datamodel.properties.IJ2EEComponentExportDataModelProperties.COMPONENT;
+import static org.eclipse.jst.j2ee.datamodel.properties.IJ2EEComponentExportDataModelProperties.EXPORT_SOURCE_FILES;
+import static org.eclipse.jst.j2ee.datamodel.properties.IJ2EEComponentExportDataModelProperties.OPTIMIZE_FOR_SPECIFIC_RUNTIME;
+import static org.eclipse.jst.j2ee.datamodel.properties.IJ2EEComponentExportDataModelProperties.RUNTIME_SPECIFIC_PARTICIPANTS;
+import static org.eclipse.jst.j2ee.datamodel.properties.IJ2EEComponentExportDataModelProperties.RUN_BUILD;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.lang.reflect.InvocationTargetException;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.ICommand;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceRuleFactory;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.core.runtime.jobs.MultiRule;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException;
+import org.eclipse.jst.j2ee.datamodel.properties.IJ2EEComponentExportDataModelProperties.IArchiveExportParticipantData;
+import org.eclipse.jst.j2ee.internal.archive.operations.EJBArchiveOpsResourceHandler;
+import org.eclipse.jst.j2ee.internal.plugin.LibCopyBuilder;
+import org.eclipse.jst.j2ee.internal.project.ProjectSupportResourceHandler;
+import org.eclipse.jst.jee.archive.ArchiveSaveFailureException;
+import org.eclipse.jst.jee.archive.internal.ArchiveUtil;
+import org.eclipse.jst.server.core.IEnterpriseApplication;
+import org.eclipse.jst.server.core.IJ2EEModule;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
+import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.ServerUtil;
+import org.eclipse.wst.server.core.model.IModuleFile;
+import org.eclipse.wst.server.core.model.IModuleFolder;
+import org.eclipse.wst.server.core.model.IModuleResource;
+import org.eclipse.wst.server.core.model.ModuleDelegate;
+
+public abstract class ModuleExportOperation extends AbstractDataModelOperation {
+
+ protected IProgressMonitor progressMonitor;
+ private IVirtualComponent component;
+ private IModule module;
+ private IPath destinationPath;
+ private boolean exportSource = false;
+
+ public ModuleExportOperation() {
+ super();
+ }
+
+ public ModuleExportOperation(IDataModel model) {
+ super(model);
+ }
+
+ protected final int REFRESH_WORK = 100;
+ protected final int JAVA_BUILDER_WORK = 100;
+ protected final int LIB_BUILDER_WORK = 100;
+ protected final int EXPORT_WORK = 1000;
+ protected final int CLOSE_WORK = 10;
+ protected final int SINGLE_PARTICIPANT_WORK = 200;
+
+ protected int computeTotalWork() {
+ int totalWork = REFRESH_WORK;
+ if (model.getBooleanProperty(RUN_BUILD)) {
+ totalWork += JAVA_BUILDER_WORK + LIB_BUILDER_WORK;
+ }
+ totalWork += EXPORT_WORK + CLOSE_WORK;
+
+ final IDataModel dm = getDataModel();
+
+ if( dm.getProperty( OPTIMIZE_FOR_SPECIFIC_RUNTIME ) == Boolean.TRUE ) {
+ final List<IArchiveExportParticipantData> extensions
+ = (List<IArchiveExportParticipantData>) dm.getProperty( RUNTIME_SPECIFIC_PARTICIPANTS );
+ totalWork += extensions.size() * SINGLE_PARTICIPANT_WORK;
+ }
+
+ return totalWork;
+ }
+
+ public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ setComponent((IVirtualComponent) model.getProperty(COMPONENT));
+ setDestinationPath(new Path(model.getStringProperty(ARCHIVE_DESTINATION)));
+// setExportSource(model.getBooleanProperty(EXPORT_SOURCE_FILES));
+
+ try
+ {
+ monitor.beginTask(ProjectSupportResourceHandler.getString(ProjectSupportResourceHandler.Exporting_archive, new Object [] { getDestinationPath().lastSegment() }), computeTotalWork());
+ setProgressMonitor(monitor);
+
+ try {
+ // defect 240999
+ component.getProject().refreshLocal(IResource.DEPTH_INFINITE, new SubProgressMonitor(monitor, REFRESH_WORK));
+ if (model.getBooleanProperty(RUN_BUILD)) {
+ runNecessaryBuilders(component, new SubProgressMonitor(monitor, JAVA_BUILDER_WORK + LIB_BUILDER_WORK));
+ }
+ export();
+ } catch (Exception e) {
+ monitor.worked(CLOSE_WORK);
+ throw new ExecutionException(EJBArchiveOpsResourceHandler.Error_exporting__UI_ + archiveString(), e);
+ }
+
+ final IDataModel dm = getDataModel();
+
+ if( dm.getProperty( OPTIMIZE_FOR_SPECIFIC_RUNTIME ) == Boolean.TRUE )
+ {
+ for( IArchiveExportParticipantData extData
+ : (List<IArchiveExportParticipantData>) dm.getProperty( RUNTIME_SPECIFIC_PARTICIPANTS ) )
+ {
+ final IDataModelOperation op
+ = extData.getParticipant().createOperation( extData.getDataModel() );
+
+ op.execute( null, null );
+ monitor.worked( SINGLE_PARTICIPANT_WORK );
+ }
+ }
+ }
+ finally
+ {
+ monitor.done();
+ }
+
+ return OK_STATUS;
+ }
+
+ protected abstract String archiveString();
+
+ protected void setProgressMonitor(IProgressMonitor newProgressMonitor) {
+ progressMonitor = newProgressMonitor;
+ }
+
+ protected IProgressMonitor getProgressMonitor() {
+ return progressMonitor;
+ }
+
+ private void setComponent(IVirtualComponent newComponent) {
+ component = newComponent;
+ setModule();
+ }
+
+ protected IVirtualComponent getComponent() {
+ if (component == null)
+ component = (IVirtualComponent) model.getProperty(COMPONENT);
+ return component;
+ }
+
+ protected IPath getDestinationPath() {
+ return destinationPath;
+ }
+
+ protected void setDestinationPath(IPath newDestinationPath) {
+ destinationPath = newDestinationPath;
+ }
+
+// protected boolean isExportSource() {
+// return exportSource;
+// }
+//
+// protected void setExportSource(boolean newExportSource) {
+// exportSource = newExportSource;
+// }
+
+ protected void setModule() {
+ String moduleType = getModuleTypeID();
+ if( component != null && component.getProject() != null && moduleType != null) {
+ IModule[] modules = ServerUtil.getModules(component.getProject());
+ for( int i = 0; i < modules.length; i++ ) {
+ if( modules[i].getModuleType().getId().equals(moduleType)) {
+ module = modules[i];
+ return;
+ }
+ }
+ }
+ module = null;
+ }
+
+ protected abstract String getModuleTypeID();
+
+
+ /* Return null to skip this child */
+ protected /* abstract */ String getChildURI(IModule parent, IModule child) {
+ IEnterpriseApplication app = (IEnterpriseApplication)parent.loadAdapter(IEnterpriseApplication.class, new NullProgressMonitor());
+ if( app != null ) {
+ return app.getURI(child);
+ }
+ return null;
+ }
+
+ protected void runNecessaryBuilders(IVirtualComponent component, IProgressMonitor monitor) throws CoreException {
+ try{
+ monitor.beginTask(null, JAVA_BUILDER_WORK + LIB_BUILDER_WORK);
+ if(!component.isBinary()){
+ IProject project = component.getProject();
+ IProjectDescription description = project.getDescription();
+ ICommand javaBuilder = getJavaCommand(description);
+ if (javaBuilder != null) {
+ project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, JavaCore.BUILDER_ID, javaBuilder.getArguments(), new SubProgressMonitor(monitor, JAVA_BUILDER_WORK));
+ }
+ ICommand libCopyBuilder = getLibCopyBuilder(description);
+ if (null != libCopyBuilder) {
+ project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, LibCopyBuilder.BUILDER_ID, libCopyBuilder.getArguments(), new SubProgressMonitor(monitor, LIB_BUILDER_WORK));
+ }
+ }
+ } finally {
+ monitor.done();
+ }
+ }
+
+ /**
+ * Find the specific Java command amongst the build spec of a given description
+ */
+ protected ICommand getJavaCommand(IProjectDescription description) throws CoreException {
+ if (description == null) {
+ return null;
+ }
+
+ ICommand[] commands = description.getBuildSpec();
+ for (int i = 0; i < commands.length; ++i) {
+ if (commands[i].getBuilderName().equals(JavaCore.BUILDER_ID)) {
+ return commands[i];
+ }
+ }
+ return null;
+ }
+
+ protected ICommand getLibCopyBuilder(IProjectDescription description) throws CoreException {
+ if (description == null) {
+ return null;
+ }
+
+ ICommand[] commands = description.getBuildSpec();
+ for (int i = 0; i < commands.length; ++i) {
+ if (commands[i].getBuilderName().equals(LibCopyBuilder.BUILDER_ID)) {
+ return commands[i];
+ }
+ }
+ return null;
+
+ }
+
+ public ISchedulingRule getSchedulingRule() {
+ Set projs = gatherDependentProjects(getComponent(), new HashSet());
+ ISchedulingRule combinedRule = null;
+ IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace().getRuleFactory();
+ for (Iterator iter = projs.iterator(); iter.hasNext();) {
+ IProject proj = (IProject) iter.next();
+ ISchedulingRule rule = ruleFactory.createRule(proj);
+ combinedRule = MultiRule.combine(rule, combinedRule);
+ }
+ combinedRule = MultiRule.combine(ruleFactory.buildRule(), combinedRule);
+
+ return combinedRule;
+ }
+
+ /* Only used by getSchedulingRule() as of now */
+ private Set gatherDependentProjects(IVirtualComponent comp, Set projs) {
+ if (!projs.contains(comp.getProject())) {
+ projs.add(comp.getProject());
+ IVirtualReference[] refs = comp.getReferences();
+ for (int i = 0; i < refs.length; i++) {
+ IVirtualReference refComp = refs[i];
+ projs.addAll(gatherDependentProjects(refComp.getReferencedComponent(), projs));
+ }
+ }
+ return projs;
+ }
+
+
+
+ protected void export() throws SaveFailureException, CoreException, InvocationTargetException, InterruptedException {
+ if( module == null )
+ throw new SaveFailureException(); // TODO add some real message
+ try {
+ File dest = getDestinationPath().toFile();
+ File parent = dest.getParentFile();
+
+ /* Prepare the streams */
+ if (dest.exists() && dest.isDirectory()) {
+ throw new IOException("The specified file: " + dest.getAbsolutePath() + " exists and is a directory");
+ }
+ if (parent != null)
+ parent.mkdirs();
+ java.io.OutputStream out = new java.io.FileOutputStream(dest);
+ ZipStreamModuleSaveAdapterImpl saver = new ZipStreamModuleSaveAdapterImpl(out);
+
+
+ /*
+ * If we were to create a dual underlying model that would work for
+ * export and publish, this is where we'd do that and incorporate
+ * preferences from the calling class
+ */
+
+ ModuleDelegate moduleDelegate = (ModuleDelegate)module.loadAdapter(ModuleDelegate.class, new NullProgressMonitor());
+ addResources(saver, moduleDelegate.members());
+ addChildren(saver, module, moduleDelegate.getChildModules());
+ saver.finish();
+ } catch( Exception e ) {
+ e.printStackTrace();
+ throw new SaveFailureException();
+ }
+ }
+
+ protected void addChildren(ZipStreamModuleSaveAdapterImpl saver, IModule parent, IModule[] children ) throws IOException, ArchiveSaveFailureException, CoreException {
+ if( children != null ) {
+ for( int i = 0; i < children.length; i++ ) {
+ String path = getChildURI(parent, children[i]);
+ ModuleDelegate childDelegate = (ModuleDelegate)children[i].
+ loadAdapter(ModuleDelegate.class, new NullProgressMonitor());
+ IJ2EEModule tempMod = (IJ2EEModule)children[i].loadAdapter(IJ2EEModule.class, new NullProgressMonitor());
+ boolean isBinary = tempMod.isBinary();
+ if( path != null ) {
+ if( isBinary ) {
+ addResources(saver, childDelegate.members());
+ } else {
+ ZipStreamModuleSaveAdapterImpl childSaver = saver.createNestedSaveAdapter(path);
+ addResources(childSaver, childDelegate.members());
+ addChildren(childSaver, children[i], childDelegate.getChildModules());
+ childSaver.finish();
+ }
+ }
+ }
+ }
+ }
+
+ protected void addResources(ZipStreamModuleSaveAdapterImpl saver, IModuleResource[] resources) throws ArchiveSaveFailureException {
+ for( int i = 0; i < resources.length; i++ ) {
+ if( resources[i] instanceof IModuleFile ) {
+ saver.save(resources[i]);
+ } else if( resources[i] instanceof IModuleFolder ) {
+ addResources(saver, ((IModuleFolder)resources[i]).members());
+ }
+ }
+ }
+
+
+ public static class ZipStreamModuleSaveAdapterImpl {
+ protected OutputStream destinationStream;
+ /** Used internally */
+ protected ZipOutputStream zipOutputStream;
+
+ public ZipStreamModuleSaveAdapterImpl(OutputStream out) {
+ destinationStream = out;
+ zipOutputStream = new ZipOutputStream(out);
+ }
+
+ public void close() throws IOException {
+ getDestinationStream().close();
+ }
+
+ protected ZipStreamModuleSaveAdapterImpl createNestedSaveAdapter(String entry) throws IOException {
+ ZipEntry nest = new ZipEntry(entry);
+ getZipOutputStream().putNextEntry(nest);
+ return new ZipStreamModuleSaveAdapterImpl(getZipOutputStream());
+ }
+
+ public void finish() throws IOException {
+ getZipOutputStream().finish();
+ //If this is not nested, close the stream to free up the resource
+ //otherwise, don't close it because the parent may not be done
+ if (!(getDestinationStream() instanceof ZipOutputStream))
+ getDestinationStream().close();
+ }
+
+ public java.io.OutputStream getDestinationStream() {
+ return destinationStream;
+ }
+
+ protected java.util.zip.ZipOutputStream getZipOutputStream() {
+ return zipOutputStream;
+ }
+
+ protected void save(IModuleResource resource) throws ArchiveSaveFailureException {
+ if( resource instanceof IModuleFile ) {
+ File f = (File)((IModuleFile)resource).getAdapter(File.class);
+ if( f == null ) {
+ IFile ifile = (IFile)((IModuleFile)resource).getAdapter(IFile.class);
+ if( ifile != null )
+ f = ifile.getLocation().toFile();
+ }
+ saveFile(f, resource.getModuleRelativePath().append(resource.getName()));
+ }
+ }
+
+ protected void saveFile(File f, IPath entryPath) throws ArchiveSaveFailureException{
+ try {
+ ZipEntry entry = new ZipEntry(entryPath.toString());
+ if (f.lastModified() > 0)
+ entry.setTime(f.lastModified());
+ getZipOutputStream().putNextEntry(entry);
+ ArchiveUtil.copy(new FileInputStream(f), getZipOutputStream());
+ getZipOutputStream().closeEntry();
+ } catch (IOException e) {
+ throw new ArchiveSaveFailureException(e);
+ }
+ }
+ }
+
+}
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/META-INF/MANIFEST.MF 2009-09-08 15:33:00 UTC (rev 17475)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/META-INF/MANIFEST.MF 2009-09-08 15:53:22 UTC (rev 17476)
@@ -32,7 +32,8 @@
org.eclipse.jdt.core;bundle-version="3.4.0",
org.jboss.tools.esb.project.core;bundle-version="1.0.0",
org.eclipse.jdt.ui;bundle-version="3.4.1",
- org.jboss.ide.eclipse.as.ui;bundle-version="1.0.0"
+ org.jboss.ide.eclipse.as.ui;bundle-version="1.0.0",
+ org.jboss.ide.eclipse.as.wtp.core;bundle-version="1.0.0"
Eclipse-LazyStart: true
Bundle-Vendor: %Bundle-Vendor.0
Export-Package: org.jboss.tools.esb.project.ui
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/export/ESBComponentExportOperation.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/export/ESBComponentExportOperation.java 2009-09-08 15:33:00 UTC (rev 17475)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/export/ESBComponentExportOperation.java 2009-09-08 15:53:22 UTC (rev 17476)
@@ -11,10 +11,10 @@
package org.jboss.tools.esb.project.ui.wizards.export;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.jboss.tools.as.wst.server.ui.xpl.J2EEModuleExportOperation;
+import org.jboss.ide.eclipse.as.wtp.core.vcf.ModuleExportOperation;
import org.jboss.tools.esb.core.ESBProjectConstant;
-public class ESBComponentExportOperation extends J2EEModuleExportOperation {
+public class ESBComponentExportOperation extends ModuleExportOperation {
public ESBComponentExportOperation() {
super();
}
14 years, 8 months
JBoss Tools SVN: r17475 - in workspace/yzhishko: org.jboss.tools.vpe.ui.bot.test/resources/editor and 7 other directories.
by jbosstools-commits@lists.jboss.org
Author: yzhishko
Date: 2009-09-08 11:33:00 -0400 (Tue, 08 Sep 2009)
New Revision: 17475
Modified:
workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tools/ui/bot/test/JBTSWTBotTestCase.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/BlockCommentTestLinesToggle.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/BlockCommentTestToggle.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/CommentTestUntoggle.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/ToggleCommentTestToggle.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/VerificationOfNameSpaces.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/pagedesign/AddSubstitutedELExpressionHelloPage.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/pagedesign/AddSubstitutedELExpressionTestPage.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/pagedesign/RemoveSubstitutedELExpressionHelloPage.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/pagedesign/RemoveSubstitutedELExpressionTestPage.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/HideBorderForUnknownTag.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/HideResourceBundlesUsageasELExpressions.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/ShowBorderForUnknownTag.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/ShowResourceBundlesUsageasELExpressions.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAutoTestCase.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/BlockCommentTest.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ToggleCommentTest.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VPEEditorTestCase.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VerificationOfNameSpacesTest.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/AddSubstitutedELExpressionFolderScopeTest.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/SubstitutedELTestCase.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/AlwaysHideSelectionBarWithoutPromptTest.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/BorderForUnknownTagsTest.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ChangeEditorTabForTheFirstOpenPageTest.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ShowNonVisualTagsTest.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ShowResourceBundlesUsageasELexpressionsTest.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/CancelTagLibDefenitionTest.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/ImportTagsFromTLDFileTest.java
Log:
waitForJobs() method has been replaced by waitForBlockingJobsFinished(...). Problem with long test running has been resolved. Tests were redesigned.
Modified: workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tools/ui/bot/test/JBTSWTBotTestCase.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tools/ui/bot/test/JBTSWTBotTestCase.java 2009-09-08 15:09:41 UTC (rev 17474)
+++ workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tools/ui/bot/test/JBTSWTBotTestCase.java 2009-09-08 15:33:00 UTC (rev 17475)
@@ -13,9 +13,12 @@
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
public abstract class JBTSWTBotTestCase extends SWTBotTestCase implements
- ILogListener {
+ ILogListener{
- private Throwable exception;
+ protected static final String BUILDING_WS = "Building workspace";
+ protected static final String VISUAL_UPDATE = "Visual Editor View Update";
+ protected static final String VISUAL_REFRESH = "Visual Editor Refresh";
+ private volatile Throwable exception;
public static final String PATH_TO_SWT_BOT_PROPERTIES = "SWTBot.properties";
private static Properties SWT_BOT_PROPERTIES;
protected SWTJBTBot bot = new SWTJBTBot();
@@ -72,7 +75,7 @@
* @see Throwable
*/
- protected Throwable getException() {
+ protected synchronized Throwable getException() {
return exception;
}
@@ -83,7 +86,7 @@
* @see Throwable
*/
- protected void setException(Throwable e) {
+ protected synchronized void setException(Throwable e) {
this.exception = e;
}
@@ -199,19 +202,59 @@
// }
/**
- * Wait until job manager is currently idle
+ * Use delay() method instead
+ * @see #delay()
*/
-
- protected void waitForJobs(){
+ @Deprecated
+ protected final void waitForJobs(){
delay();
- while (!Job.getJobManager().isIdle()) {
- Job[] jobs = Job.getJobManager().find(null);
- for (Job job : jobs) {
- if ("Updating indexes".equals(job.getName())) {
- job.cancel();
- }
- }
- }
}
+ protected final void waitForBlockingJobsAcomplished(long timeOut, String... jobNames) throws InterruptedException{
+ if (jobNames == null) {
+ delay();
+ } else {
+ boolean isProcessStarted = false;
+ long startTime = System.currentTimeMillis();
+ while (!isProcessStarted) {
+ Job[] jobs = Job.getJobManager().find(null);
+ for (Job job : jobs) {
+ for (String jobName : jobNames) {
+ if (jobName.equalsIgnoreCase(job.getName())) {
+ isProcessStarted = true;
+ }
+ }
+ }
+ long endTime = System.currentTimeMillis();
+ if (endTime-startTime>timeOut) {
+ throw new InterruptedException(stringArrayToString(jobNames) + "job(s) has never appeared or already completed");
+ }
+ }
+ while (isProcessStarted) {
+ isProcessStarted = false;
+ Job[] jobs = Job.getJobManager().find(null);
+ for (Job job : jobs) {
+ for (String jobName : jobNames) {
+ if (jobName.equalsIgnoreCase(job.getName())) {
+ delay();
+ isProcessStarted = true;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ protected final void waitForBlockingJobsAcomplished(String... jobNames) throws InterruptedException{
+ waitForBlockingJobsAcomplished(5*1000L, jobNames);
+ }
+
+ private String stringArrayToString (String... strings){
+ StringBuffer buffer = new StringBuffer("");
+ for (String string : strings) {
+ buffer.append(string+", ");
+ }
+ return buffer.toString();
+ }
+
}
Modified: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/BlockCommentTestLinesToggle.xml
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/BlockCommentTestLinesToggle.xml 2009-09-08 15:09:41 UTC (rev 17474)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/BlockCommentTestLinesToggle.xml 2009-09-08 15:33:00 UTC (rev 17475)
@@ -1,6 +1,12 @@
-<tests>
- <test id="bodyId">
- <DIV ID="bodyId">
+<BODY ID="__content__area__">
+<!--This comment is of JBIDE-3396 -->
+<DIV STYLE="-moz-user-modify: read-write;">
+<DIV STYLE="display: none; -moz-user-modify: read-only;">
+<H1 STYLE="-moz-user-modify: read-write;">
+Input User Name Page
+</H1>
+</DIV>
+<DIV>
<TABLE STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px; width: 100%;">
<TR>
<TD>
@@ -30,5 +36,5 @@
</TR>
</TABLE>
</DIV>
- </test>
-</tests>
\ No newline at end of file
+</DIV>
+</BODY>
\ No newline at end of file
Modified: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/BlockCommentTestToggle.xml
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/BlockCommentTestToggle.xml 2009-09-08 15:09:41 UTC (rev 17474)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/BlockCommentTestToggle.xml 2009-09-08 15:33:00 UTC (rev 17475)
@@ -1,6 +1,12 @@
-<tests>
- <test id="bodyId">
- <DIV ID="bodyId">
+<BODY ID="__content__area__">
+<!--This comment is of JBIDE-3396 -->
+<DIV STYLE="-moz-user-modify: read-write;">
+<DIV STYLE="display: none; -moz-user-modify: read-only;">
+<H1 STYLE="-moz-user-modify: read-write;">
+Input User Name Page
+</H1>
+</DIV>
+<DIV>
<TABLE STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px; width: 100%;">
<TR>
<TD>
@@ -32,5 +38,5 @@
</TR>
</TABLE>
</DIV>
- </test>
-</tests>
\ No newline at end of file
+</DIV>
+</BODY>
\ No newline at end of file
Modified: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/CommentTestUntoggle.xml
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/CommentTestUntoggle.xml 2009-09-08 15:09:41 UTC (rev 17474)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/CommentTestUntoggle.xml 2009-09-08 15:33:00 UTC (rev 17475)
@@ -1,6 +1,12 @@
-<tests>
- <test id="bodyId">
- <DIV ID="bodyId">
+<BODY ID="__content__area__">
+<!--This comment is of JBIDE-3396 -->
+<DIV STYLE="-moz-user-modify: read-write;">
+<DIV STYLE="display: none; -moz-user-modify: read-only;">
+<H1 STYLE="-moz-user-modify: read-write;">
+Input User Name Page
+</H1>
+</DIV>
+<DIV>
<TABLE STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px; width: 100%;">
<TR>
<TD>
@@ -33,5 +39,5 @@
</TR>
</TABLE>
</DIV>
- </test>
-</tests>
\ No newline at end of file
+</DIV>
+</BODY>
\ No newline at end of file
Modified: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/ToggleCommentTestToggle.xml
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/ToggleCommentTestToggle.xml 2009-09-08 15:09:41 UTC (rev 17474)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/ToggleCommentTestToggle.xml 2009-09-08 15:33:00 UTC (rev 17475)
@@ -1,6 +1,12 @@
-<tests>
- <test id="bodyId">
- <DIV ID="bodyId">
+<BODY ID="__content__area__">
+<!--This comment is of JBIDE-3396 -->
+<DIV STYLE="-moz-user-modify: read-write;">
+<DIV STYLE="display: none; -moz-user-modify: read-only;">
+<H1 STYLE="-moz-user-modify: read-write;">
+Input User Name Page
+</H1>
+</DIV>
+<DIV>
<TABLE STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px; width: 100%;">
<TR>
<TD>
@@ -32,5 +38,5 @@
</TR>
</TABLE>
</DIV>
- </test>
-</tests>
\ No newline at end of file
+</DIV>
+</BODY>
\ No newline at end of file
Modified: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/VerificationOfNameSpaces.xml
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/VerificationOfNameSpaces.xml 2009-09-08 15:09:41 UTC (rev 17474)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/VerificationOfNameSpaces.xml 2009-09-08 15:33:00 UTC (rev 17475)
@@ -1,4 +1,5 @@
<BODY ID="__content__area__">
+<!--This comment is of JBIDE-3396 -->
<SPAN CLASS="vpe-text">
...
</SPAN><BR VPE:PSEUDO-ELEMENT="yes" STYLE="font-style: italic; color: green; -moz-user-modify: read-only;"/>
Modified: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/pagedesign/AddSubstitutedELExpressionHelloPage.xml
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/pagedesign/AddSubstitutedELExpressionHelloPage.xml 2009-09-08 15:09:41 UTC (rev 17474)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/pagedesign/AddSubstitutedELExpressionHelloPage.xml 2009-09-08 15:33:00 UTC (rev 17475)
@@ -1,6 +1,12 @@
-<tests>
- <test id="bodyId">
- <DIV ID="bodyId">
+<BODY ID="__content__area__">
+<!--This comment is of JBIDE-3396 -->
+<DIV STYLE="-moz-user-modify: read-write;">
+<DIV STYLE="display: none; -moz-user-modify: read-only;">
+<H1 STYLE="-moz-user-modify: read-write;">
+Hello!
+</H1>
+</DIV>
+<DIV>
<TABLE STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px; width: 100%;">
<TR>
<TD>
@@ -24,5 +30,5 @@
</TR>
</TABLE>
</DIV>
- </test>
-</tests>
\ No newline at end of file
+</DIV>
+</BODY>
\ No newline at end of file
Modified: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/pagedesign/AddSubstitutedELExpressionTestPage.xml
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/pagedesign/AddSubstitutedELExpressionTestPage.xml 2009-09-08 15:09:41 UTC (rev 17474)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/pagedesign/AddSubstitutedELExpressionTestPage.xml 2009-09-08 15:33:00 UTC (rev 17475)
@@ -1,6 +1,12 @@
-<tests>
- <test id="bodyId">
- <DIV id="bodyId">
+<BODY ID="__content__area__">
+<!--This comment is of JBIDE-3396 -->
+<DIV STYLE="-moz-user-modify: read-write;">
+<DIV STYLE="display: none; -moz-user-modify: read-only;">
+<H1 STYLE="-moz-user-modify: read-write;">
+Input User Name Page
+</H1>
+</DIV>
+<DIV>
<TABLE STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px; width: 100%;">
<TR>
<TD>
@@ -33,5 +39,5 @@
</TR>
</TABLE>
</DIV>
- </test>
-</tests>
\ No newline at end of file
+</DIV>
+</BODY>
\ No newline at end of file
Modified: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/pagedesign/RemoveSubstitutedELExpressionHelloPage.xml
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/pagedesign/RemoveSubstitutedELExpressionHelloPage.xml 2009-09-08 15:09:41 UTC (rev 17474)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/pagedesign/RemoveSubstitutedELExpressionHelloPage.xml 2009-09-08 15:33:00 UTC (rev 17475)
@@ -1,6 +1,12 @@
-<tests>
- <test id="bodyId">
- <DIV ID="bodyId">
+<BODY ID="__content__area__">
+<!--This comment is of JBIDE-3396 -->
+<DIV STYLE="-moz-user-modify: read-write;">
+<DIV STYLE="display: none; -moz-user-modify: read-only;">
+<H1 STYLE="-moz-user-modify: read-write;">
+Hello!
+</H1>
+</DIV>
+<DIV>
<TABLE STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px; width: 100%;">
<TR>
<TD>
@@ -24,5 +30,5 @@
</TR>
</TABLE>
</DIV>
- </test>
-</tests>
\ No newline at end of file
+</DIV>
+</BODY>
\ No newline at end of file
Modified: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/pagedesign/RemoveSubstitutedELExpressionTestPage.xml
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/pagedesign/RemoveSubstitutedELExpressionTestPage.xml 2009-09-08 15:09:41 UTC (rev 17474)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/pagedesign/RemoveSubstitutedELExpressionTestPage.xml 2009-09-08 15:33:00 UTC (rev 17475)
@@ -1,6 +1,12 @@
-<tests>
- <test id="bodyId">
- <DIV ID="bodyId">
+<BODY ID="__content__area__">
+<!--This comment is of JBIDE-3396 -->
+<DIV STYLE="-moz-user-modify: read-write;">
+<DIV STYLE="display: none; -moz-user-modify: read-only;">
+<H1 STYLE="-moz-user-modify: read-write;">
+Input User Name Page
+</H1>
+</DIV>
+<DIV>
<TABLE STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px; width: 100%;">
<TR>
<TD>
@@ -33,5 +39,5 @@
</TR>
</TABLE>
</DIV>
- </test>
-</tests>
+</DIV>
+</BODY>
\ No newline at end of file
Modified: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/HideBorderForUnknownTag.xml
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/HideBorderForUnknownTag.xml 2009-09-08 15:09:41 UTC (rev 17474)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/HideBorderForUnknownTag.xml 2009-09-08 15:33:00 UTC (rev 17475)
@@ -1,6 +1,12 @@
-<tests>
- <test id="bodyId">
- <DIV ID="bodyId">
+<BODY ID="__content__area__">
+<!--This comment is of JBIDE-3396 -->
+<DIV STYLE="-moz-user-modify: read-write;">
+<DIV STYLE="display: none; -moz-user-modify: read-only;">
+<H1 STYLE="-moz-user-modify: read-write;">
+Input User Name Page
+</H1>
+</DIV>
+<DIV>
<TABLE STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px; width: 100%;">
<TR>
<TD>
@@ -37,5 +43,5 @@
</TR>
</TABLE>
</DIV>
- </test>
-</tests>
+</DIV>
+</BODY>
\ No newline at end of file
Modified: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/HideResourceBundlesUsageasELExpressions.xml
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/HideResourceBundlesUsageasELExpressions.xml 2009-09-08 15:09:41 UTC (rev 17474)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/HideResourceBundlesUsageasELExpressions.xml 2009-09-08 15:33:00 UTC (rev 17475)
@@ -1,6 +1,12 @@
-<tests>
- <test id="bodyId">
- <DIV ID="bodyId">
+<BODY ID="__content__area__">
+<!--This comment is of JBIDE-3396 -->
+<DIV STYLE="-moz-user-modify: read-write;">
+<DIV STYLE="display: none; -moz-user-modify: read-only;">
+<H1 STYLE="-moz-user-modify: read-write;">
+Input User Name Page
+</H1>
+</DIV>
+<DIV>
<TABLE STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px; width: 100%;">
<TR>
<TD>
@@ -33,5 +39,5 @@
</TR>
</TABLE>
</DIV>
- </test>
-</tests>
\ No newline at end of file
+</DIV>
+</BODY>
\ No newline at end of file
Modified: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/ShowBorderForUnknownTag.xml
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/ShowBorderForUnknownTag.xml 2009-09-08 15:09:41 UTC (rev 17474)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/ShowBorderForUnknownTag.xml 2009-09-08 15:33:00 UTC (rev 17475)
@@ -1,6 +1,12 @@
-<tests>
- <test id="bodyId">
- <DIV ID="bodyId">
+<BODY ID="__content__area__">
+<!--This comment is of JBIDE-3396 -->
+<DIV STYLE="-moz-user-modify: read-write;">
+<DIV STYLE="display: none; -moz-user-modify: read-only;">
+<H1 STYLE="-moz-user-modify: read-write;">
+Input User Name Page
+</H1>
+</DIV>
+<DIV>
<TABLE STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px; width: 100%;">
<TR>
<TD>
@@ -37,5 +43,5 @@
</TR>
</TABLE>
</DIV>
- </test>
-</tests>
\ No newline at end of file
+</DIV>
+</BODY>
\ No newline at end of file
Modified: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/ShowResourceBundlesUsageasELExpressions.xml
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/ShowResourceBundlesUsageasELExpressions.xml 2009-09-08 15:09:41 UTC (rev 17474)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/ShowResourceBundlesUsageasELExpressions.xml 2009-09-08 15:33:00 UTC (rev 17475)
@@ -1,6 +1,12 @@
-<tests>
- <test id="bodyId">
- <DIV ID="bodyId">
+<BODY ID="__content__area__">
+<!--This comment is of JBIDE-3396 -->
+<DIV STYLE="-moz-user-modify: read-write;">
+<DIV STYLE="display: none; -moz-user-modify: read-only;">
+<H1 STYLE="-moz-user-modify: read-write;">
+Input User Name Page
+</H1>
+</DIV>
+<DIV>
<TABLE STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px; width: 100%;">
<TR>
<TD>
@@ -33,5 +39,5 @@
</TR>
</TABLE>
</DIV>
- </test>
-</tests>
\ No newline at end of file
+</DIV>
+</BODY>
\ No newline at end of file
Modified: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAutoTestCase.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAutoTestCase.java 2009-09-08 15:09:41 UTC (rev 17474)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAutoTestCase.java 2009-09-08 15:33:00 UTC (rev 17475)
@@ -97,7 +97,7 @@
bot.menu("File").menu("New").menu("Other...").click();
bot.shell("New").activate();
SWTBotTree tree = bot.tree();
- waitForJobs();
+ delay();
tree.expandNode("JBoss Tools Web").expandNode("JSF").select("JSF Project");
bot.button("Next >").click();
bot.textWithLabel("Project Name*").setText(jsfProjectName);
@@ -105,7 +105,7 @@
bot.button("Next >").click();
try {
bot.comboBoxWithLabel("Runtime*").setSelection("jboss-eap Runtime");
- waitForJobs();
+ delay();
bot.button("Finish").click();
try {
bot.button("Yes").click();
@@ -117,7 +117,7 @@
} catch (WidgetNotFoundException e) {
bot.button(0).click();
SWTBotTree innerTree = bot.tree();
- waitForJobs();
+ delay();
innerTree.expandNode("JBoss Enterprise Middleware").select("JBoss Enterprise Application Platform 4.3 Runtime");
bot.button("Next >").click();
bot.textWithLabel("Home Directory").setText(JBOSS_EAP_HOME);
@@ -132,7 +132,10 @@
} catch (WidgetNotFoundException e2) {
}
}
- waitForJobs();
+ try {
+ waitForBlockingJobsAcomplished(60*1000L, BUILDING_WS);
+ } catch (InterruptedException e) {
+ }
setException(null);
}
@@ -147,7 +150,7 @@
* @see SWTBotMultiPageEditor
* @see Throwable
*/
-
+ @Deprecated
protected void performContentTestByIDs(String expectedVPEContentFile, SWTBotMultiPageEditor editor) throws Throwable{
JSPMultiPageEditor multiPageEditor = editor.getJSPMultiPageEditor();
Modified: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/BlockCommentTest.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/BlockCommentTest.java 2009-09-08 15:09:41 UTC (rev 17474)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/BlockCommentTest.java 2009-09-08 15:33:00 UTC (rev 17475)
@@ -19,14 +19,12 @@
getEditor().navigateTo(22,22);
bot.menu("Source").menu("Add Block Comment").click();
- waitForJobs();
checkVPE("BlockCommentTestToggle.xml");
//Test remove block comment from Source menu
getEditor().navigateTo(22,22);
bot.menu("Source").menu("Remove Block Comment").click();
- waitForJobs();
checkVPE("CommentTestUntoggle.xml");
@@ -34,42 +32,36 @@
getEditor().navigateTo(22,22);
pressBlockCommentHotKeys();
- waitForJobs();
checkVPE("BlockCommentTestToggle.xml");
//Test remove block comment with CTRL+SHIFT+\ hot keys
getEditor().navigateTo(22,22);
pressUnBlockCommentHotKeys();
- waitForJobs();
checkVPE("CommentTestUntoggle.xml");
//Test add block comment lines from Source menu
getEditor().navigateTo(18,22);
bot.menu("Source").menu("Add Block Comment").click();
- waitForJobs();
checkVPE("BlockCommentTestLinesToggle.xml");
//Test remove block comment lines from Source menu
getEditor().navigateTo(18,22);
bot.menu("Source").menu("Remove Block Comment").click();
- waitForJobs();
checkVPE("CommentTestUntoggle.xml");
//Test add block comment lines with CTRL+SHIFT+/ hot keys
getEditor().navigateTo(18,22);
bot.menu("Source").menu("Add Block Comment").click();
- waitForJobs();
checkVPE("BlockCommentTestLinesToggle.xml");
//Test remove block comment lines with CTRL+SHIFT+/ hot keys
getEditor().navigateTo(18,22);
bot.menu("Source").menu("Remove Block Comment").click();
- waitForJobs();
checkVPE("CommentTestUntoggle.xml");
}
Modified: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ToggleCommentTest.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ToggleCommentTest.java 2009-09-08 15:09:41 UTC (rev 17474)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ToggleCommentTest.java 2009-09-08 15:33:00 UTC (rev 17475)
@@ -19,7 +19,6 @@
getEditor().navigateTo(22,22);
bot.menu("Source").menu("Toggle Comment").click();
- waitForJobs();
checkSelectionBar("#comment");
checkVPE("ToggleCommentTestToggle.xml");
@@ -27,7 +26,6 @@
getEditor().navigateTo(22,22);
bot.menu("Source").menu("Toggle Comment").click();
- waitForJobs();
checkSelectionBar("h:commandButton");
checkVPE("CommentTestUntoggle.xml");
@@ -35,7 +33,6 @@
getEditor().navigateTo(22,22);
pressToggleCommentHotKeys();
- waitForJobs();
checkSelectionBar("#comment");
checkVPE("ToggleCommentTestToggle.xml");
@@ -43,7 +40,6 @@
getEditor().navigateTo(22,22);
pressToggleCommentHotKeys();
- waitForJobs();
checkSelectionBar("h:commandButton");
checkVPE("CommentTestUntoggle.xml");
Modified: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VPEEditorTestCase.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VPEEditorTestCase.java 2009-09-08 15:09:41 UTC (rev 17474)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VPEEditorTestCase.java 2009-09-08 15:33:00 UTC (rev 17475)
@@ -60,13 +60,11 @@
}
void checkVPE(String testPage) throws Throwable{
- editor.selectLine(9);
- if (!"<body id=\"bodyId\">".equals(editor.getTextOnCurrentLine().trim())) {
- editor.insertText("<body id=\"bodyId\">");
+ try {
+ waitForBlockingJobsAcomplished("Save", VISUAL_REFRESH, VISUAL_UPDATE);
+ } catch (InterruptedException e) {
}
- editor.save();
- waitForJobs();
- performContentTestByIDs(testPage, bot.multiPageEditorByTitle(TEST_PAGE));
+ performContentTestByDocument(testPage, bot.multiPageEditorByTitle(TEST_PAGE));
}
@Override
@@ -79,7 +77,10 @@
bot.menu("Edit").menu("Delete").click();
editor.setText(editorText);
editor.save();
- waitForJobs();
+ try {
+ waitForBlockingJobsAcomplished("Save");
+ } catch (InterruptedException e) {
+ }
editor.close();
super.tearDown();
}
Modified: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VerificationOfNameSpacesTest.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VerificationOfNameSpacesTest.java 2009-09-08 15:09:41 UTC (rev 17474)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VerificationOfNameSpacesTest.java 2009-09-08 15:33:00 UTC (rev 17475)
@@ -22,14 +22,17 @@
getEditor().setFocus();
bot.menu("Edit").menu("Select All").click();
- waitForJobs();
+ delay();
bot.menu("Edit").menu("Delete").click();
//Test insert test text
getEditor().setText(testText);
getEditor().save();
- waitForJobs();
+ try {
+ waitForBlockingJobsAcomplished("Save", VISUAL_REFRESH, VISUAL_UPDATE);
+ } catch (InterruptedException e) {
+ }
performContentTestByDocument("VerificationOfNameSpaces.xml", bot.multiPageEditorByTitle(TEST_PAGE));
}
Modified: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/AddSubstitutedELExpressionFolderScopeTest.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/AddSubstitutedELExpressionFolderScopeTest.java 2009-09-08 15:09:41 UTC (rev 17474)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/AddSubstitutedELExpressionFolderScopeTest.java 2009-09-08 15:33:00 UTC (rev 17475)
@@ -1,6 +1,7 @@
package org.jboss.tools.vpe.ui.bot.test.editor.pagedesign;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
@@ -44,7 +45,7 @@
bot.shell("New File JSP").activate();
bot.textWithLabel("Name*").setText(TEST_PAGE_FOR_FOLDER);
bot.button("Finish").click();
- waitForJobs();
+ delay();
SWTBotEclipseEditor editorForTestPage = bot.editorByTitle(TEST_PAGE_FOR_FOLDER+".jsp").toTextEditor();
editorForTestPage.setText(getEditorText());
editorForTestPage.save();
@@ -88,7 +89,10 @@
//Test close Design Options
bot.button("OK").click();
- waitForJobs();
+ try {
+ waitForBlockingJobsAcomplished(VISUAL_REFRESH,VISUAL_UPDATE);
+ } catch (InterruptedException e) {
+ }
//Check page content
@@ -131,7 +135,7 @@
bot.menu("Edit").menu("Delete").click();
bot.shell("Confirm Delete").activate();
bot.button("OK").click();
- waitForJobs();
+ delay();
super.tearDown();
}
@@ -144,24 +148,20 @@
tree.expandNode(JBT_TEST_PROJECT_NAME)
.expandNode("WebContent").expandNode(TEST_FOLDER)
.getNode(TEST_PAGE_FOR_FOLDER+".jsp").doubleClick();
- SWTBotEclipseEditor editor = bot.editorByTitle(TEST_PAGE_FOR_FOLDER+".jsp").toTextEditor();
- String editorText = editor.getText();
- editor.selectLine(9);
- if (!"<body id=\"bodyId\">".equals(editor.getTextOnCurrentLine().trim())) {
- editor.insertText("<body id=\"bodyId\">");
+ SWTBotEditor editor = bot.editorByTitle(TEST_PAGE_FOR_FOLDER+".jsp");
+ try {
+ waitForBlockingJobsAcomplished(VISUAL_REFRESH, VISUAL_UPDATE);
+ } catch (InterruptedException e) {
}
- editor.save();
- waitForJobs();
//Check page content
try {
- performContentTestByIDs(testPageFolder, bot.multiPageEditorByTitle(TEST_PAGE_FOR_FOLDER+".jsp"));
+ performContentTestByDocument(testPageFolder, bot.multiPageEditorByTitle(TEST_PAGE_FOR_FOLDER+".jsp"));
} catch (Throwable e) {
throw e;
}finally{
- editor.setText(editorText);
- editor.saveAndClose();
+ editor.close();
openPage();
}
Modified: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/SubstitutedELTestCase.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/SubstitutedELTestCase.java 2009-09-08 15:09:41 UTC (rev 17474)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/SubstitutedELTestCase.java 2009-09-08 15:33:00 UTC (rev 17475)
@@ -1,6 +1,7 @@
package org.jboss.tools.vpe.ui.bot.test.editor.pagedesign;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
@@ -13,7 +14,6 @@
static final String SUBSTITUTED_EL = "Substituted EL expressions";
private SWTBotEclipseEditor editor;
private String editorText;
- private String textHelloPage;
SWTBotEclipseEditor getEditor() {
@@ -54,13 +54,11 @@
void checkVPEForTestPage(String testPage) throws Throwable{
- editor.selectLine(9);
- if (!"<body id=\"bodyId\">".equals(editor.getTextOnCurrentLine().trim())) {
- editor.insertText("<body id=\"bodyId\">");
+ try {
+ waitForBlockingJobsAcomplished(VISUAL_REFRESH, VISUAL_UPDATE);
+ } catch (InterruptedException e) {
}
- editor.save();
- waitForJobs();
- performContentTestByIDs(testPage, bot.multiPageEditorByTitle(TEST_PAGE));
+ performContentTestByDocument(testPage, bot.multiPageEditorByTitle(TEST_PAGE));
}
@Override
@@ -70,8 +68,6 @@
@Override
protected void tearDown() throws Exception {
- editor.setText(editorText);
- editor.save();
bot.toolbarButtonWithTooltip(PAGE_DESIGN).click();
bot.shell(PAGE_DESIGN).activate();
bot.tabItem(SUBSTITUTED_EL).activate();
@@ -104,24 +100,20 @@
SWTBotTree tree = innerBot.tree();
tree.expandNode(JBT_TEST_PROJECT_NAME)
.expandNode("WebContent").expandNode("pages").getNode("hello.jsp").doubleClick();
- SWTBotEclipseEditor editor = bot.editorByTitle("hello.jsp").toTextEditor();
- textHelloPage = editor.getText();
- editor.selectLine(10);
- if (!"<body id=\"bodyId\">".equals(editor.getTextOnCurrentLine().trim())) {
- editor.insertText("<body id=\"bodyId\">");
+ SWTBotEditor editor = bot.editorByTitle("hello.jsp");
+ try {
+ waitForBlockingJobsAcomplished(VISUAL_REFRESH, VISUAL_UPDATE);
+ } catch (InterruptedException e) {
}
- editor.save();
- waitForJobs();
//Check page content
try {
- performContentTestByIDs(testHelloPage, bot.multiPageEditorByTitle("hello.jsp"));
+ performContentTestByDocument(testHelloPage, bot.multiPageEditorByTitle("hello.jsp"));
} catch (Throwable e) {
throw e;
}finally{
- editor.setText(textHelloPage);
- editor.saveAndClose();
+ editor.close();
openPage();
}
}
Modified: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/AlwaysHideSelectionBarWithoutPromptTest.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/AlwaysHideSelectionBarWithoutPromptTest.java 2009-09-08 15:09:41 UTC (rev 17474)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/AlwaysHideSelectionBarWithoutPromptTest.java 2009-09-08 15:33:00 UTC (rev 17475)
@@ -29,7 +29,6 @@
selectSelection();
selectPrompt();
- waitForJobs();
checkIsHide();
//Test Hide selection after reopen
@@ -41,7 +40,6 @@
//Test Show Selection Bar
selectSelection();
- waitForJobs();
checkIsShow();
//Test Show Selection Bar after reopen
@@ -64,7 +62,6 @@
//Test Show Selection Bar from dialog
selectSelection();
- waitForJobs();
checkIsShow();
//Test Show Selection Bar after reopen
Modified: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/BorderForUnknownTagsTest.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/BorderForUnknownTagsTest.java 2009-09-08 15:09:41 UTC (rev 17474)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/BorderForUnknownTagsTest.java 2009-09-08 15:33:00 UTC (rev 17475)
@@ -56,13 +56,11 @@
}
private void checkVPE(String testPage) throws Throwable{
- editor.selectLine(9);
- if (!"<body id=\"bodyId\">".equals(editor.getTextOnCurrentLine().trim())) {
- editor.insertText("<body id=\"bodyId\">");
+ try {
+ waitForBlockingJobsAcomplished(VISUAL_REFRESH, VISUAL_UPDATE);
+ } catch (InterruptedException e) {
}
- editor.save();
- waitForJobs();
- performContentTestByIDs(testPage, bot.multiPageEditorByTitle(TEST_PAGE));
+ performContentTestByDocument(testPage, bot.multiPageEditorByTitle(TEST_PAGE));
}
private void selectBorder(){
@@ -92,7 +90,10 @@
bot.menu("Edit").menu("Delete").click();
editor.setText(textEditor);
editor.save();
- waitForJobs();
+ try {
+ waitForBlockingJobsAcomplished("Save");
+ } catch (InterruptedException e) {
+ }
editor.close();
super.tearDown();
}
Modified: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ChangeEditorTabForTheFirstOpenPageTest.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ChangeEditorTabForTheFirstOpenPageTest.java 2009-09-08 15:09:41 UTC (rev 17474)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ChangeEditorTabForTheFirstOpenPageTest.java 2009-09-08 15:33:00 UTC (rev 17475)
@@ -30,7 +30,7 @@
bot.shell("New File JSP").activate();
bot.textWithLabel("Name*").setText("testPage");
bot.button("Finish").click();
- waitForJobs();
+ delay();
bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).setFocus();
//Check if the tab changed
@@ -74,7 +74,7 @@
bot.button("OK").click();
}catch (WidgetNotFoundException e) {
}
- waitForJobs();
+ delay();
super.tearDown();
}
Modified: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ShowNonVisualTagsTest.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ShowNonVisualTagsTest.java 2009-09-08 15:09:41 UTC (rev 17474)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ShowNonVisualTagsTest.java 2009-09-08 15:33:00 UTC (rev 17475)
@@ -38,7 +38,10 @@
}
private void checkVPE(String testPage) throws Throwable{
- waitForJobs();
+ try {
+ waitForBlockingJobsAcomplished(VISUAL_REFRESH, VISUAL_UPDATE);
+ } catch (InterruptedException e) {
+ }
performContentTestByDocument(testPage, bot.multiPageEditorByTitle(TEST_PAGE));
}
Modified: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ShowResourceBundlesUsageasELexpressionsTest.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ShowResourceBundlesUsageasELexpressionsTest.java 2009-09-08 15:09:41 UTC (rev 17474)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ShowResourceBundlesUsageasELexpressionsTest.java 2009-09-08 15:33:00 UTC (rev 17475)
@@ -60,19 +60,20 @@
bot.menu("Edit").menu("Delete").click();
editor.setText(textEditor);
editor.save();
- waitForJobs();
+ try {
+ waitForBlockingJobsAcomplished("Save");
+ } catch (InterruptedException e) {
+ }
editor.close();
super.tearDown();
}
private void checkVPE(String testPage) throws Throwable{
- editor.selectLine(9);
- if (!"<body id=\"bodyId\">".equals(editor.getTextOnCurrentLine().trim())) {
- editor.insertText("<body id=\"bodyId\">");
+ try {
+ waitForBlockingJobsAcomplished(VISUAL_REFRESH, VISUAL_UPDATE);
+ } catch (InterruptedException e) {
}
- editor.save();
- waitForJobs();
- performContentTestByIDs(testPage, bot.multiPageEditorByTitle(TEST_PAGE));
+ performContentTestByDocument(testPage, bot.multiPageEditorByTitle(TEST_PAGE));
}
private void selectELExpressions(){
Modified: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/CancelTagLibDefenitionTest.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/CancelTagLibDefenitionTest.java 2009-09-08 15:09:41 UTC (rev 17474)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/CancelTagLibDefenitionTest.java 2009-09-08 15:33:00 UTC (rev 17475)
@@ -26,7 +26,7 @@
//Test cancel TLD
SWTBotTree tree = bot.tree();
- waitForJobs();
+ delay();
tree.expandNode(projectProperties.getProperty("JSFProjectName")).expandNode("x-1_0-rt.tld [x_rt]").select();
bot.button("Cancel").click();
Modified: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/ImportTagsFromTLDFileTest.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/ImportTagsFromTLDFileTest.java 2009-09-08 15:09:41 UTC (rev 17474)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/ImportTagsFromTLDFileTest.java 2009-09-08 15:33:00 UTC (rev 17475)
@@ -66,7 +66,7 @@
bot.button("Browse...").click();
bot.shell("Edit TLD").activate();
SWTBotTree tree = bot.tree();
- waitForJobs();
+ delay();
tree.expandNode(projectProperties.getProperty("JSFProjectName")).expandNode("c.tld [c]").select();
bot.button("OK").click();
14 years, 8 months
JBoss Tools SVN: r17474 - trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-09-08 11:09:41 -0400 (Tue, 08 Sep 2009)
New Revision: 17474
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/AbstractConsoleConfigurationPreferences.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4824 - inspect and fix potential unsafe code places to proper usage of w3c dom and the changes in upcoming WTP 3.2
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/AbstractConsoleConfigurationPreferences.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/AbstractConsoleConfigurationPreferences.java 2009-09-08 15:05:35 UTC (rev 17473)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/AbstractConsoleConfigurationPreferences.java 2009-09-08 15:09:41 UTC (rev 17474)
@@ -210,9 +210,10 @@
String[] mappings = new String[0];
String[] classpath = new String[0];
- cfgName = node.getAttribute(NAME_ATTRIB);
+ if (node.hasAttribute(NAME_ATTRIB)) {
+ cfgName = node.getAttribute(NAME_ATTRIB);
+ }
-
String attribute = node.getAttribute(ANNOTATIONS_ATTRIB);
if(StringHelper.isNotEmpty( attribute )) {
boolean oldAnnotationFlag = ((attribute != null) && attribute.equalsIgnoreCase("true")); //$NON-NLS-1$
@@ -231,7 +232,7 @@
setProjectName( attribute );
attribute = node.getAttribute( USE_PROJECT_CLASSPATH_ATTRIB );
- setUseProjectClasspath((attribute != null) && attribute.equalsIgnoreCase("true")); //$NON-NLS-1$
+ setUseProjectClasspath("true".equalsIgnoreCase(attribute)); //$NON-NLS-1$
attribute = node.getAttribute(ENTITYRESOLVER_ATTRIB);
if(attribute!=null && attribute.trim().length()>0) {
@@ -240,12 +241,18 @@
NodeList elements = node.getElementsByTagName(HIBERNATE_CONFIG_XML_TAG);
if(elements.getLength()==1) {
- cfgFile = ( (Element)elements.item(0) ).getAttribute(LOCATION_ATTRIB);
+ final Element el = (Element)elements.item(0);
+ if (el.hasAttribute(LOCATION_ATTRIB)) {
+ cfgFile = el.getAttribute(LOCATION_ATTRIB);
+ }
}
elements = node.getElementsByTagName(HIBERNATE_PROPERTIES_TAG);
if(elements.getLength()==1) {
- propFile = ( (Element)elements.item(0) ).getAttribute(LOCATION_ATTRIB);
+ final Element el = (Element)elements.item(0);
+ if (el.hasAttribute(LOCATION_ATTRIB)) {
+ propFile = el.getAttribute(LOCATION_ATTRIB);
+ }
}
@@ -276,7 +283,8 @@
result = new String[maps.getLength()];
for (int j = 0; j < maps.getLength(); j++) {
Element child = (Element) maps.item(j);
- result[j] = child.getAttribute(LOCATION_ATTRIB);
+ result[j] = child.hasAttribute(LOCATION_ATTRIB) ?
+ child.getAttribute(LOCATION_ATTRIB) : null;
}
}
return result;
14 years, 8 months
JBoss Tools SVN: r17473 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-09-08 11:05:35 -0400 (Tue, 08 Sep 2009)
New Revision: 17473
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/LocalDeploymentModuleTab.java
Log:
first column should not be editable
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/LocalDeploymentModuleTab.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/LocalDeploymentModuleTab.java 2009-09-07 16:50:20 UTC (rev 17472)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/LocalDeploymentModuleTab.java 2009-09-08 15:05:35 UTC (rev 17473)
@@ -578,6 +578,8 @@
private class LocalDeploymentCellModifier implements ICellModifier {
public boolean canModify(Object element, String property) {
+ if( property == LOCAL_COLUMN_NAME)
+ return false;
return true;
}
14 years, 8 months
JBoss Tools SVN: r17469 - branches/jbosstools-3.1.0.M3/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2009-09-04 12:50:29 -0400 (Fri, 04 Sep 2009)
New Revision: 17469
Modified:
branches/jbosstools-3.1.0.M3/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/AbstractXMLContentAssistProcessor.java
branches/jbosstools-3.1.0.M3/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/XmlContentAssistProcessor.java
Log:
JBIDE-4848: The Content Assist doesn't show proposals for the attribute names (The issue is found by org.jboss.tools.jst.jsp.test.ca.JsfJspJbide1717Test.testJstJspJbide1717() JUnit Test Case)
Issue is fixed for branch jbosstools-3.1.0.M3
Modified: branches/jbosstools-3.1.0.M3/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/AbstractXMLContentAssistProcessor.java
===================================================================
--- branches/jbosstools-3.1.0.M3/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/AbstractXMLContentAssistProcessor.java 2009-09-04 16:23:46 UTC (rev 17468)
+++ branches/jbosstools-3.1.0.M3/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/AbstractXMLContentAssistProcessor.java 2009-09-04 16:50:29 UTC (rev 17469)
@@ -842,7 +842,7 @@
*
* @return
*/
- protected String getParent(boolean returnAttributeName) {
+ protected String getParent(boolean returnAttributeName, boolean returnThisElement) {
IStructuredModel sModel = StructuredModelManager
.getModelManager()
.getExistingModelForRead(getDocument());
@@ -884,7 +884,8 @@
n = n.getParentNode();
}
} else {
- n = n.getParentNode();
+ if (!returnThisElement)
+ n = n.getParentNode();
}
if (n == null)
return null;
Modified: branches/jbosstools-3.1.0.M3/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/XmlContentAssistProcessor.java
===================================================================
--- branches/jbosstools-3.1.0.M3/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/XmlContentAssistProcessor.java 2009-09-04 16:23:46 UTC (rev 17468)
+++ branches/jbosstools-3.1.0.M3/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/XmlContentAssistProcessor.java 2009-09-04 16:50:29 UTC (rev 17469)
@@ -85,7 +85,7 @@
String prefix = getTagPrefix();
String uri = getTagUri();
String[] parentTags = getParentTags(type == Type.ATTRIBUTE_NAME || type == Type.ATTRIBUTE_VALUE);
- String parent = getParent(type == Type.ATTRIBUTE_VALUE);
+ String parent = getParent(type == Type.ATTRIBUTE_VALUE, type == Type.ATTRIBUTE_NAME);
String queryValue = query;
String queryStringValue = stringQuery;
14 years, 8 months
JBoss Tools SVN: r17468 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2009-09-04 12:23:46 -0400 (Fri, 04 Sep 2009)
New Revision: 17468
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/AbstractXMLContentAssistProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/XmlContentAssistProcessor.java
Log:
JBIDE-4848: The Content Assist doesn't show proposals for the attribute names (The issue is found by org.jboss.tools.jst.jsp.test.ca.JsfJspJbide1717Test.testJstJspJbide1717() JUnit Test Case)
Issue is fixed
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/AbstractXMLContentAssistProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/AbstractXMLContentAssistProcessor.java 2009-09-04 14:44:08 UTC (rev 17467)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/AbstractXMLContentAssistProcessor.java 2009-09-04 16:23:46 UTC (rev 17468)
@@ -842,7 +842,7 @@
*
* @return
*/
- protected String getParent(boolean returnAttributeName) {
+ protected String getParent(boolean returnAttributeName, boolean returnThisElement) {
IStructuredModel sModel = StructuredModelManager
.getModelManager()
.getExistingModelForRead(getDocument());
@@ -884,7 +884,8 @@
n = n.getParentNode();
}
} else {
- n = n.getParentNode();
+ if (!returnThisElement)
+ n = n.getParentNode();
}
if (n == null)
return null;
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/XmlContentAssistProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/XmlContentAssistProcessor.java 2009-09-04 14:44:08 UTC (rev 17467)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/XmlContentAssistProcessor.java 2009-09-04 16:23:46 UTC (rev 17468)
@@ -85,7 +85,7 @@
String prefix = getTagPrefix();
String uri = getTagUri();
String[] parentTags = getParentTags(type == Type.ATTRIBUTE_NAME || type == Type.ATTRIBUTE_VALUE);
- String parent = getParent(type == Type.ATTRIBUTE_VALUE);
+ String parent = getParent(type == Type.ATTRIBUTE_VALUE, type == Type.ATTRIBUTE_NAME);
String queryValue = query;
String queryStringValue = stringQuery;
14 years, 8 months
JBoss Tools SVN: r17467 - trunk/bpel/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: chukhutsina
Date: 2009-09-04 10:44:08 -0400 (Fri, 04 Sep 2009)
New Revision: 17467
Modified:
trunk/bpel/docs/reference/en/modules/deploy.xml
Log:
<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:9pt;font-family:Sans Serif">
<p>https://jira.jboss.org/jira/browse/JBDS-780 -Checked,formated and a bit restructured the Guide.Mistakes were corrected. </p>
</body></html>
Modified: trunk/bpel/docs/reference/en/modules/deploy.xml
===================================================================
--- trunk/bpel/docs/reference/en/modules/deploy.xml 2009-09-04 14:39:03 UTC (rev 17466)
+++ trunk/bpel/docs/reference/en/modules/deploy.xml 2009-09-04 14:44:08 UTC (rev 17467)
@@ -79,7 +79,7 @@
<listitem>
<para>Select <property>JBoss AS 5.1 </property>as a server type. </para>
<note>
- <para>Please note, that only JBoss As 5.1 or higher version support BPEL.</para>
+ <para>Please note, that only JBoss As 5.1 or higher version supports BPEL.</para>
</note>
</listitem>
<listitem>
14 years, 8 months