Author: dazarov
Date: 2007-12-24 11:11:20 -0500 (Mon, 24 Dec 2007)
New Revision: 5434
Added:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/abcComponent.2
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/abcComponent.3
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1550
Added:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/abcComponent.2
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/abcComponent.2
(rev 0)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/abcComponent.2 2007-12-24
16:11:20 UTC (rev 5434)
@@ -0,0 +1,31 @@
+<!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:s="http://jboss.com/products/seam/taglib"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich"
+
xmlns:a="https://ajax4jsf.dev.java.net/ajax"
+ template="layout/template.xhtml">
+
+<ui:define name="body">
+
+ <h:messages globalOnly="true" styleClass="message"/>
+
+ <rich:panel>
+ <f:facet name="header">abcComponent</f:facet>
+
+ <h:form id="abcComponentForm">
+
+ <h:commandButton id="abcComponent"
value="abcComponent!"
+ action="#{bcComponent.abcComponent}"/>
+
+ </h:form>
+
+ </rich:panel>
+
+</ui:define>
+
+</ui:composition>
+
Added:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/abcComponent.3
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/abcComponent.3
(rev 0)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/abcComponent.3 2007-12-24
16:11:20 UTC (rev 5434)
@@ -0,0 +1,31 @@
+<!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:s="http://jboss.com/products/seam/taglib"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich"
+
xmlns:a="https://ajax4jsf.dev.java.net/ajax"
+ template="layout/template.xhtml">
+
+<ui:define name="body">
+
+ <h:messages globalOnly="true" styleClass="message"/>
+
+ <rich:panel>
+ <f:facet name="header">abcComponent</f:facet>
+
+ <h:form id="abcComponentForm">
+
+ <h:commandButton id="abcComponent"
value="abcComponent!"
+ action="#{abcComponent.bcComponent}"/>
+
+ </h:form>
+
+ </rich:panel>
+
+</ui:define>
+
+</ui:composition>
+
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2007-12-24
11:46:16 UTC (rev 5433)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2007-12-24
16:11:20 UTC (rev 5434)
@@ -516,12 +516,58 @@
System.out.println("UNKNOWN_VARIABLE_NAME value-
"+store.getString(SeamPreferences.UNKNOWN_VARIABLE_NAME));
System.out.println("UNPAIRED_GETTER_OR_SETTER value-
"+store.getString(SeamPreferences.UNPAIRED_GETTER_OR_SETTER));
+ ISeamProject seamProject = getSeamProject(project);
+
+ IFile abcComponentXHTMLFile =
project.getFile("WebContent/abcComponent.xhtml");
+
+
+ int number = getMarkersNumber(abcComponentXHTMLFile);
+ assertTrue("Problem marker was found in abcComponent.xhtml", number == 0);
+
// Context variable cannot be resolved
System.out.println("Test - Context variable cannot be resolved");
+ IFile abcComponentXHTMLFile2 = project.getFile("WebContent/abcComponent.2");
+ try{
+ abcComponentXHTMLFile.setContents(abcComponentXHTMLFile2.getContents(), true, false,
new NullProgressMonitor());
+ abcComponentXHTMLFile.touch(new NullProgressMonitor());
+ }catch(Exception ex){
+ JUnitUtils.fail("Error in changing 'abcComponent.xhtml' content to "
+
+ "'abcComponent.2'", ex);
+ }
+
+ refreshProject(project);
+
+ String[] messages = getMarkersMessage(abcComponentXHTMLFile);
+
+ assertTrue("Problem marker 'Context variable cannot be resolved' not
found", "bcComponent cannot be resolved".equals(messages[0]));
+
+ int[] lineNumbers = getMarkersNumbersOfLine(abcComponentXHTMLFile);
+
+ assertTrue("Problem marker has wrong line number", lineNumbers[0] == 22);
+
// Property cannot be resolved
System.out.println("Test - Property cannot be resolved");
+ IFile abcComponentXHTMLFile3 = project.getFile("WebContent/abcComponent.3");
+ try{
+ abcComponentXHTMLFile.setContents(abcComponentXHTMLFile3.getContents(), true, false,
new NullProgressMonitor());
+ abcComponentXHTMLFile.touch(new NullProgressMonitor());
+ }catch(Exception ex){
+ JUnitUtils.fail("Error in changing 'abcComponent.xhtml' content to "
+
+ "'abcComponent.3'", ex);
+ }
+
+ refreshProject(project);
+
+ messages = getMarkersMessage(abcComponentXHTMLFile);
+
+ assertTrue("Problem marker 'Property cannot be resolved' not found",
"bcComponent cannot be resolved".equals(messages[0]));
+
+ lineNumbers = getMarkersNumbersOfLine(abcComponentXHTMLFile);
+
+ assertTrue("Problem marker has wrong line number", lineNumbers[0] == 22);
+
// Unpaired Getter/Setter
System.out.println("Test - Unpaired Getter/Setter");