Author: akazakov
Date: 2012-01-18 14:44:21 -0500 (Wed, 18 Jan 2012)
New Revision: 37951
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/pages/syntaxErrors.xhtml
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/JavaSource/demo/BaseBean.java
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/ELValidatorTest.java
Log:
https://issues.jboss.org/browse/JBIDE-10661 Incorrect validation of ELs with syntax
errors
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/JavaSource/demo/BaseBean.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/JavaSource/demo/BaseBean.java 2012-01-18
19:34:29 UTC (rev 37950)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/JavaSource/demo/BaseBean.java 2012-01-18
19:44:21 UTC (rev 37951)
@@ -6,6 +6,6 @@
return "";
}
- public void fuck() {}
+ public void foo() {}
}
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/pages/syntaxErrors.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/pages/syntaxErrors.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/pages/syntaxErrors.xhtml 2012-01-18
19:44:21 UTC (rev 37951)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="windows-1251"?>
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html">
+#{abc.}
+ <h:outputText value="#{user.broken.}"/>
+
+</ui:composition>
\ No newline at end of file
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 2012-01-18
19:34:29 UTC (rev 37950)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/ELValidatorTest.java 2012-01-18
19:44:21 UTC (rev 37951)
@@ -17,6 +17,7 @@
import org.eclipse.wst.validation.internal.core.ValidationException;
import org.eclipse.wst.validation.internal.operations.WorkbenchReporter;
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
+import org.jboss.tools.common.base.test.validation.TestUtil;
import org.jboss.tools.common.preferences.SeverityPreferences;
import org.jboss.tools.common.validation.ContextValidationHelper;
import org.jboss.tools.common.validation.IProjectValidationContext;
@@ -24,7 +25,6 @@
import org.jboss.tools.common.validation.ValidationErrorManager;
import org.jboss.tools.common.validation.ValidatorManager;
import org.jboss.tools.common.validation.internal.SimpleValidatingProjectTree;
-import org.jboss.tools.jsf.JSFModelPlugin;
import org.jboss.tools.jst.web.kb.WebKbPlugin;
import org.jboss.tools.jst.web.kb.internal.validation.ELValidationMessages;
import org.jboss.tools.jst.web.kb.internal.validation.ELValidator;
@@ -247,6 +247,25 @@
}
}
+ /**
+ * See
https://jira.jboss.org/browse/JBIDE-10661
+ * @throws CoreException
+ * @throws ValidationException
+ */
+ public void testSyntaxErrors() throws CoreException, ValidationException {
+ IFile file = project.getFile("WebContent/pages/syntaxErrors.jsp");
+
+ TestUtil.validate(file);
+
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file,
ELValidationMessages.EL_SYNTAX_ERROR, true, 7, 8);
+
+ String messagePattern =
MessageFormat.format(ELValidationMessages.UNKNOWN_EL_VARIABLE_NAME, new
Object[]{"abc."});
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, messagePattern, 7);
+
+ messagePattern =
MessageFormat.format(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, new
Object[]{"broken"});
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, messagePattern, false, 8);
+ }
+
private long validateFile(String fileName, int numberOfMarkers) throws
ValidationException {
Set<String> files = new HashSet<String>();
files.add(fileName);