Author: akazakov
Date: 2008-06-27 09:40:48 -0400 (Fri, 27 Jun 2008)
New Revision: 8982
Added:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/WEB-INF/components.5
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-2451
Added:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/WEB-INF/components.5
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/WEB-INF/components.5
(rev 0)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/WEB-INF/components.5 2008-06-27
13:40:48 UTC (rev 8982)
@@ -0,0 +1,47 @@
+<?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>
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 2008-06-27
12:09:50 UTC (rev 8981)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2008-06-27
13:40:48 UTC (rev 8982)
@@ -367,47 +367,52 @@
// Duplicate @Create method
System.out.println("Test - Duplicate @Create method");
-
+
final String NEW_CONTENT_FILE_NAME7 =
"src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.7";
-
+
assertMarkerIsCreated(
TARGET_FILE_NAME,NEW_CONTENT_FILE_NAME7,
".*(a)Create.*\"createMethod\".*", 36);
assertMarkerIsCreated(
TARGET_FILE_NAME, ".*(a)Create.*\"createMethod2\".*", 41);
-
-
-
+
// Duplicate @Unwrap method
System.out.println("Test - Duplicate @Unwrap method");
-
+
final String NEW_CONTENT_FILE_NAME8 =
"src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.8";
assertMarkerIsCreated(
TARGET_FILE_NAME,NEW_CONTENT_FILE_NAME8,
".*(a)Unwrap.*\"unwrapMethod\".*", 40);
assertMarkerIsCreated(
TARGET_FILE_NAME, ".*(a)Unwrap.*\"unwrapMethod2\".*", 45);
-
-
+
+ IFile componentsFileWithoutSTComponent =
project.getFile("WebContent/WEB-INF/components.5");
+ try {
+ componentsFile.setContents(componentsFileWithoutSTComponent.getContents(), true,
false, new NullProgressMonitor());
+ } catch(Exception ex) {
+ JUnitUtils.fail("Error in changing 'components.xml' content to " +
+ "'components.5'", ex);
+ }
+ refreshProject(project);
+
// Only component class can have @Destroy method
System.out.println("Test - Only component class can have @Destroy method");
-
+
final String NEW_CONTENT_FILE_NAME9 =
"src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.9";
assertMarkerIsCreated(
TARGET_FILE_NAME,NEW_CONTENT_FILE_NAME9,
".*(a)Destroy.*\"destroyMethod\".*", 25);
-
-
+
// Only component class can have @Create method
System.out.println("Test - Only component class can have @Create method");
-
+
final String NEW_CONTENT_FILE_NAME10 =
"src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.10";
-
+
assertMarkerIsCreated(
TARGET_FILE_NAME,NEW_CONTENT_FILE_NAME10,
".*(a)Create.*\"createMethod\".*", 25);
-
+
// Only component class can have @Unwrap method
System.out.println("Test - Only component class can have @Unwrap method");
-
+
final String NEW_CONTENT_FILE_NAME11 =
"src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.11";
-
+
assertMarkerIsCreated(
TARGET_FILE_NAME,NEW_CONTENT_FILE_NAME11, "Only component class can have @Unwrap
method \"unwrapMethod\"", 26);
@@ -430,6 +435,13 @@
assertMarkerIsCreated(
TARGET_FILE_NAME,"Duplicate @Remove method \"removeMethod2\"",
22);
+ IFile componentsFileWithSTComponent =
project.getFile("WebContent/WEB-INF/components.2");
+ try {
+ componentsFile.setContents(componentsFileWithoutSTComponent.getContents(), true,
false, new NullProgressMonitor());
+ }catch(Exception ex){
+ JUnitUtils.fail("Error in changing 'components.xml' content to " +
+ "'components.6'", ex);
+ }
}
/**