JBoss Tools SVN: r26647 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2010-11-16 16:25:56 -0500 (Tue, 16 Nov 2010)
New Revision: 26647
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractServerToolsPublisher.java
Log:
JBIDE-7517 Problem with deployment when Eclipse and JBoss AS are installed on different Windows drives
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractServerToolsPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractServerToolsPublisher.java 2010-11-16 21:03:53 UTC (rev 26646)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractServerToolsPublisher.java 2010-11-16 21:25:56 UTC (rev 26647)
@@ -182,7 +182,12 @@
File temp = deployRoot.toFile().createTempFile(module.getName(), ".tmp", deployRoot.toFile()); //$NON-NLS-1$
IPath tempFile = new Path(temp.getAbsolutePath());
list.addAll(Arrays.asList(PublishUtil.packModuleIntoJar(moduleTree[moduleTree.length-1], tempFile)));
- IPublishCopyCallbackHandler handler = getCallbackHandler(new Path("/")); //$NON-NLS-1$
+ String device = deployPath.getDevice();
+ String root = "/"; //$NON-NLS-1$
+ if (device != null) {
+ root = device + root;
+ }
+ IPublishCopyCallbackHandler handler = getCallbackHandler(new Path(root));
String parentFolder = deployPath.removeLastSegments(1).toString();
handler.makeDirectoryIfRequired(new Path(parentFolder), ProgressMonitorUtil.submon(monitor, 200));
ModuleFile mf = new ModuleFile(tempFile.toFile(), tempFile.lastSegment(), tempFile);
15 years, 5 months
JBoss Tools SVN: r26646 - in trunk/seam/plugins/org.jboss.tools.seam.base.test: .settings and 10 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-11-16 16:03:53 -0500 (Tue, 16 Nov 2010)
New Revision: 26646
Added:
trunk/seam/plugins/org.jboss.tools.seam.base.test/.classpath
trunk/seam/plugins/org.jboss.tools.seam.base.test/.project
trunk/seam/plugins/org.jboss.tools.seam.base.test/.settings/
trunk/seam/plugins/org.jboss.tools.seam.base.test/.settings/org.eclipse.jdt.core.prefs
trunk/seam/plugins/org.jboss.tools.seam.base.test/META-INF/
trunk/seam/plugins/org.jboss.tools.seam.base.test/META-INF/MANIFEST.MF
trunk/seam/plugins/org.jboss.tools.seam.base.test/build.properties
trunk/seam/plugins/org.jboss.tools.seam.base.test/src/
trunk/seam/plugins/org.jboss.tools.seam.base.test/src/org/
trunk/seam/plugins/org.jboss.tools.seam.base.test/src/org/jboss/
trunk/seam/plugins/org.jboss.tools.seam.base.test/src/org/jboss/tools/
trunk/seam/plugins/org.jboss.tools.seam.base.test/src/org/jboss/tools/seam/
trunk/seam/plugins/org.jboss.tools.seam.base.test/src/org/jboss/tools/seam/core/
trunk/seam/plugins/org.jboss.tools.seam.base.test/src/org/jboss/tools/seam/core/test/
trunk/seam/plugins/org.jboss.tools.seam.base.test/src/org/jboss/tools/seam/core/test/project/
trunk/seam/plugins/org.jboss.tools.seam.base.test/src/org/jboss/tools/seam/core/test/project/facet/
trunk/seam/plugins/org.jboss.tools.seam.base.test/src/org/jboss/tools/seam/core/test/project/facet/AbstractSeamFacetTest.java
Log:
https://jira.jboss.org/browse/JBIDE-7440 Between build #79 and #80, 874 tests disappeared
Share project "org.jboss.tools.seam.base.test" into seam component plugins
Added: trunk/seam/plugins/org.jboss.tools.seam.base.test/.classpath
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.base.test/.classpath (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.base.test/.classpath 2010-11-16 21:03:53 UTC (rev 26646)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.base.test/.classpath
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/seam/plugins/org.jboss.tools.seam.base.test/.project
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.base.test/.project (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.base.test/.project 2010-11-16 21:03:53 UTC (rev 26646)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.seam.base.test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.base.test/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/seam/plugins/org.jboss.tools.seam.base.test/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.base.test/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.base.test/.settings/org.eclipse.jdt.core.prefs 2010-11-16 21:03:53 UTC (rev 26646)
@@ -0,0 +1,8 @@
+#Tue Nov 16 12:54:29 PST 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.base.test/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/seam/plugins/org.jboss.tools.seam.base.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.base.test/META-INF/MANIFEST.MF (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.base.test/META-INF/MANIFEST.MF 2010-11-16 21:03:53 UTC (rev 26646)
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Seam Tests Base Classes
+Bundle-SymbolicName: org.jboss.tools.seam.base.test
+Bundle-Version: 1.0.0.qualifier
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Require-Bundle: org.eclipse.core.resources;bundle-version="3.6.0",
+ org.eclipse.core.runtime;bundle-version="3.6.0",
+ org.eclipse.jst.common.project.facet.core;bundle-version="1.4.100",
+ org.eclipse.wst.common.project.facet.core;bundle-version="1.4.100",
+ org.eclipse.wst.common.modulecore;bundle-version="1.2.0",
+ org.eclipse.wst.common.frameworks;bundle-version="1.2.0",
+ org.jboss.tools.seam.core;bundle-version="3.2.0",
+ org.jboss.tools.tests;bundle-version="3.1.0",
+ org.junit
+Export-Package: org.jboss.tools.seam.core.test.project.facet
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.base.test/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/seam/plugins/org.jboss.tools.seam.base.test/build.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.base.test/build.properties (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.base.test/build.properties 2010-11-16 21:03:53 UTC (rev 26646)
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.base.test/build.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/seam/plugins/org.jboss.tools.seam.base.test/src/org/jboss/tools/seam/core/test/project/facet/AbstractSeamFacetTest.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.base.test/src/org/jboss/tools/seam/core/test/project/facet/AbstractSeamFacetTest.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.base.test/src/org/jboss/tools/seam/core/test/project/facet/AbstractSeamFacetTest.java 2010-11-16 21:03:53 UTC (rev 26646)
@@ -0,0 +1,313 @@
+package org.jboss.tools.seam.core.test.project.facet;
+
+import java.io.File;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectNature;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jst.common.project.facet.core.JavaFacet;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.IProjectFacet;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.jboss.tools.seam.core.SeamProjectsSet;
+import org.jboss.tools.seam.core.project.facet.SeamRuntime;
+import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
+import org.jboss.tools.seam.core.project.facet.SeamVersion;
+import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
+import org.jboss.tools.seam.internal.core.project.facet.Seam2ProjectCreator;
+import org.jboss.tools.seam.internal.core.project.facet.SeamFacetInstallDataModelProvider;
+import org.jboss.tools.seam.internal.core.project.facet.SeamProjectCreator;
+import org.jboss.tools.test.util.JobUtils;
+import org.jboss.tools.test.util.ResourcesUtils;
+
+/**
+ * Base class for facet related tests; based on the facet test class found in
+ * WTP test suite.
+ *
+ * @author max
+ *
+ */
+public abstract class AbstractSeamFacetTest extends TestCase {
+
+ protected static final IWorkspace ws = ResourcesPlugin.getWorkspace();
+
+ private SeamRuntime seamRuntime;
+
+ protected static final String SEAM_1_2_0 = "Seam 1.2.0";
+ protected static final String SEAM_2_0_0 = "Seam 2.0.0";
+
+ protected static final String SEAM_1_2_HOME = "jbosstools.test.seam.1.2.1.eap.home";
+ protected static final String SEAM_2_0_HOME = "jbosstools.test.seam.2.0.1.GA.home";
+
+ protected static final IProjectFacetVersion seamFacetVersion;
+ protected static final IProjectFacetVersion dynamicWebVersion;
+ protected static final IProjectFacetVersion javaVersion;
+ protected static final IProjectFacetVersion javaFacesVersion;
+
+ private static final IProjectFacet seamFacet;
+
+ static {
+ seamFacet = ProjectFacetsManager.getProjectFacet("jst.seam");
+ seamFacetVersion = seamFacet.getVersion("1.2");
+
+ javaVersion = JavaFacet.JAVA_50;
+ dynamicWebVersion = ProjectFacetsManager.getProjectFacet("jst.web").getVersion("2.5");
+ javaFacesVersion = ProjectFacetsManager.getProjectFacet("jst.jsf").getVersion("1.2");
+
+ }
+
+ protected final ArrayList<IResource> resourcesToCleanup = new ArrayList<IResource>();
+ protected final List<Runnable> tearDownOperations = new ArrayList<Runnable>();
+
+ protected AbstractSeamFacetTest(final String name) {
+ super(name);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ // TODO Auto-generated method stub
+ super.setUp();
+ assertSeamHomeAvailable();
+ File folder = getSeamHomeFolder();
+
+ SeamRuntimeManager.getInstance().addRuntime(SEAM_1_2_0, folder.getAbsolutePath(), SeamVersion.SEAM_1_2, true);
+ seamRuntime = SeamRuntimeManager.getInstance().findRuntimeByName(SEAM_1_2_0);
+ }
+
+ public static final String SYS_PROP_IS_NOT_DEFINED = "System property {0} is not defined";
+
+ protected File getSeamHomeFolder() {
+ String seamHomeFolder = System.getProperty(getSystemPropertyName());
+ if(seamHomeFolder==null) {
+ throw new IllegalStateException(
+ MessageFormat.format(SYS_PROP_IS_NOT_DEFINED, getSystemPropertyName())
+ );
+ }
+ return new File(seamHomeFolder).getAbsoluteFile();
+ }
+
+ public static final String SEAM_EAP_121_HOME_PROPERY = "jbosstools.test.seam.1.2.1.eap.home";
+
+ protected String getSystemPropertyName() {
+ return SEAM_EAP_121_HOME_PROPERY;
+ }
+
+ protected void tearDown() throws Exception
+
+ {
+
+ // Wait until all jobs is finished to avoid delete project problems
+
+ boolean oldAutoBuilding = true;
+ Exception last = null;
+ try {
+ oldAutoBuilding = ResourcesUtils.setBuildAutomatically(false);
+ ResourcesPlugin.getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE, null);
+ JobUtils.waitForIdle();
+ for (IResource r : this.resourcesToCleanup) {
+ try {
+ System.out.println("Deleting resource " + r.getLocation());
+ if(r instanceof IProject) {
+ IProject project = (IProject)r;
+ for (String natureId : project.getDescription().getNatureIds()) {
+ IProjectNature nature = project.getNature(natureId);
+ nature.deconfigure();
+ }
+ }
+ r.delete(true, null);
+ } catch(Exception e) {
+ e.printStackTrace();
+ last = e;
+ }
+ }
+
+ for (Runnable runnable : this.tearDownOperations) {
+ runnable.run();
+ }
+ } finally {
+ ResourcesUtils.setBuildAutomatically(oldAutoBuilding);
+ }
+
+ if(last!=null) throw last;
+ }
+
+ protected final void addResourceToCleanup(final IResource resource) {
+ if(resource==null) throw new IllegalArgumentException();
+ if(resourcesToCleanup.contains(resource)) throw new IllegalArgumentException();
+ this.resourcesToCleanup.add(resource);
+ }
+
+ protected final void addResourcesToCleanup(final IResource[] resource) {
+ if(resource==null) throw new IllegalArgumentException();
+ this.resourcesToCleanup.addAll(Arrays.asList(resource));
+ }
+
+ protected final void addTearDownOperation(final Runnable runnable) {
+ this.tearDownOperations.add(runnable);
+ }
+
+ protected IFacetedProject createFacetedProject(final String name) throws CoreException
+
+ {
+ assertFalse(ws.getRoot().getProject(name).exists());
+ final IFacetedProject fpj = ProjectFacetsManager.create(name, null,
+ null);
+ final IProject pj = fpj.getProject();
+ assertTrue(pj.exists());
+ addResourceToCleanup(pj);
+
+ return fpj;
+ }
+
+
+ protected IDataModel createSeamDataModel(String deployType) {
+ IDataModel config = (IDataModel) new SeamFacetInstallDataModelProvider().create();
+ config.setStringProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME, SEAM_1_2_0);
+ config.setBooleanProperty(ISeamFacetDataModelProperties.DB_ALREADY_EXISTS, true);
+ config.setBooleanProperty(ISeamFacetDataModelProperties.RECREATE_TABLES_AND_DATA_ON_DEPLOY, false);
+ config.setStringProperty(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS, deployType);
+ config.setStringProperty(ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME, "org.session.beans");
+ config.setStringProperty(ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME, "org.entity.beans");
+ config.setStringProperty(ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME, "org.test.beans");
+ config.setStringProperty(ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE, "noop-connection");
+ config.setProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH, new String[] { "noop-driver.jar" });
+ return config;
+ }
+
+ protected void installDependentFacets(final IFacetedProject fproj) throws CoreException {
+ fproj.installProjectFacet(javaVersion, null, null);
+ fproj.installProjectFacet(dynamicWebVersion, null, null);
+ fproj.installProjectFacet(javaFacesVersion, null, null);
+ }
+
+ protected void setIfEmpty(IDataModel model, String propertyName, String value){
+ String oldValue = model.getStringProperty(propertyName);
+ if(oldValue == null || "".equals(oldValue)){
+ model.setStringProperty(propertyName, value);
+ }
+ }
+
+ protected IFacetedProject createSeamProject(String baseProjectName, final IDataModel config) throws CoreException {
+ final IFacetedProject fproj = ProjectFacetsManager.create(baseProjectName, null,
+ null);
+
+ installDependentFacets(fproj);
+// new SeamFacetPreInstallDelegate().execute(fproj.getProject(), getSeamFacetVersion(), config, null);
+ fproj.installProjectFacet(getSeamFacetVersion(), config, null);
+
+ SeamProjectsSet seamProjectsSet = new SeamProjectsSet(fproj.getProject());
+ assertTrue(seamProjectsSet.getActionFolder().exists());
+ assertTrue(seamProjectsSet.getModelFolder().exists());
+
+ final IProject proj = fproj.getProject();
+
+ setIfEmpty(config, ISeamFacetDataModelProperties.SEAM_TEST_PROJECT, baseProjectName+"-test");
+ setIfEmpty(config, ISeamFacetDataModelProperties.SEAM_EAR_PROJECT, baseProjectName+"-ear");
+ setIfEmpty(config, ISeamFacetDataModelProperties.SEAM_EJB_PROJECT, baseProjectName+"-ejb");
+
+ ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
+
+ public void run(IProgressMonitor monitor) throws CoreException {
+ String seamVersionString = config.getProperty(IFacetDataModelProperties.FACET_VERSION_STR).toString();
+ SeamVersion seamVersion = SeamVersion.parseFromString(seamVersionString);
+ SeamProjectCreator creator = null;
+ if(seamVersion == SeamVersion.SEAM_1_2) {
+ creator = new SeamProjectCreator(config, proj);
+ } else if(seamVersion == SeamVersion.SEAM_2_0) {
+ creator = new Seam2ProjectCreator(config, proj);
+ } else if(seamVersion == SeamVersion.SEAM_2_1) {
+ creator = new Seam2ProjectCreator(config, proj);
+ } else if(seamVersion == SeamVersion.SEAM_2_2) {
+ creator = new Seam2ProjectCreator(config, proj);
+ } else {
+ throw new RuntimeException("Can't get seam version from seam facet model");
+ }
+ creator.execute(monitor);
+ proj.getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE, null);
+ }
+
+ },new NullProgressMonitor());
+
+
+ this.addResourcesToCleanup(seamProjectsSet.getAllProjects());
+
+ return fproj;
+ }
+
+ protected IFacetedProject createSeamWarProject(String name) throws CoreException {
+ final IFacetedProject fproj = createSeamProject(name, createSeamDataModel("war"));
+
+ final IProject proj = fproj.getProject();
+
+ assertNotNull(proj);
+ assertTrue(proj.exists());
+
+ assertTrue(proj.getWorkspace().getRoot().getProject(proj.getName() + "-test").exists());
+ IProject testProject = proj.getWorkspace().getRoot().getProject(proj.getName() + "-test");
+
+
+ return fproj;
+ }
+
+ protected IFacetedProject createSeamEarProject(String name) throws CoreException {
+ final IFacetedProject fproj = createSeamProject(name, createSeamDataModel("ear"));
+ SeamProjectsSet seamProjectsSet = new SeamProjectsSet(fproj.getProject());
+ final IProject proj = fproj.getProject();
+ assertNotNull(proj);
+
+ assertTrue(seamProjectsSet.getWarProject().exists());
+ assertTrue(seamProjectsSet.getTestProject().exists());
+ assertTrue(seamProjectsSet.getEjbProject().exists());
+ assertTrue(seamProjectsSet.getEarProject().exists());
+
+ return fproj;
+ }
+
+ protected IProjectFacetVersion getSeamFacetVersion() {
+ return seamFacetVersion;
+ }
+
+ public void assertSeamHomeAvailable() {
+ File folder = getSeamHomeFolder();
+
+ assertNotNull("seam home folder was null!", folder);
+ assertTrue(folder.getAbsolutePath() + " does not exist", folder.exists());
+
+ //System.out.println("Listing " + folder);
+ File[] list = folder.listFiles();
+ for (int i = 0; i < list.length; i++) {
+ File string = list[i];
+ //System.out.println(i + ": " + string.getName() +(string.isDirectory()?" (dir)":""));
+ }
+
+ File seamgen = new File(folder, "seam-gen");
+ assertNotNull("seam gen folder was null!", seamgen);
+ assertTrue(seamgen.getName() + " seamgen does not exist", seamgen.exists());
+
+ //System.out.println("Listing seamgen " + seamgen);
+ list = seamgen.listFiles();
+ for (int i = 0; i < list.length; i++) {
+ File string = list[i];
+ //System.out.println(i + ": " + string.getName() +(string.isDirectory()?" (dir)":""));
+ }
+
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.base.test/src/org/jboss/tools/seam/core/test/project/facet/AbstractSeamFacetTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 5 months
JBoss Tools SVN: r26643 - trunk/jst/plugins.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-11-16 15:47:06 -0500 (Tue, 16 Nov 2010)
New Revision: 26643
Added:
trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/
Log:
https://jira.jboss.org/browse/JBIDE-7440 Between build #79 and #80, 874 tests disappeared
Share project "org.jboss.tools.jst.jsp.base.test" into "https://svn.jboss.org/repos/jbosstools" that contains base classes for jst.jsp related tests to the right location
Copied: trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test (from rev 26642, trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test)
15 years, 5 months
JBoss Tools SVN: r26642 - in trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test: .settings and 9 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-11-16 15:46:05 -0500 (Tue, 16 Nov 2010)
New Revision: 26642
Added:
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/.classpath
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/.project
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/.settings/
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/.settings/org.eclipse.jdt.core.prefs
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/META-INF/
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/META-INF/MANIFEST.MF
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/build.properties
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/TestUtil.java
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/ca/
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/ca/CommonContentAssistantTestCase.java
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java
Log:
https://jira.jboss.org/browse/JBIDE-7440 Between build #79 and #80, 874 tests disappeared
Share project "org.jboss.tools.jst.jsp.base.test" into "https://svn.jboss.org/repos/jbosstools" that contains base classes for jst.jsp related tests
Added: trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/.classpath
===================================================================
--- trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/.classpath (rev 0)
+++ trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/.classpath 2010-11-16 20:46:05 UTC (rev 26642)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Property changes on: trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/.classpath
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/.project
===================================================================
--- trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/.project (rev 0)
+++ trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/.project 2010-11-16 20:46:05 UTC (rev 26642)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.jst.jsp.base.test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/.settings/org.eclipse.jdt.core.prefs 2010-11-16 20:46:05 UTC (rev 26642)
@@ -0,0 +1,8 @@
+#Tue Nov 16 12:09:10 PST 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Property changes on: trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/META-INF/MANIFEST.MF (rev 0)
+++ trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/META-INF/MANIFEST.MF 2010-11-16 20:46:05 UTC (rev 26642)
@@ -0,0 +1,24 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Base Classes for JSP Editor Related Tests
+Bundle-SymbolicName: org.jboss.tools.jst.jsp.base.test
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.jboss.tools.jst.jsp.base.test.Activator
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.jface;bundle-version="3.6.0",
+ org.eclipse.core.resources;bundle-version="3.6.0",
+ org.eclipse.ui;bundle-version="3.6.0",
+ org.eclipse.wst.sse.core;bundle-version="1.1.500",
+ org.eclipse.wst.sse.ui;bundle-version="1.2.0",
+ org.jboss.tools.common.text.ext;bundle-version="3.2.0",
+ org.jboss.tools.jst.jsp;bundle-version="3.2.0",
+ org.jboss.tools.tests;bundle-version="3.1.0",
+ org.eclipse.jface.text;bundle-version="3.6.0",
+ org.junit,
+ org.jboss.tools.jst.web;bundle-version="3.2.0",
+ org.eclipse.ui.ide;bundle-version="3.6.0",
+ org.jboss.tools.common.text.xml;bundle-version="3.2.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Export-Package: org.jboss.tools.jst.jsp.test,
+ org.jboss.tools.jst.jsp.test.ca
Property changes on: trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/build.properties
===================================================================
--- trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/build.properties (rev 0)
+++ trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/build.properties 2010-11-16 20:46:05 UTC (rev 26642)
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
Property changes on: trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/build.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/TestUtil.java
===================================================================
--- trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/TestUtil.java (rev 0)
+++ trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/TestUtil.java 2010-11-16 20:46:05 UTC (rev 26642)
@@ -0,0 +1,153 @@
+package org.jboss.tools.jst.jsp.test;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.TextUtilities;
+import org.eclipse.jface.text.contentassist.ContentAssistant;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.text.contentassist.IContentAssistant;
+import org.eclipse.jface.text.contentassist.IContentAssistantExtension;
+import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.texteditor.AbstractTextEditor;
+import org.eclipse.wst.sse.ui.internal.contentassist.StructuredContentAssistant;
+import org.jboss.tools.common.text.xml.contentassist.ProposalSorter;
+
+public class TestUtil {
+
+ /** The Constant MAX_IDLE. */
+ public static final long MAX_IDLE = 5*60*1000L;
+
+ /**
+ * Returns the CA Processor from content assistant for the given offset in the document.
+ *
+ *
+ * @param viewer
+ * @param offset
+ * @param ca
+ */
+
+ public static IContentAssistProcessor getProcessor(ITextViewer viewer, int offset, IContentAssistant ca) {
+ try {
+ IDocument document= viewer.getDocument();
+ String type= TextUtilities.getContentType(document, ((IContentAssistantExtension)ca).getDocumentPartitioning(), offset, true);
+ return ca.getContentAssistProcessor(type);
+ } catch (BadLocationException x) {
+ }
+
+ return null;
+ }
+
+ /**
+ * Process UI input but do not return for the specified time interval.
+ *
+ * @param waitTimeMillis
+ * the number of milliseconds
+ */
+ public static void delay(long waitTimeMillis) {
+ Display display = Display.getCurrent();
+
+ // If this is the UI thread,
+ // then process input.
+ if (display != null) {
+ long endTimeMillis = System.currentTimeMillis() + waitTimeMillis;
+ while (System.currentTimeMillis() < endTimeMillis) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+ display.update();
+ }
+ // Otherwise, perform a simple sleep.
+ else {
+ try {
+ Thread.sleep(waitTimeMillis);
+ } catch (InterruptedException e) {
+ // Ignored.
+ }
+ }
+ }
+
+ /**
+ * Wait for idle.
+ */
+ public static void waitForIdle(long maxIdle) {
+ long start = System.currentTimeMillis();
+ while (!Job.getJobManager().isIdle()) {
+ delay(500);
+ if ( (System.currentTimeMillis()-start) > maxIdle )
+ throw new RuntimeException("A long running task detected"); //$NON-NLS-1$
+ }
+ }
+
+ public static SourceViewerConfiguration getSourceViewerConfiguration(AbstractTextEditor editor) {
+ Class editorClass = editor.getClass();
+ while (editorClass != null) {
+ try {
+ Method m = editorClass.getDeclaredMethod("getSourceViewerConfiguration", new Class[] {});
+
+ if(m != null) {
+ m.setAccessible(true);
+ Object result = m.invoke(editor, new Object[]{});
+ return (result instanceof SourceViewerConfiguration ? (SourceViewerConfiguration)result : null);
+ }
+ } catch (NoSuchMethodException ne) {
+ } catch (Exception e) {
+ }
+ editorClass = editorClass.getSuperclass();
+ }
+ return null;
+
+ }
+
+ public static void prepareCAInvokation(IContentAssistant ca, ITextViewer viewer, int offset) {
+ if (ca == null || viewer == null)
+ return;
+
+ // sets cursor position
+ viewer.getTextWidget().setCaretOffset(offset);
+
+ TestUtil.waitForIdle(TestUtil.MAX_IDLE);
+ TestUtil.delay(1000);
+
+ ca.showPossibleCompletions();
+ }
+
+ public static int MAX_CATEGORIES_COUNT = 10;
+ public static List<ICompletionProposal> collectProposals(IContentAssistant ca, ITextViewer viewer, int offset) {
+ prepareCAInvokation(ca, viewer, offset);
+
+ final IContentAssistProcessor p= TestUtil.getProcessor(viewer, offset, ca);
+ List<ICompletionProposal> res= new ArrayList<ICompletionProposal>();
+ // Try to acquire all the proposal categories assuming that there are less than 10 or equal
+ for (int i = 0; i < MAX_CATEGORIES_COUNT && p != null; i++) {
+ ICompletionProposal[] result= p.computeCompletionProposals(viewer, offset);
+ for (int j = 0; result != null && j < result.length; j++) {
+ res.add(result[j]);
+ }
+ }
+ return ProposalSorter.filterAndSortProposals(res, null, null);
+ }
+ /**
+ * Close all opened editors
+ * @author mareshkau
+ */
+ public static final void closeAllEditors(){
+ IWorkbenchPage page = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getActivePage();
+ IWorkbenchPart part = page.getViewReferences()[0].getPart(false);
+ page.activate(part);
+ // close
+ page.closeAllEditors(false);
+ }
+}
Property changes on: trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/TestUtil.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/ca/CommonContentAssistantTestCase.java
===================================================================
--- trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/ca/CommonContentAssistantTestCase.java (rev 0)
+++ trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/ca/CommonContentAssistantTestCase.java 2010-11-16 20:46:05 UTC (rev 26642)
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+
+package org.jboss.tools.jst.jsp.test.ca;
+
+
+import org.jboss.tools.test.util.TestProjectProvider;
+
+
+/**
+ * Abstract class contains of common methods.
+ *
+ * @author Eugene Stherbin
+ *
+ */
+public abstract class CommonContentAssistantTestCase extends ContentAssistantTestCase {
+ /** The make copy. */
+ protected boolean makeCopy;
+
+ /** The provider. */
+ protected TestProjectProvider provider;
+
+ protected abstract String getSetUpProjectName();
+
+ @Override
+ public void setUp() throws Exception {
+ provider = new TestProjectProvider("org.jboss.tools.seam.ui.test", null, getSetUpProjectName(), makeCopy); //$NON-NLS-1$
+ project = provider.getProject();
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ if (provider != null) {
+ provider.dispose();
+ }
+ }
+}
Property changes on: trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/ca/CommonContentAssistantTestCase.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java
===================================================================
--- trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java (rev 0)
+++ trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java 2010-11-16 20:46:05 UTC (rev 26642)
@@ -0,0 +1,251 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jst.jsp.test.ca;
+
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContentAssistant;
+import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
+import org.jboss.tools.common.text.ext.util.Utils;
+import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor;
+import org.jboss.tools.jst.jsp.test.TestUtil;
+import org.jboss.tools.test.util.WorkbenchUtils;
+
+public class ContentAssistantTestCase extends TestCase {
+ protected IProject project = null;
+ protected JSPMultiPageEditor jspEditor = null;
+ protected JSPTextEditor jspTextEditor = null;
+ protected StructuredTextViewer viewer = null;
+ protected IContentAssistant contentAssistant = null;
+ protected IDocument document = null;
+
+ public void openEditor(String fileName) {
+ IEditorPart editorPart = WorkbenchUtils.openEditor(project.getName()+"/"+ fileName); //$NON-NLS-1$
+// System.out.println("openEditor: " + project.getName()+"/"+ fileName);
+ if (editorPart instanceof JSPMultiPageEditor)
+ jspEditor = (JSPMultiPageEditor) editorPart;
+
+ jspTextEditor = jspEditor.getJspEditor();
+ viewer = jspTextEditor.getTextViewer();
+ document = viewer.getDocument();
+ SourceViewerConfiguration config = TestUtil
+ .getSourceViewerConfiguration(jspTextEditor);
+ contentAssistant = (config == null ? null : config
+ .getContentAssistant(viewer));
+
+ assertTrue(
+ "Cannot get the Content Assistant instance for the editor for page \"" //$NON-NLS-1$
+ + fileName + "\"", (contentAssistant != null)); //$NON-NLS-1$
+
+ assertTrue("The IDocument is not instance of IStructuredDocument for page \"" //$NON-NLS-1$
+ + fileName + "\"", //$NON-NLS-1$
+ (document instanceof IStructuredDocument));
+
+ }
+
+ public ICompletionProposal[] checkProposals(String fileName, int offset, String[] proposals, boolean exactly) {
+ return checkProposals(fileName, null, offset, proposals, exactly, true);
+ }
+
+ public ICompletionProposal[] checkProposals(String fileName, String substring, int offset, String[] proposals, boolean exactly) {
+ return checkProposals(fileName, substring, offset, proposals, exactly, false);
+ }
+ public ICompletionProposal[] checkProposals(String fileName, String substring, int offset, String[] proposals, boolean exactly, boolean excludeELProposalsFromExactTest){
+// System.out.println("checkProposals >>> Enterring");
+// System.out.println("checkProposals >>> invoking openEditor() for " + fileName);
+ openEditor(fileName);
+// System.out.println("checkProposals >>> openEditor() is invoked for " + fileName);
+
+ int position = 0;
+ if (substring != null) {
+ String documentContent = document.get();
+ position = documentContent.indexOf(substring);
+ }
+
+ List<ICompletionProposal> res = TestUtil.collectProposals(contentAssistant, viewer, position+offset);
+
+ assertTrue("Content Assistant returned no proposals", (res != null && res.size() > 0)); //$NON-NLS-1$
+
+ // for (int i = 0; i < result.length; i++) {
+ // System.out.println("proposal - "+result[i].getDisplayString());
+ // }
+
+ ICompletionProposal[] result = res.toArray(new ICompletionProposal[res.size()]);
+ int foundCounter = 0;
+ for (int i = 0; i < proposals.length; i++) {
+ boolean found = compareProposal(proposals[i], result);
+ if (found)
+ foundCounter++;
+ assertTrue("Proposal " + proposals[i] + " not found!", found ); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ if (exactly) {
+ if (excludeELProposalsFromExactTest) {
+ assertTrue("Some other proposals were found!", foundCounter == proposals.length); //$NON-NLS-1$
+ } else {
+ assertTrue("Some other proposals were found!", result.length == proposals.length); //$NON-NLS-1$
+ }
+ }
+
+// System.out.println("checkProposals <<< Exiting");
+ return result;
+ }
+
+ public boolean compareProposal(String proposalName, ICompletionProposal[] proposals){
+ for (int i = 0; i < proposals.length; i++) {
+ if (proposals[i] instanceof AutoContentAssistantProposal) {
+ AutoContentAssistantProposal ap = (AutoContentAssistantProposal)proposals[i];
+ String replacementString = ap.getReplacementString().toLowerCase();
+ if (replacementString.equalsIgnoreCase(proposalName)) return true;
+
+
+ // For a tag proposal there will be not only the the tag name but all others characters like default attributes, tag ending characters and so on
+ if (replacementString.indexOf("/>") != -1) {
+ replacementString = replacementString.substring(0, replacementString.indexOf("/>"));
+ }
+ if (replacementString.indexOf('>') != -1) {
+ replacementString = replacementString.substring(0, replacementString.indexOf('>'));
+ }
+ if (replacementString.equalsIgnoreCase(proposalName)) return true;
+
+ String[] replacementStringParts = replacementString.split(" "); //$NON-NLS-1$
+ if (replacementStringParts != null && replacementStringParts.length > 0) {
+ if (replacementStringParts[0].equalsIgnoreCase(proposalName)) return true;
+ }
+
+ // for an attribute proposal there will be a pare of attribute-value (i.e. attrName="attrValue")
+ replacementStringParts = replacementString.split("="); //$NON-NLS-1$
+ if (replacementStringParts != null && replacementStringParts.length > 0) {
+ if (replacementStringParts[0].equalsIgnoreCase(proposalName)) return true;
+ }
+
+ // for an Unclosed EL the closing character is appended to the proposal string (i.e. person} )
+ // perform case sensitive compare operation
+ replacementStringParts = replacementString.split("}"); //$NON-NLS-1$
+ if (replacementStringParts != null && replacementStringParts.length > 0) {
+ if (replacementStringParts[0].equals(proposalName)) return true;
+ }
+
+ // For an attribute value proposal there will be the quote characters
+ replacementString = Utils.trimQuotes(replacementString);
+ if (replacementString.equalsIgnoreCase(proposalName)) return true;
+
+ } else {
+ if(proposals[i].getDisplayString().toLowerCase().equals(proposalName.toLowerCase())) return true;
+ }
+ }
+ return false;
+ }
+
+ public void closeEditor() {
+ if (jspEditor != null) {
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+ .getActivePage().closeEditor(jspEditor, false);
+ jspEditor = null;
+ }
+ }
+
+ /**
+ * @return the project
+ */
+ public IProject getProject() {
+ return project;
+ }
+
+ /**
+ * @param project the project to set
+ */
+ public void setProject(IProject project) {
+ this.project = project;
+ }
+
+ /**
+ * @return the jspEditor
+ */
+ public JSPMultiPageEditor getJspEditor() {
+ return jspEditor;
+ }
+
+ /**
+ * @param jspEditor the jspEditor to set
+ */
+ public void setJspEditor(JSPMultiPageEditor jspEditor) {
+ this.jspEditor = jspEditor;
+ }
+
+ /**
+ * @return the jspTextEditor
+ */
+ public JSPTextEditor getJspTextEditor() {
+ return jspTextEditor;
+ }
+
+ /**
+ * @param jspTextEditor the jspTextEditor to set
+ */
+ public void setJspTextEditor(JSPTextEditor jspTextEditor) {
+ this.jspTextEditor = jspTextEditor;
+ }
+
+ /**
+ * @return the viewer
+ */
+ public StructuredTextViewer getViewer() {
+ return viewer;
+ }
+
+ /**
+ * @param viewer the viewer to set
+ */
+ public void setViewer(StructuredTextViewer viewer) {
+ this.viewer = viewer;
+ }
+
+ /**
+ * @return the contentAssistant
+ */
+ public IContentAssistant getContentAssistant() {
+ return contentAssistant;
+ }
+
+ /**
+ * @param contentAssistant the contentAssistant to set
+ */
+ public void setContentAssistant(IContentAssistant contentAssistant) {
+ this.contentAssistant = contentAssistant;
+ }
+
+ /**
+ * @return the document
+ */
+ public IDocument getDocument() {
+ return document;
+ }
+
+ /**
+ * @param document the document to set
+ */
+ public void setDocument(IDocument document) {
+ this.document = document;
+ }
+}
\ No newline at end of file
Property changes on: trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 5 months
JBoss Tools SVN: r26640 - trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-11-16 15:34:16 -0500 (Tue, 16 Nov 2010)
New Revision: 26640
Modified:
trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util/WorkbenchUtils.java
Log:
https://jira.jboss.org/browse/JBIDE-7440 Between build #79 and #80, 874 tests disappeared
public static IEditorPart openEditor(IPath inputFile) added to the class
Modified: trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util/WorkbenchUtils.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util/WorkbenchUtils.java 2010-11-16 20:31:23 UTC (rev 26639)
+++ trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util/WorkbenchUtils.java 2010-11-16 20:34:16 UTC (rev 26640)
@@ -17,6 +17,7 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.preference.PreferenceDialog;
import org.eclipse.jface.preference.PreferenceManager;
@@ -91,9 +92,13 @@
}
public static IEditorPart openEditor(String inputFile) {
+ return openEditor(new Path(inputFile));
+ }
+
+ public static IEditorPart openEditor(IPath inputFile) {
IEditorPart part = null;
try {
- part = IDE.openEditor(getWorkbenchActivePage(),ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(inputFile)));
+ part = IDE.openEditor(getWorkbenchActivePage(),ResourcesPlugin.getWorkspace().getRoot().getFile(inputFile));
} catch (PartInitException e) {
e.printStackTrace();
}
15 years, 5 months
JBoss Tools SVN: r26639 - in trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest: jobs and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: elvisisking
Date: 2010-11-16 15:31:23 -0500 (Tue, 16 Nov 2010)
New Revision: 26639
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.properties
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/jobs/PublishJob.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishPage.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishWizard.java
Log:
JBDS-1402 Cannot enter the ModeShape workspace path. The ModeShape workspace area is a path segment that is prepended to the resource project path. The workspace area is configurable in ModeShape. For beta 2 I'm putting a textfield in the PublishingWizard to allow the user to put in the area.
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.java 2010-11-16 19:36:50 UTC (rev 26638)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.java 2010-11-16 20:31:23 UTC (rev 26639)
@@ -126,6 +126,9 @@
public static I18n publishPageWorkspaceLabel;
public static I18n publishPageWorkspacePublishToolTip;
public static I18n publishPageWorkspaceUnpublishToolTip;
+ public static I18n publishPageWorkspaceAreaLabel;
+ public static I18n publishPageWorkspaceAreaToolTip;
+ public static I18n publishPageFinishedErrorMsg;
public static I18n publishWizardPublishErrorMsg;
public static I18n publishWizardPublishTitle;
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.properties
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.properties 2010-11-16 19:36:50 UTC (rev 26638)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.properties 2010-11-16 20:31:23 UTC (rev 26639)
@@ -118,6 +118,9 @@
publishPageWorkspaceLabel = Workspace:
publishPageWorkspacePublishToolTip = The workspace where the resources are being published
publishPageWorkspaceUnpublishToolTip = The workspace where the resources are being unpublished
+publishPageWorkspaceAreaLabel = Workspace Area:
+publishPageWorkspaceAreaToolTip = Enter a ModeShape workspace path segment to prepend to each resource project path
+publishPageFinishedErrorMsg = Unexpected error in PublishPage after successfully finishing the publishing wizard.
publishWizardPublishErrorMsg = Error Publishing
publishWizardPublishTitle = Publish
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/jobs/PublishJob.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/jobs/PublishJob.java 2010-11-16 19:36:50 UTC (rev 26638)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/jobs/PublishJob.java 2010-11-16 20:31:23 UTC (rev 26639)
@@ -105,6 +105,11 @@
*/
private final Workspace workspace;
+ /**
+ * The path segment prepended to the resource project path (never <code>null</code> but can be empty)
+ */
+ private final String workspaceArea;
+
// ===========================================================================================================================
// Constructors
// ===========================================================================================================================
@@ -113,10 +118,12 @@
* @param type the job type (never <code>null</code>)
* @param files the files being published or unpublished (never <code>null</code>)
* @param workspace the workspace to use when publishing or unpublishing (never <code>null</code>)
+ * @param workspaceArea the path segment prepended to the file project path (maybe be <code>null</code> or empty)
*/
public PublishJob( Type type,
List<IFile> files,
- Workspace workspace ) {
+ Workspace workspace,
+ String workspaceArea ) {
super(getJobName(type, JOB_ID.incrementAndGet()));
CheckArg.isNotNull(files, "files");
@@ -126,7 +133,16 @@
this.files = files;
this.workspace = workspace;
this.jobId = JOB_ID.get();
+
+ // setup the workspace area and remove trailing separator if necessary
+ String temp = ((workspaceArea == null) ? "" : workspaceArea);
+ if (temp.endsWith(File.separator)) {
+ this.workspaceArea = temp.substring(0, (temp.length() - 1));
+ } else {
+ this.workspaceArea = temp;
+ }
+
setUser(true); // allow user to run in background
}
@@ -184,16 +200,16 @@
// write initial message to console
if (isPublishing()) {
ModeShapeMessageConsole.writeln(RestClientI18n.publishJobPublish.text(this.jobId,
- serverUrl,
- repositoryName,
- workspaceName,
- fileCount));
+ serverUrl,
+ repositoryName,
+ workspaceName,
+ fileCount));
} else {
ModeShapeMessageConsole.writeln(RestClientI18n.publishJobUnpublish.text(this.jobId,
- serverUrl,
- repositoryName,
- workspaceName,
- fileCount));
+ serverUrl,
+ repositoryName,
+ workspaceName,
+ fileCount));
}
PublishedResourceHelper resourceHelper = new PublishedResourceHelper(getServerManager());
@@ -206,7 +222,7 @@
}
File file = eclipseFile.getLocation().toFile();
- String path = eclipseFile.getParent().getFullPath().toString();
+ String path = this.workspaceArea + eclipseFile.getParent().getFullPath().toString();
Status status = null;
if (isPublishing()) {
@@ -278,14 +294,14 @@
if (canceled) {
if (isPublishing()) {
ModeShapeMessageConsole.writeln(RestClientI18n.publishJobPublishCanceledMsg.text(this.jobId,
- numProcessed,
- this.files.size(),
- duration));
+ numProcessed,
+ this.files.size(),
+ duration));
} else {
ModeShapeMessageConsole.writeln(RestClientI18n.publishJobUnpublishCanceledMsg.text(this.jobId,
- numProcessed,
- this.files.size(),
- duration));
+ numProcessed,
+ this.files.size(),
+ duration));
}
} else {
if (isPublishing()) {
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishPage.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishPage.java 2010-11-16 19:36:50 UTC (rev 26638)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishPage.java 2010-11-16 20:31:23 UTC (rev 26639)
@@ -41,6 +41,7 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.help.IWorkbenchHelpSystem;
import org.jboss.tools.modeshape.rest.Activator;
import org.jboss.tools.modeshape.rest.IServerRegistryListener;
@@ -67,10 +68,20 @@
// ===========================================================================================================================
/**
+ * The default repository workspace area where files are published.
+ */
+ private static final String DEFAULT_WORKSPACE_AREA = "/files";
+
+ /**
* The key in the wizard <code>IDialogSettings</code> for the recurse flag.
*/
private static final String RECURSE_KEY = "recurse";
+ /**
+ * The key in the wizard <code>IDialogSettings</code> for the workspace area path segment.
+ */
+ private static final String WORKSPACE_AREA_KEY = "workspaceArea";
+
// ===========================================================================================================================
// Class Fields
// ===========================================================================================================================
@@ -289,9 +300,9 @@
private org.eclipse.swt.widgets.List lstResources;
/**
- * The flag indicating if child containers should be traversed.
+ * Indicates if resources should be found recursively.
*/
- private boolean recurse;
+ private boolean recurse = true;
/**
* A collection of repositories for the selected server (never <code>null</code>).
@@ -334,6 +345,11 @@
private Workspace workspace;
/**
+ * The path segment prepended to the resource project path.
+ */
+ private String workspaceArea;
+
+ /**
* A collection of workspaces for the selected server repository (never <code>null</code>).
*/
private List<Workspace> workspaces;
@@ -375,6 +391,7 @@
// row 1: label combobox button
// row 2: label combobox
// row 3: label combobox
+ // row 4: label textbox
{ // row 1: server row
Composite pnlServer = new Composite(pnl, SWT.NONE);
@@ -450,6 +467,32 @@
this.cbxWorkspace.setToolTipText(RestClientI18n.publishPageWorkspaceUnpublishToolTip.text());
}
}
+
+ { // row 4: workspace area
+ Label lblWorkspaceArea = new Label(pnl, SWT.LEFT);
+ lblWorkspaceArea.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ lblWorkspaceArea.setText(RestClientI18n.publishPageWorkspaceAreaLabel.text());
+
+ Text txtWorkspaceArea = new Text(pnl, SWT.BORDER);
+ txtWorkspaceArea.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ txtWorkspaceArea.setToolTipText(RestClientI18n.publishPageWorkspaceAreaToolTip.text());
+ txtWorkspaceArea.addModifyListener(new ModifyListener() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
+ */
+ @Override
+ public void modifyText( ModifyEvent e ) {
+ handleWorkspaceAreaModified(((Text)e.widget).getText());
+ }
+ });
+
+ // set the workspace area from the dialog settings
+ String temp = getDialogSettings().get(WORKSPACE_AREA_KEY);
+ this.workspaceArea = ((temp == null) ? DEFAULT_WORKSPACE_AREA : temp);
+ txtWorkspaceArea.setText(this.workspaceArea);
+ }
}
private void constructResourcesPanel( Composite parent ) {
@@ -500,10 +543,16 @@
}
{ // row 3
- final Button chkRecurse = new Button(pnl, SWT.CHECK);
+ Button chkRecurse = new Button(pnl, SWT.CHECK);
chkRecurse.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
chkRecurse.setText(RestClientI18n.publishPageRecurseCheckBox.text());
chkRecurse.setToolTipText(RestClientI18n.publishPageRecurseCheckBoxToolTip.text());
+
+ // set the recurse flag based on dialog settings
+ if (getDialogSettings().get(RECURSE_KEY) != null) {
+ this.recurse = getDialogSettings().getBoolean(RECURSE_KEY);
+ }
+
chkRecurse.setSelection(this.recurse);
chkRecurse.addSelectionListener(new SelectionAdapter() {
/**
@@ -513,7 +562,7 @@
*/
@Override
public void widgetSelected( SelectionEvent e ) {
- handleRecurseChanged(chkRecurse.getSelection());
+ handleRecurseChanged(((Button)e.widget).getSelection());
}
});
@@ -527,7 +576,7 @@
@Override
public void widgetSelected( SelectionEvent e ) {
updateInitialMessage();
- chkRecurse.removeSelectionListener(this);
+ ((Button)e.widget).removeSelectionListener(this);
}
});
}
@@ -574,23 +623,11 @@
/**
* @return the files to publish or unpublish (never <code>null</code>)
*/
- public List<IFile> getFiles() {
+ List<IFile> getFiles() {
return this.files;
}
/**
- * Updates the initial page message.
- */
- void updateInitialMessage() {
- String msg = ((this.type == Type.PUBLISH) ? RestClientI18n.publishPagePublishOkStatusMsg.text()
- : RestClientI18n.publishPageUnpublishOkStatusMsg.text());
-
- if (msg.equals(getMessage())) {
- updateState();
- }
- }
-
- /**
* @return the server manager obtained from the wizard
*/
private ServerManager getServerManager() {
@@ -600,19 +637,25 @@
/**
* @return thw workspace to use when publishing or unpublishing (page must be complete)
*/
- public Workspace getWorkspace() {
+ Workspace getWorkspace() {
assert isPageComplete();
return this.workspace;
}
/**
+ * @return the path segment prepended to the resource project path (never <code>null</code> but can be empty)
+ */
+ String getWorkspaceArea() {
+ return this.workspaceArea;
+ }
+
+ /**
* Saves the recurse setting and reloads the files to be published or unpublished.
*
* @param selected the flag indicating the new recurse setting
*/
void handleRecurseChanged( boolean selected ) {
this.recurse = selected;
- saveRecurseSetting();
try {
this.files = processResources(this.resources, isRecursing(), filter);
@@ -665,8 +708,17 @@
}
/**
- * Handler for when the workspace control value is modified
+ * Handler for when the workspace area value is modified.
+ *
+ * @param workspaceArea the new workspace area (never <code>null</code>)
*/
+ void handleWorkspaceAreaModified( String workspaceArea ) {
+ this.workspaceArea = workspaceArea.trim();
+ }
+
+ /**
+ * Handler for when the workspace control value is modified.
+ */
void handleWorkspaceModified() {
int index = this.cbxWorkspace.getSelectionIndex();
@@ -679,17 +731,10 @@
}
/**
- * @return the flag indicating if resources found recursively under projects and folders should also be published or
- * unpublished
+ * @return <code>true</code> if resources found recursively under projects and folders should also be published or unpublished
*/
- protected boolean isRecursing() {
- boolean recurse = true;
-
- if (getDialogSettings().get(RECURSE_KEY) != null) {
- recurse = getDialogSettings().getBoolean(RECURSE_KEY);
- }
-
- return recurse;
+ boolean isRecursing() {
+ return this.recurse;
}
/**
@@ -874,15 +919,8 @@
}
/**
- * Saves the current recurse value to the wizard <code>IDialogSettings</code>.
- */
- protected void saveRecurseSetting() {
- getDialogSettings().put(RECURSE_KEY, this.recurse);
- }
-
- /**
* {@inheritDoc}
- *
+ *
* @see org.jboss.tools.modeshape.rest.IServerRegistryListener#serverRegistryChanged(org.jboss.tools.modeshape.rest.ServerRegistryEvent)
*/
@Override
@@ -932,17 +970,26 @@
public void setWizard( IWizard newWizard ) {
super.setWizard(newWizard);
- // need to make sure the wizard has been set on the page since the recurse value is saved in the wizard dialog settings
- this.recurse = isRecursing();
-
try {
- this.files = processResources(this.resources, this.recurse, this.filter);
+ this.files = processResources(this.resources, isRecursing(), this.filter);
} catch (CoreException e) {
Activator.getDefault().log(new Status(Severity.ERROR, RestClientI18n.publishPageRecurseProcessingErrorMsg.text(), e));
}
}
/**
+ * Updates the initial page message.
+ */
+ void updateInitialMessage() {
+ String msg = ((this.type == Type.PUBLISH) ? RestClientI18n.publishPagePublishOkStatusMsg.text()
+ : RestClientI18n.publishPageUnpublishOkStatusMsg.text());
+
+ if (msg.equals(getMessage())) {
+ updateState();
+ }
+ }
+
+ /**
* Updates message, message icon, and OK button enablement based on validation results
*/
void updateState() {
@@ -997,4 +1044,13 @@
this.status = new Status(severity, msg, null);
}
+ /**
+ * Processing done after wizard is finished. Wizard was not canceled.
+ */
+ void wizardFinished() {
+ // update dialog settings
+ getDialogSettings().put(RECURSE_KEY, this.recurse);
+ getDialogSettings().put(WORKSPACE_AREA_KEY, this.workspaceArea);
+ }
+
}
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishWizard.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishWizard.java 2010-11-16 19:36:50 UTC (rev 26638)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishWizard.java 2010-11-16 20:31:23 UTC (rev 26639)
@@ -24,6 +24,8 @@
import org.jboss.tools.modeshape.rest.jobs.PublishJob;
import org.jboss.tools.modeshape.rest.jobs.PublishJob.Type;
import org.modeshape.common.util.CheckArg;
+import org.modeshape.web.jcr.rest.client.Status;
+import org.modeshape.web.jcr.rest.client.Status.Severity;
import org.modeshape.web.jcr.rest.client.domain.Workspace;
/**
@@ -127,9 +129,19 @@
*/
@Override
public boolean performFinish() {
+ // let page know that wizard finished and was not canceled
+ try {
+ this.page.wizardFinished();
+ } catch (Exception e) {
+ // don't let this error stop the publishing operation
+ Activator.getDefault().log(new Status(Severity.ERROR, RestClientI18n.publishPageFinishedErrorMsg.text(), e));
+ }
+
+ // run publish job
Workspace workspace = this.page.getWorkspace();
List<IFile> files = this.page.getFiles();
- PublishJob job = new PublishJob(this.type, files, workspace);
+ String workspaceArea = this.page.getWorkspaceArea();
+ PublishJob job = new PublishJob(this.type, files, workspace, workspaceArea);
job.schedule();
return true;
15 years, 5 months
JBoss Tools SVN: r26638 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-16 14:36:50 -0500 (Tue, 16 Nov 2010)
New Revision: 26638
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysWizard.java
Removed:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeys.java
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage2.java
Log:
[JBIDE-7597] renamed ManageKeys to ManageKeysWizard since it is a wizard
Deleted: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeys.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeys.java 2010-11-16 19:30:38 UTC (rev 26637)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeys.java 2010-11-16 19:36:50 UTC (rev 26638)
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is 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:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.internal.deltacloud.ui.wizards;
-
-import org.eclipse.jface.wizard.Wizard;
-import org.jboss.tools.deltacloud.core.DeltaCloud;
-
-public class ManageKeys extends Wizard {
-
- private DeltaCloud cloud;
- private String fileExtension;
- private ManageKeysPage mainPage;
- private String keyname;
-
- public ManageKeys(DeltaCloud cloud, String fileExtension) {
- this.cloud = cloud;
- this.fileExtension = fileExtension;
- }
-
- public String getKeyName() {
- return keyname;
- }
-
- @Override
- public void addPages() {
- mainPage = new ManageKeysPage(cloud, fileExtension);
- addPage(mainPage);
- }
-
- @Override
- public boolean canFinish() {
- return mainPage.isPageComplete();
- }
-
- @Override
- public boolean performFinish() {
- String currFile = mainPage.getCurrFile();
- keyname = currFile.substring(0, currFile.length() - fileExtension.length());
- return true;
- }
-
-}
Copied: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysWizard.java (from rev 26563, trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeys.java)
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysWizard.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysWizard.java 2010-11-16 19:36:50 UTC (rev 26638)
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.internal.deltacloud.ui.wizards;
+
+import org.eclipse.jface.wizard.Wizard;
+import org.jboss.tools.deltacloud.core.DeltaCloud;
+
+public class ManageKeysWizard extends Wizard {
+
+ private DeltaCloud cloud;
+ private String fileExtension;
+ private ManageKeysPage mainPage;
+ private String keyname;
+
+ public ManageKeysWizard(DeltaCloud cloud, String fileExtension) {
+ this.cloud = cloud;
+ this.fileExtension = fileExtension;
+ }
+
+ public String getKeyName() {
+ return keyname;
+ }
+
+ @Override
+ public void addPages() {
+ mainPage = new ManageKeysPage(cloud, fileExtension);
+ addPage(mainPage);
+ }
+
+ @Override
+ public boolean canFinish() {
+ return mainPage.isPageComplete();
+ }
+
+ @Override
+ public boolean performFinish() {
+ String currFile = mainPage.getCurrFile();
+ keyname = currFile.substring(0, currFile.length() - fileExtension.length());
+ return true;
+ }
+
+}
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysWizard.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java 2010-11-16 19:30:38 UTC (rev 26637)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java 2010-11-16 19:36:50 UTC (rev 26638)
@@ -99,7 +99,7 @@
public void widgetSelected(SelectionEvent event) {
Shell shell = getShell();
- ManageKeys wizard = new ManageKeys(cloud, ".pem"); //$NON-NLS-1$
+ ManageKeysWizard wizard = new ManageKeysWizard(cloud, ".pem"); //$NON-NLS-1$
WizardDialog dialog = new CustomWizardDialog(shell, wizard,
IDialogConstants.OK_LABEL);
dialog.create();
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage2.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage2.java 2010-11-16 19:30:38 UTC (rev 26637)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage2.java 2010-11-16 19:36:50 UTC (rev 26638)
@@ -110,7 +110,7 @@
public void widgetSelected(SelectionEvent event) {
Shell shell = getShell();
- ManageKeys wizard = new ManageKeys(cloud, ".pem"); //$NON-NLS-1$
+ ManageKeysWizard wizard = new ManageKeysWizard(cloud, ".pem"); //$NON-NLS-1$
WizardDialog dialog = new CustomWizardDialog(shell, wizard,
IDialogConstants.OK_LABEL);
dialog.create();
15 years, 5 months