Author: dazarov
Date: 2007-12-26 11:07:59 -0500 (Wed, 26 Dec 2007)
New Revision: 5455
Added:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/SelectionIndexTest.2
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/SelectionIndexTest.3
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/SelectionIndexTest.java
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/SelectionTest.2
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/SelectionTest.3
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/SelectionTest.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/SelectionIndexTest.2
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/SelectionIndexTest.2
(rev 0)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/SelectionIndexTest.2 2007-12-26
16:07:59 UTC (rev 5455)
@@ -0,0 +1,42 @@
+package org.domain.SeamWebWarTestProject.session;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.datamodel.DataModel;
+import org.jboss.seam.annotations.datamodel.DataModelSelectionIndex;
+import org.jboss.seam.log.Log;
+import org.jboss.seam.core.FacesMessages;
+
+@Name("selectionIndexTest")
+public class SelectionIndexTest {
+
+ @Logger private Log log;
+
+ @In FacesMessages facesMessages;
+
+ @DataModel
+ private List<String> messageList=new ArrayList<String>();
+
+ @DataModel
+ private List<String> nameList=new ArrayList<String>();
+
+ @DataModelSelectionIndex int index;
+
+ public List<String> getList(){
+ return messageList;
+ }
+
+ public List<String> getNames(){
+ return nameList;
+ }
+
+ public void selectionIndexTest()
+ {
+ //implement your business logic here
+ log.info("selectionIndexTest.selectionIndexTest() action called");
+ }
+}
Added:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/SelectionIndexTest.3
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/SelectionIndexTest.3
(rev 0)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/SelectionIndexTest.3 2007-12-26
16:07:59 UTC (rev 5455)
@@ -0,0 +1,42 @@
+package org.domain.SeamWebWarTestProject.session;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.datamodel.DataModel;
+import org.jboss.seam.annotations.datamodel.DataModelSelectionIndex;
+import org.jboss.seam.log.Log;
+import org.jboss.seam.core.FacesMessages;
+
+@Name("selectionIndexTest")
+public class SelectionIndexTest {
+
+ @Logger private Log log;
+
+ @In FacesMessages facesMessages;
+
+ @DataModel
+ private List<String> messageList=new ArrayList<String>();
+
+ @DataModel
+ private List<String> nameList=new ArrayList<String>();
+
+ @DataModelSelectionIndex("messageList2") int index;
+
+ public List<String> getList(){
+ return messageList;
+ }
+
+ public List<String> getNames(){
+ return nameList;
+ }
+
+ public void selectionIndexTest()
+ {
+ //implement your business logic here
+ log.info("selectionIndexTest.selectionIndexTest() action called");
+ }
+}
Added:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/SelectionIndexTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/SelectionIndexTest.java
(rev 0)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/SelectionIndexTest.java 2007-12-26
16:07:59 UTC (rev 5455)
@@ -0,0 +1,42 @@
+package org.domain.SeamWebWarTestProject.session;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.datamodel.DataModel;
+import org.jboss.seam.annotations.datamodel.DataModelSelectionIndex;
+import org.jboss.seam.log.Log;
+import org.jboss.seam.core.FacesMessages;
+
+@Name("selectionIndexTest")
+public class SelectionIndexTest {
+
+ @Logger private Log log;
+
+ @In FacesMessages facesMessages;
+
+ @DataModel
+ private List<String> messageList=new ArrayList<String>();
+
+ @DataModel
+ private List<String> nameList=new ArrayList<String>();
+
+ @DataModelSelectionIndex("messageList") int index;
+
+ public List<String> getList(){
+ return messageList;
+ }
+
+ public List<String> getNames(){
+ return nameList;
+ }
+
+ public void selectionIndexTest()
+ {
+ //implement your business logic here
+ log.info("selectionIndexTest.selectionIndexTest() action called");
+ }
+}
Added:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/SelectionTest.2
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/SelectionTest.2
(rev 0)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/SelectionTest.2 2007-12-26
16:07:59 UTC (rev 5455)
@@ -0,0 +1,42 @@
+package org.domain.SeamWebWarTestProject.session;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.datamodel.DataModel;
+import org.jboss.seam.annotations.datamodel.DataModelSelection;
+import org.jboss.seam.log.Log;
+import org.jboss.seam.core.FacesMessages;
+
+@Name("selectionTest")
+public class SelectionTest {
+
+ @Logger private Log log;
+
+ @In FacesMessages facesMessages;
+
+ @DataModel
+ private List<String> messageList=new ArrayList<String>();
+
+ @DataModel
+ private List<String> nameList=new ArrayList<String>();
+
+ @DataModelSelection String s;
+
+ public List<String> getList(){
+ return messageList;
+ }
+
+ public List<String> getNames(){
+ return nameList;
+ }
+
+ public void selectionTest()
+ {
+ //implement your business logic here
+ log.info("selectionTest.selectionTest() action called");
+ }
+}
Added:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/SelectionTest.3
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/SelectionTest.3
(rev 0)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/SelectionTest.3 2007-12-26
16:07:59 UTC (rev 5455)
@@ -0,0 +1,42 @@
+package org.domain.SeamWebWarTestProject.session;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.datamodel.DataModel;
+import org.jboss.seam.annotations.datamodel.DataModelSelection;
+import org.jboss.seam.log.Log;
+import org.jboss.seam.core.FacesMessages;
+
+@Name("selectionTest")
+public class SelectionTest {
+
+ @Logger private Log log;
+
+ @In FacesMessages facesMessages;
+
+ @DataModel
+ private List<String> messageList=new ArrayList<String>();
+
+ @DataModel
+ private List<String> nameList=new ArrayList<String>();
+
+ @DataModelSelection("messageList2") String s;
+
+ public List<String> getList(){
+ return messageList;
+ }
+
+ public List<String> getNames(){
+ return nameList;
+ }
+
+ public void selectionTest()
+ {
+ //implement your business logic here
+ log.info("selectionTest.selectionTest() action called");
+ }
+}
Added:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/SelectionTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/SelectionTest.java
(rev 0)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/SelectionTest.java 2007-12-26
16:07:59 UTC (rev 5455)
@@ -0,0 +1,42 @@
+package org.domain.SeamWebWarTestProject.session;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.datamodel.DataModel;
+import org.jboss.seam.annotations.datamodel.DataModelSelection;
+import org.jboss.seam.log.Log;
+import org.jboss.seam.core.FacesMessages;
+
+@Name("selectionTest")
+public class SelectionTest {
+
+ @Logger private Log log;
+
+ @In FacesMessages facesMessages;
+
+ @DataModel
+ private List<String> messageList=new ArrayList<String>();
+
+ @DataModel
+ private List<String> nameList=new ArrayList<String>();
+
+ @DataModelSelection("messageList") String s;
+
+ public List<String> getList(){
+ return messageList;
+ }
+
+ public List<String> getNames(){
+ return nameList;
+ }
+
+ public void selectionTest()
+ {
+ //implement your business logic here
+ log.info("selectionTest.selectionTest() action called");
+ }
+}
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-26
15:39:11 UTC (rev 5454)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2007-12-26
16:07:59 UTC (rev 5455)
@@ -529,11 +529,98 @@
}
public void testBijectionsValidator() {
+ ISeamProject seamProject = getSeamProject(project);
+
+ IFile selectionTestFile =
project.getFile("src/action/org/domain/SeamWebWarTestProject/session/SelectionTest.java");
+ IFile selectionIndexTestFile =
project.getFile("src/action/org/domain/SeamWebWarTestProject/session/SelectionIndexTest.java");
+
+ refreshProject(project);
+
+ int number = getMarkersNumber(selectionTestFile);
+ assertTrue("Problem marker was found in SelectionIndexTest.java", number ==
0);
+
+ number = getMarkersNumber(selectionIndexTestFile);
+ assertTrue("Problem marker was found in SelectionIndexTest.java", number ==
0);
+
// Multiple data binder
System.out.println("Test - Multiple data binder");
+ IFile selectionTestFile2 =
project.getFile("src/action/org/domain/SeamWebWarTestProject/session/SelectionTest.2");
+ try{
+ selectionTestFile.setContents(selectionTestFile2.getContents(), true, false, new
NullProgressMonitor());
+ selectionTestFile.touch(new NullProgressMonitor());
+ }catch(Exception ex){
+ JUnitUtils.fail("Error in changing 'SelectionTest.java' content to "
+
+ "'SelectionTest.2'", ex);
+ }
+
+ IFile selectionIndexTestFile2 =
project.getFile("src/action/org/domain/SeamWebWarTestProject/session/SelectionIndexTest.2");
+ try{
+ selectionIndexTestFile.setContents(selectionIndexTestFile2.getContents(), true, false,
new NullProgressMonitor());
+ selectionIndexTestFile.touch(new NullProgressMonitor());
+ }catch(Exception ex){
+ JUnitUtils.fail("Error in changing 'SelectionIndexTest.java' content to
" +
+ "'SelectionIndexTest.2'", ex);
+ }
+
+ refreshProject(project);
+
+ String[] messages = getMarkersMessage(selectionTestFile);
+ assertTrue("Problem marker 'Multiple data binder",
messages[0].startsWith("@DataModelSelection and @DataModelSelectionIndex without name
of the DataModel requires the only one @DataModel in the component"));
+
+ int[] lineNumbers = getMarkersNumbersOfLine(selectionTestFile);
+
+ assertTrue("Wrong number of problem markers", lineNumbers.length ==
messages.length && messages.length == 2);
+
+ assertTrue("Problem marker has wrong line number", lineNumbers[0] == 21 ||
lineNumbers[0] == 24);
+ assertTrue("Problem marker has wrong line number", lineNumbers[0] == 21 ||
lineNumbers[0] == 24);
+
+ messages = getMarkersMessage(selectionIndexTestFile);
+ assertTrue("Problem marker 'Multiple data binder",
messages[0].startsWith("@DataModelSelection and @DataModelSelectionIndex without name
of the DataModel requires the only one @DataModel in the component"));
+
+ lineNumbers = getMarkersNumbersOfLine(selectionIndexTestFile);
+
+ assertTrue("Wrong number of problem markers", lineNumbers.length ==
messages.length && messages.length == 2);
+
+ assertTrue("Problem marker has wrong line number", lineNumbers[0] == 21 ||
lineNumbers[0] == 24);
+ assertTrue("Problem marker has wrong line number", lineNumbers[0] == 21 ||
lineNumbers[0] == 24);
+
// Unknown @DataModel/@Out name
System.out.println("Test - Unknown @DataModel/@Out name");
+
+ IFile selectionTestFile3 =
project.getFile("src/action/org/domain/SeamWebWarTestProject/session/SelectionTest.3");
+ try{
+ selectionTestFile.setContents(selectionTestFile3.getContents(), true, false, new
NullProgressMonitor());
+ selectionTestFile.touch(new NullProgressMonitor());
+ }catch(Exception ex){
+ JUnitUtils.fail("Error in changing 'SelectionTest.java' content to "
+
+ "'SelectionTest.3'", ex);
+ }
+
+ IFile selectionIndexTestFile3 =
project.getFile("src/action/org/domain/SeamWebWarTestProject/session/SelectionIndexTest.3");
+ try{
+ selectionIndexTestFile.setContents(selectionIndexTestFile3.getContents(), true, false,
new NullProgressMonitor());
+ selectionIndexTestFile.touch(new NullProgressMonitor());
+ }catch(Exception ex){
+ JUnitUtils.fail("Error in changing 'SelectionIndexTest.java' content to
" +
+ "'SelectionIndexTest.3'", ex);
+ }
+
+ refreshProject(project);
+
+ messages = getMarkersMessage(selectionTestFile);
+ assertTrue("Problem marker 'Unknown @DataModel/@Out name",
messages[0].startsWith("Unknown @DataModel/@Out name: messageList2"));
+
+ lineNumbers = getMarkersNumbersOfLine(selectionTestFile);
+
+ assertTrue("Problem marker has wrong line number", lineNumbers[0] == 27);
+
+ messages = getMarkersMessage(selectionIndexTestFile);
+ assertTrue("Problem marker 'Unknown @DataModel/@Out name",
messages[0].startsWith("Unknown @DataModel/@Out name: messageList2"));
+
+ lineNumbers = getMarkersNumbersOfLine(selectionIndexTestFile);
+
+ assertTrue("Problem marker has wrong line number", lineNumbers[0] == 27);
}
public void testContextVariablesValidator() {