Author: snjeza
Date: 2009-04-07 18:13:49 -0400 (Tue, 07 Apr 2009)
New Revision: 14579
Added:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/jbide/JBide3989Test.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java
Log:
JBIDE-3989 Create a JUnit test case for JBIDE-3979
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF 2009-04-07 18:44:31
UTC (rev 14578)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF 2009-04-07 22:13:49
UTC (rev 14579)
@@ -64,7 +64,11 @@
Export-Package: org.jboss.tools.seam.ui,
org.jboss.tools.seam.ui.actions,
org.jboss.tools.seam.ui.builder,
+ org.jboss.tools.seam.ui.dialog,
+ org.jboss.tools.seam.ui.handlers,
org.jboss.tools.seam.ui.internal.project.facet;x-internal:=true,
+ org.jboss.tools.seam.ui.internal.reveng,
+ org.jboss.tools.seam.ui.marker,
org.jboss.tools.seam.ui.preferences,
org.jboss.tools.seam.ui.refactoring,
org.jboss.tools.seam.ui.search,
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java 2009-04-07
18:44:31 UTC (rev 14578)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java 2009-04-07
22:13:49 UTC (rev 14579)
@@ -18,17 +18,12 @@
import org.jboss.tools.seam.ui.test.ca.SeamELContentAssistJbide1676Test;
import org.jboss.tools.seam.ui.test.ca.SeamELContentAssistTest;
import org.jboss.tools.seam.ui.test.hyperlink.SeamViewHyperlinkPartitionerTest;
+import org.jboss.tools.seam.ui.test.jbide.JBide3989Test;
import org.jboss.tools.seam.ui.test.preferences.SeamPreferencesPageTest;
import org.jboss.tools.seam.ui.test.preferences.SeamSettingsPreferencesPageTest;
import org.jboss.tools.seam.ui.test.view.SeamComponentsViewAllTests;
import org.jboss.tools.seam.ui.test.wizard.OpenSeamComponentDialogTest;
import org.jboss.tools.seam.ui.test.wizard.PackageNamesTest;
-import org.jboss.tools.seam.ui.test.wizard.Seam12EARNewOperationTest;
-import org.jboss.tools.seam.ui.test.wizard.Seam12WARNewOperationTest;
-import org.jboss.tools.seam.ui.test.wizard.Seam12XOperationsTestSuite121EAP;
-import org.jboss.tools.seam.ui.test.wizard.Seam20EARNewOperationTest;
-import org.jboss.tools.seam.ui.test.wizard.Seam20WARNewOperationTest;
-import org.jboss.tools.seam.ui.test.wizard.Seam20XOperationsTestSuite201GA;
import org.jboss.tools.seam.ui.test.wizard.SeamActionNewWizardTest;
import org.jboss.tools.seam.ui.test.wizard.SeamFormNewWizardTest;
import org.jboss.tools.seam.ui.test.wizard.SeamProjectNewWizardTest;
@@ -57,6 +52,7 @@
suite.addTestSuite(SeamELContentAssistJbide1645Test.class);
suite.addTest(new ProjectImportTestSetup(new
TestSuite(SeamSettingsPreferencesPageTest.class),
"org.jboss.tools.seam.ui.test",
"projects/TestSeamSettingsPreferencesPage",
"TestSeamSettingsPreferencesPage"));
suite.addTestSuite(PackageNamesTest.class);
+ suite.addTestSuite(JBide3989Test.class);
return suite;
}
}
\ No newline at end of file
Added:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/jbide/JBide3989Test.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/jbide/JBide3989Test.java
(rev 0)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/jbide/JBide3989Test.java 2009-04-07
22:13:49 UTC (rev 14579)
@@ -0,0 +1,96 @@
+/*************************************************************************************
+ * Copyright (c) 2008 JBoss, a division of Red Hat 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, a division of Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.seam.ui.test.jbide;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.ui.IMarkerResolution;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.wst.validation.internal.operations.ValidatorManager;
+import org.jboss.tools.common.test.util.TestProjectProvider;
+import org.jboss.tools.seam.core.ISeamProject;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.ui.marker.SeamRuntimeMarkerResolution;
+import org.jboss.tools.test.util.JobUtils;
+import org.jboss.tools.test.util.ResourcesUtils;
+
+/**
+ * @author snjeza
+ *
+ */
+public class JBide3989Test extends TestCase {
+
+ private IProject project;
+ private static final String PROJECT_NAME = "TestSeamELContentAssist";
+ private boolean makeCopy = true;
+
+ public static Test suite() {
+ return new TestSuite(JBide3989Test.class);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ TestProjectProvider provider = new TestProjectProvider(
+ "org.jboss.tools.seam.ui.test", null, PROJECT_NAME, makeCopy);
+ project = provider.getProject();
+ project.refreshLocal(IResource.DEPTH_INFINITE, null);
+ JobUtils.waitForIdle();
+ ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, true);
+ seamProject.setRuntimeName("UNKNOWN");
+ ValidatorManager.addProjectBuildValidationSupport(project);
+ project.build(IncrementalProjectBuilder.CLEAN_BUILD,
+ new NullProgressMonitor());
+ JobUtils.waitForIdle();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ JobUtils.waitForIdle();
+ boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
+ try {
+ project.delete(true, true, null);
+ } finally {
+ ResourcesUtils.setBuildAutomatically(saveAutoBuild);
+ }
+ }
+
+ public void testJBide3989() throws CoreException {
+ IMarker[] markers = project.findMarkers(IMarker.PROBLEM, true,
+ IResource.DEPTH_INFINITE);
+ boolean found = false;
+ for (int i = 0; i < markers.length; i++) {
+ IMarker marker = markers[i];
+ IMarkerResolution[] resolutions = IDE.getMarkerHelpRegistry()
+ .getResolutions(marker);
+ for (int j = 0; j < resolutions.length; j++) {
+ IMarkerResolution resolution = resolutions[j];
+ if (resolution instanceof SeamRuntimeMarkerResolution) {
+ found = true;
+ break;
+ }
+ }
+ if (found) {
+ break;
+ }
+ }
+ assertTrue("The quickfix \"Set Seam Properties\" doesn't
exist.", found);
+ }
+
+}