Author: akazakov
Date: 2011-05-26 15:43:02 -0400 (Thu, 26 May 2011)
New Revision: 31527
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/META-INF/MANIFEST.MF
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/.project
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesTestSetup.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesValidationTest.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist/CATestUtil.java
trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/META-INF/MANIFEST.MF
trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/TestUtil.java
trunk/struts/tests/org.jboss.tools.struts.text.ext.test/src/org/jboss/tools/struts/text/tests/hyperlink/StrutsJbide1762Test.java
Log:
https://issues.jboss.org/browse/JBIDE-8576
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-05-26
19:00:45 UTC (rev 31526)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-05-26
19:43:02 UTC (rev 31527)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.tools.cdi.internal.core.validation;
-
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collections;
@@ -188,6 +187,9 @@
CDICoreNature nature = CDICorePlugin.getCDI(projectSet.getRootProject(), false);
if(nature!=null) {
cdiProject = nature.getDelegate();
+ if(cdiProject==null) {
+ CDICorePlugin.getDefault().logError("Trying to validate " + rootProject +
" but CDI Tools model for the project is not buit.");
+ }
}
projectName = projectSet.getRootProject().getName();
sourceFolders = null;
@@ -280,7 +282,6 @@
}
}
if(!dependentFiles.isEmpty()) {
- System.out.println("Dependencies=" + dependentFiles.size());
filesToValidate.addAll(dependentFiles);
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/META-INF/MANIFEST.MF
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/META-INF/MANIFEST.MF 2011-05-26
19:00:45 UTC (rev 31526)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/META-INF/MANIFEST.MF 2011-05-26
19:43:02 UTC (rev 31527)
@@ -11,4 +11,5 @@
org.eclipse.core.resources;bundle-version="3.7.100",
org.jboss.tools.tests,
org.eclipse.core.runtime;bundle-version="3.7.0",
- org.jboss.tools.cdi.core
+ org.jboss.tools.cdi.core,
+ org.jboss.tools.jst.jsp.base.test
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/.project
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/.project 2011-05-26
19:00:45 UTC (rev 31526)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/.project 2011-05-26
19:43:02 UTC (rev 31527)
@@ -6,22 +6,22 @@
</projects>
<buildSpec>
<buildCommand>
- <name>org.eclipse.wst.validation.validationbuilder</name>
+ <name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
+ <name>org.jboss.tools.jst.web.kb.kbbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
- <name>org.jboss.tools.jst.web.kb.kbbuilder</name>
+ <name>org.jboss.tools.cdi.core.cdibuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
- <name>org.jboss.tools.cdi.core.cdibuilder</name>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesTestSetup.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesTestSetup.java 2011-05-26
19:00:45 UTC (rev 31526)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesTestSetup.java 2011-05-26
19:43:02 UTC (rev 31527)
@@ -36,7 +36,7 @@
@Override
protected void setUp() throws Exception {
project = ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME);
- if(project == null || !project.exists()) {
+ if(!project.exists()) {
project = ResourcesUtils.importProject(PLUGIN_ID, PROJECT_PATH);
}
}
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesValidationTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesValidationTest.java 2011-05-26
19:00:45 UTC (rev 31526)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesValidationTest.java 2011-05-26
19:43:02 UTC (rev 31527)
@@ -10,12 +10,22 @@
******************************************************************************/
package org.jboss.tools.cdi.seam.faces.core.test;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+
import junit.framework.TestCase;
import org.eclipse.core.resources.IFile;
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.jboss.tools.cdi.internal.core.validation.CDIValidationMessages;
+import org.jboss.tools.jst.jsp.test.TestUtil;
+import org.jboss.tools.jst.web.kb.internal.validation.ValidatorManager;
+import org.jboss.tools.test.util.JobUtils;
+import org.jboss.tools.test.util.ResourcesUtils;
import org.jboss.tools.tests.AbstractResourceMarkerTest;
/**
@@ -25,9 +35,14 @@
protected IProject project;
- public IProject getTestProject() {
+ public IProject getTestProject() throws IOException, CoreException,
InvocationTargetException, InterruptedException {
if(project==null) {
+ ValidatorManager.setStatus("INIT");
project =
ResourcesPlugin.getWorkspace().getRoot().getProject(SeamFacesTestSetup.PROJECT_NAME);
+ if(!project.exists()) {
+ project = ResourcesUtils.importProject(SeamFacesTestSetup.PLUGIN_ID,
SeamFacesTestSetup.PROJECT_PATH);
+ }
+ TestUtil.waitForValidation(project);
}
return project;
}
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2011-05-26
19:00:45 UTC (rev 31526)
+++
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2011-05-26
19:43:02 UTC (rev 31527)
@@ -34,8 +34,8 @@
import org.jboss.tools.cdi.ui.marker.MakeMethodPublicMarkerResolution;
import org.jboss.tools.cdi.ui.marker.TestableResolutionWithRefactoringProcessor;
import org.jboss.tools.common.util.FileUtil;
+import org.jboss.tools.jst.jsp.test.TestUtil;
import org.jboss.tools.jst.web.kb.internal.validation.ValidatorManager;
-import org.jboss.tools.test.util.JobUtils;
/**
* @author Daniel Azarov
@@ -55,7 +55,7 @@
ValidatorManager.setStatus("TESTING");
copyFiles(project, fileNames);
- waitForIdle(project);
+ TestUtil.waitForValidation(project);
try{
file = project.getFile(fileNames[0]);
@@ -104,7 +104,7 @@
resolution.run(marker);
}
- waitForIdle(project);
+ TestUtil.waitForValidation(project);
file = project.getFile(fileNames[0]);
IMarker[] newMarkers = file.findMarkers(markerType,
true, IResource.DEPTH_INFINITE);
@@ -123,21 +123,10 @@
fail("Problem marker with id: "+id+" not found");
}finally{
restoreFiles(project, fileNames);
- waitForIdle(project);
+ TestUtil.waitForValidation(project);
}
}
- private void waitForIdle(IProject project) throws CoreException{
- JobUtils.waitForIdle();
- for (int i = 0; i < 50; i++) {
- if(ValidatorManager.getStatus().equals(ValidatorManager.SLEEPING)) {
- break;
- }
- JobUtils.delay(100);
- JobUtils.waitForIdle();
- }
- }
-
private void copyFiles(IProject project, String[] fileNames) throws CoreException{
for(String fileName : fileNames){
IFile file = project.getFile(fileName);
Modified:
trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist/CATestUtil.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist/CATestUtil.java 2011-05-26
19:00:45 UTC (rev 31526)
+++
trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist/CATestUtil.java 2011-05-26
19:43:02 UTC (rev 31527)
@@ -29,7 +29,6 @@
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.AbstractTextEditor;
import org.eclipse.ui.texteditor.ITextEditor;
import org.jboss.tools.common.text.xml.contentassist.ProposalSorter;
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/META-INF/MANIFEST.MF 2011-05-26
19:00:45 UTC (rev 31526)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/META-INF/MANIFEST.MF 2011-05-26
19:43:02 UTC (rev 31527)
@@ -17,7 +17,8 @@
org.junit;bundle-version="3.8.2",
org.jboss.tools.jst.web;bundle-version="3.2.0",
org.eclipse.ui.ide;bundle-version="3.7.0",
- org.jboss.tools.common.model.ui
+ org.jboss.tools.common.model.ui,
+ org.jboss.tools.jst.web.kb
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: org.jboss.tools.jst.jsp.test,
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/TestUtil.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/TestUtil.java 2011-05-26
19:00:45 UTC (rev 31526)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/TestUtil.java 2011-05-26
19:43:02 UTC (rev 31527)
@@ -1,7 +1,20 @@
package org.jboss.tools.jst.jsp.test;
-import org.jboss.tools.common.base.test.contentassist.CATestUtil;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.jboss.tools.jst.web.kb.internal.validation.ValidatorManager;
+import org.jboss.tools.test.util.JobUtils;
-public class TestUtil extends CATestUtil {
+public class TestUtil {
-}
+ public static void waitForValidation(IProject project) throws CoreException{
+ JobUtils.waitForIdle();
+ for (int i = 0; i < 50; i++) {
+ if(ValidatorManager.getStatus().equals(ValidatorManager.SLEEPING)) {
+ break;
+ }
+ JobUtils.delay(100);
+ JobUtils.waitForIdle();
+ }
+ }
+}
\ No newline at end of file
Modified:
trunk/struts/tests/org.jboss.tools.struts.text.ext.test/src/org/jboss/tools/struts/text/tests/hyperlink/StrutsJbide1762Test.java
===================================================================
---
trunk/struts/tests/org.jboss.tools.struts.text.ext.test/src/org/jboss/tools/struts/text/tests/hyperlink/StrutsJbide1762Test.java 2011-05-26
19:00:45 UTC (rev 31526)
+++
trunk/struts/tests/org.jboss.tools.struts.text.ext.test/src/org/jboss/tools/struts/text/tests/hyperlink/StrutsJbide1762Test.java 2011-05-26
19:43:02 UTC (rev 31527)
@@ -22,9 +22,9 @@
import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
+import org.jboss.tools.common.base.test.contentassist.CATestUtil;
import org.jboss.tools.common.model.ui.editor.EditorPartWrapper;
import org.jboss.tools.common.model.ui.texteditors.XMLTextEditorComponent;
-import org.jboss.tools.jst.jsp.test.TestUtil;
import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.TestProjectProvider;
@@ -98,7 +98,7 @@
e.printStackTrace();
assertTrue("Waiting for the jobs to complete has failed.", false);
}
- TestUtil.delay(3000);
+ CATestUtil.delay(3000);
// ITextEditor textEditor = TestUtil.getActiveTextEditor(wrapperEditor);
ITextEditor textEditor = getTextEditor(wrapperEditor);
@@ -112,7 +112,7 @@
// wrapperEditor.getJspEditor();
StructuredTextViewer viewer = xmlTextEditor.getTextViewer();
IDocument document = viewer.getDocument();
- SourceViewerConfiguration config =
TestUtil.getSourceViewerConfiguration(xmlTextEditor);
+ SourceViewerConfiguration config =
CATestUtil.getSourceViewerConfiguration(xmlTextEditor);
IHyperlinkDetector[] hyperlinkDetectors = (config == null ? null :
config.getHyperlinkDetectors(viewer));
assertTrue("Cannot get the Hyperlink Detectors for the editor for page
\"" + WEB_XML_NAME + "\"", (hyperlinkDetectors != null));
@@ -179,16 +179,14 @@
index = startNodeIndex;
continue;
}
-
+
// System.out.println("Posting the Test Regions: " +
documentContent.substring(startNodeIndex, endNodeIndex));
for (int j = startNodeIndex; j < endNodeIndex; j++) {
regions.add(new Region(j, 0));
}
index = documentContent.indexOf(">", endNodeIndex);
}
-
+
return regions;
}
-
-
-}
+}
\ No newline at end of file