Seam SVN: r9525 - in trunk: src/test/ftest and 10 other directories.
by seam-commits@lists.jboss.org
Author: jharting
Date: 2008-11-07 06:53:51 -0500 (Fri, 07 Nov 2008)
New Revision: 9525
Added:
trunk/src/test/ftest/examples/contactlist/
trunk/src/test/ftest/examples/contactlist/build.xml
trunk/src/test/ftest/examples/contactlist/src/
trunk/src/test/ftest/examples/contactlist/src/org/
trunk/src/test/ftest/examples/contactlist/src/org/jboss/
trunk/src/test/ftest/examples/contactlist/src/org/jboss/seam/
trunk/src/test/ftest/examples/contactlist/src/org/jboss/seam/example/
trunk/src/test/ftest/examples/contactlist/src/org/jboss/seam/example/contactlist/
trunk/src/test/ftest/examples/contactlist/src/org/jboss/seam/example/contactlist/test/
trunk/src/test/ftest/examples/contactlist/src/org/jboss/seam/example/contactlist/test/selenium/
trunk/src/test/ftest/examples/contactlist/src/org/jboss/seam/example/contactlist/test/selenium/CommentTest.java
trunk/src/test/ftest/examples/contactlist/src/org/jboss/seam/example/contactlist/test/selenium/ContactCRUDTest.java
trunk/src/test/ftest/examples/contactlist/src/org/jboss/seam/example/contactlist/test/selenium/ContactlistConstants.java
trunk/src/test/ftest/examples/contactlist/src/org/jboss/seam/example/contactlist/test/selenium/Person.java
trunk/src/test/ftest/examples/contactlist/src/org/jboss/seam/example/contactlist/test/selenium/SeleniumContactlistTest.java
trunk/src/test/ftest/examples/contactlist/testng.xml
Modified:
trunk/examples/contactlist/view/editContact.xhtml
trunk/examples/contactlist/view/search.xhtml
trunk/examples/contactlist/view/viewContact.xhtml
trunk/src/test/ftest/build.xml
Log:
selenium tests for contactlist example
Modified: trunk/examples/contactlist/view/editContact.xhtml
===================================================================
--- trunk/examples/contactlist/view/editContact.xhtml 2008-11-07 10:11:41 UTC (rev 9524)
+++ trunk/examples/contactlist/view/editContact.xhtml 2008-11-07 11:53:51 UTC (rev 9525)
@@ -13,21 +13,21 @@
<body>
<div class="menuButtons">
- <s:link view="/search.xhtml" value="Search Contacts"/>
- <s:link view="/editContact.xhtml" value="Create New Contact">
+ <s:link id="search" view="/search.xhtml" value="Search Contacts"/>
+ <s:link id="create" view="/editContact.xhtml" value="Create New Contact">
<f:param name="contactId"/> <!-- suppress propagation of contact id page parameter -->
</s:link>
- <s:link view="/viewContact.xhtml" value="View Contact" rendered="#{contactHome.managed}"/>
- <s:link view="/editContact.xhtml" value="Edit Contact" rendered="#{contactHome.managed}"/>
+ <s:link id="view" view="/viewContact.xhtml" value="View Contact" rendered="#{contactHome.managed}"/>
+ <s:link id="edit" view="/editContact.xhtml" value="Edit Contact" rendered="#{contactHome.managed}"/>
</div>
<div class="body">
<h1>Edit Contact</h1>
- <h:form>
+ <h:form id="editForm">
- <h:messages globalOnly="true" styleClass="message"/>
+ <h:messages id="messages" globalOnly="true" styleClass="message"/>
<!-- editable fields -->
<s:validateAll>
@@ -44,55 +44,55 @@
<tr class="prop">
<td class="name">First Name:</td>
<td class="value">
- <s:decorate><h:inputText id="firstName" value="#{contact.firstName}" required="true"/></s:decorate>
+ <s:decorate id="firstNameDecorate"><h:inputText id="firstName" value="#{contact.firstName}" required="true"/></s:decorate>
</td>
</tr>
<tr class="prop">
<td class="name">Last Name:</td>
<td class="value">
- <s:decorate><h:inputText id="lastName" value="#{contact.lastName}" required="true"/></s:decorate>
+ <s:decorate id="lastNameDecorate"><h:inputText id="lastName" value="#{contact.lastName}" required="true"/></s:decorate>
</td>
</tr>
<tr class="prop">
<td class="name">Cell Phone:</td>
<td class="value">
- <s:decorate><h:inputText id="cellPhone" value="#{contact.cellPhone}"/></s:decorate>
+ <s:decorate id="cellPhoneDecorate"><h:inputText id="cellPhone" value="#{contact.cellPhone}"/></s:decorate>
</td>
</tr>
<tr class="prop">
<td class="name">Home Phone:</td>
<td class="value">
- <s:decorate><h:inputText id="homePhone" value="#{contact.homePhone}"/></s:decorate>
+ <s:decorate id="homePhoneDecorate"><h:inputText id="homePhone" value="#{contact.homePhone}"/></s:decorate>
</td>
</tr>
<tr class="prop">
<td class="name">Address:</td>
<td class="value">
- <s:decorate><h:inputText id="address" value="#{contact.address}"/></s:decorate>
+ <s:decorate id="addressDecorate"><h:inputText id="address" value="#{contact.address}"/></s:decorate>
</td>
</tr>
<tr class="prop">
<td class="name">City:</td>
<td class="value">
- <s:decorate><h:inputText id="city" value="#{contact.city}"/></s:decorate>
+ <s:decorate id="cityDecorate"><h:inputText id="city" value="#{contact.city}"/></s:decorate>
</td>
</tr>
<tr class="prop">
<td class="name">State:</td>
<td class="value">
- <s:decorate><h:inputText id="state" value="#{contact.state}"/></s:decorate>
+ <s:decorate id="stateDecorate"><h:inputText id="state" value="#{contact.state}"/></s:decorate>
</td>
</tr>
<tr class="prop">
<td class="name">Zip:</td>
<td class="value">
- <s:decorate><h:inputText id="zip" value="#{contact.zip}"/></s:decorate>
+ <s:decorate id="zipDecorate"><h:inputText id="zip" value="#{contact.zip}"/></s:decorate>
</td>
</tr>
<tr class="prop">
<td class="name">Country:</td>
<td class="value">
- <s:decorate><h:inputText id="country" value="#{contact.country}"/></s:decorate>
+ <s:decorate id="countryDecorate"><h:inputText id="country" value="#{contact.country}"/></s:decorate>
</td>
</tr>
</table>
@@ -103,12 +103,12 @@
<!-- actions -->
<div class="actionButtons">
- <h:commandLink action="#{contactHome.update}" value="Update Contact" rendered="#{contactHome.managed}"/>
- <s:link action="#{contactHome.remove}" value="Delete Contact" rendered="#{contactHome.managed}"/>
- <s:link view="/viewContact.xhtml" value="Cancel" rendered="#{contactHome.managed}"/>
+ <h:commandLink id="updateContact" action="#{contactHome.update}" value="Update Contact" rendered="#{contactHome.managed}"/>
+ <s:link id="deleteContact" action="#{contactHome.remove}" value="Delete Contact" rendered="#{contactHome.managed}"/>
+ <s:link id="cancelManaged" view="/viewContact.xhtml" value="Cancel" rendered="#{contactHome.managed}"/>
- <h:commandLink action="#{contactHome.persist}" value="Create Contact" rendered="#{!contactHome.managed}"/>
- <s:link view="/search.xhtml" value="Cancel" rendered="#{!contactHome.managed}"/>
+ <h:commandLink id="createContact" action="#{contactHome.persist}" value="Create Contact" rendered="#{!contactHome.managed}"/>
+ <s:link id="cancel" view="/search.xhtml" value="Cancel" rendered="#{!contactHome.managed}"/>
</div>
Modified: trunk/examples/contactlist/view/search.xhtml
===================================================================
--- trunk/examples/contactlist/view/search.xhtml 2008-11-07 10:11:41 UTC (rev 9524)
+++ trunk/examples/contactlist/view/search.xhtml 2008-11-07 11:53:51 UTC (rev 9525)
@@ -12,13 +12,13 @@
<body>
<div class="menuButtons">
- <s:link view="/search.xhtml" value="Search Contacts">
+ <s:link id="search" view="/search.xhtml" value="Search Contacts">
<f:param name="firstName" />
<f:param name="lastName" />
<f:param name="firstResult" />
</s:link>
- <s:link view="/editContact.xhtml" value="Create New Contact">
+ <s:link id="create" view="/editContact.xhtml" value="Create New Contact">
<f:param name="contactId"/> <!-- suppress propagation of contact id page parameter -->
</s:link>
</div>
@@ -27,22 +27,22 @@
<h1>ContactList</h1>
- <h:messages styleClass="message"/>
+ <h:messages id="messages" styleClass="message"/>
<!-- search box -->
<div class="dialog">
- <h:form>
+ <h:form id="searchForm">
<span class="prop">
<span class="name">First Name:</span>
- <span class="value"><h:inputText value="#{exampleContact.firstName}"/></span>
+ <span class="value"><h:inputText id="firstName" value="#{exampleContact.firstName}"/></span>
</span>
<span class="prop">
<span class="name">Last Name :</span>
- <span class="value"><h:inputText value="#{exampleContact.lastName}"/></span>
+ <span class="value"><h:inputText id="lastName" value="#{exampleContact.lastName}"/></span>
</span>
- <h:commandButton value="Search" action="newsearch"/>
+ <h:commandButton id="submit" value="Search" action="newsearch"/>
</h:form>
</div>
@@ -58,20 +58,20 @@
<th>Zip</th>
<th>Country</th>
</tr>
- <ui:repeat value="#{contacts.resultList}" var="cont">
+ <ui:repeat id="searchResult" value="#{contacts.resultList}" var="cont">
<tr>
<td>
- <s:link view="/viewContact.xhtml" value="#{cont.firstName} #{cont.lastName}">
+ <s:link id="link" view="/viewContact.xhtml" value="#{cont.firstName} #{cont.lastName}">
<f:param name="contactId" value="#{cont.id}"/>
</s:link>
</td>
- <td>#{cont.cellPhone}</td>
- <td>#{cont.homePhone}</td>
- <td>#{cont.address}</td>
- <td>#{cont.city}</td>
- <td>#{cont.state}</td>
- <td>#{cont.zip}</td>
- <td>#{cont.country}</td>
+ <td><h:outputText id="cellPhone" value="#{cont.cellPhone}" /></td>
+ <td><h:outputText id="homePhone" value="#{cont.homePhone}" /></td>
+ <td><h:outputText id="address" value="#{cont.address}" /></td>
+ <td><h:outputText id="city" value="#{cont.city}" /></td>
+ <td><h:outputText id="state" value="#{cont.state}" /></td>
+ <td><h:outputText id="zip" value="#{cont.zip}" /></td>
+ <td><h:outputText id="country" value="#{cont.country}" /></td>
</tr>
</ui:repeat>
</table>
Modified: trunk/examples/contactlist/view/viewContact.xhtml
===================================================================
--- trunk/examples/contactlist/view/viewContact.xhtml 2008-11-07 10:11:41 UTC (rev 9524)
+++ trunk/examples/contactlist/view/viewContact.xhtml 2008-11-07 11:53:51 UTC (rev 9525)
@@ -13,19 +13,19 @@
<body>
<div class="menuButtons">
- <s:link view="/search.xhtml" value="Search Contacts"/>
- <s:link view="/editContact.xhtml" value="Create New Contact">
+ <s:link id="search" view="/search.xhtml" value="Search Contacts"/>
+ <s:link id="create" view="/editContact.xhtml" value="Create New Contact">
<f:param name="contactId"/> <!-- suppress propagation of contact id page parameter -->
</s:link>
- <s:link view="/viewContact.xhtml" value="View Contact"/>
- <s:link view="/editContact.xhtml" value="Edit Contact"/>
+ <s:link id="view" view="/viewContact.xhtml" value="View Contact"/>
+ <s:link id="edit" view="/editContact.xhtml" value="Edit Contact"/>
</div>
<div class="body">
<h1>View Contact</h1>
- <h:messages styleClass="message"/>
+ <h:messages id="messages" styleClass="message"/>
<!-- fields -->
<div class="dialog">
@@ -71,8 +71,8 @@
<!-- actions -->
<div class="actionButtons">
- <s:link view="/editContact.xhtml" value="Edit Contact"/>
- <s:link action="#{contactHome.remove}" value="Delete Contact" rendered="#{contactHome.managed}"/>
+ <s:link id="editContact" view="/editContact.xhtml" value="Edit Contact"/>
+ <s:link id="deleteContact" action="#{contactHome.remove}" value="Delete Contact" rendered="#{contactHome.managed}"/>
</div>
<!-- associations -->
@@ -95,7 +95,7 @@
</h:column>
</h:dataTable>
- <h:form>
+ <h:form id="commentForm">
<!-- editable fields -->
<div class="dialog">
@@ -115,7 +115,7 @@
<!-- actions -->
<div class="actionButtons">
- <h:commandLink action="#{commentHome.persist}" value="Create Comment"/>
+ <h:commandLink id="submit" action="#{commentHome.persist}" value="Create Comment"/>
</div>
</h:form>
Modified: trunk/src/test/ftest/build.xml
===================================================================
--- trunk/src/test/ftest/build.xml 2008-11-07 10:11:41 UTC (rev 9524)
+++ trunk/src/test/ftest/build.xml 2008-11-07 11:53:51 UTC (rev 9525)
@@ -49,6 +49,7 @@
<!-- Execute tests for all examples-->
<testexample name="booking" />
<testexample name="dvdstore" />
+ <testexample name="contactlist" />
<testexample name="groovybooking" />
<testexample name="hibernate" />
<testexample name="icefaces" />
@@ -75,6 +76,7 @@
<target name="cleanall">
<cleanexample name="booking" />
<cleanexample name="dvdstore" />
+ <cleanexample name="contactlist" />
<cleanexample name="groovybooking" />
<cleanexample name="hibernate" />
<cleanexample name="icefaces" />
@@ -87,6 +89,7 @@
<target name="undeployall">
<undeployexample name="booking" />
<undeployexample name="dvdstore" />
+ <undeployexample name="contactlist" />
<undeployexample name="groovybooking" />
<undeployexample name="hibernate" />
<undeployexample name="icefaces" />
Added: trunk/src/test/ftest/examples/contactlist/build.xml
===================================================================
--- trunk/src/test/ftest/examples/contactlist/build.xml (rev 0)
+++ trunk/src/test/ftest/examples/contactlist/build.xml 2008-11-07 11:53:51 UTC (rev 9525)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2008, Red Hat Middleware LLC, and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+-->
+<project name="contactlist.ftest.build" basedir="." default="build">
+ <property name="example.name" value="contactlist"/>
+ <property name="jboss.deploy.target" value="deploy"/>
+ <property name="jboss.deploy.waittime" value="10"/>
+ <property name="jboss.undeploy.target" value="undeploy"/>
+ <property name="example.ready.check.url" value="seam-contactlist/search.seam"/>
+
+ <import file="../build.xml" />
+</project>
Added: trunk/src/test/ftest/examples/contactlist/src/org/jboss/seam/example/contactlist/test/selenium/CommentTest.java
===================================================================
--- trunk/src/test/ftest/examples/contactlist/src/org/jboss/seam/example/contactlist/test/selenium/CommentTest.java (rev 0)
+++ trunk/src/test/ftest/examples/contactlist/src/org/jboss/seam/example/contactlist/test/selenium/CommentTest.java 2008-11-07 11:53:51 UTC (rev 9525)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.example.contactlist.test.selenium;
+
+import org.testng.annotations.Test;
+import static org.testng.AssertJUnit.*;
+
+import com.thoughtworks.selenium.Wait;
+
+public class CommentTest extends SeleniumContactlistTest {
+
+ @Test
+ public void testComment() {
+ String firstName = "Gavin";
+ String lastName = "King";
+ String message = "founder of the Hibernate open source object/relational mapping project";
+ // find contact
+ browser.open(START_PAGE);
+ new Wait() {
+ @Override
+ public boolean until() {
+ return browser.isElementPresent(SEARCH_SUBMIT);
+ }
+ }.wait("Search submit link not found.");
+ search(firstName, lastName);
+ assertTrue("Contact not found. Application is in unexpected state.",
+ searchResultPresent(firstName, lastName));
+ browser.click(SEARCH_RESULT_FIRST_ROW_LINK);
+ browser.waitForPageToLoad(TIMEOUT);
+ // submit comment
+ browser.type(COMMENT_TEXTAREA, message);
+ browser.click(COMMENT_SUBMIT);
+ browser.waitForPageToLoad(TIMEOUT);
+ // assert comment is stored
+ browser.click(SEARCH_CONTACT_PAGE);
+ browser.waitForPageToLoad(TIMEOUT);
+ search(firstName, lastName);
+ browser.click(SEARCH_RESULT_FIRST_ROW_LINK);
+ browser.waitForPageToLoad(TIMEOUT);
+ assertTrue("Comment is not stored.", browser
+ .isTextPresent(message));
+ }
+}
Property changes on: trunk/src/test/ftest/examples/contactlist/src/org/jboss/seam/example/contactlist/test/selenium/CommentTest.java
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/src/test/ftest/examples/contactlist/src/org/jboss/seam/example/contactlist/test/selenium/ContactCRUDTest.java
===================================================================
--- trunk/src/test/ftest/examples/contactlist/src/org/jboss/seam/example/contactlist/test/selenium/ContactCRUDTest.java (rev 0)
+++ trunk/src/test/ftest/examples/contactlist/src/org/jboss/seam/example/contactlist/test/selenium/ContactCRUDTest.java 2008-11-07 11:53:51 UTC (rev 9525)
@@ -0,0 +1,154 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.example.contactlist.test.selenium;
+
+import org.testng.annotations.Test;
+import static org.testng.AssertJUnit.*;
+import com.thoughtworks.selenium.Wait;
+
+public class ContactCRUDTest extends SeleniumContactlistTest {
+
+ // used for creation test
+ private Person john = new Person("John", "Doe", "0123456789", "0123456789",
+ "Street", "City", "State", "01234", "US");
+ private Person jane = new Person("Jane", "Doe", "0123456789", "0123456789",
+ "Street", "City", "State", "01234", "US");
+ // used for edit test
+ private Person jozef = new Person("Jozef", "Hartinger", "0123456789",
+ "0123456789", "Cervinkova 99", "Brno", "Czech Republic", "01234",
+ "CZ");
+
+ @Test
+ public void testCreateContact() {
+ browser.open(START_PAGE);
+ new Wait() {
+ @Override
+ public boolean until() {
+ return browser.isElementPresent(CREATE_CONTACT_PAGE);
+ }
+ }.wait("Create contact link not found.");
+ browser.click(CREATE_CONTACT_PAGE);
+ browser.waitForPageToLoad(TIMEOUT);
+ fillCreateContactForm(john);
+ browser.click(CREATE_CONTACT_SUBMIT);
+ new Wait() {
+ @Override
+ public boolean until() {
+ return browser.isElementPresent(SEARCH_CONTACT_PAGE);
+ }
+ }.wait("Search link not found.");
+ browser.click(SEARCH_CONTACT_PAGE);
+ browser.waitForPageToLoad(TIMEOUT);
+ search(john);
+ assertTrue("Creating new contact failed.", searchResultPresent(john));
+ }
+
+ @Test
+ public void testCreationCanceling() {
+ browser.open(START_PAGE);
+ new Wait() {
+ @Override
+ public boolean until() {
+ return browser.isElementPresent(CREATE_CONTACT_PAGE);
+ }
+ }.wait("Create contact link not found.");
+ browser.click(CREATE_CONTACT_PAGE);
+ browser.waitForPageToLoad(TIMEOUT);
+ fillCreateContactForm(jane);
+ browser.click(CREATE_CONTACT_CANCEL);
+ new Wait() {
+ @Override
+ public boolean until() {
+ return browser.isElementPresent(SEARCH_CONTACT_PAGE);
+ }
+ }.wait("Search link not found.");
+ browser.click(SEARCH_CONTACT_PAGE);
+ browser.waitForPageToLoad(TIMEOUT);
+ browser.type(SEARCH_FIRST_NAME_FIELD, jane.getFirstName());
+ browser.type(SEARCH_LAST_NAME_FIELD, jane.getLastName());
+ browser.click(SEARCH_SUBMIT);
+ browser.waitForPageToLoad(TIMEOUT);
+ assertFalse("New contact created despite cancel.", searchResultPresent(jane));
+ }
+
+ @Test
+ public void testEditContact() {
+ String firstName = "Shane";
+ String lastName = "Bryzak";
+ // find contact
+ browser.open(START_PAGE);
+ new Wait() {
+ @Override
+ public boolean until() {
+ return browser.isElementPresent(SEARCH_SUBMIT);
+ }
+ }.wait("Search submit link not found.");
+ search(firstName, lastName);
+ assertTrue("Contact not found. Application is in unexpected state.",
+ searchResultPresent(firstName, lastName));
+ browser.click(SEARCH_RESULT_FIRST_ROW_LINK);
+ browser.waitForPageToLoad(TIMEOUT);
+ browser.click(EDIT_CONTACT_LINK);
+ browser.waitForPageToLoad(TIMEOUT);
+ // update form fields
+ fillCreateContactForm(jozef);
+ browser.click(UPDATE_CONTACT_SUBMIT);
+ browser.waitForPageToLoad(TIMEOUT);
+ // make sure new values are present
+ browser.click(SEARCH_CONTACT_PAGE);
+ browser.waitForPageToLoad(TIMEOUT);
+ search(jozef);
+ assertTrue("Contact update failed. New values missing", searchResultPresent(jozef));
+ // make sure old values are not present
+ browser.click(SEARCH_CONTACT_PAGE);
+ browser.waitForPageToLoad(TIMEOUT);
+ search(firstName, lastName);
+ assertFalse("Contact update failed. Old values still present", searchResultPresent(firstName, lastName));
+ }
+
+ @Test
+ public void testRemoveContact() {
+ String firstName = "Norman";
+ String lastName = "Richards";
+ // find contact
+ browser.open(START_PAGE);
+ new Wait() {
+ @Override
+ public boolean until() {
+ return browser.isElementPresent(SEARCH_SUBMIT);
+ }
+ }.wait("Search submit link not found.");
+ search(firstName, lastName);
+ assertTrue("Contact not found. Application is in unexpected state.",
+ searchResultPresent(firstName, lastName));
+ browser.click(SEARCH_RESULT_FIRST_ROW_LINK);
+ browser.waitForPageToLoad(TIMEOUT);
+ // remove contact
+ browser.click(REMOVE_CONTACT_LINK);
+ browser.waitForPageToLoad(TIMEOUT);
+ // assert contact is removed
+ browser.click(SEARCH_CONTACT_PAGE);
+ browser.waitForPageToLoad(TIMEOUT);
+ search(firstName, lastName);
+ assertFalse("Contact present despite it should be removed.", searchResultPresent(firstName, lastName));
+ }
+}
Property changes on: trunk/src/test/ftest/examples/contactlist/src/org/jboss/seam/example/contactlist/test/selenium/ContactCRUDTest.java
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/src/test/ftest/examples/contactlist/src/org/jboss/seam/example/contactlist/test/selenium/ContactlistConstants.java
===================================================================
--- trunk/src/test/ftest/examples/contactlist/src/org/jboss/seam/example/contactlist/test/selenium/ContactlistConstants.java (rev 0)
+++ trunk/src/test/ftest/examples/contactlist/src/org/jboss/seam/example/contactlist/test/selenium/ContactlistConstants.java 2008-11-07 11:53:51 UTC (rev 9525)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.example.contactlist.test.selenium;
+
+public interface ContactlistConstants {
+
+ public static String START_PAGE = "/seam-contactlist";
+ public static String SEARCH_CONTACT_PAGE = "id=search";
+ public static String SEARCH_FIRST_NAME_FIELD = "id=searchForm:firstName";
+ public static String SEARCH_LAST_NAME_FIELD = "id=searchForm:lastName";
+ public static String SEARCH_SUBMIT = "id=searchForm:submit";
+ public static String CREATE_CONTACT_PAGE = "id=create";
+ public static String CREATE_CONTACT_SUBMIT = "id=editForm:createContact";
+ public static String CREATE_CONTACT_CANCEL = "id=editForm:cancel";
+ public static String FIRST_NAME_FIELD = "id=editForm:firstNameDecorate:firstName";
+ public static String LAST_NAME_FIELD = "id=editForm:lastNameDecorate:lastName";
+ public static String CELL_PHONE_FIELD = "id=editForm:cellPhoneDecorate:cellPhone";
+ public static String HOME_PHONE_FIELD = "id=editForm:homePhoneDecorate:homePhone";
+ public static String ADDRESS_FIELD = "id=editForm:addressDecorate:address";
+ public static String CITY_FIELD = "id=editForm:cityDecorate:city";
+ public static String STATE_FIELD = "id=editForm:stateDecorate:state";
+ public static String ZIP_FIELD = "id=editForm:zipDecorate:zip";
+ public static String COUNTRY_FIELD = "id=editForm:countryDecorate:country";
+ public static String EDIT_CONTACT_LINK = "editContact";
+ public static String UPDATE_CONTACT_SUBMIT = "editForm:updateContact";
+ public static String EDIT_FORM_REMOVE_CONTACT_LINK = "id=editForm:deleteContact";
+ public static String REMOVE_CONTACT_LINK = "id=deleteContact";
+ public static String SEARCH_RESULT_FIRST_ROW_LINK = "id=searchResult:0:link";
+ public static String SEARCH_RESULT_FIRST_ROW_CELL_PHONE = "id=searchResult:0:cellPhone";
+ public static String SEARCH_RESULT_FIRST_ROW_HOME_PHONE = "id=searchResult:0:homePhone";
+ public static String SEARCH_RESULT_FIRST_ROW_ADDRESS = "id=searchResult:0:address";
+ public static String SEARCH_RESULT_FIRST_ROW_CITY = "id=searchResult:0:city";
+ public static String SEARCH_RESULT_FIRST_ROW_STATE = "id=searchResult:0:state";
+ public static String SEARCH_RESULT_FIRST_ROW_ZIP = "id=searchResult:0:zip";
+ public static String SEARCH_RESULT_FIRST_ROW_COUNTRY = "id=searchResult:0:country";
+ public static String COMMENT_TEXTAREA = "commentForm:text";
+ public static String COMMENT_SUBMIT = "commentForm:submit";
+}
Property changes on: trunk/src/test/ftest/examples/contactlist/src/org/jboss/seam/example/contactlist/test/selenium/ContactlistConstants.java
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/src/test/ftest/examples/contactlist/src/org/jboss/seam/example/contactlist/test/selenium/Person.java
===================================================================
--- trunk/src/test/ftest/examples/contactlist/src/org/jboss/seam/example/contactlist/test/selenium/Person.java (rev 0)
+++ trunk/src/test/ftest/examples/contactlist/src/org/jboss/seam/example/contactlist/test/selenium/Person.java 2008-11-07 11:53:51 UTC (rev 9525)
@@ -0,0 +1,121 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.example.contactlist.test.selenium;
+
+public class Person {
+ private String firstName;
+ private String lastName;
+ private String cellPhone;
+ private String homePhone;
+ private String address;
+ private String city;
+ private String state;
+ private String zip;
+ private String country;
+
+ public Person(String firstName, String lastName, String cellPhone, String homePhone,
+ String address, String city, String state, String zip, String country) {
+ this.firstName = firstName;
+ this.lastName = lastName;
+ this.cellPhone = cellPhone;
+ this.homePhone = homePhone;
+ this.address = address;
+ this.city = city;
+ this.state = state;
+ this.zip = zip;
+ this.country = country;
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+
+
+ public String getCellPhone() {
+ return cellPhone;
+ }
+
+ public void setCellPhone(String cellPhone) {
+ this.cellPhone = cellPhone;
+ }
+
+ public String getHomePhone() {
+ return homePhone;
+ }
+
+ public void setHomePhone(String homePhone) {
+ this.homePhone = homePhone;
+ }
+
+ public String getAddress() {
+ return address;
+ }
+
+ public void setAddress(String address) {
+ this.address = address;
+ }
+
+ public String getCity() {
+ return city;
+ }
+
+ public void setCity(String city) {
+ this.city = city;
+ }
+
+ public String getState() {
+ return state;
+ }
+
+ public void setState(String state) {
+ this.state = state;
+ }
+
+ public String getZip() {
+ return zip;
+ }
+
+ public void setZip(String zip) {
+ this.zip = zip;
+ }
+
+ public String getCountry() {
+ return country;
+ }
+
+ public void setCountry(String country) {
+ this.country = country;
+ }
+
+}
Property changes on: trunk/src/test/ftest/examples/contactlist/src/org/jboss/seam/example/contactlist/test/selenium/Person.java
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/src/test/ftest/examples/contactlist/src/org/jboss/seam/example/contactlist/test/selenium/SeleniumContactlistTest.java
===================================================================
--- trunk/src/test/ftest/examples/contactlist/src/org/jboss/seam/example/contactlist/test/selenium/SeleniumContactlistTest.java (rev 0)
+++ trunk/src/test/ftest/examples/contactlist/src/org/jboss/seam/example/contactlist/test/selenium/SeleniumContactlistTest.java 2008-11-07 11:53:51 UTC (rev 9525)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.example.contactlist.test.selenium;
+
+import org.jboss.seam.example.common.test.selenium.SeamSeleniumTest;
+
+public class SeleniumContactlistTest extends SeamSeleniumTest implements ContactlistConstants {
+
+ public boolean searchResultPresent(String firstName, String lastName) {
+ return browser.isElementPresent(SEARCH_RESULT_FIRST_ROW_LINK) &&
+ browser.getText(SEARCH_RESULT_FIRST_ROW_LINK).equals(firstName + " " + lastName);
+ }
+
+ public boolean searchResultPresent(Person person) {
+ return searchResultPresent(person.getFirstName(), person.getLastName()) &&
+ browser.getText(SEARCH_RESULT_FIRST_ROW_CELL_PHONE).equals(person.getCellPhone()) &&
+ browser.getText(SEARCH_RESULT_FIRST_ROW_HOME_PHONE).equals(person.getHomePhone()) &&
+ browser.getText(SEARCH_RESULT_FIRST_ROW_ADDRESS).equals(person.getAddress()) &&
+ browser.getText(SEARCH_RESULT_FIRST_ROW_CITY).equals(person.getCity()) &&
+ browser.getText(SEARCH_RESULT_FIRST_ROW_STATE).equals(person.getState()) &&
+ browser.getText(SEARCH_RESULT_FIRST_ROW_ZIP).equals(person.getZip()) &&
+ browser.getText(SEARCH_RESULT_FIRST_ROW_COUNTRY).equals(person.getCountry());
+ }
+
+ public void fillCreateContactForm(Person person) {
+ browser.type(FIRST_NAME_FIELD, person.getFirstName());
+ browser.type(LAST_NAME_FIELD, person.getLastName());
+ browser.type(CELL_PHONE_FIELD, person.getCellPhone());
+ browser.type(HOME_PHONE_FIELD, person.getHomePhone());
+ browser.type(ADDRESS_FIELD, person.getAddress());
+ browser.type(CITY_FIELD, person.getCity());
+ browser.type(STATE_FIELD, person.getState());
+ browser.type(ZIP_FIELD, person.getZip());
+ browser.type(COUNTRY_FIELD, person.getCountry());
+ }
+
+ public void search(String firstName, String lastName) {
+ browser.type(SEARCH_FIRST_NAME_FIELD, firstName);
+ browser.type(SEARCH_LAST_NAME_FIELD, lastName);
+ browser.click(SEARCH_SUBMIT);
+ browser.waitForPageToLoad(TIMEOUT);
+ }
+
+ public void search(Person person) {
+ search(person.getFirstName(), person.getLastName());
+ }
+}
Added: trunk/src/test/ftest/examples/contactlist/testng.xml
===================================================================
--- trunk/src/test/ftest/examples/contactlist/testng.xml (rev 0)
+++ trunk/src/test/ftest/examples/contactlist/testng.xml 2008-11-07 11:53:51 UTC (rev 9525)
@@ -0,0 +1,33 @@
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2008, Red Hat Middleware LLC, and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+-->
+<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
+<suite name="Contactlist example" verbose="2" parallel="false">
+ <test name="Contactlist example">
+ <parameter name="PROPERTY_FILE" value="empty" />
+ <classes>
+ <class
+ name="org.jboss.seam.example.contactlist.test.selenium.ContactCRUDTest" />
+ <class
+ name="org.jboss.seam.example.contactlist.test.selenium.CommentTest" />
+ </classes>
+ </test>
+</suite>
\ No newline at end of file
Property changes on: trunk/src/test/ftest/examples/contactlist/testng.xml
___________________________________________________________________
Name: svn:executable
+ *
16 years
Seam SVN: r9524 - trunk/src/main/org/jboss/seam/security/permission.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-11-07 05:11:41 -0500 (Fri, 07 Nov 2008)
New Revision: 9524
Modified:
trunk/src/main/org/jboss/seam/security/permission/RuleBasedPermissionResolver.java
Log:
JBSEAM-3681
Modified: trunk/src/main/org/jboss/seam/security/permission/RuleBasedPermissionResolver.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/permission/RuleBasedPermissionResolver.java 2008-11-07 05:56:26 UTC (rev 9523)
+++ trunk/src/main/org/jboss/seam/security/permission/RuleBasedPermissionResolver.java 2008-11-07 10:11:41 UTC (rev 9524)
@@ -202,10 +202,10 @@
{
Identity identity = Identity.instance();
- getSecurityContext().insert(identity.getPrincipal());
-
if (getSecurityContext() != null)
{
+ getSecurityContext().insert(identity.getPrincipal());
+
for ( Group sg : identity.getSubject().getPrincipals(Group.class) )
{
if ( Identity.ROLES_GROUP.equals( sg.getName() ) )
16 years
Seam SVN: r9523 - in trunk/seam-gen: icefaces/build-scripts and 1 other directory.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2008-11-07 00:56:26 -0500 (Fri, 07 Nov 2008)
New Revision: 9523
Modified:
trunk/seam-gen/build-scripts/build-war.xml
trunk/seam-gen/build-scripts/build.xml
trunk/seam-gen/icefaces/build-scripts/build-war.xml
trunk/seam-gen/icefaces/build-scripts/build.xml
Log:
package fine-grained component descriptors
Modified: trunk/seam-gen/build-scripts/build-war.xml
===================================================================
--- trunk/seam-gen/build-scripts/build-war.xml 2008-11-07 00:08:21 UTC (rev 9522)
+++ trunk/seam-gen/build-scripts/build-war.xml 2008-11-07 05:56:26 UTC (rev 9523)
@@ -162,6 +162,9 @@
<include name="seam.properties" />
<include name="*.drl" />
</fileset>
+ <fileset dir="${src.model.dir}">
+ <include name="**/*.component.xml" />
+ </fileset>
</copy>
<copy tofile="${war.dir}/WEB-INF/classes/components.properties"
Modified: trunk/seam-gen/build-scripts/build.xml
===================================================================
--- trunk/seam-gen/build-scripts/build.xml 2008-11-07 00:08:21 UTC (rev 9522)
+++ trunk/seam-gen/build-scripts/build.xml 2008-11-07 05:56:26 UTC (rev 9523)
@@ -145,6 +145,9 @@
<include name="seam.properties"/>
<include name="*.drl"/>
</fileset>
+ <fileset dir="${src.model.dir}">
+ <include name="**/*.component.xml" />
+ </fileset>
</copy>
<copy todir="${jar.dir}/META-INF">
<fileset dir="${basedir}/resources/META-INF">
Modified: trunk/seam-gen/icefaces/build-scripts/build-war.xml
===================================================================
--- trunk/seam-gen/icefaces/build-scripts/build-war.xml 2008-11-07 00:08:21 UTC (rev 9522)
+++ trunk/seam-gen/icefaces/build-scripts/build-war.xml 2008-11-07 05:56:26 UTC (rev 9523)
@@ -162,6 +162,9 @@
<include name="seam.properties" />
<include name="*.drl" />
</fileset>
+ <fileset dir="${src.model.dir}">
+ <include name="**/*.component.xml" />
+ </fileset>
</copy>
<copy tofile="${war.dir}/WEB-INF/classes/components.properties"
Modified: trunk/seam-gen/icefaces/build-scripts/build.xml
===================================================================
--- trunk/seam-gen/icefaces/build-scripts/build.xml 2008-11-07 00:08:21 UTC (rev 9522)
+++ trunk/seam-gen/icefaces/build-scripts/build.xml 2008-11-07 05:56:26 UTC (rev 9523)
@@ -145,6 +145,9 @@
<include name="seam.properties"/>
<include name="*.drl"/>
</fileset>
+ <fileset dir="${src.model.dir}">
+ <include name="**/*.component.xml" />
+ </fileset>
</copy>
<copy todir="${jar.dir}/META-INF">
<fileset dir="${basedir}/resources/META-INF">
16 years
Seam SVN: r9522 - branches/community/Seam_2_0.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2008-11-06 19:08:21 -0500 (Thu, 06 Nov 2008)
New Revision: 9522
Modified:
branches/community/Seam_2_0/seam2migration.txt
Log:
JBPAPP-1166
add missing advice
add notes about changes to seam-gen build, pertaining to testing and packaging
Modified: branches/community/Seam_2_0/seam2migration.txt
===================================================================
--- branches/community/Seam_2_0/seam2migration.txt 2008-11-06 22:39:16 UTC (rev 9521)
+++ branches/community/Seam_2_0/seam2migration.txt 2008-11-07 00:08:21 UTC (rev 9522)
@@ -1,6 +1,6 @@
Seam 2.0 Migration Guide
========================
-Before you get started with Seam2, you'll need to make a few changes to
+Before you get started with Seam 2, you'll need to make a few changes to
your existing code and configuration. This process should not be too
painful - if you get stuck, just refer back to the updated Seam examples.
@@ -8,7 +8,7 @@
--------------------------------
Seam 2.0 has been tested on the following containers:
-* JBoss 4.2 (it is possible to run Seam2 on JBoss 4.0.5 by upgrading JSF)
+* JBoss 4.2 (it's possible to run Seam 2 on JBoss 4.0.5 by upgrading JSF to 1.2)
* Tomcat 6.0 (Tomcat 5.5 is not compatible with JSF 1.2)
* GlassFish V2
* OC4J 11g Technology Preview
@@ -21,23 +21,49 @@
you'll need to make some changes to web.xml:
* remove the MyFaces StartupServletContextListener
-* remove the Ajax4JSF filter and mappings
+* remove the Ajax4JSF filter, mappings, and
+ org.ajax4jsf.VIEW_HANDLERS context parameter
* rename org.jboss.seam.web.SeamFilter to
org.jboss.seam.servlet.SeamFilter
+* rename org.jboss.seam.servlet.ResourceServlet to
+ org.jboss.seam.servlet.SeamResourceServlet
+* change the web-app version from 2.4 to 2.5
+ also change j2ee to javaee in namespace URL
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ version="2.5">
+ ...
+</web-app>
-Also note that for the JSF RI, client-side state saving is not required.
+Since Seam 1.2, you didn't need any declarations of SeamExceptionFilter
+or SeamRedirectFilter in web.xml, just a single declaration of SeamFilter.
+Make sure you've already made that change.
+Also note that for the JSF RI, client-side state saving, defined by
+the context param javax.faces.STATE_SAVING_METHOD, is not required
+and can be removed (server is the default).
+
You'll also need to make some changes to faces-config.xml:
-* Remove the (Tranactional)SeamPhaseListener declaration
+* Remove the TranactionalSeamPhaseListener or SeamPhaseListener declaration,
+ whichever is currently in use
* Remove the SeamELResolver declaration, if you have one
* Change the declaration of SeamFaceletViewHandler to the standard
- com.sun.facelets.FaceletViewHandler
+ com.sun.facelets.FaceletViewHandler (and make sure it's enabled)
+* Remove the DTD on the document and add the XML Schema declarations to the
+ root tag (<faces-config>)
+<faces-config version="1.2"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+ ...
+</faces-config>
-Since Seam 1.2, you didn't need any declarations of SeamExceptionFilter
-or SeamRedirectFilter in web.xml, just a single declaration of SeamFilter.
-Make sure you've already made that change.
-
Code migration
--------------
Seam's built-in components have undergone a major reorganization designed
@@ -47,6 +73,7 @@
* Persistence-related components moved to org.jboss.seam.persistence
* jBPM related components moved to org.jboss.seam.bpm
* JSF-related components moved org.jboss.seam.faces
+ most significantly org.jboss.seam.faces.FacesMessages
* Servlet-related components have moved to org.jboss.seam.web
* Components related to asynchronicity moved to org.jboss.seam.async
* i18n-related components moved to org.jboss.seam.international
@@ -88,39 +115,53 @@
You'll need to update your components.xml file to reflect the new schemas
and namespaces. Take a look at the Seam examples if you're unsure of
-exactly what you need to do.
+exactly what you need to do. Specifically, you are changing the namespace
+URLs to match the Seam version (i.e., 2.0 or 2.1).
-Finally, some declarations must be removed completely:
+Some declarations have moved or must be removed completely:
-* remove <conversation-is-long-running-parameter> from <core:init/>
+* replace <core:managed-persistence-context> and <core:entity-manager-factory> with
+ <persistence:managed-persistence-context> and
+ <persistence:entity-manager-factory>, respectively
+* remove conversation-is-long-running-parameter attribute from <core:manager/>
* remove <core:ejb/>
* remove <core:microcontainer/>
-* replace <core:transaction-listener/> with
- <transaction:ejb-transaction/>
+* replace <core:transaction-listener/> with <transaction:ejb-transaction/>
* replace <core:resource-bundle/> with <core:resource-loader/>
-Note: Seam transaction management is now enabled by default. If you want
- to disable use of Seam-managed transactions, use the following:
+Note: Seam transaction management is now enabled by default. It's now
+ controlled in components.xml rather than by a JSF phase listener
+ declaration in faces-config.xml. If you want to disable use of
+ Seam-managed transactions, use the following:
- <core:init transaction-management-enabled="false"/>
+ <core:init transaction-management-enabled="false"/>
-Note: The expression attribute on event action's has been deprecated in favor of
- execute e.g.:
+Note: The expression attribute on event action's has been deprecated in favor
+ of execute, e.g.
- <event type="org.jboss.seam.notLoggedIn">
+ <event type="org.jboss.seam.security.notLoggedIn">
<action execute="#{redirect.captureCurrentView}"/>
</event>
+ <event type="org.jboss.seam.loginSuccessful">
+ <action execute="#{redirect.returnToCapturedView}"/>
+ </event>
+In 2.1 the security events use the prefix org.jboss.seam.security instead of
+just org.jboss.seam (e.g. org.jboss.seam.security.notLoggedIn). Note that the
+event org.jboss.seam.security.loginSuccessful event should be used in place of
+org.jboss.seam.postAuthenticate for returning to the captured view.
+
Migration to JBoss Embedded
---------------------------
Support for deployment to JBoss Embeddable EJB3 and JBoss Microcontainer
has been removed. Instead, the new JBoss Embedded distribution gives you
a full set of EE-compatible APIs with simplified deployment.
-For testing, you need the jars in Seam's lib/ directory, together with the
-bootstrap/ directory in your classpath. SeamTest will automatically start
-the container. Refer to the Seam examples, or seam-gen, if you have
-trouble.
+For testing, you need the jars in Seam's lib/ directory, together with the
+bootstrap/ directory in your classpath. SeamTest will automatically start
+the container. You can remove any references or artifacts related to the
+JBoss Embeddable EJB3 (e.g., embedded-ejb folder and jboss-beans.xml). Refer
+to the Seam examples or seam-gen if you have trouble.
For Tomcat deployment, follow the instructions in the user guide. You no
longer need any special configuration or packaging for Tomcat deployments.
@@ -137,12 +178,13 @@
Migration to RichFaces 3.1
--------------------------
If you are using RichFaces or Ajax4jsf, a major reorganisation of the codebase
-has occurred. ajax4jsf.jar and richfaces.jar have been replaced by
+has occurred. The JARs ajax4jsf.jar and richfaces.jar have been replaced by
richfaces-api.jar (which should go in your ear lib/ directory) and
richfaces-impl.jar and richfaces-ui.jar (both of which go in WEB-INF/lib).
-s:selectDate has been deprecated in favor of rich:calendar. No more
-development will be done on s:selectDate.
+<s:selectDate> has been deprecated in favor of <rich:calendar>. No more
+development will be done on <s:selectDate>. You can remove the styles related
+to the data picker from your stylesheet to save on unnecessary bandwidth use.
You should check the RichFaces documentation for more information on parameter
name changes and namespace changes.
@@ -156,10 +198,16 @@
Changes to Seam UI
------------------
-* s:decorate has become a naming container. Therefore client ids have changed
- from fooForm:fooInput to fooForm:foo:fooInput (assuming your s:decorate has
- foo as an id.
+* <s:decorate> has become a naming container. Therefore client ids have changed
+ from fooForm:fooInput to fooForm:foo:fooInput, assuming the following declaration
+<h:form id="fooForm">
+ <s:decorate id="foo">
+ <h:inputText id="fooInput" value="#{bean.property}"/>
+ </s:decorate>
+</h:form>
+If you don't provide an id to <s:decorate>, one will be generated by JSF.
+
Changes to seam-gen
-------------------
@@ -181,7 +229,32 @@
Home and Query objects are "action" components, not "model" components
and are therefore placed in the action package. This change makes the
-convensions followed by generate-entities consistent with the convensions
+conventions followed by generate-entities consistent with the convensions
used in the new-entity command.
Remember, model classes are kept separate because they cannot be hot reloaded.
+
+Due to the change from JBoss Embeddable EJB3 to JBoss Embedded for testing,
+it is recommended that you generate a project using seam-gen from Seam 2
+and borrow the build.xml file from that project. If you have made
+significant changes to the build.xml in your project, you may want to focus
+on just migrating the test-related targets.
+
+In order for tests to work under JBoss Embedded, you need to change the
+value of the <datasource> element in resources/META-INF/persistence-test.xml
+(or persistence-test-war.xml) to java:/DefaultDS. The alternative is to
+deploy a -ds.xml file to the bootstrap/deploy folder and use the JNDI name
+defined by that file.
+
+If you use the build.xml from a Seam 2 seam-gen project, you will also need
+the deployed-*.list file(s). These files define which JAR files are packaged
+in the EAR or WAR. They were introduced to externalize this set of JARS from
+the build.xml file.
+
+To accomodate a change in the RichFaces panel, you need to add the following
+style to your stylesheet. Otherwise, you're search criteria block in pages
+created by generate-entities will bleed into the table of results.
+
+.rich-stglpanel-body {
+ overflow: auto;
+}
16 years
Seam SVN: r9518 - branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2008-11-06 05:28:25 -0500 (Thu, 06 Nov 2008)
New Revision: 9518
Modified:
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Migration.xml
Log:
JBPAPP-1168
Modified: branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Migration.xml
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Migration.xml 2008-11-06 07:13:41 UTC (rev 9517)
+++ branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Migration.xml 2008-11-06 10:28:25 UTC (rev 9518)
@@ -102,6 +102,15 @@
<section>
<title>Migrating <literal>web.xml</literal> and <literal>faces-config.xml</literal> to Seam 2</title>
+
+ <para>
+ First you should migrate
+ <literal>web.xml</literal>
+ and
+ <literal>faces-config.xml</literal>
+ files from DTD to XSD format, if you already haven't done it. It is
+ relevant for Seam users before version 1.2.
+ </para>
<para>
In your Seam 1.2 app you may have specified some Seam specific
@@ -312,6 +321,8 @@
<important>
<para>
+ Migrate all configuration XML file from DTD to XSD format if you use an old Seam
+ DTD configuration formats.
Don't forget to update the XSD's in <literal>pages.xml</literal> and
<literal>components.xml</literal> to point at the ones for Seam 2.
Just change the suffix from <literal>-1.2.xsd</literal> to
@@ -329,6 +340,10 @@
packages.
</para>
+ <para>Also please be sure that you have already migrated your components.xml
+ file from DTD to XSD format.
+ </para>
+
<para>
You'll need to update both your <literal>components.xml</literal>
and any references in Java code.
16 years
Seam SVN: r9517 - trunk/src/main/org/jboss/seam/faces.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-11-06 02:13:41 -0500 (Thu, 06 Nov 2008)
New Revision: 9517
Modified:
trunk/src/main/org/jboss/seam/faces/Switcher.java
Log:
JBSEAM-2881
Modified: trunk/src/main/org/jboss/seam/faces/Switcher.java
===================================================================
--- trunk/src/main/org/jboss/seam/faces/Switcher.java 2008-11-06 06:33:33 UTC (rev 9516)
+++ trunk/src/main/org/jboss/seam/faces/Switcher.java 2008-11-06 07:13:41 UTC (rev 9517)
@@ -99,7 +99,10 @@
public String select()
{
- boolean isOutcome = conversationIdOrOutcome==null || !Character.isDigit( conversationIdOrOutcome.charAt(0) );
+
+ boolean isOutcome = conversationIdOrOutcome==null ||
+ (!Character.isDigit(conversationIdOrOutcome.charAt(0)) && conversationIdOrOutcome.indexOf(':') < 0);
+
String actualOutcome;
if (isOutcome)
{
16 years
Seam SVN: r9516 - trunk/src/main/org/jboss/seam/core.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-11-06 01:33:33 -0500 (Thu, 06 Nov 2008)
New Revision: 9516
Modified:
trunk/src/main/org/jboss/seam/core/Manager.java
Log:
Pass the conversation entry as an event parameter
Modified: trunk/src/main/org/jboss/seam/core/Manager.java
===================================================================
--- trunk/src/main/org/jboss/seam/core/Manager.java 2008-11-06 06:31:45 UTC (rev 9515)
+++ trunk/src/main/org/jboss/seam/core/Manager.java 2008-11-06 06:33:33 UTC (rev 9516)
@@ -138,7 +138,7 @@
}
if (events != null)
{
- events.raiseEvent(EVENT_CONVERSATION_DESTROYED);
+ events.raiseEvent(EVENT_CONVERSATION_DESTROYED, conversationEntry);
}
destroyConversation(conversationEntry.getId(), getSessionMap());
}
16 years
Seam SVN: r9515 - in trunk/src: test/integration/src/org/jboss/seam/test/integration and 1 other directory.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-11-06 01:31:45 -0500 (Thu, 06 Nov 2008)
New Revision: 9515
Modified:
trunk/src/main/org/jboss/seam/core/Conversation.java
trunk/src/main/org/jboss/seam/core/Manager.java
trunk/src/test/integration/src/org/jboss/seam/test/integration/ConversationTest.java
Log:
JBSEAM-164
Modified: trunk/src/main/org/jboss/seam/core/Conversation.java
===================================================================
--- trunk/src/main/org/jboss/seam/core/Conversation.java 2008-11-06 06:01:47 UTC (rev 9514)
+++ trunk/src/main/org/jboss/seam/core/Conversation.java 2008-11-06 06:31:45 UTC (rev 9515)
@@ -34,6 +34,14 @@
private Integer concurrentRequestTimeout;
String description;
String viewId;
+
+ /**
+ * Kills all conversations except the current one
+ */
+ public void killAllOthers()
+ {
+ Manager.instance().killAllOtherConversations();
+ }
/**
* Get the timeout for this conversation instance.
Modified: trunk/src/main/org/jboss/seam/core/Manager.java
===================================================================
--- trunk/src/main/org/jboss/seam/core/Manager.java 2008-11-06 06:01:47 UTC (rev 9514)
+++ trunk/src/main/org/jboss/seam/core/Manager.java 2008-11-06 06:31:45 UTC (rev 9515)
@@ -11,6 +11,7 @@
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
@@ -45,6 +46,10 @@
@BypassInterceptors
public class Manager
{
+ public static final String EVENT_CONVERSATION_TIMEOUT = "org.jboss.seam.conversationTimeout";
+ public static final String EVENT_CONVERSATION_DESTROYED = "org.jboss.seam.conversationDestroyed";
+ public static final String EVENT_CONVERSATION_BEGIN = "org.jboss.seam.beginConversation";
+ public static final String EVENT_CONVERSATION_END = "org.jboss.seam.endConversation";
private static final LogProvider log = Logging.getLogProvider(Manager.class);
@@ -72,8 +77,99 @@
private String URIEncoding = DEFAULT_ENCODING;
private FlushModeType defaultFlushMode;
+
+ /**
+ * Kills all conversations except the current one
+ */
+ public void killAllOtherConversations()
+ {
+ ConversationEntries conversationEntries = ConversationEntries.instance();
+ Events events = Events.exists() ? Events.instance() : null;
+
+ if (conversationEntries != null)
+ {
+ List<ConversationEntry> entries = new ArrayList<ConversationEntry>(
+ conversationEntries.getConversationEntries());
+
+ for (ConversationEntry conversationEntry : entries)
+ {
+ // kill all entries expect the current one
+ // current conversation entry will be null if , kill-all is called
+ // inside a new @Begin
+ if (getCurrentConversationEntry() == null
+ || !getCurrentConversationIdStack().contains(
+ conversationEntry.getId()))
+ {
+ log.info("Kill all other conversations, executed: kill conversation id = "
+ + conversationEntry.getId());
+
+ boolean locked = conversationEntry.lockNoWait(); // we had better
+ // not wait for it, or we would be waiting for ALL other requests
+ try
+ {
+ if (locked)
+ {
+ if (log.isDebugEnabled())
+ {
+ log.debug("conversation killed manually: " + conversationEntry.getId());
+ }
+ }
+ else
+ {
+ // if we could not acquire the lock, someone has left a
+ // garbage lock lying around
+ // the reason garbage locks can exist is that we don't
+ // require a servlet filter to
+ // exist - but if we do use SeamExceptionFilter, it will
+ // clean up garbage and this
+ // case should never occur
+
+ // NOTE: this is slightly broken - in theory there is a
+ // window where a new request
+ // could have come in and got the lock just before us but
+ // called touch() just
+ // after we check the timeout - but in practice this would
+ // be extremely rare,
+ // and that request will get an
+ // IllegalMonitorStateException when it tries to
+ // unlock() the CE
+ log.debug("kill conversation with garbage lock: "
+ + conversationEntry.getId());
+ }
+ if (events != null)
+ {
+ events.raiseEvent(EVENT_CONVERSATION_DESTROYED);
+ }
+ destroyConversation(conversationEntry.getId(), getSessionMap());
+ }
+ finally
+ {
+ if (locked)
+ {
+ conversationEntry.unlock();
+ }
+ }
+ }
+ }
+ }
+ }
+ /**
+ * @return Map session
+ */
+ private Map<String, Object> getSessionMap()
+ {
+ // this method could be moved to a utility class
+ Map<String, Object> session = new HashMap<String, Object>();
+ String[] sessionAttributeNames = Contexts.getSessionContext().getNames();
+ for (String attributeName : sessionAttributeNames)
+ {
+ session.put(attributeName, Contexts.getSessionContext().get(attributeName));
+ }
+ return session;
+ }
+
// DONT BREAK, icefaces uses this
public String getCurrentConversationId()
{
@@ -320,7 +416,7 @@
}
if ( Events.exists() )
{
- Events.instance().raiseEvent("org.jboss.seam.conversationTimeout", conversationEntry.getId());
+ Events.instance().raiseEvent(EVENT_CONVERSATION_TIMEOUT, conversationEntry.getId());
}
destroyConversation( conversationEntry.getId(), session );
}
@@ -589,7 +685,7 @@
createConversationEntry();
Conversation.instance(); //force instantiation of the Conversation in the outer (non-nested) conversation
storeConversationToViewRootIfNecessary();
- if ( Events.exists() ) Events.instance().raiseEvent("org.jboss.seam.beginConversation");
+ if ( Events.exists() ) Events.instance().raiseEvent(EVENT_CONVERSATION_BEGIN);
}
}
@@ -610,7 +706,7 @@
createCurrentConversationIdStack(id).addAll(oldStack);
createConversationEntry();
storeConversationToViewRootIfNecessary();
- if ( Events.exists() ) Events.instance().raiseEvent("org.jboss.seam.beginConversation");
+ if ( Events.exists() ) Events.instance().raiseEvent(EVENT_CONVERSATION_BEGIN);
}
/**
@@ -621,7 +717,7 @@
if ( isLongRunningConversation() )
{
log.debug("Ending long-running conversation");
- if ( Events.exists() ) Events.instance().raiseEvent("org.jboss.seam.endConversation");
+ if ( Events.exists() ) Events.instance().raiseEvent(EVENT_CONVERSATION_END);
setLongRunningConversation(false);
destroyBeforeRedirect = beforeRedirect;
endNestedConversations( getCurrentConversationId() );
Modified: trunk/src/test/integration/src/org/jboss/seam/test/integration/ConversationTest.java
===================================================================
--- trunk/src/test/integration/src/org/jboss/seam/test/integration/ConversationTest.java 2008-11-06 06:01:47 UTC (rev 9514)
+++ trunk/src/test/integration/src/org/jboss/seam/test/integration/ConversationTest.java 2008-11-06 06:31:45 UTC (rev 9515)
@@ -5,6 +5,7 @@
import javax.faces.model.SelectItem;
+import org.jboss.seam.core.ConversationEntries;
import org.jboss.seam.core.ConversationEntry;
import org.jboss.seam.core.Manager;
import org.jboss.seam.faces.Switcher;
@@ -336,4 +337,105 @@
}.run();
}
+ @Test
+ public void killAllOthers() throws Exception
+ {
+ new FacesRequest("/pageWithAnotherDescription.xhtml") {
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ Manager.instance().beginConversation();
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert ConversationEntries.instance().size() == 1;
+ }
+ }.run();
+
+ new FacesRequest("/pageWithoutDescription.xhtml") {
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ Manager.instance().beginConversation();
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert ConversationEntries.instance().size() == 2;
+ }
+ }.run();
+
+ new FacesRequest("/pageWithDescription.xhtml") {
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ Manager.instance().beginConversation();
+ Manager.instance().killAllOtherConversations();
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert ConversationEntries.instance().size() == 1;
+ }
+ }.run();
+
+ }
+
+ @Test
+ public void nestedKillAllOthers() throws Exception
+ {
+
+ final String unrelated = new FacesRequest("/pageWithoutDescription.xhtml") {
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ Manager.instance().beginConversation();
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert ConversationEntries.instance().size() == 1;
+ }
+ }.run();
+
+ String root = new FacesRequest("/pageWithDescription.xhtml") {
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ Manager.instance().beginConversation();
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert ConversationEntries.instance().size() == 2;
+ }
+ }.run();
+
+ // nested conversation
+ new FacesRequest("/pageWithDescription.xhtml", root) {
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ Manager.instance().beginNestedConversation();
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert ConversationEntries.instance().size() == 3;
+
+ Manager.instance().killAllOtherConversations();
+ assert ConversationEntries.instance().size() == 2;
+ assert ConversationEntries.instance().getConversationIds()
+ .contains(unrelated) == false;
+ }
+
+ }.run();
+ }
}
16 years
Seam SVN: r9514 - trunk/src/main/org/jboss/seam/navigation.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-11-06 01:01:47 -0500 (Thu, 06 Nov 2008)
New Revision: 9514
Modified:
trunk/src/main/org/jboss/seam/navigation/Page.java
trunk/src/main/org/jboss/seam/navigation/Pages.java
trunk/src/main/org/jboss/seam/navigation/Rule.java
Log:
JBSEAM-2154
Modified: trunk/src/main/org/jboss/seam/navigation/Page.java
===================================================================
--- trunk/src/main/org/jboss/seam/navigation/Page.java 2008-11-06 03:09:55 UTC (rev 9513)
+++ trunk/src/main/org/jboss/seam/navigation/Page.java 2008-11-06 06:01:47 UTC (rev 9514)
@@ -16,7 +16,7 @@
import org.jboss.seam.core.ResourceLoader;
import org.jboss.seam.core.Expressions.ValueExpression;
import org.jboss.seam.security.Identity;
-import org.jboss.seam.util.Faces;
+import org.jboss.seam.util.Strings;
import org.jboss.seam.web.Pattern;
/**
@@ -45,7 +45,7 @@
private TaskControl taskControl = new TaskControl();
private ProcessControl processControl = new ProcessControl();
private ConversationIdParameter conversationIdParameter;
- private String eventType;
+ private List<String> eventTypes = new ArrayList<String>();
private List<Pattern> rewritePatterns = new ArrayList<Pattern>();
private List<Header> httpHeaders = new ArrayList<Header>();
@@ -270,7 +270,7 @@
for ( Input in: getInputs() ) in.in();
- if (eventType!=null)
+ for (String eventType : eventTypes)
{
Events.instance().raiseEvent(eventType);
}
@@ -386,20 +386,23 @@
this.conversationIdParameter = param;
}
- public String getEventType()
+ public List<String> getEventTypes()
{
- return eventType;
+ return eventTypes;
}
- public void setEventType(String eventType)
+ public void addEventType(String eventType)
{
- this.eventType = eventType;
+ if (!Strings.isEmpty(eventType))
+ {
+ eventTypes.add(eventType);
+ }
}
-
- public List<Pattern> getRewritePatterns() {
- return rewritePatterns;
- }
+ public List<Pattern> getRewritePatterns()
+ {
+ return rewritePatterns;
+ }
//public void setRewritePatterns(List<String> rewritePatterns) {
// this.rewritePatterns = rewritePatterns;
Modified: trunk/src/main/org/jboss/seam/navigation/Pages.java
===================================================================
--- trunk/src/main/org/jboss/seam/navigation/Pages.java 2008-11-06 03:09:55 UTC (rev 9513)
+++ trunk/src/main/org/jboss/seam/navigation/Pages.java 2008-11-06 06:01:47 UTC (rev 9514)
@@ -1217,10 +1217,10 @@
page.addRewritePattern(pattern.attributeValue("pattern"));
}
- Element eventElement = element.element("raise-event");
- if (eventElement!=null)
+ List<Element> events = element.elements("raise-event");
+ for (Element eventElement : events)
{
- page.setEventType( eventElement.attributeValue("type") );
+ page.addEventType( eventElement.attributeValue("type") );
}
Action action = parseAction(element, "action", false);
@@ -1413,10 +1413,10 @@
private static void parseEvent(Element element, Rule rule)
{
- Element eventElement = element.element("raise-event");
- if ( eventElement!=null )
+ List<Element> events = element.elements("raise-event");
+ for (Element eventElement : events)
{
- rule.setEventType( eventElement.attributeValue("type") );
+ rule.addEventType( eventElement.attributeValue("type") );
}
}
Modified: trunk/src/main/org/jboss/seam/navigation/Rule.java
===================================================================
--- trunk/src/main/org/jboss/seam/navigation/Rule.java 2008-11-06 03:09:55 UTC (rev 9513)
+++ trunk/src/main/org/jboss/seam/navigation/Rule.java 2008-11-06 06:01:47 UTC (rev 9514)
@@ -7,6 +7,7 @@
import org.jboss.seam.core.Events;
import org.jboss.seam.core.Expressions.ValueExpression;
+import org.jboss.seam.util.Strings;
/**
* Metadata for an <rule/> in pages.xml
@@ -23,7 +24,7 @@
private TaskControl taskControl = new TaskControl();
private ProcessControl processControl = new ProcessControl();
private List<NavigationHandler> navigationHandlers = new ArrayList<NavigationHandler>();
- private String eventType;
+ private List<String> eventTypes = new ArrayList<String>();
public boolean matches(String actualValue)
{
@@ -91,7 +92,7 @@
{
output.out();
}
- if (eventType!=null)
+ for (String eventType : eventTypes)
{
Events.instance().raiseEvent(eventType);
}
@@ -102,13 +103,16 @@
return false;
}
- public String getEventType()
+ public List<String> getEventTypes()
{
- return eventType;
+ return eventTypes;
}
- public void setEventType(String event)
+ public void addEventType(String eventType)
{
- this.eventType = event;
+ if (!Strings.isEmpty(eventType))
+ {
+ eventTypes.add(eventType);
+ }
}
}
\ No newline at end of file
16 years
Seam SVN: r9513 - trunk/src/main/org/jboss/seam/mock.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-11-05 22:09:55 -0500 (Wed, 05 Nov 2008)
New Revision: 9513
Modified:
trunk/src/main/org/jboss/seam/mock/MockServletContext.java
Log:
JBSEAM-3638
Modified: trunk/src/main/org/jboss/seam/mock/MockServletContext.java
===================================================================
--- trunk/src/main/org/jboss/seam/mock/MockServletContext.java 2008-11-06 02:03:32 UTC (rev 9512)
+++ trunk/src/main/org/jboss/seam/mock/MockServletContext.java 2008-11-06 03:09:55 UTC (rev 9513)
@@ -56,7 +56,7 @@
}
else
{
- webappRoot = new File(getClass().getResource("/").toURI());
+ webappRoot = new File(getClass().getResource("/.").toURI());
}
}
catch (URISyntaxException e)
16 years