Author: akazakov
Date: 2011-08-11 17:37:37 -0400 (Thu, 11 Aug 2011)
New Revision: 33818
Added:
trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/ValidationProjectTestSetup.java
Removed:
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/KBProjectTestSetup.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JSPProblemMarkerResolutionTest.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/JstWebKbAllTests.java
Log:
https://issues.jboss.org/browse/JBIDE-9532
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JSPProblemMarkerResolutionTest.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JSPProblemMarkerResolutionTest.java 2011-08-11
20:56:13 UTC (rev 33817)
+++
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JSPProblemMarkerResolutionTest.java 2011-08-11
21:37:37 UTC (rev 33818)
@@ -3,14 +3,11 @@
import org.eclipse.core.resources.IFile;
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.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.ui.IMarkerResolution;
+import org.jboss.tools.jst.jsp.test.TestUtil;
import org.jboss.tools.jst.web.ui.action.JSPProblemMarkerResolutionGenerator;
-import org.jboss.tools.test.util.JobUtils;
-import org.jboss.tools.test.util.ProjectImportTestSetup;
import org.jboss.tools.tests.AbstractResourceMarkerTest;
public class JSPProblemMarkerResolutionTest extends AbstractResourceMarkerTest{
@@ -24,33 +21,22 @@
super(name);
}
+ @Override
protected void setUp() throws Exception {
- JobUtils.waitForIdle();
- IResource project =
ResourcesPlugin.getWorkspace().getRoot().findMember("test_jsf_project");
- if(project == null) {
- ProjectImportTestSetup setup = new ProjectImportTestSetup(
- this,
- "org.jboss.tools.jsf.ui.test",
- "projects/test_jsf_project",
- "test_jsf_project");
- project = setup.importProject();
- }
- this.project = project.getProject();
- this.project.build(IncrementalProjectBuilder.FULL_BUILD, null);
- JobUtils.waitForIdle();
+ project =
ResourcesPlugin.getWorkspace().getRoot().getProject("test_jsf_project");
}
-
+
public void testProblemMarkerResolutionInJSP() throws CoreException {
IFile jspFile = project.getFile("WebContent/pages/test_page1.jsp");
-
- assertMarkerIsCreated(jspFile, "org.eclipse.jst.jsp.core.validationMarker",
"Unknown tag (h:commandButton).");
-
+
+ assertMarkerIsCreated(jspFile, "org.eclipse.jst.jsp.core.validationMarker",
"Unknown tag (h:commandButton).", true, 8);
+
IMarker[] markers = findMarkers(jspFile,
"org.eclipse.jst.jsp.core.validationMarker", "Unknown tag
(h:commandButton).");
-
+
assertEquals(1, markers.length);
-
+
JSPProblemMarkerResolutionGenerator generator = new
JSPProblemMarkerResolutionGenerator();
-
+
for(IMarker marker : markers){
generator.hasResolutions(marker);
IMarkerResolution[] resolutions = generator.getResolutions(marker);
@@ -58,23 +44,23 @@
resolution.run(marker);
}
}
-
- refreshProject(project);
-
+
+ TestUtil.validate(jspFile);
+
assertMarkerIsNotCreated(jspFile,
"org.eclipse.jst.jsp.core.validationMarker", "Unknown tag
(h:commandButton).");
}
-
+
public void testProblemMarkerResolutionInXHTML() throws CoreException {
IFile jspFile = project.getFile("WebContent/pages/test_page2.xhtml");
-
- assertMarkerIsCreated(jspFile, "org.eclipse.wst.html.core.validationMarker",
"Unknown tag (ui:insert).");
-
+
+ assertMarkerIsCreated(jspFile, "org.eclipse.wst.html.core.validationMarker",
"Unknown tag (ui:insert).", true, 8, 17, 31);
+
IMarker[] markers = findMarkers(jspFile,
"org.eclipse.wst.html.core.validationMarker", "Unknown tag
(ui:insert).");
-
+
assertEquals(3, markers.length);
-
+
JSPProblemMarkerResolutionGenerator generator = new
JSPProblemMarkerResolutionGenerator();
-
+
for(IMarker marker : markers){
generator.hasResolutions(marker);
IMarkerResolution[] resolutions = generator.getResolutions(marker);
@@ -82,20 +68,9 @@
resolution.run(marker);
}
}
-
- refreshProject(project);
-
+
+ TestUtil.validate(jspFile);
+
assertMarkerIsNotCreated(jspFile,
"org.eclipse.wst.html.core.validationMarker", "Unknown tag
(ui:insert).");
}
-
- private void refreshProject(IProject project){
- try {
- project.refreshLocal(IResource.DEPTH_INFINITE, null);
- project.build(IncrementalProjectBuilder.FULL_BUILD, null);
- JobUtils.waitForIdle();
- JobUtils.delay(2000);
- } catch (CoreException e) {
- // ignore
- }
- }
-}
+}
\ No newline at end of file
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java 2011-08-11
20:56:13 UTC (rev 33817)
+++
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java 2011-08-11
21:37:37 UTC (rev 33818)
@@ -25,8 +25,8 @@
import org.jboss.tools.jsf.jsp.ca.test.CASuggestsNotOnlyELProposalsJBIDE2437Test;
import
org.jboss.tools.jsf.jsp.ca.test.CAUnnecessaryElementsForDirAttributeInXHTMLPageJBIDE1813Test;
import org.jboss.tools.jsf.jsp.ca.test.CAVarAttributeForDataTableTagJBIDE2016;
+import org.jboss.tools.jsf.jsp.ca.test.JavaClassContentAssistProviderTest;
import org.jboss.tools.jsf.jsp.ca.test.JsfJBide3845Test;
-import org.jboss.tools.jsf.jsp.ca.test.JavaClassContentAssistProviderTest;
import org.jboss.tools.jsf.jsp.ca.test.JsfJspJbide1704Test;
import org.jboss.tools.jsf.jsp.ca.test.JsfJspJbide1717Test;
import org.jboss.tools.jsf.jsp.ca.test.JsfJspJbide6259Test;
@@ -34,6 +34,7 @@
import org.jboss.tools.jsf.jsp.ca.test.JspElFunctionsTest;
import org.jboss.tools.jsf.jsp.ca.test.WebContentAssistProviderTest;
import org.jboss.tools.jsf.ui.test.refactoring.ELReferencesRenameTest;
+import org.jboss.tools.jst.jsp.test.ValidationProjectTestSetup;
import org.jboss.tools.test.util.ProjectImportTestSetup;
public class JsfUiAllTests {
@@ -88,7 +89,7 @@
"org.jboss.tools.jsf.ui.test",
new String[]{"projects/test_add_jsf_capabilities"},
new String[]{"test_add_jsf_capabilities"}));
- suite.addTest(new ProjectImportTestSetup(new
TestSuite(JSPProblemMarkerResolutionTest.class),
+ suite.addTest(new ValidationProjectTestSetup(new
TestSuite(JSPProblemMarkerResolutionTest.class),
"org.jboss.tools.jsf.ui.test",
new String[]{"projects/test_jsf_project"},
new String[]{"test_jsf_project"}));
Copied:
trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/ValidationProjectTestSetup.java
(from rev 33816,
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/KBProjectTestSetup.java)
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/ValidationProjectTestSetup.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/ValidationProjectTestSetup.java 2011-08-11
21:37:37 UTC (rev 33818)
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * 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.jst.jsp.test;
+
+import junit.framework.Test;
+
+import org.eclipse.core.resources.IProject;
+import org.jboss.tools.test.util.ProjectImportTestSetup;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class ValidationProjectTestSetup extends ProjectImportTestSetup {
+
+ public ValidationProjectTestSetup(Test test, String bundleName, String projectPath,
String projectName) {
+ super(test,bundleName, projectPath, projectName);
+ }
+
+ public ValidationProjectTestSetup(Test test, String bundleName, String[] projectPaths,
String[] projectNames) {
+ super(test, bundleName, projectPaths, projectNames);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.model.util.test.XProjectImportTestSetUp#setUp()
+ */
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ for (IProject project : projects) {
+ TestUtil._waitForValidation(project);
+ }
+ }
+}
\ No newline at end of file
Property changes on:
trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/ValidationProjectTestSetup.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified:
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/JstWebKbAllTests.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/JstWebKbAllTests.java 2011-08-11
20:56:13 UTC (rev 33817)
+++
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/JstWebKbAllTests.java 2011-08-11
21:37:37 UTC (rev 33818)
@@ -14,6 +14,7 @@
import junit.framework.TestSuite;
import org.jboss.tools.common.model.util.test.XProjectImportTestSetUp;
+import org.jboss.tools.jst.jsp.test.ValidationProjectTestSetup;
import org.jboss.tools.jst.web.kb.test.validation.BuilderOrderMarkerResolutionTest;
import org.jboss.tools.jst.web.kb.test.validation.KBValidationTest;
import org.jboss.tools.test.util.ProjectImportTestSetup;
@@ -48,7 +49,7 @@
suiteAll.addTestSuite(KBValidationTest.class);
suite = new TestSuite(BuilderOrderMarkerResolutionTest.class.getName());
suite.addTestSuite(BuilderOrderMarkerResolutionTest.class);
- testSetup = new KBProjectTestSetup(suite,
+ testSetup = new ValidationProjectTestSetup(suite,
"org.jboss.tools.jst.web.kb.test",
new String[]{"projects/TestBrokenBuilderOrder"},
new String[]{"TestBrokenBuilderOrder"});
Deleted:
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/KBProjectTestSetup.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/KBProjectTestSetup.java 2011-08-11
20:56:13 UTC (rev 33817)
+++
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/KBProjectTestSetup.java 2011-08-11
21:37:37 UTC (rev 33818)
@@ -1,43 +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.jst.web.kb.test;
-
-import junit.framework.Test;
-
-import org.eclipse.core.resources.IProject;
-import org.jboss.tools.common.model.util.test.XProjectImportTestSetUp;
-import org.jboss.tools.jst.jsp.test.TestUtil;
-
-/**
- * @author Alexey Kazakov
- */
-public class KBProjectTestSetup extends XProjectImportTestSetUp {
-
- public KBProjectTestSetup(Test test, String bundleName, String projectPath, String
projectName) {
- super(test,bundleName, projectPath, projectName);
- }
-
- public KBProjectTestSetup(Test test, String bundleName, String[] projectPaths, String[]
projectNames) {
- super(test, bundleName, projectPaths, projectNames);
- }
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.common.model.util.test.XProjectImportTestSetUp#setUp()
- */
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- for (IProject project : projects) {
- TestUtil._waitForValidation(project);
- }
- }
-}
\ No newline at end of file