Author: dazarov
Date: 2007-10-25 12:00:03 -0400 (Thu, 25 Oct 2007)
New Revision: 4515
Added:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/WEB-INF/components.4
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.10
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.11
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.12
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.9
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/WebContent/WEB-INF/components.4
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/WEB-INF/components.4
(rev 0)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/WEB-INF/components.4 2007-10-25
16:00:03 UTC (rev 4515)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components
xmlns="http://jboss.com/products/seam/components"
+
xmlns:core="http://jboss.com/products/seam/core"
+
xmlns:drools="http://jboss.com/products/seam/drools"
+
xmlns:security="http://jboss.com/products/seam/security"
+
xmlns:mail="http://jboss.com/products/seam/mail"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation=
+ "http://jboss.com/products/seam/core
http://jboss.com/products/seam/core-1.1.xsd
+
http://jboss.com/products/seam/drools
http://jboss.com/products/seam/drools-1.1.xsd
+
http://jboss.com/products/seam/security
http://jboss.com/products/seam/security-1.1.xsd
+
http://jboss.com/products/seam/mail
http://jboss.com/products/seam/mail-1.2.xsd
+
http://jboss.com/products/seam/components
http://jboss.com/products/seam/components-1.1.xsd">
+
+
+ <core:init debug="true" jndi-pattern="@jndiPattern@"/>
+
+ <core:manager concurrent-request-timeout="500"
+ conversation-timeout="120000"
+ conversation-id-parameter="cid"
+ conversation-is-long-running-parameter="clr"/>
+
+
+ <core:entity-manager-factory
name="SeamWebWarTestProjectEntityManagerFactory"
+ persistence-unit-name="SeamWebWarTestProject"/>
+
+ <core:ejb installed="@embeddedEjb@"/>
+
+
+
+ <event type="org.jboss.seam.notLoggedIn">
+ <action expression="#{redirect.captureCurrentView}"/>
+ </event>
+ <event type="org.jboss.seam.postAuthenticate">
+ <action expression="#{redirect.returnToCapturedView}"/>
+ </event>
+
+ <mail:mail-session host="localhost" port="2525"
username="test" password="test" />
+
+ <!-- For use with jBPM pageflow or process management -->
+ <!--
+ <core:jbpm>
+ <core:process-definitions></core:process-definitions>
+ <core:pageflow-definitions></core:pageflow-definitions>
+ </core:jbpm>
+ -->
+
+</components>
Added:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.10
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.10
(rev 0)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.10 2007-10-25
16:00:03 UTC (rev 4515)
@@ -0,0 +1,37 @@
+package org.domain.SeamWebWarTestProject.session;
+
+
+import org.jboss.seam.annotations.Create;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.log.Log;
+
+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(){
+
+ }
+
+ 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.11
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.11
(rev 0)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.11 2007-10-25
16:00:03 UTC (rev 4515)
@@ -0,0 +1,38 @@
+package org.domain.SeamWebWarTestProject.session;
+
+
+import org.jboss.seam.annotations.Unwrap;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.log.Log;
+
+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
+
+ @Unwrap
+ public void unwrapMethod(){
+
+ }
+
+ 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.12
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.12
(rev 0)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.12 2007-10-25
16:00:03 UTC (rev 4515)
@@ -0,0 +1,38 @@
+package org.domain.SeamWebWarTestProject.session;
+
+
+import org.jboss.seam.annotations.Observer;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.log.Log;
+
+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
+
+ @Observer
+ public void observerMethod(){
+
+ }
+
+ 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.9
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.9
(rev 0)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.9 2007-10-25
16:00:03 UTC (rev 4515)
@@ -0,0 +1,37 @@
+package org.domain.SeamWebWarTestProject.session;
+
+
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.log.Log;
+
+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(){
+
+ }
+
+ 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
15:58:04 UTC (rev 4514)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2007-10-25
16:00:03 UTC (rev 4515)
@@ -207,6 +207,7 @@
public void testComponentLifeCycleMethodsValidator() {
ISeamProject seamProject = getSeamProject(project);
+ IFile componentsFile = project.getFile("WebContent/WEB-INF/components.xml");
IFile statefulComponentFile =
project.getFile("src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.java");
@@ -227,8 +228,8 @@
refreshProject(project);
- String[] message = getMarkersMessage(statefulComponentFile);
- assertTrue("Problem marker 'Duplicate @Destroy method' not found",
message[0].startsWith("Duplicate @Destroy method \"destroyMethod"));
+ String[] messages = getMarkersMessage(statefulComponentFile);
+ assertTrue("Problem marker 'Duplicate @Destroy method' not found",
messages[0].startsWith("Duplicate @Destroy method \"destroyMethod"));
// Duplicate @Create method
System.out.println("Test - Duplicate @Create method");
@@ -244,8 +245,8 @@
refreshProject(project);
- message = getMarkersMessage(statefulComponentFile);
- assertTrue("Problem marker 'Duplicate @Create method' not found",
message[0].startsWith("Duplicate @Create method \"createMethod"));
+ messages = getMarkersMessage(statefulComponentFile);
+ assertTrue("Problem marker 'Duplicate @Create method' not found",
messages[0].startsWith("Duplicate @Create method \"createMethod"));
// Duplicate @Unwrap method
System.out.println("Test - Duplicate @Unwrap method");
@@ -261,14 +262,85 @@
refreshProject(project);
- message = getMarkersMessage(statefulComponentFile);
- assertTrue("Problem marker 'Duplicate @Unwrap method' not found",
message[0].startsWith("Duplicate @Unwrap method \"unwrapMethod"));
+ messages = getMarkersMessage(statefulComponentFile);
+ assertTrue("Problem marker 'Duplicate @Unwrap method' not found",
messages[0].startsWith("Duplicate @Unwrap method \"unwrapMethod"));
// Only component class can have @Destroy method
+ System.out.println("Test - Only component class can have @Destroy method");
+
+ IFile componentsFile4 = project.getFile("WebContent/WEB-INF/components.4");
+
+ try{
+ componentsFile.setContents(componentsFile4.getContents(), true, false, new
NullProgressMonitor());
+ componentsFile.touch(new NullProgressMonitor());
+ }catch(Exception ex){
+ JUnitUtils.fail("Error in changing 'components.xml' content to " +
+ "'components.4'", ex);
+ }
+ IFile statefulComponentFile9 =
project.getFile("src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.9");
+ try{
+ statefulComponentFile.setContents(statefulComponentFile9.getContents(), true, false,
new NullProgressMonitor());
+ statefulComponentFile.touch(new NullProgressMonitor());
+ }catch(Exception ex){
+ JUnitUtils.fail("Error in changing 'StatefulComponent.java' content to
" +
+ "'StatefulComponent.9'", ex);
+ }
+
+ refreshProject(project);
+
+ messages = getMarkersMessage(statefulComponentFile);
+ assertTrue("Problem marker 'Only component class can have @Destroy method'
not found", "Only component class can have @Destroy method
\"destroyMethod\"".equals(messages[0]));
+
// Only component class can have @Create method
+ System.out.println("Test - Only component class can have @Create method");
+
+ IFile statefulComponentFile10 =
project.getFile("src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.10");
+ try{
+ statefulComponentFile.setContents(statefulComponentFile10.getContents(), true, false,
new NullProgressMonitor());
+ statefulComponentFile.touch(new NullProgressMonitor());
+ }catch(Exception ex){
+ JUnitUtils.fail("Error in changing 'StatefulComponent.java' content to
" +
+ "'StatefulComponent.10'", ex);
+ }
+
+ refreshProject(project);
+
+ messages = getMarkersMessage(statefulComponentFile);
+ assertTrue("Problem marker 'Only component class can have @Create method'
not found", "Only component class can have @Create method
\"createMethod\"".equals(messages[0]));
+
// Only component class can have @Unwrap method
+ System.out.println("Test - Only component class can have @Unwrap method");
+
+ IFile statefulComponentFile11 =
project.getFile("src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.11");
+ try{
+ statefulComponentFile.setContents(statefulComponentFile11.getContents(), true, false,
new NullProgressMonitor());
+ statefulComponentFile.touch(new NullProgressMonitor());
+ }catch(Exception ex){
+ JUnitUtils.fail("Error in changing 'StatefulComponent.java' content to
" +
+ "'StatefulComponent.11'", ex);
+ }
+
+ refreshProject(project);
+
+ messages = getMarkersMessage(statefulComponentFile);
+ assertTrue("Problem marker 'Only component class can have @Unwrap method'
not found", "Only component class can have @Unwrap method
\"unwrapMethod\"".equals(messages[0]));
+
// Only component class can have @Observer method
-
+ System.out.println("Test - Only component class can have @Observer method");
+
+ IFile statefulComponentFile12 =
project.getFile("src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.12");
+ try{
+ statefulComponentFile.setContents(statefulComponentFile12.getContents(), true, false,
new NullProgressMonitor());
+ statefulComponentFile.touch(new NullProgressMonitor());
+ }catch(Exception ex){
+ JUnitUtils.fail("Error in changing 'StatefulComponent.java' content to
" +
+ "'StatefulComponent.12'", ex);
+ }
+
+ refreshProject(project);
+
+ messages = getMarkersMessage(statefulComponentFile);
+ assertTrue("Problem marker 'Only component class can have @Observer
method' not found", "Only component class can have @Observer method
\"observerMethod\"".equals(messages[0]));
}
public void testFactoriesValidator() {