Author: dazarov
Date: 2007-10-30 10:52:00 -0400 (Tue, 30 Oct 2007)
New Revision: 4578
Added:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/entity/abcEntity.2
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/entity/abcEntity.3
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/entity/abcEntity.java
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/entity/abcEntity.2
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/entity/abcEntity.2
(rev 0)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/entity/abcEntity.2 2007-10-30
14:52:00 UTC (rev 4578)
@@ -0,0 +1,55 @@
+package org.domain.SeamWebWarTestProject.entity;
+
+import javax.ejb.Remove;
+import java.io.Serializable;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Version;
+import org.hibernate.validator.Length;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+@Entity
+(a)Scope(ScopeType.STATELESS)
+@Name("abcEntity")
+public class abcEntity implements Serializable {
+ static final long serialVersionUID = 1000;
+ //seam-gen attributes (you should probably edit these)
+ private Long id;
+ private Integer version;
+ private String name;
+
+ //add additional entity attributes
+
+ //seam-gen attribute getters/setters with annotations (you probably should edit)
+
+ @Id @GeneratedValue
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ @Version
+ public Integer getVersion() {
+ return version;
+ }
+
+ @Remove
+ public void removeMethod(){
+
+ }
+
+ @Length(max=20)
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
Added:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/entity/abcEntity.3
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/entity/abcEntity.3
(rev 0)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/entity/abcEntity.3 2007-10-30
14:52:00 UTC (rev 4578)
@@ -0,0 +1,60 @@
+package org.domain.SeamWebWarTestProject.entity;
+
+import javax.ejb.Remove;
+import java.io.Serializable;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Version;
+import org.hibernate.validator.Length;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+@Entity
+(a)Scope(ScopeType.EVENT)
+@Name("abcEntity")
+public class abcEntity implements Serializable {
+ static final long serialVersionUID = 1000;
+ //seam-gen attributes (you should probably edit these)
+ private Long id;
+ private Integer version;
+ private String name;
+
+ //add additional entity attributes
+
+ //seam-gen attribute getters/setters with annotations (you probably should edit)
+
+ @Id @GeneratedValue
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ @Version
+ public Integer getVersion() {
+ return version;
+ }
+
+ @Remove
+ public void removeMethod(){
+
+ }
+
+ @Remove
+ public void removeMethod2(){
+
+ }
+
+ @Length(max=20)
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/entity/abcEntity.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/entity/abcEntity.java 2007-10-30
13:48:08 UTC (rev 4577)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/entity/abcEntity.java 2007-10-30
14:52:00 UTC (rev 4578)
@@ -8,10 +8,12 @@
import javax.persistence.Version;
import org.hibernate.validator.Length;
import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
@Entity
@Scope(ScopeType.EVENT)
+@Name("abcEntity")
public class abcEntity implements Serializable {
static final long serialVersionUID = 1000;
//seam-gen attributes (you should probably edit these)
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-30
13:48:08 UTC (rev 4577)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2007-10-30
14:52:00 UTC (rev 4578)
@@ -208,6 +208,42 @@
int number = getMarkersNumber(abcEntityFile);
assertTrue("Problem marker was found in abcEntity.java", number == 0);
+
+ // Entity component has wrong scope
+ System.out.println("Test - Entity component has wrong scope");
+
+ IFile abcEntityFile2 =
project.getFile("src/action/org/domain/SeamWebWarTestProject/entity/abcEntity.2");
+ try{
+ abcEntityFile.setContents(abcEntityFile2.getContents(), true, false, new
NullProgressMonitor());
+ abcEntityFile.touch(new NullProgressMonitor());
+ }catch(Exception ex){
+ JUnitUtils.fail("Error in changing 'abcEntity.java' content to " +
+ "'abcEntity.2'", ex);
+ }
+
+ refreshProject(project);
+
+ String[] messages = getMarkersMessage(abcEntityFile);
+ assertTrue("Problem marker 'Entity component has wrong scope' not
found", "Entity component \"abcEntity\" should not have
org.jboss.seam.ScopeType.STATELESS".equals(messages[0]));
+
+
+ // Duplicate @Remove method
+ System.out.println("Test - Duplicate @Remove method");
+
+ IFile abcEntityFile3 =
project.getFile("src/action/org/domain/SeamWebWarTestProject/entity/abcEntity.3");
+ try{
+ abcEntityFile.setContents(abcEntityFile3.getContents(), true, false, new
NullProgressMonitor());
+ abcEntityFile.touch(new NullProgressMonitor());
+ }catch(Exception ex){
+ JUnitUtils.fail("Error in changing 'abcEntity.java' content to " +
+ "'abcEntity.3'", ex);
+ }
+
+ refreshProject(project);
+
+ messages = getMarkersMessage(abcEntityFile);
+ assertTrue("Problem marker 'Duplicate @Remove method' not found",
messages[0].startsWith("Duplicate @Remove method \"removeMethod"));
+
}
public void testComponentLifeCycleMethodsValidator() {