Author: dazarov
Date: 2007-10-25 09:01:50 -0400 (Thu, 25 Oct 2007)
New Revision: 4511
Added:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.7
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.8
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/EXIN-13
Added:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.7
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.7
(rev 0)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.7 2007-10-25
13:01:50 UTC (rev 4511)
@@ -0,0 +1,64 @@
+package org.domain.SeamWebWarTestProject.session;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.Create;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.log.Log;
+
+@Name("statefulComponent")
+
+@Stateful
+(a)Scope(ScopeType.APPLICATION)
+public class StatefulComponent {
+
+ private String abc;
+
+ @Logger private Log log;
+
+
+ //seam-gen method
+ public String statefulComponent()
+ {
+ //implement your business logic here
+ log.info("statefulComponent.statefulComponent() action called");
+ return "success";
+ }
+
+ //add additional action methods
+
+ @Create
+ public void createMethod(){
+
+ }
+
+ @Create
+ public void createMethod2(){
+
+ }
+
+ @Destroy
+ public void destroyMethod(){
+
+ }
+
+
+ @Remove
+ public void removeMethod(){
+
+ }
+
+ public String getAbc() {
+ return abc;
+ }
+
+ public void setAbc(String abc) {
+ this.abc = abc;
+ }
+
+}
\ No newline at end of file
Added:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.8
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.8
(rev 0)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.8 2007-10-25
13:01:50 UTC (rev 4511)
@@ -0,0 +1,62 @@
+package org.domain.SeamWebWarTestProject.session;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.Unwrap;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.log.Log;
+
+@Name("statefulComponent")
+
+@Stateful
+(a)Scope(ScopeType.APPLICATION)
+public class StatefulComponent {
+
+ private String abc;
+
+ @Logger private Log log;
+
+
+ //seam-gen method
+ public String statefulComponent()
+ {
+ //implement your business logic here
+ log.info("statefulComponent.statefulComponent() action called");
+ return "success";
+ }
+
+ //add additional action methods
+ @Destroy
+ public void destroyMethod(){
+
+ }
+
+ @Unwrap
+ public void unwrapMethod(){
+
+ }
+
+ @Unwrap
+ public void unwrapMethod2(){
+
+ }
+
+ @Remove
+ public void removeMethod(){
+
+ }
+
+ public String getAbc() {
+ return abc;
+ }
+
+ public void setAbc(String abc) {
+ this.abc = abc;
+ }
+
+}
\ No newline at end of file
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-10-25
12:01:17 UTC (rev 4510)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2007-10-25
13:01:50 UTC (rev 4511)
@@ -231,7 +231,39 @@
assertTrue("Problem marker 'Duplicate @Destroy method' not found",
message[0].startsWith("Duplicate @Destroy method \"destroyMethod"));
// Duplicate @Create method
+ System.out.println("Test - Duplicate @Create method");
+
+ IFile statefulComponentFile7 =
project.getFile("src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.7");
+ try{
+ statefulComponentFile.setContents(statefulComponentFile7.getContents(), true, false,
new NullProgressMonitor());
+ statefulComponentFile.touch(new NullProgressMonitor());
+ }catch(Exception ex){
+ JUnitUtils.fail("Error in changing 'StatefulComponent.java' content to
" +
+ "'StatefulComponent.7'", ex);
+ }
+
+ refreshProject(project);
+
+ message = getMarkersMessage(statefulComponentFile);
+ assertTrue("Problem marker 'Duplicate @Create method' not found",
message[0].startsWith("Duplicate @Create method \"createMethod"));
+
// Duplicate @Unwrap method
+ System.out.println("Test - Duplicate @Unwrap method");
+
+ IFile statefulComponentFile8 =
project.getFile("src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.8");
+ try{
+ statefulComponentFile.setContents(statefulComponentFile8.getContents(), true, false,
new NullProgressMonitor());
+ statefulComponentFile.touch(new NullProgressMonitor());
+ }catch(Exception ex){
+ JUnitUtils.fail("Error in changing 'StatefulComponent.java' content to
" +
+ "'StatefulComponent.8'", ex);
+ }
+
+ refreshProject(project);
+
+ message = getMarkersMessage(statefulComponentFile);
+ assertTrue("Problem marker 'Duplicate @Unwrap method' not found",
message[0].startsWith("Duplicate @Unwrap method \"unwrapMethod"));
+
// Only component class can have @Destroy method
// Only component class can have @Create method
// Only component class can have @Unwrap method