Author: akazakov
Date: 2010-12-09 15:16:52 -0500 (Thu, 09 Dec 2010)
New Revision: 27298
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/.project
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/ELValidatorTest.java
Log:
https://issues.jboss.org/browse/JBIDE-7748 Fixed JSF tests
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/.project
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/.project 2010-12-09
19:50:26 UTC (rev 27297)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/.project 2010-12-09
20:16:52 UTC (rev 27298)
@@ -16,11 +16,6 @@
</arguments>
</buildCommand>
<buildCommand>
- <name>org.eclipse.wst.validation.validationbuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
<name>org.jboss.tools.jst.web.kb.kbbuilder</name>
<arguments>
</arguments>
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/ELValidatorTest.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/ELValidatorTest.java 2010-12-09
19:50:26 UTC (rev 27297)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/ELValidatorTest.java 2010-12-09
20:16:52 UTC (rev 27298)
@@ -83,16 +83,25 @@
14);
IFile file = project.getFile("WebContent/testElRevalidation.xhtml");
- file.deleteMarkers(IValidator.KB_PROBLEM_MARKER_TYPE, true, IResource.DEPTH_ZERO);
+ file.deleteMarkers(ELValidator.PROBLEM_TYPE, true, IResource.DEPTH_ZERO);
+ assertMarkerIsNotCreatedForLine(
+ "WebContent/testElRevalidation.xhtml",
+ JSFValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME,
+ new Object[] {"user"},
+ 14, false);
+
// Check if the validator was not invoked.
copyContentsFile("WebContent/WEB-INF/faces-config.xml",
"WebContent/WEB-INF/faces-config.original");
+ file = project.getFile("WebContent/WEB-INF/faces-config.xml");
+ ValidationFramework.getDefault().validate(file, new NullProgressMonitor());
+
assertMarkerIsNotCreatedForLine(
"WebContent/testElRevalidation.xhtml",
JSFValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME,
new Object[] {"user"},
- 14);
+ 14, false);
} finally {
store.setValue(JSFSeverityPreferences.RE_VALIDATE_UNRESOLVED_EL,
JSFSeverityPreferences.ENABLE);
store.setValue(JSFSeverityPreferences.UNKNOWN_EL_VARIABLE_NAME,
JSFSeverityPreferences.IGNORE);
@@ -304,10 +313,16 @@
}
private void assertMarkerIsCreatedForLine(String fileName, String template, Object[]
parameters, int lineNumber) throws CoreException{
+ assertMarkerIsCreatedForLine(fileName, template, parameters, lineNumber, true);
+ }
+
+ private void assertMarkerIsCreatedForLine(String fileName, String template, Object[]
parameters, int lineNumber, boolean validate) throws CoreException{
String messagePattern = MessageFormat.format(template, parameters);
IFile file = project.getFile(fileName);
- ValidationFramework.getDefault().validate(file, new NullProgressMonitor());
+ if(validate) {
+ ValidationFramework.getDefault().validate(file, new NullProgressMonitor());
+ }
IMarker[] markers = file.findMarkers(null, true, IResource.DEPTH_INFINITE);
for (int i = 0; i < markers.length; i++) {
@@ -320,10 +335,16 @@
}
private void assertMarkerIsNotCreatedForLine(String fileName, String template, Object[]
parameters, int lineNumber) throws CoreException{
+ assertMarkerIsNotCreatedForLine(fileName, template, parameters, lineNumber, true);
+ }
+
+ private void assertMarkerIsNotCreatedForLine(String fileName, String template, Object[]
parameters, int lineNumber, boolean validate) throws CoreException{
String messagePattern = MessageFormat.format(template, parameters);
IFile file = project.getFile(fileName);
- ValidationFramework.getDefault().validate(file, new NullProgressMonitor());
+ if(validate) {
+ ValidationFramework.getDefault().validate(file, new NullProgressMonitor());
+ }
IMarker[] markers = file.findMarkers(null, true, IResource.DEPTH_INFINITE);
for (int i = 0; i < markers.length; i++) {