Seam SVN: r15120 - in branches/community/Seam_2_3/examples-ee6/jpa: jpa-web/src/main/java/org/jboss/seam/example/jpa and 2 other directories.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2012-09-06 10:56:12 -0400 (Thu, 06 Sep 2012)
New Revision: 15120
Modified:
branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/java/org/jboss/seam/example/jpa/test/BookingTest.java
branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/java/org/jboss/seam/example/jpa/AuthenticatorAction.java
branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/java/org/jboss/seam/example/jpa/BookingListAction.java
branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/java/org/jboss/seam/example/jpa/RegisterAction.java
branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/resources/META-INF/persistence.xml
branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/home.xhtml
branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/main.xhtml
branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/register.xhtml
branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/template.xhtml
Log:
JBSEAM-4876 using JPA 2 criteriaAPI and getSingleResult in JPA Booking
Modified: branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/java/org/jboss/seam/example/jpa/test/BookingTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/java/org/jboss/seam/example/jpa/test/BookingTest.java 2012-09-05 13:52:16 UTC (rev 15119)
+++ branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/java/org/jboss/seam/example/jpa/test/BookingTest.java 2012-09-06 14:56:12 UTC (rev 15120)
@@ -13,6 +13,7 @@
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.OverProtocol;
import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.Component;
import org.jboss.seam.contexts.Contexts;
import org.jboss.seam.core.Manager;
import org.jboss.seam.example.jpa.Booking;
@@ -24,6 +25,7 @@
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -70,17 +72,17 @@
@Override
protected void invokeApplication()
{
- assert invokeAction("#{hotelSearch.find}")==null;
+ Assert.assertNull(invokeAction("#{hotelSearch.find}"));
}
@Override
protected void renderResponse()
{
DataModel hotels = (DataModel) Contexts.getSessionContext().get("hotels");
- assert hotels.getRowCount()==1;
- assert ( (Hotel) hotels.getRowData() ).getCity().equals("NY");
- assert getValue("#{hotelSearch.searchString}").equals("Union Square");
- assert !Manager.instance().isLongRunningConversation();
+ Assert.assertEquals(1, hotels.getRowCount());
+ Assert.assertEquals("NY",( (Hotel) hotels.getRowData() ).getCity() );
+ Assert.assertEquals("Union Square", getValue("#{hotelSearch.searchString}"));
+ Assert.assertTrue(!Manager.instance().isLongRunningConversation());
}
}.run();
@@ -91,7 +93,7 @@
protected void invokeApplication() throws Exception {
HotelBookingAction hotelBooking = (HotelBookingAction) getInstance("hotelBooking");
DataModel hotels = (DataModel) Contexts.getSessionContext().get("hotels");
- assert hotels.getRowCount()==1;
+ Assert.assertEquals(1, hotels.getRowCount());
hotelBooking.selectHotel( (Hotel) hotels.getRowData() );
}
@@ -99,9 +101,9 @@
protected void renderResponse()
{
Hotel hotel = (Hotel) Contexts.getConversationContext().get("hotel");
- assert hotel.getCity().equals("NY");
- assert hotel.getZip().equals("10011");
- assert Manager.instance().isLongRunningConversation();
+ Assert.assertEquals("NY",hotel.getCity() );
+ Assert.assertEquals("10011",hotel.getZip() );
+ Assert.assertTrue(Manager.instance().isLongRunningConversation());
}
}.run();
@@ -117,14 +119,14 @@
@Override
protected void renderResponse()
{
- assert getValue("#{booking.user}")!=null;
- assert getValue("#{booking.hotel}")!=null;
- assert getValue("#{booking.creditCard}")==null;
- assert getValue("#{booking.creditCardName}")==null;
+ Assert.assertNotNull(getValue("#{booking.user}"));
+ Assert.assertNotNull(getValue("#{booking.hotel}"));
+ Assert.assertNull(getValue("#{booking.creditCard}"));
+ Assert.assertNull(getValue("#{booking.creditCardName}"));
Booking booking = (Booking) Contexts.getConversationContext().get("booking");
- assert booking.getHotel()==Contexts.getConversationContext().get("hotel");
- assert booking.getUser()==Contexts.getSessionContext().get("user");
- assert Manager.instance().isLongRunningConversation();
+ Assert.assertTrue(booking.getHotel()==Contexts.getConversationContext().get("hotel"));
+ Assert.assertTrue(booking.getUser()==Contexts.getConversationContext().get("user"));
+ Assert.assertTrue(Manager.instance().isLongRunningConversation());
}
}.run();
@@ -135,23 +137,23 @@
protected void processValidations() throws Exception
{
validateValue("#{booking.creditCard}", "123");
- assert isValidationFailure();
+ Assert.assertTrue(isValidationFailure());
}
@Override
protected void renderResponse()
{
Iterator messages = FacesContext.getCurrentInstance().getMessages();
- assert messages.hasNext();
- assert ( (FacesMessage) messages.next() ).getSummary().equals("Credit card number must 16 digits long");
- assert !messages.hasNext();
- assert Manager.instance().isLongRunningConversation();
+ Assert.assertTrue(messages.hasNext());
+ Assert.assertEquals("Credit card number must 16 digits long", ( (FacesMessage) messages.next() ).getSummary());
+ Assert.assertFalse(messages.hasNext());
+ Assert.assertTrue(Manager.instance().isLongRunningConversation());
}
@Override
protected void afterRequest()
{
- assert !isInvokeApplicationBegun();
+ Assert.assertTrue(!isInvokeApplicationBegun());
}
}.run();
@@ -162,23 +164,23 @@
protected void processValidations() throws Exception
{
validateValue("#{booking.creditCardName}", "");
- assert isValidationFailure();
+ Assert.assertTrue(isValidationFailure());
}
@Override
protected void renderResponse()
{
Iterator messages = FacesContext.getCurrentInstance().getMessages();
- assert messages.hasNext();
- assert ( (FacesMessage) messages.next() ).getSummary().equals("Credit card name is required");
- assert !messages.hasNext();
- assert Manager.instance().isLongRunningConversation();
+ Assert.assertTrue(messages.hasNext());
+ Assert.assertEquals("Credit card name is required", ( (FacesMessage) messages.next() ).getSummary());
+ Assert.assertFalse(messages.hasNext());
+ Assert.assertTrue(Manager.instance().isLongRunningConversation());
}
@Override
protected void afterRequest()
{
- assert !isInvokeApplicationBegun();
+ Assert.assertFalse(isInvokeApplicationBegun());
}
}.run();
@@ -206,11 +208,12 @@
protected void renderResponse()
{
Iterator messages = FacesContext.getCurrentInstance().getMessages();
- assert messages.hasNext();
+ Assert.assertTrue(Manager.instance().isLongRunningConversation());
+ Assert.assertTrue(messages.hasNext());
FacesMessage message = (FacesMessage) messages.next();
- assert message.getSummary().equals("Check out date must be later than check in date");
- assert !messages.hasNext();
- assert Manager.instance().isLongRunningConversation();
+ Assert.assertEquals("Check out date must be later than check in date",message.getSummary());
+ Assert.assertFalse(messages.hasNext());
+ Assert.assertTrue(Manager.instance().isLongRunningConversation());
}
@Override
@@ -240,13 +243,13 @@
@Override
protected void renderResponse()
{
- assert Manager.instance().isLongRunningConversation();
+ Assert.assertTrue(Manager.instance().isLongRunningConversation());
}
@Override
protected void afterRequest()
{
- assert isInvokeApplicationComplete();
+ Assert.assertTrue( isInvokeApplicationComplete() );
}
}.run();
@@ -262,7 +265,7 @@
@Override
protected void afterRequest()
{
- assert isInvokeApplicationComplete();
+ Assert.assertTrue( isInvokeApplicationComplete() );
}
}.run();
@@ -273,12 +276,12 @@
protected void renderResponse()
{
ListDataModel bookings = (ListDataModel) getInstance("bookings");
- assert bookings.getRowCount()==1;
+ Assert.assertEquals(1, bookings.getRowCount());
bookings.setRowIndex(0);
Booking booking = (Booking) bookings.getRowData();
- assert booking.getHotel().getCity().equals("NY");
- assert booking.getUser().getUsername().equals("gavin");
- assert !Manager.instance().isLongRunningConversation();
+ Assert.assertEquals("NY", booking.getHotel().getCity());
+ Assert.assertEquals("gavin", booking.getUser().getUsername());
+ Assert.assertFalse(Manager.instance().isLongRunningConversation());
}
}.run();
@@ -297,8 +300,8 @@
protected void renderResponse()
{
ListDataModel bookings = (ListDataModel) Contexts.getSessionContext().get("bookings");
- assert bookings.getRowCount()==0;
- assert !Manager.instance().isLongRunningConversation();
+ Assert.assertEquals(0, bookings.getRowCount());
+ Assert.assertFalse(Manager.instance().isLongRunningConversation());
}
}.run();
Modified: branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/java/org/jboss/seam/example/jpa/AuthenticatorAction.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/java/org/jboss/seam/example/jpa/AuthenticatorAction.java 2012-09-05 13:52:16 UTC (rev 15119)
+++ branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/java/org/jboss/seam/example/jpa/AuthenticatorAction.java 2012-09-06 14:56:12 UTC (rev 15120)
@@ -2,13 +2,13 @@
import static org.jboss.seam.ScopeType.SESSION;
-import java.util.List;
-
import javax.persistence.EntityManager;
+import javax.persistence.NoResultException;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Out;
+import org.jboss.seam.faces.FacesMessages;
@Name("authenticator")
public class AuthenticatorAction
@@ -20,18 +20,18 @@
public boolean authenticate()
{
- List results = em.createQuery("select u from User u where u.username=#{identity.username} and u.password=#{identity.password}")
- .getResultList();
-
- if ( results.size()==0 )
+ try
{
- return false;
+ user = (User) em.createQuery("select u from User u where u.username=#{identity.username} and u.password=#{identity.password}")
+ .getSingleResult();
+ return true;
}
- else
+ catch (NoResultException e)
{
- user = (User) results.get(0);
- return true;
+ FacesMessages.instance().add("Authentication failed");
+ return false;
}
+
}
}
Modified: branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/java/org/jboss/seam/example/jpa/BookingListAction.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/java/org/jboss/seam/example/jpa/BookingListAction.java 2012-09-05 13:52:16 UTC (rev 15119)
+++ branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/java/org/jboss/seam/example/jpa/BookingListAction.java 2012-09-06 14:56:12 UTC (rev 15120)
@@ -8,6 +8,9 @@
import java.util.List;
import javax.persistence.EntityManager;
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Root;
import org.jboss.seam.annotations.Factory;
import org.jboss.seam.annotations.In;
@@ -47,9 +50,20 @@
// @Transactional
public void getBookings()
{
- bookings = em.createQuery("select b from Booking b where b.user.username = :username order by b.checkinDate")
- .setParameter("username", user.getUsername())
- .getResultList();
+// JPA 1.0 way
+// bookings = em.createQuery("select b from Booking b where b.user.username = :username order by b.checkinDate")
+// .setParameter("username", user.getUsername())
+// .getResultList();
+
+ //JPA 2.0 way - using new CriteriaBuilder API for dynamic query execution
+ //this easily check the typos in comparison to usage of string query
+ CriteriaBuilder criteriaBuilder = em.getCriteriaBuilder();
+ CriteriaQuery<Booking> query = criteriaBuilder.createQuery(Booking.class);
+ Root<Booking> hotelBooking = query.from(Booking.class);
+ query.where(criteriaBuilder.equal(hotelBooking.get("user"), user));
+ query.orderBy(criteriaBuilder.asc(hotelBooking.get("checkinDate")));
+
+ bookings = em.createQuery(query).getResultList();
}
public void cancel()
Modified: branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/java/org/jboss/seam/example/jpa/RegisterAction.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/java/org/jboss/seam/example/jpa/RegisterAction.java 2012-09-05 13:52:16 UTC (rev 15119)
+++ branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/java/org/jboss/seam/example/jpa/RegisterAction.java 2012-09-06 14:56:12 UTC (rev 15120)
@@ -3,9 +3,8 @@
import static org.jboss.seam.ScopeType.EVENT;
-import java.util.List;
-
import javax.persistence.EntityManager;
+import javax.persistence.NoResultException;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
@@ -34,18 +33,19 @@
{
if ( user.getPassword().equals(verify) )
{
- List existing = em.createQuery("select u.username from User u where u.username=#{user.username}")
- .getResultList();
- if (existing.size()==0)
+ // this is JPA 2.0 usage of new method getSingleResult()
+ try
{
+ em.createQuery("select u.username from User u where u.username=#{user.username}").getSingleResult();
+ facesMessages.addToControl("username", "Username #{user.username} already exists");
+ }
+ catch (NoResultException e)
+ {
em.persist(user);
facesMessages.add("Successfully registered as #{user.username}");
registered = true;
}
- else
- {
- facesMessages.addToControl("username", "Username #{user.username} already exists");
- }
+
}
else
{
Modified: branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/resources/META-INF/persistence.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/resources/META-INF/persistence.xml 2012-09-05 13:52:16 UTC (rev 15119)
+++ branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/resources/META-INF/persistence.xml 2012-09-06 14:56:12 UTC (rev 15120)
@@ -1,15 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
- version="1.0">
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
+ version="2.0">
<persistence-unit name="bookingDatabase" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<non-jta-data-source>java:jboss/datasources/ExampleDS</non-jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.show_sql" value="true"/>
-<!-- <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/> -->
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
<!-- Binds the EntityManagerFactory to JNDI where Seam can look it up.
This is only relevant when the container automatically loads the persistence unit, as is the case in JBoss AS 5. -->
Modified: branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/home.xhtml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/home.xhtml 2012-09-05 13:52:16 UTC (rev 15119)
+++ branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/home.xhtml 2012-09-06 14:56:12 UTC (rev 15120)
@@ -42,7 +42,7 @@
</h:form>
</div>
</div>
- <div id="footer">Created with JBoss EJB 3.0, Seam, JSF (Mojarra), and Facelets</div>
+ <div id="footer">Created with Seam, JSF 2 and JPA 2</div>
</div>
</f:view>
</h:body>
Modified: branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/main.xhtml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/main.xhtml 2012-09-05 13:52:16 UTC (rev 15119)
+++ branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/main.xhtml 2012-09-06 14:56:12 UTC (rev 15120)
@@ -20,7 +20,7 @@
<h1>Search Hotels</h1>
<fieldset>
<h:inputText id="searchString" value="#{hotelSearch.searchString}" style="width: 165px;">
- <a:ajax id="onkeyup" event="keyup" listener="#{hotelSearch.find}" render="searchResults" />
+ <a:ajax id="keyup" event="keyup" listener="#{hotelSearch.find}" render="searchResults" />
</h:inputText>
 
<a:commandButton id="findHotels" value="Find Hotels" action="#{hotelSearch.find}" reRender="searchResults"/>
Modified: branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/register.xhtml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/register.xhtml 2012-09-05 13:52:16 UTC (rev 15119)
+++ branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/register.xhtml 2012-09-06 14:56:12 UTC (rev 15120)
@@ -98,7 +98,7 @@
</div>
</div>
</div>
- <div id="footer">Created with JBoss EJB 3.0, Seam, JSF (Mojarra), and Facelets</div>
+ <div id="footer">Created with Seam, JSF 2 and JPA 2</div>
</div>
</h:body>
</html>
Modified: branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/template.xhtml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/template.xhtml 2012-09-05 13:52:16 UTC (rev 15119)
+++ branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/template.xhtml 2012-09-06 14:56:12 UTC (rev 15120)
@@ -29,7 +29,7 @@
<ui:include src="conversations.xhtml" />
</div>
</div>
- <div id="footer">Created with JBoss Seam, JSF 1.2, Hibernate 3 and Facelets</div>
+ <div id="footer">Created with JBoss Seam, JSF 2 and JPA 2</div>
</div>
</h:body>
</html>
12 years, 3 months
Seam SVN: r15119 - branches/community/Seam_2_3/distribution/src/main/assembly.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2012-09-05 09:52:16 -0400 (Wed, 05 Sep 2012)
New Revision: 15119
Modified:
branches/community/Seam_2_3/distribution/src/main/assembly/seam23migration.txt
Log:
JBSEAM-5029 fixed typos in migration guide text
Modified: branches/community/Seam_2_3/distribution/src/main/assembly/seam23migration.txt
===================================================================
--- branches/community/Seam_2_3/distribution/src/main/assembly/seam23migration.txt 2012-09-05 13:47:57 UTC (rev 15118)
+++ branches/community/Seam_2_3/distribution/src/main/assembly/seam23migration.txt 2012-09-05 13:52:16 UTC (rev 15119)
@@ -37,11 +37,11 @@
Bean Validation instead of Hibernate Validator
------------------
-You need to migrate from org.hibernate.validator.* validator annotations to java.validation.constraint.* equivalent
+You need to migrate from org.hibernate.validator.* validator annotations to javax.validation.constraint.* equivalent
for instance:
-org.hibernate.validator.Length to java.validation.constraint.Size,
-org.hibernate.validator.NotNull to java.validation.constraint.NotNull,
-org.hibernate.validator.Pattern to java.validation.constraint.Pattern.
+org.hibernate.validator.Length to javax.validation.constraint.Size,
+org.hibernate.validator.NotNull to javax.validation.constraint.NotNull,
+org.hibernate.validator.Pattern to javax.validation.constraint.Pattern.
JSF 1 to JSF 2 Facelets
------------------
12 years, 3 months
Seam SVN: r15118 - branches/community/Seam_2_3/seam-reference-guide/src/docbook/en-US.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2012-09-05 09:47:57 -0400 (Wed, 05 Sep 2012)
New Revision: 15118
Modified:
branches/community/Seam_2_3/seam-reference-guide/src/docbook/en-US/Excel.xml
Log:
JBSEAM-4925 removed a space
Modified: branches/community/Seam_2_3/seam-reference-guide/src/docbook/en-US/Excel.xml
===================================================================
--- branches/community/Seam_2_3/seam-reference-guide/src/docbook/en-US/Excel.xml 2012-09-05 13:45:33 UTC (rev 15117)
+++ branches/community/Seam_2_3/seam-reference-guide/src/docbook/en-US/Excel.xml 2012-09-05 13:47:57 UTC (rev 15118)
@@ -65,8 +65,8 @@
</para>
<para>
If you are having problems accessing the generated file under IE (especially
- with https), make sure you are not using too strict restrictions in the browser
- <!-- (see <ulink url="http://www.nwnetworks.com/iezones.htm"/>) server disappeared? :-o-->,
+ with https), make sure you are not using too strict restrictions in the browser,
+ <!-- (see <ulink url="http://www.nwnetworks.com/iezones.htm"/>) server disappeared? :-o-->
too strict security constraint in web.xml or a combination of both.
</para>
</section>
12 years, 3 months
Seam SVN: r15117 - branches/community/Seam_2_3/seam-reference-guide/src/docbook/en-US.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2012-09-05 09:45:33 -0400 (Wed, 05 Sep 2012)
New Revision: 15117
Modified:
branches/community/Seam_2_3/seam-reference-guide/src/docbook/en-US/Excel.xml
branches/community/Seam_2_3/seam-reference-guide/src/docbook/en-US/Getting_Started_With_JBoss_Tools.xml
Log:
JBSEAM-4925 fixed broken links in doc
Modified: branches/community/Seam_2_3/seam-reference-guide/src/docbook/en-US/Excel.xml
===================================================================
--- branches/community/Seam_2_3/seam-reference-guide/src/docbook/en-US/Excel.xml 2012-09-05 12:25:25 UTC (rev 15116)
+++ branches/community/Seam_2_3/seam-reference-guide/src/docbook/en-US/Excel.xml 2012-09-05 13:45:33 UTC (rev 15117)
@@ -66,8 +66,8 @@
<para>
If you are having problems accessing the generated file under IE (especially
with https), make sure you are not using too strict restrictions in the browser
- (see <ulink url="http://www.nwnetworks.com/iezones.htm"/>), too strict security
- constraint in web.xml or a combination of both.
+ <!-- (see <ulink url="http://www.nwnetworks.com/iezones.htm"/>) server disappeared? :-o-->,
+ too strict security constraint in web.xml or a combination of both.
</para>
</section>
<section id="excel.usage">
Modified: branches/community/Seam_2_3/seam-reference-guide/src/docbook/en-US/Getting_Started_With_JBoss_Tools.xml
===================================================================
--- branches/community/Seam_2_3/seam-reference-guide/src/docbook/en-US/Getting_Started_With_JBoss_Tools.xml 2012-09-05 12:25:25 UTC (rev 15116)
+++ branches/community/Seam_2_3/seam-reference-guide/src/docbook/en-US/Getting_Started_With_JBoss_Tools.xml 2012-09-05 13:45:33 UTC (rev 15117)
@@ -17,7 +17,7 @@
</para>
<para>Please read the latest JBoss Tools documentation at
- <ulink url="http://docs.jboss.org/tools/latest/en/seam/html_single/">http://docs.jboss.org/tools/latest/en/seam/html_single/</ulink>
+ <ulink url="http://docs.jboss.org/tools/latest/en/seam_tools_ref_guide/html/index.html">http://docs.jboss.org/tools/latest/en/seam_tools_ref_guide/html/index.html</ulink>.
</para>
<para>
12 years, 3 months
Seam SVN: r15116 - branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/mock.
by seam-commits@lists.jboss.org
Author: maschmid
Date: 2012-09-05 08:25:25 -0400 (Wed, 05 Sep 2012)
New Revision: 15116
Modified:
branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/mock/MockSeamListener.java
Log:
JBSEAM-5027 Sabotage Mojarra initialization in MockSeamListener by removing the com.sun.faces.facesInitializerMappingsAdded attribute
Modified: branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/mock/MockSeamListener.java
===================================================================
--- branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/mock/MockSeamListener.java 2012-09-05 12:06:51 UTC (rev 15115)
+++ branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/mock/MockSeamListener.java 2012-09-05 12:25:25 UTC (rev 15116)
@@ -33,6 +33,10 @@
log.info( "Welcome to Mock Seam " + Seam.getVersion() );
event.getServletContext().setAttribute( Seam.VERSION, Seam.getVersion() );
servletContext = event.getServletContext();
+
+ // Sabotage Mojarra initialization.
+ // This is required as Mojarra will attempt to initialize even if there is no FacesServlet configured in web.xml
+ servletContext.removeAttribute("com.sun.faces.facesInitializerMappingsAdded");
}
public static ServletContext getServletContext() {
12 years, 3 months
Seam SVN: r15115 - in branches/community/Seam_2_3: examples-ee6/ui/ui-tests and 2 other directories.
by seam-commits@lists.jboss.org
Author: rsmeral
Date: 2012-09-05 08:06:51 -0400 (Wed, 05 Sep 2012)
New Revision: 15115
Modified:
branches/community/Seam_2_3/bom/pom.xml
branches/community/Seam_2_3/examples-ee6/ui/ui-tests/pom.xml
branches/community/Seam_2_3/examples-ee6/ui/ui-tests/src/test/java/org/jboss/seam/example/ui/test/htmlunit/HtmlUnitUITest.java
branches/community/Seam_2_3/seam-integration-tests/pom.xml
Log:
bom: upgrade commons-lang to 2.6
Modified: branches/community/Seam_2_3/bom/pom.xml
===================================================================
--- branches/community/Seam_2_3/bom/pom.xml 2012-09-05 11:38:30 UTC (rev 15114)
+++ branches/community/Seam_2_3/bom/pom.xml 2012-09-05 12:06:51 UTC (rev 15115)
@@ -317,7 +317,7 @@
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
- <version>2.3</version>
+ <version>2.6</version>
</dependency>
<dependency>
Modified: branches/community/Seam_2_3/examples-ee6/ui/ui-tests/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/ui/ui-tests/pom.xml 2012-09-05 11:38:30 UTC (rev 15114)
+++ branches/community/Seam_2_3/examples-ee6/ui/ui-tests/pom.xml 2012-09-05 12:06:51 UTC (rev 15115)
@@ -58,14 +58,6 @@
<version>2.9</version>
</dependency>
- <!-- Override for HTMLUnit -->
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.6</version>
- <scope>test</scope>
- </dependency>
-
</dependencies>
<build>
Modified: branches/community/Seam_2_3/examples-ee6/ui/ui-tests/src/test/java/org/jboss/seam/example/ui/test/htmlunit/HtmlUnitUITest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/ui/ui-tests/src/test/java/org/jboss/seam/example/ui/test/htmlunit/HtmlUnitUITest.java 2012-09-05 11:38:30 UTC (rev 15114)
+++ branches/community/Seam_2_3/examples-ee6/ui/ui-tests/src/test/java/org/jboss/seam/example/ui/test/htmlunit/HtmlUnitUITest.java 2012-09-05 12:06:51 UTC (rev 15115)
@@ -64,7 +64,7 @@
@BeforeMethod
public void setUp() throws Exception{
URL url = new URL(PAGE_URL);
- wc = new WebClient(BrowserVersion.FIREFOX_2);
+ wc = new WebClient(BrowserVersion.FIREFOX_3_6);
page = (HtmlPage) wc.getPage(url);
}
Modified: branches/community/Seam_2_3/seam-integration-tests/pom.xml
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests/pom.xml 2012-09-05 11:38:30 UTC (rev 15114)
+++ branches/community/Seam_2_3/seam-integration-tests/pom.xml 2012-09-05 12:06:51 UTC (rev 15115)
@@ -171,14 +171,6 @@
<scope>test</scope>
</dependency>
- <!-- Override for HtmlUnit -->
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.6</version>
- <scope>test</scope>
- </dependency>
-
</dependencies>
<profiles>
12 years, 3 months
Seam SVN: r15114 - branches/community/Seam_2_3/examples-ee6/ui/ui-tests.
by seam-commits@lists.jboss.org
Author: rsmeral
Date: 2012-09-05 07:38:30 -0400 (Wed, 05 Sep 2012)
New Revision: 15114
Modified:
branches/community/Seam_2_3/examples-ee6/ui/ui-tests/pom.xml
Log:
ui-tests: upgrade HTMLUnit to 2.9, commons-lang to 2.6
Modified: branches/community/Seam_2_3/examples-ee6/ui/ui-tests/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/ui/ui-tests/pom.xml 2012-09-05 06:36:11 UTC (rev 15113)
+++ branches/community/Seam_2_3/examples-ee6/ui/ui-tests/pom.xml 2012-09-05 11:38:30 UTC (rev 15114)
@@ -55,8 +55,17 @@
<dependency>
<groupId>net.sourceforge.htmlunit</groupId>
<artifactId>htmlunit</artifactId>
- <version>2.3</version>
+ <version>2.9</version>
</dependency>
+
+ <!-- Override for HTMLUnit -->
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.6</version>
+ <scope>test</scope>
+ </dependency>
+
</dependencies>
<build>
12 years, 3 months
Seam SVN: r15113 - branches/community/Seam_2_3/seam-reference-guide/src/docbook/en-US.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2012-09-05 02:36:11 -0400 (Wed, 05 Sep 2012)
New Revision: 15113
Modified:
branches/community/Seam_2_3/seam-reference-guide/src/docbook/en-US/Persistence.xml
Log:
JBSEAM-3857 added warning about SMPC and manual flush mode
Modified: branches/community/Seam_2_3/seam-reference-guide/src/docbook/en-US/Persistence.xml
===================================================================
--- branches/community/Seam_2_3/seam-reference-guide/src/docbook/en-US/Persistence.xml 2012-09-04 14:52:25 UTC (rev 15112)
+++ branches/community/Seam_2_3/seam-reference-guide/src/docbook/en-US/Persistence.xml 2012-09-05 06:36:11 UTC (rev 15113)
@@ -482,6 +482,9 @@
<core:manager conversation-timeout="120000" default-flush-mode="manual" />
</components>]]></programlisting>
+ <warning><para> if you use SMPC in your Stateful bean, manual flush mode is ignored as this mode is specific Hibernate extension to JPA specification.
+ Seam can’t control the flush mode of the persistence context on an SFSB - that means no manual flushing on SFSB! </para>
+ </warning>
</section>
</section>
12 years, 3 months
Seam SVN: r15112 - branches/community/Seam_2_3/examples-ee6/seamspace/seamspace-tests/src/test/java/org/jboss/seam/example/seamspace/test.
by seam-commits@lists.jboss.org
Author: maschmid
Date: 2012-09-04 10:52:25 -0400 (Tue, 04 Sep 2012)
New Revision: 15112
Modified:
branches/community/Seam_2_3/examples-ee6/seamspace/seamspace-tests/src/test/java/org/jboss/seam/example/seamspace/test/BlogTest.java
branches/community/Seam_2_3/examples-ee6/seamspace/seamspace-tests/src/test/java/org/jboss/seam/example/seamspace/test/RegisterTest.java
Log:
JBSEAM-5024 change java asserts to junit asserts so that the behavior doesn't depend on -ea
Modified: branches/community/Seam_2_3/examples-ee6/seamspace/seamspace-tests/src/test/java/org/jboss/seam/example/seamspace/test/BlogTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/seamspace/seamspace-tests/src/test/java/org/jboss/seam/example/seamspace/test/BlogTest.java 2012-09-04 13:57:47 UTC (rev 15111)
+++ branches/community/Seam_2_3/examples-ee6/seamspace/seamspace-tests/src/test/java/org/jboss/seam/example/seamspace/test/BlogTest.java 2012-09-04 14:52:25 UTC (rev 15112)
@@ -1,9 +1,10 @@
package org.jboss.seam.example.seamspace.test;
+import static org.junit.Assert.*;
+
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.OverProtocol;
import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.seam.mock.AbstractSeamTest.FacesRequest;
import org.jboss.seam.mock.JUnitSeamTest;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
@@ -23,7 +24,7 @@
web.addClasses(BlogTest.class);
return er;
}
-
+
@Test
public void testCreateBlog() throws Exception
{
@@ -36,19 +37,19 @@
setValue("#{identity.username}", "demo");
setValue("#{identity.password}", "demo");
invokeAction("#{identity.login}");
- assert getValue("#{identity.loggedIn}").equals(true);
+ assertTrue((Boolean)getValue("#{identity.loggedIn}"));
}
}.run();
-
+
String cid = new FacesRequest()
{
@Override
protected void invokeApplication() throws Exception
- {
- assert invokeAction("#{blog.createEntry}") == null;
- }
+ {
+ assertNull(invokeAction("#{blog.createEntry}"));
+ }
}.run();
-
+
new FacesRequest("/createBlog.xhtml", cid)
{
@Override
@@ -70,26 +71,26 @@
"Sed vitae nulla eu tellus fringilla sagittis. Nunc convallis, mi at lobortis " +
"rhoncus, neque turpis ullamcorper odio, quis scelerisque est dolor non velit. Integer vulputate.");
}
-
+
@Override
protected void invokeApplication() throws Exception
{
- assert invokeAction("#{blog.saveEntry}") == null;
+ assertNull(invokeAction("#{blog.saveEntry}"));
}
-
+
}.run();
-
+
new FacesRequest()
{
@Override
protected void invokeApplication() throws Exception
{
invokeAction("#{identity.logout}");
- assert getValue("#{identity.loggedIn}").equals(false);
+ assertFalse((Boolean)getValue("#{identity.loggedIn}"));
}
- }.run();
+ }.run();
}
-
+
//@Test
public void testCreateComment() throws Exception
{
@@ -101,10 +102,10 @@
setValue("#{identity.username}", "demo");
setValue("#{identity.password}", "demo");
invokeAction("#{identity.login}");
- assert getValue("#{identity.loggedIn}").equals(true);
+ assertTrue((Boolean)getValue("#{identity.loggedIn}"));
}
- }.run();
-
+ }.run();
+
String cid = new FacesRequest("/comment.xhtml")
{
@Override
@@ -112,13 +113,13 @@
{
setParameter("name", "Mr_Smiley");
setParameter("blogId", "1");
- }
+ }
@Override
protected void renderResponse() throws Exception
{
- assert getValue("#{selectedBlog}") != null;
- assert getValue("#{selectedBlog.blogId}").equals(1);
+ assertNotNull(getValue("#{selectedBlog}"));
+ assertEquals(1, getValue("#{selectedBlog.blogId}"));
}
}.run();
@@ -127,13 +128,13 @@
@Override
protected void invokeApplication() throws Exception
{
- assert invokeAction("#{blog.createComment}") == null;
-
- assert getValue("#{comment}") != null;
- assert getValue("#{comment.blog}") != null;
+ assertNull(invokeAction("#{blog.createComment}"));
+
+ assertNotNull(getValue("#{comment}"));
+ assertNotNull(getValue("#{comment.blog}"));
}
}.run();
-
+
new FacesRequest("/comment.xhtml", cid)
{
@Override
@@ -141,23 +142,23 @@
{
setValue("#{comment.comment}", "I totally disagree with your blog entry!");
}
-
+
@Override
protected void invokeApplication() throws Exception
{
- assert invokeAction("#{blog.saveComment}") == null;
+ assertNull(invokeAction("#{blog.saveComment}"));
}
}.run();
-
+
new FacesRequest()
{
@Override
protected void invokeApplication() throws Exception
{
invokeAction("#{identity.logout}");
- assert getValue("#{identity.loggedIn}").equals(false);
+ assertFalse((Boolean)getValue("#{identity.loggedIn}"));
}
- }.run();
-
+ }.run();
+
}
}
Modified: branches/community/Seam_2_3/examples-ee6/seamspace/seamspace-tests/src/test/java/org/jboss/seam/example/seamspace/test/RegisterTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/seamspace/seamspace-tests/src/test/java/org/jboss/seam/example/seamspace/test/RegisterTest.java 2012-09-04 13:57:47 UTC (rev 15111)
+++ branches/community/Seam_2_3/examples-ee6/seamspace/seamspace-tests/src/test/java/org/jboss/seam/example/seamspace/test/RegisterTest.java 2012-09-04 14:52:25 UTC (rev 15112)
@@ -1,12 +1,13 @@
package org.jboss.seam.example.seamspace.test;
+import static org.junit.Assert.*;
+
import java.util.Date;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.OverProtocol;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.seam.core.Manager;
-import org.jboss.seam.mock.AbstractSeamTest.FacesRequest;
import org.jboss.seam.mock.JUnitSeamTest;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
@@ -26,19 +27,19 @@
WebArchive web = er.getAsType(WebArchive.class, "seamspace-web.war");
web.addClasses(RegisterTest.class);
return er;
- }
-
+ }
+
@Test
public void testRegister() throws Exception
{
- String cid = new FacesRequest()
- {
+ String cid = new FacesRequest()
+ {
@Override
protected void invokeApplication() throws Exception
{
- assert invokeAction("#{register.start}") == null;
- }
- }.run();
+ assertNull(invokeAction("#{register.start}"));
+ }
+ }.run();
new FacesRequest("/register.xhtml", cid)
{
@@ -53,38 +54,38 @@
setValue("#{register.password}", "secret");
setValue("#{register.confirm}", "secret");
setValue("#{register.gender}", "Male");
- setValue("#{register.member.dob}", new Date(107100000000L));
+ setValue("#{register.member.dob}", new Date(107100000000L));
}
-
+
@Override
protected void invokeApplication() throws Exception
{
- assert invokeAction("#{register.next}") == null;
- }
+ assertNull(invokeAction("#{register.next}"));
+ }
}.run();
-
+
new FacesRequest("/register2.xhtml", cid)
- {
+ {
@Override
protected void invokeApplication() throws Exception
{
- assert invokeAction("#{register.uploadPicture}") == null;
- assert !Manager.instance().isLongRunningConversation();
- }
-
- }.run();
-
+ assertNull(invokeAction("#{register.uploadPicture}"));
+ assertFalse(Manager.instance().isLongRunningConversation());
+ }
+
+ }.run();
+
new FacesRequest()
- {
+ {
@Override
protected void invokeApplication() throws Exception
{
- assert getValue("#{identity.loggedIn}").equals(true);
- assert invokeAction("#{identity.logout}") == null;
- assert getValue("#{identity.loggedIn}").equals(false);
- }
-
- }.run();
+ assertTrue((Boolean)getValue("#{identity.loggedIn}"));
+ assertNull(invokeAction("#{identity.logout}"));
+ assertFalse((Boolean)getValue("#{identity.loggedIn}"));
+ }
+
+ }.run();
}
}
12 years, 3 months
Seam SVN: r15111 - in branches/community/Seam_2_3/examples-ee6/metawidget/groovybooking: groovybooking-web and 1 other directory.
by seam-commits@lists.jboss.org
Author: maschmid
Date: 2012-09-04 09:57:47 -0400 (Tue, 04 Sep 2012)
New Revision: 15111
Modified:
branches/community/Seam_2_3/examples-ee6/metawidget/groovybooking/groovybooking-tests/src/test/resources/metawidget-groovybooking.properties
branches/community/Seam_2_3/examples-ee6/metawidget/groovybooking/groovybooking-web/pom.xml
Log:
update metawidget/groovybooking metawidget version to 2.4
Modified: branches/community/Seam_2_3/examples-ee6/metawidget/groovybooking/groovybooking-tests/src/test/resources/metawidget-groovybooking.properties
===================================================================
--- branches/community/Seam_2_3/examples-ee6/metawidget/groovybooking/groovybooking-tests/src/test/resources/metawidget-groovybooking.properties 2012-09-04 13:23:21 UTC (rev 15110)
+++ branches/community/Seam_2_3/examples-ee6/metawidget/groovybooking/groovybooking-tests/src/test/resources/metawidget-groovybooking.properties 2012-09-04 13:57:47 UTC (rev 15111)
@@ -29,7 +29,7 @@
PASSWORD_UPDATED_MESSAGE Password updated
PASSWORD_REENTER_MESSAGE verify
PASSWORD_VALUE_REQUIRED_MESSAGE //div[@class='errors']
-PASSWORD_LENGTH_MESSAGE length must be between
+PASSWORD_LENGTH_MESSAGE size must be between
PASSWORD_PASSWORD id=setpassword:PasswordDecorate:password
PASSWORD_VERIFY id=setpassword:VerifyDecorate:verify
PASSWORD_SUBMIT id=setpassword:change
@@ -66,7 +66,7 @@
REGISTRATION_VERIFY_MESSAGE xpath=id('register:verifyDecorate')//div[@class='errors']
REGISTRATION_SUBMIT id=register:register
REGISTRATION_REENTER_MESSAGE verify
-REGISTRATION_LENGTH_MESSAGE length must be between
+REGISTRATION_LENGTH_MESSAGE size must be between
REGISTRATION_SUCCESSFUL_MESSAGE Successfully registered as {0}
REGISTRATION_USER_EXISTS_MESSAGE Username {0} already exists
NOT_LOGGED_IN_MESSAGE Please log in first
Modified: branches/community/Seam_2_3/examples-ee6/metawidget/groovybooking/groovybooking-web/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/metawidget/groovybooking/groovybooking-web/pom.xml 2012-09-04 13:23:21 UTC (rev 15110)
+++ branches/community/Seam_2_3/examples-ee6/metawidget/groovybooking/groovybooking-web/pom.xml 2012-09-04 13:57:47 UTC (rev 15111)
@@ -109,37 +109,37 @@
<dependency>
<groupId>org.metawidget.modules</groupId>
<artifactId>metawidget-annotation</artifactId>
- <version>2.1</version>
+ <version>2.4</version>
</dependency>
<dependency>
<groupId>org.metawidget.modules.faces</groupId>
<artifactId>metawidget-facesannotation</artifactId>
- <version>2.1</version>
+ <version>2.4</version>
</dependency>
<dependency>
<groupId>org.metawidget.modules.faces</groupId>
<artifactId>metawidget-faces</artifactId>
- <version>2.1</version>
+ <version>2.4</version>
</dependency>
<dependency>
<groupId>org.metawidget.modules.faces</groupId>
<artifactId>metawidget-richfaces</artifactId>
- <version>2.1</version>
+ <version>2.4</version>
</dependency>
<dependency>
<groupId>org.metawidget.modules</groupId>
<artifactId>metawidget-jpa</artifactId>
- <version>2.1</version>
+ <version>2.4</version>
</dependency>
<dependency>
<groupId>org.metawidget.modules</groupId>
<artifactId>metawidget-beanvalidation</artifactId>
- <version>2.1</version>
+ <version>2.4</version>
</dependency>
<dependency>
<groupId>org.metawidget.modules</groupId>
<artifactId>metawidget-groovy</artifactId>
- <version>2.1</version>
+ <version>2.4</version>
</dependency>
</dependencies>
12 years, 3 months