[jboss-cvs] jboss-seam/examples/booking/src/org/jboss/seam/example/booking/test ...
Gavin King
gavin.king at jboss.com
Tue Jun 12 15:05:28 EDT 2007
User: gavin
Date: 07/06/12 15:05:28
Modified: examples/booking/src/org/jboss/seam/example/booking/test
LoginTest.java
Log:
example of ComponentTest
Revision Changes Path
1.27 +28 -1 jboss-seam/examples/booking/src/org/jboss/seam/example/booking/test/LoginTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: LoginTest.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/booking/src/org/jboss/seam/example/booking/test/LoginTest.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -b -r1.26 -r1.27
--- LoginTest.java 4 Jun 2007 17:56:59 -0000 1.26
+++ LoginTest.java 12 Jun 2007 19:05:28 -0000 1.27
@@ -1,4 +1,4 @@
-//$Id: LoginTest.java,v 1.26 2007/06/04 17:56:59 gavin Exp $
+//$Id: LoginTest.java,v 1.27 2007/06/12 19:05:28 gavin Exp $
package org.jboss.seam.example.booking.test;
import org.jboss.seam.core.Manager;
@@ -10,6 +10,33 @@
{
@Test
+ public void testLoginComponent() throws Exception
+ {
+ new ComponentTest() {
+
+ @Override
+ protected void testComponents() throws Exception
+ {
+ assert getValue("#{identity.loggedIn}").equals(false);
+ setValue("#{identity.username}", "gavin");
+ setValue("#{identity.password}", "foobar");
+ invokeMethod("#{identity.login}");
+ assert getValue("#{user.name}").equals("Gavin King");
+ assert getValue("#{user.username}").equals("gavin");
+ assert getValue("#{user.password}").equals("foobar");
+ assert getValue("#{identity.loggedIn}").equals(true);
+ invokeMethod("#{identity.logout}");
+ assert getValue("#{identity.loggedIn}").equals(false);
+ setValue("#{identity.username}", "gavin");
+ setValue("#{identity.password}", "tiger");
+ invokeMethod("#{identity.login}");
+ assert getValue("#{identity.loggedIn}").equals(false);
+ }
+
+ }.run();
+ }
+
+ @Test
public void testLogin() throws Exception
{
More information about the jboss-cvs-commits
mailing list