[embjopr-commits] EMBJOPR SVN: r148 - trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit.

embjopr-commits at lists.jboss.org embjopr-commits at lists.jboss.org
Fri Feb 13 10:54:11 EST 2009


Author: ozizka at redhat.com
Date: 2009-02-13 10:54:11 -0500 (Fri, 13 Feb 2009)
New Revision: 148

Added:
   trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/LoginTest.java
Log:
Login test

Added: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/LoginTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/LoginTest.java	                        (rev 0)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/LoginTest.java	2009-02-13 15:54:11 UTC (rev 148)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jopr.jsfunit;
+
+import java.io.IOException;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * Login test. Makes use of default login in EmbjoprTestCase::setUp()
+ *
+ * @author Stan Silvert
+ */
+public class LoginTest extends EmbjoprTestCase
+{
+
+   /**
+    * @return the suite of tests being tested
+    */
+   public static Test suite() {
+      return new TestSuite( LoginTest.class );
+   }
+
+
+
+   public void testLoggedIn() throws IOException
+   {
+
+		 // TODO: Move user name to a constant.
+		 assertTrue( client.getPageAsText().contains(LOGIN_USERNAME) );
+		 assertTrue( client.getPageAsText().contains("Logout") );
+
+		 assertEquals("admin", server.getManagedBeanValue("#{identity.username}") );
+
+	 }
+
+
+}
\ No newline at end of file




More information about the embjopr-commits mailing list