Author: dazarov
Date: 2007-12-28 07:09:06 -0500 (Fri, 28 Dec 2007)
New Revision: 5466
Added:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/ContextVariableTest.2
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/ContextVariableTest.3
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/ContextVariableTest.java
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/src/action/org/domain/SeamWebWarTestProject/session/ContextVariableTest.2
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/ContextVariableTest.2
(rev 0)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/ContextVariableTest.2 2007-12-28
12:09:06 UTC (rev 5466)
@@ -0,0 +1,53 @@
+package org.domain.SeamWebWarTestProject.session;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.seam.annotations.Factory;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Role;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.datamodel.DataModel;
+import org.jboss.seam.log.Log;
+import org.jboss.seam.core.FacesMessages;
+
+@Name("messageList")
+@Role(name="messageList")
+public class ContextVariableTest {
+
+ @Logger private Log log;
+
+ @In FacesMessages facesMessages;
+
+ @Out(value="output")
+ private String output;
+
+ public void contextVariableTest()
+ {
+ //implement your business logic here
+ log.info("contextVariableTest.contextVariableTest() action called");
+ }
+
+ @DataModel
+ private List<String> messageList=new ArrayList<String>();
+
+ @Factory("messageList")
+ public void findMessages() {
+
+ }
+
+ @Factory("messageList")
+ public void findMessages2() {
+
+ }
+
+ public List<String> getList(){
+ return messageList;
+ }
+
+ public String getOutput(){
+ return output;
+ }
+}
Added:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/ContextVariableTest.3
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/ContextVariableTest.3
(rev 0)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/ContextVariableTest.3 2007-12-28
12:09:06 UTC (rev 5466)
@@ -0,0 +1,48 @@
+package org.domain.SeamWebWarTestProject.session;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.seam.annotations.Factory;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Role;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.datamodel.DataModel;
+import org.jboss.seam.log.Log;
+import org.jboss.seam.core.FacesMessages;
+
+@Name("contextVariableTest")
+@Role(name="role1")
+public class ContextVariableTest {
+
+ @Logger private Log log;
+
+ @In("messageList5") FacesMessages facesMessages;
+
+ @Out(value="output")
+ private String output;
+
+ public void contextVariableTest()
+ {
+ //implement your business logic here
+ log.info("contextVariableTest.contextVariableTest() action called");
+ }
+
+ @DataModel
+ private List<String> messageList=new ArrayList<String>();
+
+ @Factory("messageList")
+ public void findMessages() {
+
+ }
+
+ public List<String> getList(){
+ return messageList;
+ }
+
+ public String getOutput(){
+ return output;
+ }
+}
Added:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/ContextVariableTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/ContextVariableTest.java
(rev 0)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/ContextVariableTest.java 2007-12-28
12:09:06 UTC (rev 5466)
@@ -0,0 +1,48 @@
+package org.domain.SeamWebWarTestProject.session;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.seam.annotations.Factory;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Role;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.datamodel.DataModel;
+import org.jboss.seam.log.Log;
+import org.jboss.seam.core.FacesMessages;
+
+@Name("contextVariableTest")
+@Role(name="role1")
+public class ContextVariableTest {
+
+ @Logger private Log log;
+
+ @In FacesMessages facesMessages;
+
+ @Out(value="output")
+ private String output;
+
+ public void contextVariableTest()
+ {
+ //implement your business logic here
+ log.info("contextVariableTest.contextVariableTest() action called");
+ }
+
+ @DataModel
+ private List<String> messageList=new ArrayList<String>();
+
+ @Factory("messageList")
+ public void findMessages() {
+
+ }
+
+ public List<String> getList(){
+ return messageList;
+ }
+
+ public String getOutput(){
+ return output;
+ }
+}
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-28
11:34:08 UTC (rev 5465)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2007-12-28
12:09:06 UTC (rev 5466)
@@ -628,11 +628,61 @@
IPreferenceStore store = SeamCorePlugin.getDefault().getPreferenceStore();
System.out.println("UNKNOWN_EL_VARIABLE_NAME value-
"+store.getString(SeamPreferences.UNKNOWN_EL_VARIABLE_NAME));
+ ISeamProject seamProject = getSeamProject(project);
+
+ IFile contextVariableTestFile =
project.getFile("src/action/org/domain/SeamWebWarTestProject/session/ContextVariableTest.java");
+
+ refreshProject(project);
+
+ int number = getMarkersNumber(contextVariableTestFile);
+ assertTrue("Problem marker was found in contextVariableTestFile.java", number
== 0);
+
// Duplicate variable name
System.out.println("Test - Duplicate variable name");
+ IFile contextVariableTestFile2 =
project.getFile("src/action/org/domain/SeamWebWarTestProject/session/ContextVariableTest.2");
+ try{
+ contextVariableTestFile.setContents(contextVariableTestFile2.getContents(), true,
false, new NullProgressMonitor());
+ contextVariableTestFile.touch(new NullProgressMonitor());
+ }catch(Exception ex){
+ JUnitUtils.fail("Error in changing 'ContextVariableTest.java' content to
" +
+ "'ContextVariableTest.2'", ex);
+ }
+
+ refreshProject(project);
+
+ String[] messages = getMarkersMessage(contextVariableTestFile);
+
+ assertTrue("Not all problem markers 'Duplicate variable name' was
found", messages.length == 4);
+
+ assertTrue("Problem marker 'Duplicate variable name' not found",
"Duplicate variable name: messageList".equals(messages[0]));
+
+ int[] lineNumbers = getMarkersNumbersOfLine(contextVariableTestFile);
+
+ assertTrue("Problem marker has wrong line number", (lineNumbers[0] ==
16)||(lineNumbers[0] == 17)||(lineNumbers[0] == 36)||(lineNumbers[0] == 41));
+
// Unknown variable name
System.out.println("Test - Unknown variable name");
+
+ IFile contextVariableTestFile3 =
project.getFile("src/action/org/domain/SeamWebWarTestProject/session/ContextVariableTest.3");
+ try{
+ contextVariableTestFile.setContents(contextVariableTestFile3.getContents(), true,
false, new NullProgressMonitor());
+ contextVariableTestFile.touch(new NullProgressMonitor());
+ }catch(Exception ex){
+ JUnitUtils.fail("Error in changing 'ContextVariableTest.java' content to
" +
+ "'ContextVariableTest.3'", ex);
+ }
+
+ refreshProject(project);
+
+ messages = getMarkersMessage(contextVariableTestFile);
+
+ assertTrue("Problem marker 'Unknown variable name' not found",
"Unknown context variable name: messageList5".equals(messages[0]));
+
+ lineNumbers = getMarkersNumbersOfLine(contextVariableTestFile);
+
+ assertTrue("Problem marker has wrong line number", lineNumbers[0] == 22);
+
}
public void testExpressionLanguageValidator() {