JBoss Tools SVN: r37742 - in trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test: src/org/jboss/tools/portlet/ui/bot/test/tmp and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2012-01-10 08:20:43 -0500 (Tue, 10 Jan 2012)
New Revision: 37742
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/META-INF/MANIFEST.MF
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/tmp/TmpTest.java
Log:
New temporary test case
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/META-INF/MANIFEST.MF 2012-01-10 13:13:30 UTC (rev 37741)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/META-INF/MANIFEST.MF 2012-01-10 13:20:43 UTC (rev 37742)
@@ -20,3 +20,4 @@
org.eclipse.wst.jsdt.web.core;bundle-version="1.0.401",
org.eclipse.wst.jsdt.web.support.jsp;bundle-version="1.0.400",
org.eclipse.wst.jsdt.web.ui;bundle-version="1.0.401"
+Import-Package: org.eclipse.jst.j2ee.internal.plugin
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/tmp/TmpTest.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/tmp/TmpTest.java 2012-01-10 13:13:30 UTC (rev 37741)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/tmp/TmpTest.java 2012-01-10 13:20:43 UTC (rev 37742)
@@ -1,15 +1,26 @@
package org.jboss.tools.portlet.ui.bot.test.tmp;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jst.j2ee.internal.plugin.IJ2EEModuleConstants;
+import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin;
import org.jboss.tools.portlet.ui.bot.test.testcase.SWTTaskBasedTestCase;
import org.jboss.tools.ui.bot.ext.config.Annotations.DB;
import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
import org.junit.Test;
+import org.osgi.framework.Bundle;
@Require(db=@DB)
public class TmpTest extends SWTTaskBasedTestCase {
@Test
public void testTmp() throws InterruptedException{
+ @SuppressWarnings("restriction")
+ String pluginId = J2EEPlugin.getPlugin().getPluginID();
+ System.out.println("Plugin id: " + pluginId);
+ Bundle bundle = Platform.getBundle(pluginId);
+ System.out.println("Location: " + bundle.getLocation());
+ System.out.println("Jar ext: " + IJ2EEModuleConstants.JAR_EXT);
+ System.out.println("Comparison: " + bundle.getLocation().endsWith(IJ2EEModuleConstants.JAR_EXT));
System.out.println();
Thread.sleep(60 * 60 * 1000);
}
12 years, 11 months
JBoss Tools SVN: r37741 - in trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard: appimport and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-01-10 08:13:30 -0500 (Tue, 10 Jan 2012)
New Revision: 37741
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ConfigureGitSharedProject.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ConfigureUnsharedProject.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ImportNewProject.java
Removed:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/AddToExistingProjectOperation.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ImportNewProjectOperation.java
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardModel.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ImportProjectWizardModel.java
Log:
[JBIDE-10479] renamed AddToExistingProjectOperation -> ConfigureUnsharedProject, added ConfigureGitSharedProject
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardModel.java 2012-01-10 13:04:24 UTC (rev 37740)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardModel.java 2012-01-10 13:13:30 UTC (rev 37741)
@@ -78,7 +78,7 @@
}
public IApplication createApplication(String name, ICartridge cartridge, IProgressMonitor monitor) throws OpenShiftException {
- monitor.subTask("creating application...");
+// monitor.subTask("creating application...");
IApplication application = getUser().createApplication(name, cartridge);
waitForAccessible(application, monitor);
return application;
@@ -89,7 +89,7 @@
}
private void waitForAccessible(IApplication application, IProgressMonitor monitor) throws OpenShiftApplicationNotAvailableException, OpenShiftException {
- monitor.subTask("waiting for application to become accessible...");
+// monitor.subTask("waiting for application to become accessible...");
if (!application.waitForAccessible(APP_CREATION_TIMEOUT * 1000)) {
throw new OpenShiftApplicationNotAvailableException(NLS.bind(
OpenShiftExpressUIMessages.HOSTNAME_NOT_ANSWERING,
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationWizardPage.java 2012-01-10 13:04:24 UTC (rev 37740)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationWizardPage.java 2012-01-10 13:13:30 UTC (rev 37741)
@@ -169,7 +169,7 @@
public boolean createApplication() {
final DelegatingProgressMonitor delegatingMonitor = new DelegatingProgressMonitor();
- Job job = new Job(NLS.bind("New application {0}", wizardModel.getName())) {
+ Job job = new Job(NLS.bind("Creating new application {0}", wizardModel.getName())) {
@Override
protected IStatus run(IProgressMonitor monitor) {
@@ -184,6 +184,8 @@
return OpenShiftUIActivator.createErrorStatus(
"Could not create application \"{0}\"",
(Throwable) e, wizardModel.getName());
+ } finally {
+ delegatingMonitor.done();
}
}
};
@@ -191,6 +193,7 @@
Future<IStatus> jobResult = WizardUtils.runInWizard(job, delegatingMonitor, getContainer());
return JobUtils.isOk(jobResult.get(10, TimeUnit.SECONDS));
} catch (Exception e) {
+ OpenShiftUIActivator.log(e);
return false;
}
}
Deleted: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/AddToExistingProjectOperation.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/AddToExistingProjectOperation.java 2012-01-10 13:04:24 UTC (rev 37740)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/AddToExistingProjectOperation.java 2012-01-10 13:13:30 UTC (rev 37741)
@@ -1,166 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.openshift.express.internal.ui.wizard.appimport;
-
-import java.io.File;
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.net.MalformedURLException;
-import java.net.URISyntaxException;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.transport.URIish;
-import org.eclipse.osgi.util.NLS;
-import org.jboss.ide.eclipse.as.core.util.FileUtil;
-import org.jboss.tools.openshift.egit.core.EGitUtils;
-import org.jboss.tools.openshift.egit.core.GitIgnore;
-import org.jboss.tools.openshift.express.internal.ui.utils.FileUtils;
-
-import com.openshift.express.client.IApplication;
-import com.openshift.express.client.IUser;
-import com.openshift.express.client.OpenShiftException;
-
-/**
- * @author André Dietisheim <adietish(a)redhat.com>
- */
-public class AddToExistingProjectOperation extends AbstractImportApplicationOperation {
-
- public AddToExistingProjectOperation(String projectName, IApplication application, String remoteName,
- IUser user) {
- super(projectName, application, remoteName);
- }
-
- /**
- * Enables the user chosen project to be used on the chosen OpenShift
- * application. Clones the application git repository, copies the
- * configuration files to the user project (in the workspace), shares the
- * user project with git and creates the server adapter.
- *
- * @param monitor
- * the monitor to report progress to
- * @return
- * @throws URISyntaxException
- * The OpenShift application repository could not be cloned,
- * because the uri it is located at is not a valid git uri
- * @throws OpenShiftException
- *
- * @throws InvocationTargetException
- * The OpenShift application repository could not be cloned, the
- * clone operation failed.
- * @throws InterruptedException
- * The OpenShift application repository could not be cloned, the
- * clone operation was interrupted.
- * @throws IOException
- * The configuration files could not be copied from the git
- * clone to the user project
- * @throws CoreException
- * The user project could not be shared with the git
- *
- * @see #cloneRepository
- * @see #copyOpenshiftConfiguration
- * @see #shareProject
- * @see #createServerAdapterIfRequired
- */
- @Override
- public List<IProject> execute(IProgressMonitor monitor)
- throws OpenShiftException, InvocationTargetException, InterruptedException, IOException, CoreException,
- URISyntaxException {
- // File repositoryFile =
- // model.cloneRepository(monitor);
- // model.importProject(repositoryFile, monitor);
- // Repository repository =
- // model.shareProject(monitor);
- // model.mergeWithApplicationRepository(repository,
- // monitor);
- File tmpFolder = FileUtils.getRandomTmpFolder();
- File repositoryFile = cloneRepository(getApplication(), getRemoteName(), tmpFolder, monitor);
- IProject project = getProject(getProjectName());
- copyOpenshiftConfigurations(repositoryFile, project, monitor);
- FileUtil.safeDelete(tmpFolder);
-
- shareProject(project, monitor);
- return Collections.singletonList(project);
- }
-
- private void shareProject(IProject project, IProgressMonitor monitor) throws CoreException {
- monitor.subTask(NLS.bind("Sharing project {0}...", project.getName()));
- EGitUtils.share(project, monitor);
- }
-
- /**
- * Copies the openshift configuration from the given source folder to the
- * given project. Copies
- * <ul>
- * <li>.git</li>
- * <li>.openshift</li>
- * <li>deployments</li>
- * <li>pom.xml</li>
- * </ul>
- * to the project in the workspace
- *
- * @param sourceFolder
- * the source to copy the openshift config from
- * @param project
- * the project to copy the configuration to.
- * @param monitor
- * the monitor to report progress to
- * @throws IOException
- */
- private void copyOpenshiftConfigurations(final File sourceFolder, IProject project, IProgressMonitor monitor)
- throws IOException {
- Assert.isLegal(project != null);
- File projectFolder = project.getLocation().toFile();
- monitor.subTask(NLS.bind("Copying openshift configuration to project {0}...", project.getName()));
- FileUtils.copy(new File(sourceFolder, ".git"), projectFolder, false);
- FileUtils.copy(new File(sourceFolder, ".openshift"), projectFolder, false);
- FileUtils.copy(new File(sourceFolder, "deployments"), projectFolder, false);
- FileUtils.copy(new File(sourceFolder, "pom.xml"), projectFolder, false);
- createGitIgnore(projectFolder);
- }
-
- /**
- * Creates the git ignore file with a predefined set of entries. An existing
- * .gitignore file is not overwritten, we then just dont do anything.
- *
- * @param projectFolder
- * @throws IOException
- */
- private void createGitIgnore(File projectFolder) throws IOException {
- GitIgnore gitIgnore = new GitIgnore(projectFolder);
- // TODO: merge existing .gitignore
- // (https://issues.jboss.org/browse/JBIDE-10391)
- if (gitIgnore.exists()) {
- return;
- }
- gitIgnore.add("target")
- .add(".settings")
- .add(".project")
- .add(".classpath")
- .add(".factorypath");
- gitIgnore.write(false);
- }
-
- @SuppressWarnings("unused")
- private void mergeWithApplicationRepository(Repository repository, IApplication application,
- IProgressMonitor monitor)
- throws MalformedURLException, URISyntaxException, IOException, OpenShiftException, CoreException,
- InvocationTargetException {
- URIish uri = new URIish(application.getGitUri());
- EGitUtils.addRemoteTo("openshift", uri, repository);
- EGitUtils.mergeWithRemote(uri, "refs/remotes/openshift/HEAD", repository, monitor);
- }
-}
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ConfigureGitSharedProject.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ConfigureGitSharedProject.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ConfigureGitSharedProject.java 2012-01-10 13:13:30 UTC (rev 37741)
@@ -0,0 +1,142 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.openshift.express.internal.ui.wizard.appimport;
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jgit.lib.Repository;
+import org.eclipse.jgit.transport.URIish;
+import org.eclipse.osgi.util.NLS;
+import org.jboss.ide.eclipse.as.core.util.FileUtil;
+import org.jboss.tools.openshift.egit.core.EGitUtils;
+import org.jboss.tools.openshift.egit.core.GitIgnore;
+import org.jboss.tools.openshift.express.internal.ui.utils.FileUtils;
+
+import com.openshift.express.client.IApplication;
+import com.openshift.express.client.IUser;
+import com.openshift.express.client.OpenShiftException;
+
+/**
+ * @author André Dietisheim <adietish(a)redhat.com>
+ */
+public class ConfigureGitSharedProject extends AbstractImportApplicationOperation {
+
+ public ConfigureGitSharedProject(String projectName, IApplication application, String remoteName,
+ IUser user) {
+ super(projectName, application, remoteName);
+ }
+
+ /**
+ * Enables the user chosen project to be used on the chosen OpenShift
+ * application. Clones the application git repository, copies the
+ * configuration files to the user project (in the workspace), shares the
+ * user project with git and creates the server adapter.
+ *
+ * @param monitor
+ * the monitor to report progress to
+ * @return
+ * @throws URISyntaxException
+ * The OpenShift application repository could not be cloned,
+ * because the uri it is located at is not a valid git uri
+ * @throws OpenShiftException
+ *
+ * @throws InvocationTargetException
+ * The OpenShift application repository could not be cloned, the
+ * clone operation failed.
+ * @throws InterruptedException
+ * The OpenShift application repository could not be cloned, the
+ * clone operation was interrupted.
+ * @throws IOException
+ * The configuration files could not be copied from the git
+ * clone to the user project
+ * @throws CoreException
+ * The user project could not be shared with the git
+ *
+ * @see #cloneRepository
+ * @see #copyOpenshiftConfiguration
+ * @see #shareProject
+ * @see #createServerAdapterIfRequired
+ */
+ @Override
+ public List<IProject> execute(IProgressMonitor monitor)
+ throws OpenShiftException, InvocationTargetException, InterruptedException, IOException, CoreException,
+ URISyntaxException {
+ IProject project = getProject(getProjectName());
+ Assert.isTrue(EGitUtils.isSharedWithGit(project));
+
+ File tmpFolder = FileUtils.getRandomTmpFolder();
+ File repositoryFile = cloneRepository(getApplication(), getRemoteName(), tmpFolder, monitor);
+ copyOpenshiftConfigurations(repositoryFile, project, monitor);
+ FileUtil.safeDelete(tmpFolder);
+
+ return Collections.singletonList(project);
+ }
+
+ /**
+ * Copies the openshift configuration from the given source folder to the
+ * given project. Copies
+ * <ul>
+ * <li>.openshift</li>
+ * <li>deployments</li>
+ * <li>pom.xml</li>
+ * </ul>
+ * to the project in the workspace
+ *
+ * @param sourceFolder
+ * the source to copy the openshift config from
+ * @param project
+ * the project to copy the configuration to.
+ * @param monitor
+ * the monitor to report progress to
+ * @throws IOException
+ */
+ private void copyOpenshiftConfigurations(final File sourceFolder, IProject project, IProgressMonitor monitor)
+ throws IOException {
+ Assert.isLegal(project != null);
+ File projectFolder = project.getLocation().toFile();
+ monitor.subTask(NLS.bind("Copying openshift configuration to project {0}...", project.getName()));
+ FileUtils.copy(new File(sourceFolder, ".openshift"), projectFolder, false);
+ FileUtils.copy(new File(sourceFolder, "deployments"), projectFolder, false);
+ createGitIgnore(projectFolder);
+ }
+
+ /**
+ * Creates the git ignore file with a predefined set of entries. An existing
+ * .gitignore file is not overwritten, we then just dont do anything.
+ *
+ * @param projectFolder
+ * @throws IOException
+ */
+ private void createGitIgnore(File projectFolder) throws IOException {
+ GitIgnore gitIgnore = new GitIgnore(projectFolder);
+ // TODO: merge existing .gitignore
+ // (https://issues.jboss.org/browse/JBIDE-10391)
+ if (gitIgnore.exists()) {
+ return;
+ }
+ gitIgnore.add("target")
+ .add(".settings")
+ .add(".project")
+ .add(".classpath")
+ .add(".factorypath");
+ gitIgnore.write(false);
+ }
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ConfigureGitSharedProject.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ConfigureUnsharedProject.java (from rev 37726, trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/AddToExistingProjectOperation.java)
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ConfigureUnsharedProject.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ConfigureUnsharedProject.java 2012-01-10 13:13:30 UTC (rev 37741)
@@ -0,0 +1,162 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.openshift.express.internal.ui.wizard.appimport;
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.net.URISyntaxException;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osgi.util.NLS;
+import org.jboss.ide.eclipse.as.core.util.FileUtil;
+import org.jboss.tools.openshift.egit.core.EGitUtils;
+import org.jboss.tools.openshift.egit.core.GitIgnore;
+import org.jboss.tools.openshift.express.internal.ui.utils.FileUtils;
+
+import com.openshift.express.client.IApplication;
+import com.openshift.express.client.IUser;
+import com.openshift.express.client.OpenShiftException;
+
+/**
+ * @author André Dietisheim <adietish(a)redhat.com>
+ */
+public class ConfigureUnsharedProject extends AbstractImportApplicationOperation {
+
+ public ConfigureUnsharedProject(String projectName, IApplication application, String remoteName,
+ IUser user) {
+ super(projectName, application, remoteName);
+ }
+
+ /**
+ * Enables the user chosen project to be used on the chosen OpenShift
+ * application. Clones the application git repository, copies the
+ * configuration files to the user project (in the workspace), shares the
+ * user project with git and creates the server adapter.
+ *
+ * @param monitor
+ * the monitor to report progress to
+ * @return
+ * @throws URISyntaxException
+ * The OpenShift application repository could not be cloned,
+ * because the uri it is located at is not a valid git uri
+ * @throws OpenShiftException
+ *
+ * @throws InvocationTargetException
+ * The OpenShift application repository could not be cloned, the
+ * clone operation failed.
+ * @throws InterruptedException
+ * The OpenShift application repository could not be cloned, the
+ * clone operation was interrupted.
+ * @throws IOException
+ * The configuration files could not be copied from the git
+ * clone to the user project
+ * @throws CoreException
+ * The user project could not be shared with the git
+ *
+ * @see #cloneRepository
+ * @see #copyOpenshiftConfiguration
+ * @see #shareProject
+ * @see #createServerAdapterIfRequired
+ */
+ @Override
+ public List<IProject> execute(IProgressMonitor monitor)
+ throws OpenShiftException, InvocationTargetException, InterruptedException, IOException, CoreException,
+ URISyntaxException {
+ // File repositoryFile =
+ // model.cloneRepository(monitor);
+ // model.importProject(repositoryFile, monitor);
+ // Repository repository =
+ // model.shareProject(monitor);
+ // model.mergeWithApplicationRepository(repository,
+ // monitor);
+ File tmpFolder = FileUtils.getRandomTmpFolder();
+ File repositoryFile = cloneRepository(getApplication(), getRemoteName(), tmpFolder, monitor);
+ IProject project = getProject(getProjectName());
+ copyOpenshiftConfigurations(repositoryFile, project, monitor);
+ FileUtil.safeDelete(tmpFolder);
+
+ shareProject(project, monitor);
+ return Collections.singletonList(project);
+ }
+
+ private void shareProject(IProject project, IProgressMonitor monitor) throws CoreException {
+ monitor.subTask(NLS.bind("Sharing project {0}...", project.getName()));
+ EGitUtils.share(project, monitor);
+ }
+
+ /**
+ * Copies the openshift configuration from the given source folder to the
+ * given project. Copies
+ * <ul>
+ * <li>.git</li>
+ * <li>.openshift</li>
+ * <li>deployments</li>
+ * <li>pom.xml</li>
+ * </ul>
+ * to the project in the workspace
+ *
+ * @param sourceFolder
+ * the source to copy the openshift config from
+ * @param project
+ * the project to copy the configuration to.
+ * @param monitor
+ * the monitor to report progress to
+ * @throws IOException
+ */
+ private void copyOpenshiftConfigurations(final File sourceFolder, IProject project, IProgressMonitor monitor)
+ throws IOException {
+ Assert.isLegal(project != null);
+ File projectFolder = project.getLocation().toFile();
+ monitor.subTask(NLS.bind("Copying openshift configuration to project {0}...", project.getName()));
+ FileUtils.copy(new File(sourceFolder, ".git"), projectFolder, false);
+ FileUtils.copy(new File(sourceFolder, ".openshift"), projectFolder, false);
+ FileUtils.copy(new File(sourceFolder, "deployments"), projectFolder, false);
+ FileUtils.copy(new File(sourceFolder, "pom.xml"), projectFolder, false);
+ createGitIgnore(projectFolder);
+ }
+
+ /**
+ * Creates the git ignore file with a predefined set of entries. An existing
+ * .gitignore file is not overwritten, we then just dont do anything.
+ *
+ * @param projectFolder
+ * @throws IOException
+ */
+ private void createGitIgnore(File projectFolder) throws IOException {
+ GitIgnore gitIgnore = new GitIgnore(projectFolder);
+ // TODO: merge existing .gitignore
+ // (https://issues.jboss.org/browse/JBIDE-10391)
+ if (gitIgnore.exists()) {
+ return;
+ }
+ gitIgnore.add("target")
+ .add(".settings")
+ .add(".project")
+ .add(".classpath")
+ .add(".factorypath");
+ gitIgnore.write(false);
+ }
+
+// private void mergeWithApplicationRepository(Repository repository, IApplication application,
+// IProgressMonitor monitor)
+// throws MalformedURLException, URISyntaxException, IOException, OpenShiftException, CoreException,
+// InvocationTargetException {
+// URIish uri = new URIish(application.getGitUri());
+// EGitUtils.addRemoteTo("openshift", uri, repository);
+// EGitUtils.mergeWithRemote(uri, "refs/remotes/openshift/HEAD", repository, monitor);
+// }
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ConfigureUnsharedProject.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ImportNewProject.java (from rev 37719, trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ImportNewProjectOperation.java)
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ImportNewProject.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ImportNewProject.java 2012-01-10 13:13:30 UTC (rev 37741)
@@ -0,0 +1,138 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.openshift.express.internal.ui.wizard.appimport;
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jgit.lib.Repository;
+import org.eclipse.jgit.transport.URIish;
+import org.eclipse.osgi.util.NLS;
+import org.jboss.tools.openshift.egit.core.EGitUtils;
+import org.jboss.tools.openshift.express.internal.ui.ImportFailedException;
+import org.jboss.tools.openshift.express.internal.ui.WontOverwriteException;
+import org.jboss.tools.openshift.express.internal.ui.wizard.appimport.project.GeneralProjectImportOperation;
+import org.jboss.tools.openshift.express.internal.ui.wizard.appimport.project.MavenProjectImportOperation;
+
+import com.openshift.express.client.IApplication;
+import com.openshift.express.client.OpenShiftException;
+
+/**
+ * @author André Dietisheim <adietish(a)redhat.com>
+ */
+public class ImportNewProject extends AbstractImportApplicationOperation {
+
+ private File cloneDestination;
+
+ public ImportNewProject(String projectName, IApplication application, String remoteName,
+ File cloneDestination) {
+ super(projectName, application, remoteName);
+ this.cloneDestination = cloneDestination;
+ }
+
+ /**
+ * Imports the (new) project that the user has chosen into the workspace.
+ *
+ * @param monitor
+ * the monitor to report progress to
+ * @throws OpenShiftException
+ * @throws CoreException
+ * @throws InterruptedException
+ * @throws URISyntaxException
+ * @throws InvocationTargetException
+ */
+ public List<IProject> execute(IProgressMonitor monitor)
+ throws OpenShiftException, CoreException, InterruptedException, URISyntaxException,
+ InvocationTargetException {
+ if (cloneDestinationExists()) {
+ throw new WontOverwriteException(
+ NLS.bind("There's already a folder at {0}. The new OpenShift project would overwrite it. " +
+ "Please choose another destination to clone to.",
+ getCloneDestination().getAbsolutePath()));
+ }
+
+ File repositoryFolder =
+ cloneRepository(getApplication(), getRemoteName(), cloneDestination, monitor);
+ List<IProject> importedProjects = importProjectsFrom(repositoryFolder, monitor);
+ if (importedProjects.size() == 0) {
+ throw new ImportFailedException(
+ NLS.bind("Could not import project {0}. One of the possible reasons is that there's already a " +
+ "project in your workspace that matches the openshift application/maven name of the " +
+ "OpenShift application. " +
+ "Please rename your workspace project in that case and start over again."
+ , getProjectName()));
+ }
+
+ connectToGitRepo(importedProjects, repositoryFolder, monitor);
+ return importedProjects;
+ }
+
+ @SuppressWarnings("unused")
+ private void mergeWithApplicationRepository(Repository repository, IApplication application,
+ IProgressMonitor monitor)
+ throws MalformedURLException, URISyntaxException, IOException, OpenShiftException, CoreException,
+ InvocationTargetException {
+ URIish uri = new URIish(application.getGitUri());
+ EGitUtils.addRemoteTo("openshift", uri, repository);
+ EGitUtils.mergeWithRemote(uri, "refs/remotes/openshift/HEAD", repository, monitor);
+ }
+
+ /**
+ * Imports the projects that are within the given folder. Supports maven and
+ * general projects
+ *
+ * @param folder
+ * the folder the projects are located in
+ * @param monitor
+ * the monitor to report progress to
+ * @return
+ * @throws CoreException
+ * @throws InterruptedException
+ */
+ private List<IProject> importProjectsFrom(final File folder, IProgressMonitor monitor)
+ throws CoreException, InterruptedException {
+ MavenProjectImportOperation mavenImport = new MavenProjectImportOperation(folder);
+ List<IProject> importedProjects = Collections.emptyList();
+ if (mavenImport.isMavenProject()) {
+ importedProjects = mavenImport.importToWorkspace(monitor);
+ } else {
+ importedProjects = new GeneralProjectImportOperation(folder).importToWorkspace(monitor);
+ }
+ return importedProjects;
+ }
+
+ private void connectToGitRepo(List<IProject> projects, File projectFolder, IProgressMonitor monitor)
+ throws CoreException {
+ for (IProject project : projects) {
+ if (project != null) {
+ EGitUtils.connect(project, monitor);
+ }
+ }
+ }
+
+ protected File getCloneDestination() {
+ return cloneDestination;
+ }
+
+ protected boolean cloneDestinationExists() {
+ return cloneDestination != null
+ && cloneDestination.exists();
+ }
+
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ImportNewProject.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ImportNewProjectOperation.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ImportNewProjectOperation.java 2012-01-10 13:04:24 UTC (rev 37740)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ImportNewProjectOperation.java 2012-01-10 13:13:30 UTC (rev 37741)
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.openshift.express.internal.ui.wizard.appimport;
-
-import java.io.File;
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.net.MalformedURLException;
-import java.net.URISyntaxException;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.transport.URIish;
-import org.eclipse.osgi.util.NLS;
-import org.jboss.tools.openshift.egit.core.EGitUtils;
-import org.jboss.tools.openshift.express.internal.ui.ImportFailedException;
-import org.jboss.tools.openshift.express.internal.ui.WontOverwriteException;
-import org.jboss.tools.openshift.express.internal.ui.wizard.appimport.project.GeneralProjectImportOperation;
-import org.jboss.tools.openshift.express.internal.ui.wizard.appimport.project.MavenProjectImportOperation;
-
-import com.openshift.express.client.IApplication;
-import com.openshift.express.client.OpenShiftException;
-
-/**
- * @author André Dietisheim <adietish(a)redhat.com>
- */
-public class ImportNewProjectOperation extends AbstractImportApplicationOperation {
-
- private File cloneDestination;
-
- public ImportNewProjectOperation(String projectName, IApplication application, String remoteName,
- File cloneDestination) {
- super(projectName, application, remoteName);
- this.cloneDestination = cloneDestination;
- }
-
- /**
- * Imports the (new) project that the user has chosen into the workspace.
- *
- * @param monitor
- * the monitor to report progress to
- * @throws OpenShiftException
- * @throws CoreException
- * @throws InterruptedException
- * @throws URISyntaxException
- * @throws InvocationTargetException
- */
- public List<IProject> execute(IProgressMonitor monitor)
- throws OpenShiftException, CoreException, InterruptedException, URISyntaxException,
- InvocationTargetException {
- if (cloneDestinationExists()) {
- throw new WontOverwriteException(
- NLS.bind("There's already a folder at {0}. The new OpenShift project would overwrite it. " +
- "Please choose another destination to clone to.",
- getCloneDestination().getAbsolutePath()));
- }
-
- File repositoryFolder =
- cloneRepository(getApplication(), getRemoteName(), cloneDestination, monitor);
- List<IProject> importedProjects = importProjectsFrom(repositoryFolder, monitor);
- if (importedProjects.size() == 0) {
- throw new ImportFailedException(
- NLS.bind("Could not import project {0}. One of the possible reasons is that there's already a " +
- "project in your workspace that matches the openshift application/maven name of the " +
- "OpenShift application. " +
- "Please rename your workspace project in that case and start over again."
- , getProjectName()));
- }
-
- connectToGitRepo(importedProjects, repositoryFolder, monitor);
- return importedProjects;
- }
-
- @SuppressWarnings("unused")
- private void mergeWithApplicationRepository(Repository repository, IApplication application,
- IProgressMonitor monitor)
- throws MalformedURLException, URISyntaxException, IOException, OpenShiftException, CoreException,
- InvocationTargetException {
- URIish uri = new URIish(application.getGitUri());
- EGitUtils.addRemoteTo("openshift", uri, repository);
- EGitUtils.mergeWithRemote(uri, "refs/remotes/openshift/HEAD", repository, monitor);
- }
-
- /**
- * Imports the projects that are within the given folder. Supports maven and
- * general projects
- *
- * @param folder
- * the folder the projects are located in
- * @param monitor
- * the monitor to report progress to
- * @return
- * @throws CoreException
- * @throws InterruptedException
- */
- private List<IProject> importProjectsFrom(final File folder, IProgressMonitor monitor)
- throws CoreException, InterruptedException {
- MavenProjectImportOperation mavenImport = new MavenProjectImportOperation(folder);
- List<IProject> importedProjects = Collections.emptyList();
- if (mavenImport.isMavenProject()) {
- importedProjects = mavenImport.importToWorkspace(monitor);
- } else {
- importedProjects = new GeneralProjectImportOperation(folder).importToWorkspace(monitor);
- }
- return importedProjects;
- }
-
- private void connectToGitRepo(List<IProject> projects, File projectFolder, IProgressMonitor monitor)
- throws CoreException {
- for (IProject project : projects) {
- if (project != null) {
- EGitUtils.connect(project, monitor);
- }
- }
- }
-
- protected File getCloneDestination() {
- return cloneDestination;
- }
-
- protected boolean cloneDestinationExists() {
- return cloneDestination != null
- && cloneDestination.exists();
- }
-
-}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ImportProjectWizardModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ImportProjectWizardModel.java 2012-01-10 13:04:24 UTC (rev 37740)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ImportProjectWizardModel.java 2012-01-10 13:13:30 UTC (rev 37741)
@@ -65,7 +65,7 @@
*/
public void importProject(IProgressMonitor monitor) throws OpenShiftException, CoreException, InterruptedException,
URISyntaxException, InvocationTargetException {
- List<IProject> importedProjects = new ImportNewProjectOperation(getProjectName()
+ List<IProject> importedProjects = new ImportNewProject(getProjectName()
, getApplication()
, getRemoteName()
, getRepositoryFile())
@@ -101,7 +101,7 @@
public void addToExistingProject(IProgressMonitor monitor)
throws OpenShiftException, InvocationTargetException, InterruptedException, IOException, CoreException,
URISyntaxException {
- List<IProject> importedProjects = new AddToExistingProjectOperation(
+ List<IProject> importedProjects = new ConfigureUnsharedProject(
getProjectName()
, getApplication()
, getRemoteName()
12 years, 11 months
JBoss Tools SVN: r37740 - in trunk/common/plugins: org.jboss.tools.common.jdt/src/org/jboss/tools/common/jdt/core/internal/buildpath and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-01-10 08:04:24 -0500 (Tue, 10 Jan 2012)
New Revision: 37740
Added:
trunk/common/plugins/org.jboss.tools.common.jdt/src/org/jboss/tools/common/jdt/core/buildpath/ClasspathContainersHelper.java
trunk/common/plugins/org.jboss.tools.common.jdt/src/org/jboss/tools/common/jdt/core/internal/buildpath/GradleLibraryMaterializationPostProcessor.java
Modified:
trunk/common/plugins/org.jboss.tools.common.jdt.ui/src/org/jboss/tools/common/jdt/ui/Messages.java
trunk/common/plugins/org.jboss.tools.common.jdt.ui/src/org/jboss/tools/common/jdt/ui/buildpath/dialog/MaterializeLibraryDialog.java
trunk/common/plugins/org.jboss.tools.common.jdt.ui/src/org/jboss/tools/common/jdt/ui/buildpath/dialog/MaterializeLibraryWarningFactory.java
trunk/common/plugins/org.jboss.tools.common.jdt.ui/src/org/jboss/tools/common/jdt/ui/messages.properties
trunk/common/plugins/org.jboss.tools.common.jdt/src/org/jboss/tools/common/jdt/core/internal/buildpath/LibraryMaterializationPostProcessorFactory.java
trunk/common/plugins/org.jboss.tools.common.jdt/src/org/jboss/tools/common/jdt/core/internal/buildpath/MavenLibraryMaterializationPostProcessor.java
Log:
JBIDE-10363 : Remove the gradle nature when materializing com.springsource.sts.gradle.classpathcontainer
Added: trunk/common/plugins/org.jboss.tools.common.jdt/src/org/jboss/tools/common/jdt/core/buildpath/ClasspathContainersHelper.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt/src/org/jboss/tools/common/jdt/core/buildpath/ClasspathContainersHelper.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt/src/org/jboss/tools/common/jdt/core/buildpath/ClasspathContainersHelper.java 2012-01-10 13:04:24 UTC (rev 37740)
@@ -0,0 +1,34 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.common.jdt.core.buildpath;
+
+import org.eclipse.jdt.core.IClasspathContainer;
+
+public class ClasspathContainersHelper {
+
+ public static final String MAVEN_CONTAINER_ID = "org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER";
+
+ public static final String GRADLE_CONTAINER_ID = "com.springsource.sts.gradle.classpathcontainer";
+
+ public static final String JRE_CONTAINER_ID = "org.eclipse.jdt.launching.JRE_CONTAINER";
+
+
+ private ClasspathContainersHelper() {
+ //We don't want to instanciate that class
+ }
+
+ public static boolean applies(IClasspathContainer classpathLibrary, String libPrefix) {
+ return classpathLibrary != null
+ && classpathLibrary.getPath() != null
+ && classpathLibrary.getPath().toPortableString().startsWith(libPrefix);
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.jdt/src/org/jboss/tools/common/jdt/core/internal/buildpath/GradleLibraryMaterializationPostProcessor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt/src/org/jboss/tools/common/jdt/core/internal/buildpath/GradleLibraryMaterializationPostProcessor.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt/src/org/jboss/tools/common/jdt/core/internal/buildpath/GradleLibraryMaterializationPostProcessor.java 2012-01-10 13:04:24 UTC (rev 37740)
@@ -0,0 +1,39 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2012 Red Hat, Inc. 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.common.jdt.core.internal.buildpath;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.IJavaProject;
+import org.jboss.tools.common.EclipseUtil;
+import org.jboss.tools.common.jdt.core.buildpath.ClasspathContainersHelper;
+import org.jboss.tools.common.jdt.core.buildpath.ILibraryMaterializationPostProcessor;
+
+class GradleLibraryMaterializationPostProcessor implements ILibraryMaterializationPostProcessor {
+
+ private static final String GRADLE_NATURE_ID = "com.springsource.sts.gradle.core.nature";
+
+ public boolean applies(IJavaProject javaProject, IPath containerPath) throws CoreException {
+ boolean applies = javaProject != null
+ && javaProject.getProject().hasNature(GRADLE_NATURE_ID)
+ && (ClasspathContainersHelper.GRADLE_CONTAINER_ID
+ .equals(containerPath.toPortableString()));
+ return applies;
+ }
+
+ public void execute(IJavaProject javaProject, IPath containerPath,
+ IProgressMonitor monitor) throws CoreException {
+ if (applies(javaProject, containerPath)) {
+ EclipseUtil.removeNatureFromProject(javaProject.getProject(), GRADLE_NATURE_ID);
+ }
+ }
+}
Modified: trunk/common/plugins/org.jboss.tools.common.jdt/src/org/jboss/tools/common/jdt/core/internal/buildpath/LibraryMaterializationPostProcessorFactory.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt/src/org/jboss/tools/common/jdt/core/internal/buildpath/LibraryMaterializationPostProcessorFactory.java 2012-01-10 10:36:02 UTC (rev 37739)
+++ trunk/common/plugins/org.jboss.tools.common.jdt/src/org/jboss/tools/common/jdt/core/internal/buildpath/LibraryMaterializationPostProcessorFactory.java 2012-01-10 13:04:24 UTC (rev 37740)
@@ -15,12 +15,12 @@
public class LibraryMaterializationPostProcessorFactory implements ILibraryMaterializationPostProcessorFactory {
- /* (non-Javadoc)
- * @see org.jboss.tools.common.jdt.core.buildpath.ILibraryMaterializationPostProcessorFactory#getLibraryMaterializationPostProcessors()
- */
@Override
public ILibraryMaterializationPostProcessor[] getLibraryMaterializationPostProcessors() {
- return new ILibraryMaterializationPostProcessor[]{new MavenLibraryMaterializationPostProcessor()};
+ return new ILibraryMaterializationPostProcessor[]{
+ new MavenLibraryMaterializationPostProcessor(),
+ new GradleLibraryMaterializationPostProcessor()
+ };
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.jdt/src/org/jboss/tools/common/jdt/core/internal/buildpath/MavenLibraryMaterializationPostProcessor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt/src/org/jboss/tools/common/jdt/core/internal/buildpath/MavenLibraryMaterializationPostProcessor.java 2012-01-10 10:36:02 UTC (rev 37739)
+++ trunk/common/plugins/org.jboss.tools.common.jdt/src/org/jboss/tools/common/jdt/core/internal/buildpath/MavenLibraryMaterializationPostProcessor.java 2012-01-10 13:04:24 UTC (rev 37740)
@@ -20,6 +20,7 @@
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.jboss.tools.common.EclipseUtil;
+import org.jboss.tools.common.jdt.core.buildpath.ClasspathContainersHelper;
import org.jboss.tools.common.jdt.core.buildpath.ILibraryMaterializationPostProcessor;
class MavenLibraryMaterializationPostProcessor implements ILibraryMaterializationPostProcessor {
@@ -29,7 +30,7 @@
public boolean applies(IJavaProject javaProject, IPath containerPath) throws CoreException {
boolean applies = javaProject != null
&& javaProject.getProject().hasNature(MAVEN_NATURE_ID)
- && ("org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"
+ && (ClasspathContainersHelper.MAVEN_CONTAINER_ID
.equals(containerPath.toPortableString()));
return applies;
}
Modified: trunk/common/plugins/org.jboss.tools.common.jdt.ui/src/org/jboss/tools/common/jdt/ui/Messages.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.ui/src/org/jboss/tools/common/jdt/ui/Messages.java 2012-01-10 10:36:02 UTC (rev 37739)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.ui/src/org/jboss/tools/common/jdt/ui/Messages.java 2012-01-10 13:04:24 UTC (rev 37740)
@@ -30,6 +30,10 @@
public static String Jre_Dialog_Warning;
+ public static String Gradle_Configuration_Warning;
+
+ public static String Gradle_Configuration_Dialog_Warning;
+
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
Modified: trunk/common/plugins/org.jboss.tools.common.jdt.ui/src/org/jboss/tools/common/jdt/ui/buildpath/dialog/MaterializeLibraryDialog.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.ui/src/org/jboss/tools/common/jdt/ui/buildpath/dialog/MaterializeLibraryDialog.java 2012-01-10 10:36:02 UTC (rev 37739)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.ui/src/org/jboss/tools/common/jdt/ui/buildpath/dialog/MaterializeLibraryDialog.java 2012-01-10 13:04:24 UTC (rev 37740)
@@ -49,7 +49,6 @@
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
Modified: trunk/common/plugins/org.jboss.tools.common.jdt.ui/src/org/jboss/tools/common/jdt/ui/buildpath/dialog/MaterializeLibraryWarningFactory.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.ui/src/org/jboss/tools/common/jdt/ui/buildpath/dialog/MaterializeLibraryWarningFactory.java 2012-01-10 10:36:02 UTC (rev 37739)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.ui/src/org/jboss/tools/common/jdt/ui/buildpath/dialog/MaterializeLibraryWarningFactory.java 2012-01-10 13:04:24 UTC (rev 37740)
@@ -10,8 +10,10 @@
************************************************************************************/
package org.jboss.tools.common.jdt.ui.buildpath.dialog;
+import static org.jboss.tools.common.jdt.core.buildpath.ClasspathContainersHelper.applies;
import org.eclipse.jdt.core.IClasspathContainer;
import org.eclipse.osgi.util.NLS;
+import org.jboss.tools.common.jdt.core.buildpath.ClasspathContainersHelper;
import org.jboss.tools.common.jdt.ui.Messages;
public class MaterializeLibraryWarningFactory implements IMaterializeLibraryWarningFactory {
@@ -20,9 +22,13 @@
public String getWarning(IClasspathContainer classpathLibrary) {
if (isMavenLibrary(classpathLibrary)) {
return Messages.Maven_Configuration_Warning;
- } else if (isJreLibrary(classpathLibrary)) {
+ }
+ if (isJreLibrary(classpathLibrary)) {
return NLS.bind(Messages.Jre_Warning, classpathLibrary.getDescription());
}
+ if (isGradleLibrary(classpathLibrary)) {
+ return Messages.Gradle_Configuration_Warning;
+ }
return null;
}
@@ -30,24 +36,26 @@
public String getDialogWarning(IClasspathContainer classpathLibrary) {
if (isMavenLibrary(classpathLibrary)) {
return Messages.Maven_Configuration_Dialog_Warning;
- } else if (isJreLibrary(classpathLibrary)) {
+ }
+ if (isJreLibrary(classpathLibrary)) {
return NLS.bind(Messages.Jre_Dialog_Warning, classpathLibrary.getDescription());
}
+ if (isGradleLibrary(classpathLibrary)) {
+ return Messages.Gradle_Configuration_Dialog_Warning;
+ }
return null;
}
private boolean isJreLibrary(IClasspathContainer classpathLibrary) {
- return applies(classpathLibrary, "org.eclipse.jdt.launching.JRE_CONTAINER");
+ return applies(classpathLibrary, ClasspathContainersHelper.JRE_CONTAINER_ID);
}
private boolean isMavenLibrary(IClasspathContainer classpathLibrary) {
- return applies(classpathLibrary, "org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER");
+ return applies(classpathLibrary, ClasspathContainersHelper.MAVEN_CONTAINER_ID);
}
- private boolean applies(IClasspathContainer classpathLibrary, String libPrefix) {
- return classpathLibrary != null
- && classpathLibrary.getPath() != null
- && classpathLibrary.getPath().toPortableString().startsWith(libPrefix);
+ private boolean isGradleLibrary(IClasspathContainer classpathLibrary) {
+ return applies(classpathLibrary, ClasspathContainersHelper.GRADLE_CONTAINER_ID);
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.jdt.ui/src/org/jboss/tools/common/jdt/ui/messages.properties
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.ui/src/org/jboss/tools/common/jdt/ui/messages.properties 2012-01-10 10:36:02 UTC (rev 37739)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.ui/src/org/jboss/tools/common/jdt/ui/messages.properties 2012-01-10 13:04:24 UTC (rev 37740)
@@ -2,6 +2,8 @@
Maven_Configuration_Warning =This will also remove the Maven configuration from this project.
Maven_Configuration_Dialog_Warning = This will also remove the Maven configuration from this project.\nThis operation cannot be undone, are you sure ?
+Gradle_Configuration_Warning =This will also remove the Gradle configuration from this project.
+Gradle_Configuration_Dialog_Warning = This will also remove the Gradle configuration from this project.\nThis operation cannot be undone, are you sure ?
Jre_Warning = Materializing {0} might have unexpected consequences and is not recommended.
Jre_Dialog_Warning = Materializing {0} might have unexpected consequences and is not recommended. Are you sure?
12 years, 11 months
JBoss Tools SVN: r37739 - in trunk/ws/plugins: org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/contentassist and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: xcoulon
Date: 2012-01-10 05:36:02 -0500 (Tue, 10 Jan 2012)
New Revision: 37739
Modified:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsElementFactory.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/contentassist/PathParamAnnotationValueCompletionProposalComputer.java
Log:
Preventing errors when the java syntax of the underlying resource is incorrect
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsElementFactory.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsElementFactory.java 2012-01-10 09:33:23 UTC (rev 37738)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsElementFactory.java 2012-01-10 10:36:02 UTC (rev 37739)
@@ -231,15 +231,18 @@
final Annotation producesAnnotation = annotations.get(Produces.class.getName());
final Annotation consumesAnnotation = annotations.get(Consumes.class.getName());
final JavaMethodSignature methodSignature = JdtUtils.resolveMethodSignature(javaMethod, ast);
- final Builder builder = new JaxrsResourceMethod.Builder(javaMethod, parentResource, metamodel)
- .pathTemplate(pathAnnotation).consumes(consumesAnnotation).produces(producesAnnotation)
- .httpMethod(httpMethod).returnType(methodSignature.getReturnedType());
- for (JavaMethodParameter methodParam : methodSignature.getMethodParameters()) {
- builder.methodParameter(methodParam);
+ // avoid creating Resource Method when the Java Method cannot be parsed (ie, syntax/compilation error)
+ if (methodSignature != null) {
+ final Builder builder = new JaxrsResourceMethod.Builder(javaMethod, parentResource, metamodel)
+ .pathTemplate(pathAnnotation).consumes(consumesAnnotation).produces(producesAnnotation)
+ .httpMethod(httpMethod).returnType(methodSignature.getReturnedType());
+ for (JavaMethodParameter methodParam : methodSignature.getMethodParameters()) {
+ builder.methodParameter(methodParam);
+ }
+ final JaxrsResourceMethod resourceMethod = builder.build();
+
+ return resourceMethod;
}
- final JaxrsResourceMethod resourceMethod = builder.build();
-
- return resourceMethod;
}
return null;
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/contentassist/PathParamAnnotationValueCompletionProposalComputer.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/contentassist/PathParamAnnotationValueCompletionProposalComputer.java 2012-01-10 09:33:23 UTC (rev 37738)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/contentassist/PathParamAnnotationValueCompletionProposalComputer.java 2012-01-10 10:36:02 UTC (rev 37739)
@@ -45,8 +45,7 @@
import org.jboss.tools.ws.jaxrs.ui.internal.utils.Logger;
/**
- * Computes proposals for <code>java.ws.rs.PathParam</code> annotation values in
- * the compilation unit context.
+ * Computes proposals for <code>java.ws.rs.PathParam</code> annotation values in the compilation unit context.
*
* @author xcoulon
*/
@@ -80,18 +79,22 @@
IJavaElement invocationElement = javaContext.getCompilationUnit().getElementAt(
context.getInvocationOffset());
if (invocationElement.getElementType() == IJavaElement.METHOD) {
- IJaxrsResourceMethod resourceMethod = metamodel.getElement(invocationElement, IJaxrsResourceMethod.class);
- for (JavaMethodParameter methodParameter : resourceMethod.getJavaMethodParameters()) {
- for (Annotation annotation : methodParameter.getAnnotations()) {
- final TypedRegion region = annotation.getRegion();
- if (annotation.getName().equals(PathParam.class.getName()) && region != null
- && context.getInvocationOffset() >= region.getOffset()
- && context.getInvocationOffset() < (region.getOffset() + region.getLength())) {
- // completion proposal on @PathParam method
- // annotation
- return internalComputePathParamProposals(javaContext, annotation, resourceMethod);
+ IJaxrsResourceMethod resourceMethod = metamodel.getElement(invocationElement,
+ IJaxrsResourceMethod.class);
+ // the java method must be associated with a JAX-RS Resource Method.
+ if (resourceMethod != null) {
+ for (JavaMethodParameter methodParameter : resourceMethod.getJavaMethodParameters()) {
+ for (Annotation annotation : methodParameter.getAnnotations()) {
+ final TypedRegion region = annotation.getRegion();
+ if (annotation.getName().equals(PathParam.class.getName()) && region != null
+ && context.getInvocationOffset() >= region.getOffset()
+ && context.getInvocationOffset() < (region.getOffset() + region.getLength())) {
+ // completion proposal on @PathParam method
+ // annotation
+ return internalComputePathParamProposals(javaContext, annotation, resourceMethod);
+ }
+
}
-
}
}
}
@@ -102,13 +105,12 @@
}
/**
- * Computes the valid proposals for the <code>javax.ws.rs.PathParam</code>
- * annotation value. The proposals are based on:
+ * Computes the valid proposals for the <code>javax.ws.rs.PathParam</code> annotation value. The proposals are based
+ * on:
* <ul>
- * <li>The values of the <code>javax.ws.rs.Path</code> annotations, both at
- * the method and at the type level (inclusion),</li>
- * <li>The values of the sibling <code>javax.ws.rs.PathParam</code>
- * annotations (exclusion).
+ * <li>The values of the <code>javax.ws.rs.Path</code> annotations, both at the method and at the type level
+ * (inclusion),</li>
+ * <li>The values of the sibling <code>javax.ws.rs.PathParam</code> annotations (exclusion).
* </ul>
*
* @param javaContext
@@ -130,7 +132,7 @@
final ITypedRegion region = getRegion(javaContext);
String matchValue = javaContext.getDocument().get(region.getOffset(),
javaContext.getInvocationOffset() - region.getOffset());
- if(matchValue.charAt(0) == '\"') {
+ if (matchValue.charAt(0) == '\"') {
matchValue = matchValue.substring(1);
}
List<String> proposals = resourceMethod.getPathParamValueProposals();
@@ -154,8 +156,7 @@
}
/**
- * Resolves the typed region for the given java content assist invocation
- * context.
+ * Resolves the typed region for the given java content assist invocation context.
*
* @param javaContext
* the java content assist invocation context
12 years, 11 months
JBoss Tools SVN: r37738 - in trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test: tmp and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2012-01-10 04:33:23 -0500 (Tue, 10 Jan 2012)
New Revision: 37738
Added:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/tmp/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/tmp/TmpTest.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/tmp/TmpTestSuite.java
Log:
Temporary test for @DB requirement
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/tmp/TmpTest.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/tmp/TmpTest.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/tmp/TmpTest.java 2012-01-10 09:33:23 UTC (rev 37738)
@@ -0,0 +1,16 @@
+package org.jboss.tools.portlet.ui.bot.test.tmp;
+
+import org.jboss.tools.portlet.ui.bot.test.testcase.SWTTaskBasedTestCase;
+import org.jboss.tools.ui.bot.ext.config.Annotations.DB;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
+import org.junit.Test;
+
+@Require(db=@DB)
+public class TmpTest extends SWTTaskBasedTestCase {
+
+ @Test
+ public void testTmp() throws InterruptedException{
+ System.out.println();
+ Thread.sleep(60 * 60 * 1000);
+ }
+}
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/tmp/TmpTestSuite.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/tmp/TmpTestSuite.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/tmp/TmpTestSuite.java 2012-01-10 09:33:23 UTC (rev 37738)
@@ -0,0 +1,13 @@
+package org.jboss.tools.portlet.ui.bot.test.tmp;
+
+import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+(a)RunWith(RequirementAwareSuite.class)
+(a)Suite.SuiteClasses({
+ TmpTest.class,
+ })
+public class TmpTestSuite {
+
+}
12 years, 11 months
JBoss Tools SVN: r37737 - in trunk/ws/tests/org.jboss.tools.ws.ui.bot.test: src/org/jboss/tools/ws/ui/bot/test and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2012-01-10 04:17:46 -0500 (Tue, 10 Jan 2012)
New Revision: 37737
Added:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/RESTfulExplorerTest.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/RESTfulSupportTest.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/RESTfulValidationTest.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/todo.txt
Removed:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/EAPCompAllTests.launch
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/WSAllBotTests.launch
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/RESTfulExplorerSupportTest.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/RESTfulExplorerValidationTest.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/RESTfulServicesExplorerTest.java
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSAllBotTests.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSTestBase.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/RESTfulTestBase.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/validation/RESTfulValidationTest.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleRESTTestBase.java
Log:
Decomposition and moving RESTful-like bot tests + template of new RESTful-like bot test added
Deleted: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/EAPCompAllTests.launch
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/EAPCompAllTests.launch 2012-01-10 09:08:41 UTC (rev 37736)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/EAPCompAllTests.launch 2012-01-10 09:17:46 UTC (rev 37737)
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.swtbot.eclipse.ui.launcher.JunitLaunchConfig">
-<booleanAttribute key="append.args" value="true"/>
-<booleanAttribute key="askclear" value="false"/>
-<booleanAttribute key="automaticAdd" value="true"/>
-<booleanAttribute key="automaticValidate" value="false"/>
-<stringAttribute key="bootstrap" value=""/>
-<stringAttribute key="checked" value="[NONE]"/>
-<booleanAttribute key="clearConfig" value="true"/>
-<booleanAttribute key="clearws" value="true"/>
-<booleanAttribute key="clearwslog" value="false"/>
-<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
-<booleanAttribute key="default" value="true"/>
-<booleanAttribute key="includeOptional" value="true"/>
-<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/webservice/eap/EAPCompAllTests.java"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="1"/>
-</listAttribute>
-<mapAttribute key="org.eclipse.debug.core.environmentVariables">
-<mapEntry key="DISPLAY" value=":1"/>
-</mapAttribute>
-<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
-<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
-<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
-<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.jboss.tools.ws.ui.bot.test.webservice.eap.EAPCompAllTests"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.jboss.tools.ws.ui.bot.test"/>
-<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dosgi.requiredJavaVersion=1.5 -XX:MaxPermSize=256m -Xms256m -Xmx1024m -Dswtbot.test.properties.file=${env_var:HOME}/swtbot.properties -Dusage_reporting_enabled=false"/>
-<stringAttribute key="pde.version" value="3.3"/>
-<stringAttribute key="product" value="com.jboss.jbds.product.product"/>
-<booleanAttribute key="show_selected_only" value="false"/>
-<stringAttribute key="templateConfig" value="${target_home}/configuration/config.ini"/>
-<booleanAttribute key="tracing" value="false"/>
-<booleanAttribute key="useCustomFeatures" value="false"/>
-<booleanAttribute key="useDefaultConfig" value="true"/>
-<booleanAttribute key="useDefaultConfigArea" value="false"/>
-<booleanAttribute key="useProduct" value="true"/>
-</launchConfiguration>
Deleted: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/WSAllBotTests.launch
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/WSAllBotTests.launch 2012-01-10 09:08:41 UTC (rev 37736)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/WSAllBotTests.launch 2012-01-10 09:17:46 UTC (rev 37737)
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.swtbot.eclipse.ui.launcher.JunitLaunchConfig">
-<booleanAttribute key="append.args" value="true"/>
-<booleanAttribute key="askclear" value="false"/>
-<booleanAttribute key="automaticAdd" value="true"/>
-<booleanAttribute key="automaticValidate" value="false"/>
-<stringAttribute key="bootstrap" value=""/>
-<stringAttribute key="checked" value="[NONE]"/>
-<booleanAttribute key="clearConfig" value="true"/>
-<booleanAttribute key="clearws" value="true"/>
-<booleanAttribute key="clearwslog" value="false"/>
-<booleanAttribute key="com.mountainminds.eclemma.core.INPLACE_INSTRUMENTATION" value="true"/>
-<listAttribute key="com.mountainminds.eclemma.core.INSTRUMENTATION_PATHS">
-<listEntry value="/org.jboss.tools.ws.ui/target/classes"/>
-<listEntry value="/org.jboss.tools.ws.creation.ui/target/classes"/>
-<listEntry value="/org.jboss.tools.ws.core/target/classes"/>
-<listEntry value="/org.jboss.tools.ws.creation.core/bin"/>
-</listAttribute>
-<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
-<booleanAttribute key="default" value="true"/>
-<booleanAttribute key="includeOptional" value="true"/>
-<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSAllBotTests.java"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="1"/>
-</listAttribute>
-<mapAttribute key="org.eclipse.debug.core.environmentVariables">
-<mapEntry key="DISPLAY" value=":1"/>
-</mapAttribute>
-<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
-<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
-<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
-<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.jboss.tools.ws.ui.bot.test.WSAllBotTests"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.jboss.tools.ws.ui.bot.test"/>
-<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dosgi.requiredJavaVersion=1.5 -XX:MaxPermSize=256m -Xms256m -Xmx1024m -Dswtbot.test.properties.file=${env_var:HOME}/swtbot.properties -Dusage_reporting_enabled=false"/>
-<stringAttribute key="pde.version" value="3.3"/>
-<stringAttribute key="product" value="org.eclipse.platform.ide"/>
-<booleanAttribute key="show_selected_only" value="false"/>
-<booleanAttribute key="tracing" value="false"/>
-<booleanAttribute key="useCustomFeatures" value="false"/>
-<booleanAttribute key="useDefaultConfig" value="true"/>
-<booleanAttribute key="useDefaultConfigArea" value="false"/>
-<booleanAttribute key="useProduct" value="true"/>
-</launchConfiguration>
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSAllBotTests.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSAllBotTests.java 2012-01-10 09:08:41 UTC (rev 37736)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSAllBotTests.java 2012-01-10 09:17:46 UTC (rev 37737)
@@ -11,8 +11,8 @@
package org.jboss.tools.ws.ui.bot.test;
import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
-import org.jboss.tools.ws.ui.bot.test.rest.explorer.RESTfulExplorerSupportTest;
-import org.jboss.tools.ws.ui.bot.test.rest.explorer.RESTfulServicesExplorerTest;
+import org.jboss.tools.ws.ui.bot.test.rest.explorer.RESTfulExplorerTest;
+import org.jboss.tools.ws.ui.bot.test.rest.explorer.RESTfulSupportTest;
import org.jboss.tools.ws.ui.bot.test.rest.validation.RESTfulValidationTest;
import org.jboss.tools.ws.ui.bot.test.sample.test.SampleRESTWebServiceTest;
import org.jboss.tools.ws.ui.bot.test.sample.test.SampleSoapWebServiceTest;
@@ -52,9 +52,9 @@
SampleRESTWebServiceTest.class,
SimpleSoapWebServiceTest.class,
SimpleRESTWebServiceTest.class,
- RESTfulExplorerSupportTest.class,
- RESTfulServicesExplorerTest.class,
- RESTfulValidationTest.class,
+ RESTfulSupportTest.class,
+ RESTfulExplorerTest.class,
+// RESTfulValidationTest.class,
BottomUpWSTest.class,
TopDownWSTest.class,
WsClientTest.class,
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSTestBase.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSTestBase.java 2012-01-10 09:08:41 UTC (rev 37736)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSTestBase.java 2012-01-10 09:17:46 UTC (rev 37737)
@@ -18,6 +18,7 @@
import org.jboss.tools.ui.bot.ext.SWTTestExt;
import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
+import org.jboss.tools.ui.bot.ext.config.Annotations.ServerType;
import org.jboss.tools.ws.ui.bot.test.uiutils.wizards.WsWizardBase.Slider_Level;
import org.jboss.tools.ws.ui.bot.test.utils.DeploymentHelper;
import org.jboss.tools.ws.ui.bot.test.utils.ProjectHelper;
@@ -33,7 +34,7 @@
* @author jjankovi
*
*/
-@Require(server=@Server(),perspective="Java EE")
+@Require(server=(a)Server(type=ServerType.EAP), perspective="Java EE")
@RunWith(RequirementAwareSuite.class)
@SuiteClasses({ WSAllBotTests.class })
public class WSTestBase extends SWTTestExt {
@@ -47,7 +48,7 @@
+ "<soap:Body>{0}</soap:Body>" + "</soap:Envelope>";
protected static final Logger LOGGER = Logger
- .getLogger(WSTestBase.class.getName());
+ .getLogger(WSAllBotTests.class.getName());
protected final String LINE_SEPARATOR = System.getProperty("line.separator");
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/RESTfulTestBase.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/RESTfulTestBase.java 2012-01-10 09:08:41 UTC (rev 37736)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/RESTfulTestBase.java 2012-01-10 09:17:46 UTC (rev 37737)
@@ -11,9 +11,18 @@
package org.jboss.tools.ws.ui.bot.test.rest;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
+import org.jboss.tools.ui.bot.ext.gen.IPreference;
+import org.jboss.tools.ui.bot.ext.view.ProblemsView;
import org.jboss.tools.ws.ui.bot.test.WSTestBase;
import org.jboss.tools.ws.ui.bot.test.utils.NodeContextUtil;
@@ -22,8 +31,12 @@
* @author jjankovi
*
*/
+@Require(server=@Server(), perspective="Java EE")
public class RESTfulTestBase extends WSTestBase {
+ protected final String PATH_PARAM_VALID_ERROR = "Invalid @PathParam value";
+ protected final String VALIDATION_PREFERENCE = "Validation";
+ protected final String JAX_RS_VALIDATOR = "JAX-RS Metamodel Validator";
protected final String CONFIGURE_MENU_LABEL = "Configure";
protected final String REST_SUPPORT_MENU_LABEL_ADD = "Add JAX-RS 1.1 support...";
protected final String REST_SUPPORT_MENU_LABEL_REMOVE = "Remove JAX-RS 1.1 support...";
@@ -33,10 +46,48 @@
ADD, REMOVE;
}
- /**
- *
- * @param wsProjectName
- */
+ protected SWTBotTreeItem[] getRESTValidationErrorsAfterCleanBuild(String wsProjectName) {
+ eclipse.cleanAllProjects();
+ return getRESTValidationErrors(wsProjectName);
+ }
+
+ protected SWTBotTreeItem[] getRESTValidationErrors(String wsProjectName) {
+ return ProblemsView.getFilteredErrorsTreeItems(bot, PATH_PARAM_VALID_ERROR, "/"
+ + wsProjectName, null, null);
+ }
+
+ protected void enableRESTValidation() {
+ SWTBotTable validatorTable = preferenceDialog(VALIDATION_PREFERENCE, new ArrayList<String>()).table();
+ int restValidationRow = -1;
+ for (int row = 0; row < validatorTable.rowCount(); row++) {
+ if (validatorTable.getTableItem(row).getText().equals(JAX_RS_VALIDATOR)) {
+ restValidationRow = row;
+ break;
+ }
+ }
+ assertTrue(restValidationRow >= 0);
+
+ }
+
+ protected void disableRESTValidation() {
+
+ }
+
+ protected SWTBot preferenceDialog(final String name, final List<String> path) {
+ return open.preferenceOpen(new IPreference() {
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public List<String> getGroupPath() {
+ return path;
+ }
+ });
+ }
+
protected void addRestSupport(String wsProjectName) {
configureRestSupport(wsProjectName, ConfigureOption.ADD);
}
@@ -70,4 +121,9 @@
RESTFulAnnotations.REST_EXPLORER_LABEL_BUILD.getLabel()));
}
+
+ protected static void addRestEasyLibs(String wsProjectName) {
+ assertTrue(configuredState.getServer().type.equals("EAP"));
+ }
+
}
Deleted: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/RESTfulExplorerSupportTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/RESTfulExplorerSupportTest.java 2012-01-10 09:08:41 UTC (rev 37736)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/RESTfulExplorerSupportTest.java 2012-01-10 09:17:46 UTC (rev 37737)
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2011 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.ws.ui.bot.test.rest.explorer;
-
-import org.jboss.tools.ws.ui.bot.test.rest.RESTfulTestBase;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Test checks if context menu 'Add RESTful 1.1 Support' works properly
- * @author jjankovi
- *
- */
-public class RESTfulExplorerSupportTest extends RESTfulTestBase {
-
- protected String getWsProjectName() {
- return "RestExplorerTest";
- }
-
- protected String getWsPackage() {
- return "org.rest.explorer.validation.test";
- }
-
- protected String getWsName() {
- return "RestService";
- }
-
- @Before
- public void setup() {
- if (!projectExists(getWsProjectName())) {
- projectHelper.createProject(getWsProjectName());
- }
- }
-
-
- @Test
- public void testSupportJAX_RS1_1_Explorer() {
-
- addRestSupport(getWsProjectName());
- assertTrue(isRestSupportEnabled(getWsProjectName()));
-
- }
-
-}
Added: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/RESTfulExplorerTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/RESTfulExplorerTest.java (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/RESTfulExplorerTest.java 2012-01-10 09:17:46 UTC (rev 37737)
@@ -0,0 +1,273 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2011 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.ws.ui.bot.test.rest.explorer;
+
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ws.ui.bot.test.rest.RESTFulAnnotations;
+import org.jboss.tools.ws.ui.bot.test.rest.RESTfulTestBase;
+import org.jboss.tools.ws.ui.bot.test.ti.wizard.RESTFullExplorerWizard;
+import org.junit.Test;
+
+/**
+ * Test operates on exploring RESTFul services in RESTful explorer
+ *
+ * @author jjankovi
+ *
+ */
+public class RESTfulExplorerTest extends RESTfulTestBase {
+
+ private RESTFullExplorerWizard restfulWizard = null;
+
+ protected String getWsProjectName() {
+ return "RestServicesExplorer";
+ }
+
+ protected String getWsPackage() {
+ return "org.rest.explorer.services.test";
+ }
+
+ protected String getWsName() {
+ return "RestService";
+ }
+
+ @Override
+ public void setup() {
+ if (!projectExists(getWsProjectName())) {
+ projectHelper.createProject(getWsProjectName());
+ }
+ if (!isRestSupportEnabled(getWsProjectName())) {
+ addRestSupport(getWsProjectName());
+ }
+ if (!projectExplorer.isFilePresent(getWsProjectName(), "Java Resources",
+ "src", getWsPackage(), getWsName() + ".java")) {
+ projectHelper.createClass(getWsProjectName(), getWsPackage(), getWsName());
+ }
+ }
+
+ @Override
+ public void cleanup() {
+ if (projectExists(getWsProjectName())) {
+ removeRestSupport(getWsProjectName());
+ }
+ }
+
+ @Test
+ public void testAddingSimpleRESTMethods() {
+
+ resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
+ RESTfulExplorerTest.class.
+ getResourceAsStream("/resources/restful/BasicRestfulWS.java.ws"),
+ false, getWsPackage(), getWsName());
+ /**
+ * workaround
+ */
+ eclipse.cleanAllProjects();
+ bot.sleep(Timing.time3S());
+
+ restfulWizard = new RESTFullExplorerWizard(getWsProjectName());
+ SWTBotTreeItem[] restServices = restfulWizard.getAllRestServices();
+
+ assertTrue(restServices.length == 4);
+ assertTrue(allRestServicesArePresent(restServices));
+
+ for (SWTBotTreeItem restService : restServices) {
+ assertTrue(restfulWizard.getPathForRestFulService(restService).equals("/rest"));
+ assertTrue(restfulWizard.getConsumesInfo(restService).equals("*/*"));
+ assertTrue(restfulWizard.getProducesInfo(restService).equals("*/*"));
+ }
+ }
+
+ @Test
+ public void testAddingAdvancedRESTMethods() {
+
+ resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
+ RESTfulExplorerTest.class.
+ getResourceAsStream("/resources/restful/AdvancedRestfulWS.java.ws"),
+ false, getWsPackage(), getWsName());
+ /**
+ * workaround
+ */
+ eclipse.cleanAllProjects();
+ bot.sleep(Timing.time3S());
+
+ restfulWizard = new RESTFullExplorerWizard(getWsProjectName());
+ SWTBotTreeItem[] restServices = restfulWizard.getAllRestServices();
+
+ assertTrue(restServices.length == 4);
+ assertTrue(allRestServicesArePresent(restServices));
+
+ for (SWTBotTreeItem restService : restServices) {
+ if (restfulWizard.getRestServiceName(restService).equals(RESTFulAnnotations.GET.getLabel())) {
+ assertTrue(restfulWizard.getPathForRestFulService(restService).equals("/rest/{id}"));
+ assertTrue(restfulWizard.getConsumesInfo(restService).equals("*/*"));
+ assertTrue(restfulWizard.getProducesInfo(restService).equals("text/plain"));
+ }
+ if (restfulWizard.getRestServiceName(restService).equals(RESTFulAnnotations.PUT.getLabel())) {
+ assertTrue(restfulWizard.getPathForRestFulService(restService).equals("/rest/put/{id}"));
+ assertTrue(restfulWizard.getConsumesInfo(restService).equals("text/plain"));
+ assertTrue(restfulWizard.getProducesInfo(restService).equals("*/*"));
+ }
+ if (restfulWizard.getRestServiceName(restService).equals(RESTFulAnnotations.POST.getLabel())) {
+ assertTrue(restfulWizard.getPathForRestFulService(restService).equals("/rest/post/{id}"));
+ assertTrue(restfulWizard.getConsumesInfo(restService).equals("text/plain"));
+ assertTrue(restfulWizard.getProducesInfo(restService).equals("text/plain"));
+ }
+ if (restfulWizard.getRestServiceName(restService).equals(RESTFulAnnotations.DELETE.getLabel())) {
+ assertTrue(restfulWizard.getPathForRestFulService(restService).equals("/rest/delete/{id}"));
+ assertTrue(restfulWizard.getConsumesInfo(restService).equals("*/*"));
+ assertTrue(restfulWizard.getProducesInfo(restService).equals("*/*"));
+ }
+ }
+
+ }
+
+ @Test
+ public void testEditingSimpleRESTMethods() {
+
+ resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
+ RESTfulExplorerTest.class.
+ getResourceAsStream("/resources/restful/BasicRestfulWS.java.ws"),
+ false, getWsPackage(), getWsName());
+
+ /**
+ * workaround
+ */
+ eclipse.cleanAllProjects();
+ bot.sleep(Timing.time3S());
+
+ restfulWizard = new RESTFullExplorerWizard(getWsProjectName());
+ SWTBotTreeItem[] restServices = restfulWizard.getAllRestServices();
+
+ assertTrue(allRestServicesArePresent(restServices));
+
+ resourceHelper.replaceInEditor(bot.activeEditor().toTextEditor(), "@DELETE", "@GET");
+
+ /**
+ * workaround
+ */
+ eclipse.cleanAllProjects();
+ bot.sleep(Timing.time3S());
+
+ restfulWizard = new RESTFullExplorerWizard(getWsProjectName());
+ restServices = restfulWizard.getAllRestServices();
+
+ assertFalse(allRestServicesArePresent(restServices));
+
+ for (SWTBotTreeItem restService : restServices) {
+ if (restfulWizard.getRestServiceName(restService).equals(RESTFulAnnotations.DELETE.getLabel())) {
+ fail("There should not be DELETE RESTful services");
+ }
+ }
+
+ }
+
+ @Test
+ public void testEditingAdvancedRESTMethods() {
+
+ resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
+ RESTfulExplorerTest.class.
+ getResourceAsStream("/resources/restful/AdvancedRestfulWS.java.ws"),
+ false, getWsPackage(), getWsName());
+
+ /**
+ * workaround
+ */
+ eclipse.cleanAllProjects();
+ bot.sleep(Timing.time3S());
+
+ restfulWizard = new RESTFullExplorerWizard(getWsProjectName());
+ SWTBotTreeItem[] restServices = restfulWizard.getAllRestServices();
+
+ for (SWTBotTreeItem restService : restServices) {
+ if (restfulWizard.getRestServiceName(restService).equals(RESTFulAnnotations.DELETE.getLabel())) {
+ assertTrue(restfulWizard.getPathForRestFulService(restService).equals("/rest/delete/{id}"));
+ assertTrue(restfulWizard.getProducesInfo(restService).equals("*/*"));
+ }
+ }
+
+ resourceHelper.replaceInEditor(bot.activeEditor().toTextEditor(), "/delete/{id}", "delete/edited/{id}");
+ resourceHelper.replaceInEditor(bot.activeEditor().toTextEditor(), "@DELETE",
+ "@DELETE" + LINE_SEPARATOR + "@Produces(\"text/plain\")");
+
+ /**
+ * workaround
+ */
+ eclipse.cleanAllProjects();
+ bot.sleep(Timing.time3S());
+
+ restfulWizard = new RESTFullExplorerWizard(getWsProjectName());
+ restServices = restfulWizard.getAllRestServices();
+
+ for (SWTBotTreeItem restService : restServices) {
+ if (restfulWizard.getRestServiceName(restService).equals(RESTFulAnnotations.DELETE.getLabel())) {
+ assertTrue(restfulWizard.getPathForRestFulService(restService).equals("/rest/delete/edited/{id}"));
+ assertTrue(restfulWizard.getProducesInfo(restService).equals("text/plain"));
+ }
+ }
+ }
+
+ @Test
+ public void testDeletingRESTMethods() {
+
+ resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
+ RESTfulExplorerTest.class.
+ getResourceAsStream("/resources/restful/BasicRestfulWS.java.ws"),
+ false, getWsPackage(), getWsName());
+
+ /**
+ * workaround
+ */
+ eclipse.cleanAllProjects();
+ bot.sleep(Timing.time3S());
+
+ restfulWizard = new RESTFullExplorerWizard(getWsProjectName());
+ SWTBotTreeItem[] restServices = restfulWizard.getAllRestServices();
+
+ assertTrue(restServices.length == 4);
+
+ resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
+ RESTfulExplorerTest.class.
+ getResourceAsStream("/resources/restful/EmptyRestfulWS.java.ws"),
+ false, getWsPackage(), getWsName());
+
+ /**
+ * workaround
+ */
+ eclipse.cleanAllProjects();
+ bot.sleep(Timing.time3S());
+
+ restfulWizard = new RESTFullExplorerWizard(getWsProjectName());
+ restServices = restfulWizard.getAllRestServices();
+
+ assertTrue(restServices.length == 0);
+
+ }
+
+ private boolean allRestServicesArePresent(SWTBotTreeItem[] restServices) {
+
+ String[] restMethods = {RESTFulAnnotations.GET.getLabel(), RESTFulAnnotations.POST.getLabel(),
+ RESTFulAnnotations.POST.getLabel(), RESTFulAnnotations.DELETE.getLabel()};
+ for (String restMethod : restMethods) {
+ boolean serviceFound = false;
+ for (SWTBotTreeItem restService : restServices) {
+ if (restfulWizard.getRestServiceName(restService).equals(restMethod)) {
+ serviceFound = true;
+ break;
+ }
+ }
+ if (!serviceFound) return false;
+ }
+ return true;
+ }
+
+}
Deleted: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/RESTfulExplorerValidationTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/RESTfulExplorerValidationTest.java 2012-01-10 09:08:41 UTC (rev 37736)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/RESTfulExplorerValidationTest.java 2012-01-10 09:17:46 UTC (rev 37737)
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2011 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.ws.ui.bot.test.rest.explorer;
-
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
-import org.jboss.tools.ui.bot.ext.Timing;
-import org.jboss.tools.ws.ui.bot.test.WSTestBase;
-import org.jboss.tools.ws.ui.bot.test.utils.NodeContextUtil;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- *
- * @author jjankovi
- *
- */
-public class RESTfulExplorerValidationTest extends WSTestBase {
-
- private static final String CONFIGURE_MENU_LABEL = "Configure";
- private static final String REST_SUPPORT_MENU_LABEL_ADD = "Add JAX-RS 1.1 support...";
- private static final String REST_SUPPORT_MENU_LABEL_REMOVE = "Remove JAX-RS 1.1 support...";
- private static final String REST_EXPLORER_LABEL = "JAX-RS REST Web Services";
-
- protected String getWsProjectName() {
- return "RestExplorerTest";
- }
-
- protected String getWsPackage() {
- return "org.rest.explorer.validation.test";
- }
-
- protected String getWsName() {
- return "RestService";
- }
-
- @Before
- public void setup() {
- if (!projectExists(getWsProjectName())) {
- projectHelper.createProject(getWsProjectName());
- }
- }
-
-
- @Test
- public void testSupportJAX_RS1_1_Explorer() {
-
- addRestSupport(getWsProjectName());
-
- projectExplorer.selectProject(getWsProjectName());
- SWTBotTree tree = projectExplorer.bot().tree();
- SWTBotTreeItem item = tree.getTreeItem(getWsProjectName());
- assertTrue(NodeContextUtil.nodeContextMenu(tree, item, CONFIGURE_MENU_LABEL,
- REST_SUPPORT_MENU_LABEL_REMOVE).isVisible());
- assertTrue(projectExplorer.isFilePresent(getWsProjectName(), REST_EXPLORER_LABEL));
-
- }
-
- private void addRestSupport(String wsProjectName) {
- projectExplorer.selectProject(wsProjectName);
- SWTBotTree tree = projectExplorer.bot().tree();
- SWTBotTreeItem item = tree.getTreeItem(wsProjectName);
- item.expand();
- NodeContextUtil.nodeContextMenu(tree, item, CONFIGURE_MENU_LABEL,
- REST_SUPPORT_MENU_LABEL_ADD).click();
- bot.sleep(Timing.time2S());
- util.waitForNonIgnoredJobs();
- }
-
-}
Deleted: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/RESTfulServicesExplorerTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/RESTfulServicesExplorerTest.java 2012-01-10 09:08:41 UTC (rev 37736)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/RESTfulServicesExplorerTest.java 2012-01-10 09:17:46 UTC (rev 37737)
@@ -1,287 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2011 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.ws.ui.bot.test.rest.explorer;
-
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
-import org.jboss.tools.ui.bot.ext.Timing;
-import org.jboss.tools.ws.ui.bot.test.rest.RESTFulAnnotations;
-import org.jboss.tools.ws.ui.bot.test.rest.RESTfulTestBase;
-import org.jboss.tools.ws.ui.bot.test.ti.wizard.RESTFullExplorerWizard;
-import org.junit.Test;
-
-/**
- * Test operates on exploring RESTFul services in RESTful explorer
- *
- * TO DO: I have to add rest libraries for EAP 5.1
- * @author jjankovi
- *
- */
-public class RESTfulServicesExplorerTest extends RESTfulTestBase {
-
- private RESTFullExplorerWizard restfulWizard = null;
-
- protected String getWsProjectName() {
- return "RestServicesExplorer";
- }
-
- protected String getWsPackage() {
- return "org.rest.explorer.services.test";
- }
-
- protected String getWsName() {
- return "RestService";
- }
-
- @Override
- public void setup() {
- if (!projectExists(getWsProjectName())) {
- projectHelper.createProject(getWsProjectName());
- }
- if (!isRestSupportEnabled(getWsProjectName())) {
- addRestSupport(getWsProjectName());
- }
- }
-
- @Override
- public void cleanup() {
- if (projectExists(getWsProjectName())) {
- removeRestSupport(getWsProjectName());
- }
- }
-
- @Test
- public void testAddingSimpleRESTMethods() {
-
- if (!projectExplorer.isFilePresent(getWsProjectName(), "Java Resources", "src", getWsPackage(), getWsName() + ".java")) {
- projectHelper.createClass(getWsProjectName(), getWsPackage(), getWsName());
- }
-
- resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
- RESTfulServicesExplorerTest.class.
- getResourceAsStream("/resources/restful/BasicRestfulWS.java.ws"),
- false, getWsPackage(), getWsName());
- /**
- * workaround
- */
- eclipse.cleanAllProjects();
- bot.sleep(Timing.time3S());
-
- restfulWizard = new RESTFullExplorerWizard(getWsProjectName());
- SWTBotTreeItem[] restServices = restfulWizard.getAllRestServices();
-
- assertTrue(restServices.length == 4);
- assertTrue(areAllRestServicesPresent(restServices));
-
- for (SWTBotTreeItem restService : restServices) {
- assertTrue(restfulWizard.getPathForRestFulService(restService).equals("/rest"));
- assertTrue(restfulWizard.getConsumesInfo(restService).equals("*/*"));
- assertTrue(restfulWizard.getProducesInfo(restService).equals("*/*"));
- }
- }
-
- @Test
- public void testAddingAdvancedRESTMethods() {
-
- if (!projectExplorer.isFilePresent(getWsProjectName(), "Java Resources", "src", getWsPackage(), getWsName() + ".java")) {
- projectHelper.createClass(getWsProjectName(), getWsPackage(), getWsName());
- }
-
- resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
- RESTfulServicesExplorerTest.class.
- getResourceAsStream("/resources/restful/AdvancedRestfulWS.java.ws"),
- false, getWsPackage(), getWsName());
- /**
- * workaround
- */
- eclipse.cleanAllProjects();
- bot.sleep(Timing.time3S());
-
- restfulWizard = new RESTFullExplorerWizard(getWsProjectName());
- SWTBotTreeItem[] restServices = restfulWizard.getAllRestServices();
-
- assertTrue(restServices.length == 4);
- assertTrue(areAllRestServicesPresent(restServices));
-
- for (SWTBotTreeItem restService : restServices) {
- if (restfulWizard.getRestServiceName(restService).equals(RESTFulAnnotations.GET.getLabel())) {
- assertTrue(restfulWizard.getPathForRestFulService(restService).equals("/rest/{id}"));
- assertTrue(restfulWizard.getConsumesInfo(restService).equals("*/*"));
- assertTrue(restfulWizard.getProducesInfo(restService).equals("text/plain"));
- }
- if (restfulWizard.getRestServiceName(restService).equals(RESTFulAnnotations.PUT.getLabel())) {
- assertTrue(restfulWizard.getPathForRestFulService(restService).equals("/rest/put/{id}"));
- assertTrue(restfulWizard.getConsumesInfo(restService).equals("text/plain"));
- assertTrue(restfulWizard.getProducesInfo(restService).equals("*/*"));
- }
- if (restfulWizard.getRestServiceName(restService).equals(RESTFulAnnotations.POST.getLabel())) {
- assertTrue(restfulWizard.getPathForRestFulService(restService).equals("/rest/post/{id}"));
- assertTrue(restfulWizard.getConsumesInfo(restService).equals("text/plain"));
- assertTrue(restfulWizard.getProducesInfo(restService).equals("text/plain"));
- }
- if (restfulWizard.getRestServiceName(restService).equals(RESTFulAnnotations.DELETE.getLabel())) {
- assertTrue(restfulWizard.getPathForRestFulService(restService).equals("/rest/delete/{id}"));
- assertTrue(restfulWizard.getConsumesInfo(restService).equals("*/*"));
- assertTrue(restfulWizard.getProducesInfo(restService).equals("*/*"));
- }
- }
-
- }
-
- @Test
- public void testEditingSimpleRESTMethods() {
- if (!projectExplorer.isFilePresent(getWsProjectName(), "Java Resources", "src", getWsPackage(), getWsName() + ".java")) {
- projectHelper.createClass(getWsProjectName(), getWsPackage(), getWsName());
- }
-
- resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
- RESTfulServicesExplorerTest.class.
- getResourceAsStream("/resources/restful/BasicRestfulWS.java.ws"),
- false, getWsPackage(), getWsName());
-
- /**
- * workaround
- */
- eclipse.cleanAllProjects();
- bot.sleep(Timing.time3S());
-
- restfulWizard = new RESTFullExplorerWizard(getWsProjectName());
- SWTBotTreeItem[] restServices = restfulWizard.getAllRestServices();
-
- assertTrue(areAllRestServicesPresent(restServices));
-
- resourceHelper.replaceInEditor(bot.activeEditor().toTextEditor(), "@DELETE", "@GET");
-
- /**
- * workaround
- */
- eclipse.cleanAllProjects();
- bot.sleep(Timing.time3S());
-
- restfulWizard = new RESTFullExplorerWizard(getWsProjectName());
- restServices = restfulWizard.getAllRestServices();
-
- assertFalse(areAllRestServicesPresent(restServices));
-
- for (SWTBotTreeItem restService : restServices) {
- if (restfulWizard.getRestServiceName(restService).equals(RESTFulAnnotations.DELETE.getLabel())) {
- fail("There should not be DELETE RESTful services");
- }
- }
-
- }
-
- @Test
- public void testEditingAdvancedRESTMethods() {
- if (!projectExplorer.isFilePresent(getWsProjectName(), "Java Resources", "src", getWsPackage(), getWsName() + ".java")) {
- projectHelper.createClass(getWsProjectName(), getWsPackage(), getWsName());
- }
-
- resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
- RESTfulServicesExplorerTest.class.
- getResourceAsStream("/resources/restful/AdvancedRestfulWS.java.ws"),
- false, getWsPackage(), getWsName());
-
- /**
- * workaround
- */
- eclipse.cleanAllProjects();
- bot.sleep(Timing.time3S());
-
- restfulWizard = new RESTFullExplorerWizard(getWsProjectName());
- SWTBotTreeItem[] restServices = restfulWizard.getAllRestServices();
-
- for (SWTBotTreeItem restService : restServices) {
- if (restfulWizard.getRestServiceName(restService).equals(RESTFulAnnotations.DELETE.getLabel())) {
- assertTrue(restfulWizard.getPathForRestFulService(restService).equals("/rest/delete/{id}"));
- assertTrue(restfulWizard.getProducesInfo(restService).equals("*/*"));
- }
- }
-
- resourceHelper.replaceInEditor(bot.activeEditor().toTextEditor(), "/delete/{id}", "delete/edited/{id}");
- resourceHelper.replaceInEditor(bot.activeEditor().toTextEditor(), "@DELETE",
- "@DELETE" + LINE_SEPARATOR + "@Produces(\"text/plain\")");
-
- /**
- * workaround
- */
- eclipse.cleanAllProjects();
- bot.sleep(Timing.time3S());
-
- restfulWizard = new RESTFullExplorerWizard(getWsProjectName());
- restServices = restfulWizard.getAllRestServices();
-
- for (SWTBotTreeItem restService : restServices) {
- if (restfulWizard.getRestServiceName(restService).equals(RESTFulAnnotations.DELETE.getLabel())) {
- assertTrue(restfulWizard.getPathForRestFulService(restService).equals("/rest/delete/edited/{id}"));
- assertTrue(restfulWizard.getProducesInfo(restService).equals("text/plain"));
- }
- }
- }
-
- @Test
- public void testDeletingRESTMethods() {
- if (!projectExplorer.isFilePresent(getWsProjectName(), "Java Resources", "src", getWsPackage(), getWsName() + ".java")) {
- projectHelper.createClass(getWsProjectName(), getWsPackage(), getWsName());
- }
-
- resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
- RESTfulServicesExplorerTest.class.
- getResourceAsStream("/resources/restful/BasicRestfulWS.java.ws"),
- false, getWsPackage(), getWsName());
-
- /**
- * workaround
- */
- eclipse.cleanAllProjects();
- bot.sleep(Timing.time3S());
-
- restfulWizard = new RESTFullExplorerWizard(getWsProjectName());
- SWTBotTreeItem[] restServices = restfulWizard.getAllRestServices();
-
- assertTrue(restServices.length == 4);
-
- resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
- RESTfulServicesExplorerTest.class.
- getResourceAsStream("/resources/restful/EmptyRestfulWS.java.ws"),
- false, getWsPackage(), getWsName());
-
- /**
- * workaround
- */
- eclipse.cleanAllProjects();
- bot.sleep(Timing.time3S());
-
- restfulWizard = new RESTFullExplorerWizard(getWsProjectName());
- restServices = restfulWizard.getAllRestServices();
-
- assertTrue(restServices.length == 0);
-
- }
-
- private boolean areAllRestServicesPresent(SWTBotTreeItem[] restServices) {
-
- String[] restMethods = {RESTFulAnnotations.GET.getLabel(), RESTFulAnnotations.POST.getLabel(),
- RESTFulAnnotations.POST.getLabel(), RESTFulAnnotations.DELETE.getLabel()};
- for (String restMethod : restMethods) {
- boolean serviceFound = false;
- for (SWTBotTreeItem restService : restServices) {
- if (restfulWizard.getRestServiceName(restService).equals(restMethod)) {
- serviceFound = true;
- break;
- }
- }
- if (!serviceFound) return false;
- }
- return true;
- }
-
-}
Added: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/RESTfulSupportTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/RESTfulSupportTest.java (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/RESTfulSupportTest.java 2012-01-10 09:17:46 UTC (rev 37737)
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2011 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.ws.ui.bot.test.rest.explorer;
+
+import org.jboss.tools.ws.ui.bot.test.rest.RESTfulTestBase;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Test checks if context menu 'Add RESTful 1.1 Support' works properly
+ * @author jjankovi
+ *
+ */
+public class RESTfulSupportTest extends RESTfulTestBase {
+
+ protected String getWsProjectName() {
+ return "RestExplorerTest";
+ }
+
+ protected String getWsPackage() {
+ return "org.rest.explorer.validation.test";
+ }
+
+ protected String getWsName() {
+ return "RestService";
+ }
+
+ @Before
+ public void setup() {
+ if (!projectExists(getWsProjectName())) {
+ projectHelper.createProject(getWsProjectName());
+ }
+ }
+
+
+ @Test
+ public void testJAXRSExplorerSupport() {
+
+ addRestSupport(getWsProjectName());
+ assertTrue(isRestSupportEnabled(getWsProjectName()));
+
+ }
+
+}
Added: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/RESTfulValidationTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/RESTfulValidationTest.java (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/RESTfulValidationTest.java 2012-01-10 09:17:46 UTC (rev 37737)
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2011 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.ws.ui.bot.test.rest.explorer;
+
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ws.ui.bot.test.WSTestBase;
+import org.jboss.tools.ws.ui.bot.test.utils.NodeContextUtil;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ *
+ * @author jjankovi
+ *
+ */
+public class RESTfulValidationTest extends WSTestBase {
+
+ private static final String CONFIGURE_MENU_LABEL = "Configure";
+ private static final String REST_SUPPORT_MENU_LABEL_ADD = "Add JAX-RS 1.1 support...";
+ private static final String REST_SUPPORT_MENU_LABEL_REMOVE = "Remove JAX-RS 1.1 support...";
+ private static final String REST_EXPLORER_LABEL = "JAX-RS REST Web Services";
+
+ protected String getWsProjectName() {
+ return "RestExplorerTest";
+ }
+
+ protected String getWsPackage() {
+ return "org.rest.explorer.validation.test";
+ }
+
+ protected String getWsName() {
+ return "RestService";
+ }
+
+ @Before
+ public void setup() {
+ if (!projectExists(getWsProjectName())) {
+ projectHelper.createProject(getWsProjectName());
+ }
+ }
+
+
+ @Test
+ public void testSupportJAX_RS1_1_Explorer() {
+
+ addRestSupport(getWsProjectName());
+
+ projectExplorer.selectProject(getWsProjectName());
+ SWTBotTree tree = projectExplorer.bot().tree();
+ SWTBotTreeItem item = tree.getTreeItem(getWsProjectName());
+ assertTrue(NodeContextUtil.nodeContextMenu(tree, item, CONFIGURE_MENU_LABEL,
+ REST_SUPPORT_MENU_LABEL_REMOVE).isVisible());
+ assertTrue(projectExplorer.isFilePresent(getWsProjectName(), REST_EXPLORER_LABEL));
+
+ }
+
+ private void addRestSupport(String wsProjectName) {
+ projectExplorer.selectProject(wsProjectName);
+ SWTBotTree tree = projectExplorer.bot().tree();
+ SWTBotTreeItem item = tree.getTreeItem(wsProjectName);
+ item.expand();
+ NodeContextUtil.nodeContextMenu(tree, item, CONFIGURE_MENU_LABEL,
+ REST_SUPPORT_MENU_LABEL_ADD).click();
+ bot.sleep(Timing.time2S());
+ util.waitForNonIgnoredJobs();
+ }
+
+}
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/validation/RESTfulValidationTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/validation/RESTfulValidationTest.java 2012-01-10 09:08:41 UTC (rev 37736)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/validation/RESTfulValidationTest.java 2012-01-10 09:17:46 UTC (rev 37737)
@@ -12,6 +12,8 @@
package org.jboss.tools.ws.ui.bot.test.rest.validation;
import org.jboss.tools.ws.ui.bot.test.rest.RESTfulTestBase;
+import org.jboss.tools.ws.ui.bot.test.rest.explorer.RESTfulExplorerTest;
+import org.junit.Ignore;
/**
* Test operates on JAX-RS validation
@@ -32,22 +34,50 @@
return "RestService";
}
+ @Override
+ public void setup() {
+ if (!projectExists(getWsProjectName())) {
+ projectHelper.createProject(getWsProjectName());
+ }
+ if (!projectExplorer.isFilePresent(getWsProjectName(), "Java Resources",
+ "src", getWsPackage(), getWsName() + ".java")) {
+ projectHelper.createClass(getWsProjectName(), getWsPackage(), getWsName());
+ }
+ }
+ @Ignore
public void testCorrectValueValidation() {
- //not implemented yet
+
+ resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
+ RESTfulExplorerTest.class.
+ getResourceAsStream("/resources/restful/CorrectRestWS.java.ws"),
+ false, getWsPackage(), getWsName());
+
+ assertTrue(getRESTValidationErrorsAfterCleanBuild(getWsProjectName()).length == 0);
+
}
-
+ @Ignore
public void testBadValueValidation() {
- //not implemented yet
+ resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
+ RESTfulExplorerTest.class.
+ getResourceAsStream("/resources/restful/BadRestWS.java.ws"),
+ false, getWsPackage(), getWsName());
+
+ assertTrue("" + getRESTValidationErrorsAfterCleanBuild(getWsProjectName()).length,
+ getRESTValidationErrorsAfterCleanBuild(getWsProjectName()).length == 1);
}
-
+ @Ignore
public void testCorrectToBadValueValidation() {
//not implemented yet
}
-
+ @Ignore
+ public void testBadToCorrectValueValidation() {
+ //not implemented yet
+ }
+ @Ignore
public void testValidatorDisabling() {
//not implemented yet
}
-
+ @Ignore
public void testValidatorReenabling() {
//not implemented yet
}
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleRESTTestBase.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleRESTTestBase.java 2012-01-10 09:08:41 UTC (rev 37736)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleRESTTestBase.java 2012-01-10 09:17:46 UTC (rev 37737)
@@ -11,6 +11,8 @@
package org.jboss.tools.ws.ui.bot.test.sample;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
import org.jboss.tools.ws.ui.bot.test.uiutils.wizards.Type;
/**
@@ -18,6 +20,7 @@
* @author jjankovi
*
*/
+@Require(server=@Server(), perspective="Java EE")
public class SampleRESTTestBase extends SampleWSBase {
protected void createSampleRESTWS(String project, String name, String pkg,
Added: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/todo.txt
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/todo.txt (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/todo.txt 2012-01-10 09:17:46 UTC (rev 37737)
@@ -0,0 +1,3 @@
+* manually add resteasy libs to project with EAP target server (RESTfulTestBase)
+* enable/disable JAX-RS validator (RESTfulTestBase)
+* test operating on JAX-RS completion
\ No newline at end of file
12 years, 11 months
JBoss Tools SVN: r37736 - trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2012-01-10 04:08:41 -0500 (Tue, 10 Jan 2012)
New Revision: 37736
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/pom.xml
Log:
Removed unnecessary feature.
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/pom.xml
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/pom.xml 2012-01-10 04:02:34 UTC (rev 37735)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/pom.xml 2012-01-10 09:08:41 UTC (rev 37736)
@@ -26,16 +26,11 @@
<configuration>
<useUIThread>false</useUIThread>
<testSuite>org.jboss.tools.portlet.ui.bot.test</testSuite>
- <testClass>org.jboss.tools.portlet.ui.bot.test.core.JavaPortletTestSuite</testClass>
+ <testClass>org.jboss.tools.portlet.ui.bot.test.jsf.JSFPortletTestSuite</testClass>
<skip>${swtbot.test.skip}</skip>
<dependencies combine.children="append">
<dependency>
<type>p2-installable-unit</type>
- <artifactId>org.eclipse.jst.server_ui.feature.feature.group</artifactId>
- <version>0.0.0</version>
- </dependency>
- <dependency>
- <type>p2-installable-unit</type>
<artifactId>org.jboss.tools.portlet.feature.feature.group</artifactId>
<version>0.0.0</version>
</dependency>
12 years, 11 months
JBoss Tools SVN: r37735 - trunk/maven/docs/maven_reference_guide/en-US.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2012-01-09 23:02:34 -0500 (Mon, 09 Jan 2012)
New Revision: 37735
Modified:
trunk/maven/docs/maven_reference_guide/en-US/Book_Info.xml
trunk/maven/docs/maven_reference_guide/en-US/introduction.xml
Log:
updated for 3.3.0.M5
Modified: trunk/maven/docs/maven_reference_guide/en-US/Book_Info.xml
===================================================================
--- trunk/maven/docs/maven_reference_guide/en-US/Book_Info.xml 2012-01-10 01:04:32 UTC (rev 37734)
+++ trunk/maven/docs/maven_reference_guide/en-US/Book_Info.xml 2012-01-10 04:02:34 UTC (rev 37735)
@@ -13,7 +13,7 @@
<edition>5.0.0</edition>
- <pubsnumber>2</pubsnumber>
+ <pubsnumber>3</pubsnumber>
<abstract>
<para>
Modified: trunk/maven/docs/maven_reference_guide/en-US/introduction.xml
===================================================================
--- trunk/maven/docs/maven_reference_guide/en-US/introduction.xml 2012-01-10 01:04:32 UTC (rev 37734)
+++ trunk/maven/docs/maven_reference_guide/en-US/introduction.xml 2012-01-10 04:02:34 UTC (rev 37735)
@@ -85,7 +85,7 @@
</table>
- <para>Starting from 3.1 M2 version JBoss Tools includes new JBoss Maven Integration plug-in which for now allows to create mavenized Seam projects and enable Seam tools support for imported Maven projects.</para>
+ <!-- <para>Starting from 3.1 M2 version JBoss Tools includes new JBoss Maven Integration plug-in which for now allows to create mavenized Seam projects and enable Seam tools support for imported Maven projects.</para> -->
</section>
12 years, 12 months
JBoss Tools SVN: r37734 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-01-09 20:04:32 -0500 (Mon, 09 Jan 2012)
New Revision: 37734
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEntitiesWizardPage.java
Log:
https://issues.jboss.org/browse/JBIDE-10606 Seam Generate Entities wizard problem
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEntitiesWizardPage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEntitiesWizardPage.java 2012-01-09 23:21:40 UTC (rev 37733)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEntitiesWizardPage.java 2012-01-10 01:04:32 UTC (rev 37734)
@@ -18,6 +18,7 @@
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IPath;
@@ -219,6 +220,7 @@
if(ISeamParameter.SEAM_PROJECT_NAME.equals(event.getPropertyName()) &&
event.getNewValue()!=null &&
!event.getNewValue().equals(event.getOldValue())) {
+ rootSeamProject = SeamWizardUtils.getRootSeamProject(getSelectedProject());
String consoleConfigName = getConsoleConfigurationName(event.getNewValue().toString());
if(consoleConfigName!=null) {
configEditor.setValue(consoleConfigName);
@@ -226,7 +228,18 @@
}
wizardChanged();
}
-
+
+ public IProject getSelectedProject() {
+ String projectName = projectEditor.getValueAsString();
+ if(projectName!=null && projectName.trim().length()>0) {
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
+ if(project.exists()) {
+ return (IProject)project;
+ }
+ }
+ return null;
+ }
+
public void wizardChanged(){
existingReveng.setEnabled("reverse".equals(radios.getValue()));
reverseEngineeringSettings.setEnabled(existingReveng.isEnabled() && existingReveng.isSelected());
12 years, 12 months
JBoss Tools SVN: r37733 - trunk/as/plugins.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2012-01-09 18:21:40 -0500 (Mon, 09 Jan 2012)
New Revision: 37733
Modified:
trunk/as/plugins/pom.xml
Log:
Removed as7 references to fix as-bootstrap profile
Modified: trunk/as/plugins/pom.xml
===================================================================
--- trunk/as/plugins/pom.xml 2012-01-09 22:16:52 UTC (rev 37732)
+++ trunk/as/plugins/pom.xml 2012-01-09 23:21:40 UTC (rev 37733)
@@ -23,9 +23,8 @@
<module>org.jboss.ide.eclipse.as.rse.core</module>
<module>org.jboss.ide.eclipse.as.rse.ui</module>
<module>org.jboss.ide.eclipse.as.jmx.integration</module>
- <module>org.jboss.ide.eclipse.as.management.core</module>
- <module>org.jboss.ide.eclipse.as.management.as7</module>
- <module>org.jboss.ide.eclipse.as.management.as71</module>
+ <module>org.jboss.ide.eclipse.as.management.core</module>
+ <module>org.jboss.ide.eclipse.as.management.as71</module>
</modules>
</project>
12 years, 12 months