EMBJOPR SVN: r641 - trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-07-31 16:24:59 -0400 (Fri, 31 Jul 2009)
New Revision: 641
Added:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/LoginBadPassTest.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/LoginBadUserTest.java
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java
Log:
* Added login failure tests.
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java 2009-07-30 22:31:56 UTC (rev 640)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java 2009-07-31 20:24:59 UTC (rev 641)
@@ -75,6 +75,12 @@
public static final String LOGIN_USERNAME = "admin";
public static final String LOGIN_PASSWORD = "admin";
+
+ public String getLoginUser() { return LOGIN_USERNAME; }
+ public String getLoginPass() { return LOGIN_PASSWORD; }
+
+
+
// Tab Menu IDs
public static final String SUMMARY_TAB = "summaryTab";
@@ -152,7 +158,7 @@
// Always press OK for confirm dialogs
wcSpec.getWebClient().setConfirmHandler(new SimpleConfirmHandler(true));
- wcSpec.setInitialRequestStrategy(new JoprLoginStrategy()); // logs in
+ wcSpec.setInitialRequestStrategy(new JoprLoginStrategy( this.getLoginUser(), this.getLoginPass())); // logs in
JSFSession jsfSession = new JSFSession(wcSpec);
this.client = jsfSession.getJSFClientSession();
Added: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/LoginBadPassTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/LoginBadPassTest.java (rev 0)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/LoginBadPassTest.java 2009-07-31 20:24:59 UTC (rev 641)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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 java.util.Random;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * Login test. Makes use of default login in EmbjoprTestCase::setUp()
+ *
+ * @author Ondrej Zizka
+ */
+public class LoginBadPassTest extends EmbjoprTestCase
+{
+
+ public static final String LOGIN_PASSWORD = "wrong-pass";
+ @Override public String getLoginPass() { return LOGIN_PASSWORD; }
+
+ public static final String LOGIN_ERROR_MSG = "log in attempt failed, please try again";
+
+
+
+
+ /**
+ * @return the suite of tests being tested
+ */
+ public static Test suite() {
+ return new TestSuite( LoginBadPassTest.class );
+ }
+
+
+
+ public void testLoginFailed() throws IOException
+ {
+ ejtt.dumpPage(this.getClass().getSimpleName()+"+testLoginFailed-"+(new Random().nextInt(100))+".html");
+
+ log.info("Checking the presence of error message: - '"+LOGIN_ERROR_MSG+"'.");
+ assertTrue( "Page should contain login error message.", client.getPageAsText().contains(LOGIN_ERROR_MSG) );
+
+ log.info("Checking the absence of the Logout link.");
+ assertFalse( "Page should noc contain \"Logout\" link.", client.getPageAsText().contains("Logout") );
+
+ log.info("Checking that #{identity.username} is not set: "+server.getManagedBeanValue("#{identity.username}") );
+ //assertFalse(, server.getManagedBeanValue("#{identity.username}") );
+ }
+
+
+}
\ No newline at end of file
Added: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/LoginBadUserTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/LoginBadUserTest.java (rev 0)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/LoginBadUserTest.java 2009-07-31 20:24:59 UTC (rev 641)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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 junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * Login test. Makes use of default login in EmbjoprTestCase::setUp()
+ *
+ * @author Ondrej Zizka
+ */
+public class LoginBadUserTest extends LoginBadPassTest
+{
+
+ public static final String LOGIN_USERNAME = "non-existent-user";
+ @Override public String getLoginUser() { return LOGIN_USERNAME; }
+
+
+
+ /**
+ * @return the suite of tests being tested
+ */
+ public static Test suite() {
+ return new TestSuite( LoginBadUserTest.class );
+ }
+
+
+}
\ No newline at end of file
15 years, 5 months
EMBJOPR SVN: r640 - in trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit: util and 1 other directory.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-07-30 18:31:56 -0400 (Thu, 30 Jul 2009)
New Revision: 640
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/jmsDestinations/JMSOperationsTest.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java
Log:
* JMSOperationsTest updated.
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/jmsDestinations/JMSOperationsTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/jmsDestinations/JMSOperationsTest.java 2009-07-30 21:19:20 UTC (rev 639)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/jmsDestinations/JMSOperationsTest.java 2009-07-30 22:31:56 UTC (rev 640)
@@ -23,7 +23,6 @@
package org.jboss.jopr.jsfunit.as5.jmsDestinations;
import com.gargoylesoftware.htmlunit.html.*;
-import junit.framework.Test;
import java.util.Map;
import java.util.HashMap;
import java.util.LinkedHashMap;
@@ -46,7 +45,6 @@
import javax.management.ObjectName;
import org.jboss.jopr.jsfunit.util.EmbJoprTestToolkit.ContentTable;
import org.jboss.jopr.jsfunit.util.EmbJoprTestToolkit.ContentTableRow;
-import org.jboss.jopr.jsfunit.util.EmbJoprTestToolkit;
/**
@@ -65,7 +63,7 @@
* after executing the "Remove All Messages" operation for a topic
* when there are no messages.
*/
- public void testRemoveAllMessagesAfterTopicCreation() throws Exception {
+ public void XtextRemoveAllMessagesAfterTopicCreation() throws Exception {
String jndiName = "RemoveAllMessagesAfterTopicCreation";
// Create the topic first
@@ -144,7 +142,7 @@
* after executing the "Remove All Messages" operation for a queue
* when there are no messages.
*/
- public void testRemoveAllMessagesAfterQueueCreation() throws Exception {
+ public void XtextRemoveAllMessagesAfterQueueCreation() throws Exception {
String jndiName = "RemoveAllMessagesMAfterQueueCreation";
@@ -231,7 +229,7 @@
* after executing the "Reset Message Counter" operation for a queue
* right after creation.
*/
- public void testResetMessageCounterAfterQueueCreation() throws Exception {
+ public void XtextResetMessageCounterAfterQueueCreation() throws Exception {
String jndiName = "ResetMessageCounterAfterQueueCreation";
// Create the queue first
@@ -260,7 +258,7 @@
* after executing the "Reset Message Counter" operation for a queue
* when there are multiple messages in the queue.
*/
- public void testQueueResetMessageCounterAfterMultipleMessages() throws Exception {
+ public void XtextQueueResetMessageCounterAfterMultipleMessages() throws Exception {
String jndiName = "QueueResetMessageCounterAfterMultipleMessages";
// Create the queue first
@@ -275,7 +273,7 @@
* when there are multiple messages in the queue. Use a queue that
* already exists.
*/
- public void testQueueResetMessageCounterAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
+ public void XtextQueueResetMessageCounterAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
String jndiName = "ResetMessageCounterMultipleMessagesExistingQueue";
expandNavTreeArrow(JMS_NAV_LABEL);
@@ -315,7 +313,7 @@
* executing the "Reset Message Counter History" operation for a queue
* after creation.
*/
- public void testResetMessageCounterHistoryAfterQueueCreation() throws Exception {
+ public void XtextResetMessageCounterHistoryAfterQueueCreation() throws Exception {
String jndiName = "ResetMessageCounterHistoryAfterQueueCreation";
// Create the queue first
@@ -344,7 +342,7 @@
* executing the "Reset Message Counter History" operation for a queue
* that has multiple messages.
*/
- public void testQueueResetMessageCounterHistoryAfterMultipleMessages() throws Exception {
+ public void XtextQueueResetMessageCounterHistoryAfterMultipleMessages() throws Exception {
String jndiName = "QueueResetMessageCounterHistoryAfterMultipleMessages";
// Create the queue first
@@ -358,7 +356,7 @@
* executing the "Reset Message Counter History" operation for a queue
* that has multiple messages. Use a queue that already exists.
*/
- public void testQueueResetMessageCounterHistoryAfterMultipleMessagesUsingExsitingServiceFile() throws Exception {
+ public void XtextQueueResetMessageCounterHistoryAfterMultipleMessagesUsingExsitingServiceFile() throws Exception {
String jndiName = "ResetMessageCounterHistoryMultipleMessagesExistingQueue";
expandNavTreeArrow(JMS_NAV_LABEL);
@@ -397,7 +395,7 @@
* after the "List All Subscriptions" operation is invoked for
* a topic right after creation.
*/
- public void testListAllSubscriptionsAfterTopicCreation() throws Exception {
+ public void XtextListAllSubscriptionsAfterTopicCreation() throws Exception {
String jndiName = "ListAllSubscriptionsAfterTopicCreation";
// Create the topic first
@@ -427,7 +425,7 @@
* the "List All Subscriptions" operation for a topic that has multiple subscribers.
* Use a topic that already exists.
*/
- public void testTopicListAllSubscriptionsAfterMultipleSubscribersUsingExistingServiceFile() throws Exception {
+ public void XtextTopicListAllSubscriptionsAfterMultipleSubscribersUsingExistingServiceFile() throws Exception {
String jndiName = "ListAllSubscriptionsMultipleSubscribersExistingTopic";
expandNavTreeArrow(JMS_NAV_LABEL);
@@ -459,7 +457,7 @@
* after the "List Durable Subscriptions" operation is invoked for
* a topic right after creation.
*/
- public void testListDurableSubscriptionsAfterTopicCreation() throws Exception {
+ public void XtextListDurableSubscriptionsAfterTopicCreation() throws Exception {
String jndiName = "ListDurableSubscriptionsAfterTopicCreation";
// Create the topic first
@@ -474,7 +472,7 @@
* the "List Durable Subscriptions" operation for a topic that has multiple
* durable subscribers.
*/
- public void testTopicListDurableSubscriptionsAfterMultipleSubscribers() throws Exception {
+ public void XtextTopicListDurableSubscriptionsAfterMultipleSubscribers() throws Exception {
String jndiName = "ListDurableSubscriptionsAfterMultipleSubscribers";
// Create the topic first
@@ -489,7 +487,7 @@
* the "List Durable Subscriptions" operation for a topic that has multiple
* durable subscribers. Use a topic that already exists.
*/
- public void testTopicListDurableSubscriptionsAfterMultipleSubscribersUsingExistingServiceFile() throws Exception {
+ public void XtextTopicListDurableSubscriptionsAfterMultipleSubscribersUsingExistingServiceFile() throws Exception {
String jndiName = "ListDurableSubscriptionsMultipleSubscribersExistingTopic";
expandNavTreeArrow(JMS_NAV_LABEL);
@@ -514,7 +512,7 @@
* after the "List Non Durable Subscriptions" operation is invoked for
* a topic right after creation.
*/
- public void testListNonDurableSubscriptionsAfterTopicCreation() throws Exception {
+ public void XtextListNonDurableSubscriptionsAfterTopicCreation() throws Exception {
String jndiName = "ListNonDurableSubscriptionsAfterTopicCreation";
// Create the topic first
@@ -529,7 +527,7 @@
* the "List Non Durable Subscriptions" operation for a topic that has multiple
* non-durable subscribers.
*/
- public void testTopicListNonDurableSubscriptionsAfterMultipleSubscribers() throws Exception {
+ public void XtextTopicListNonDurableSubscriptionsAfterMultipleSubscribers() throws Exception {
String jndiName = "ListNonDurableSubscriptionsAfterMultipleSubscribers";
// Create the topic first
@@ -544,7 +542,7 @@
* the "List Non Durable Subscriptions" operation for a topic that has multiple
* non-durable subscribers. Use a topic that already exists.
*/
- public void testTopicListNonDurableSubscriptionsAfterMultipleSubscribersUsingExistingServiceFile() throws Exception {
+ public void XtextTopicListNonDurableSubscriptionsAfterMultipleSubscribersUsingExistingServiceFile() throws Exception {
String jndiName = "ListNonDurableSubscriptionsMultipleSubscribersExistingTopic";
expandNavTreeArrow(JMS_NAV_LABEL);
@@ -570,7 +568,7 @@
* operation for queues is executed successfully after creating
* a new queue.
*/
- public void testListMessageCounterAsHTMLAfterQueueCreation() throws Exception {
+ public void XtextListMessageCounterAsHTMLAfterQueueCreation() throws Exception {
ArrayList<String> expectedValues = new ArrayList<String>();
String jndiName = "ListMessageCounterAfterQueueCreation";
@@ -605,7 +603,7 @@
* operation for queues returns the correct results when the queue has
* multiple messages.
*/
- public void testListMessageCounterAsHTMLAfterMultipleMessagess() throws Exception {
+ public void XtextListMessageCounterAsHTMLAfterMultipleMessagess() throws Exception {
String jndiName = "ListMessageCounterAfterMultipleMessages";
// Create the queue first
@@ -620,7 +618,7 @@
* operation for queues returns the correct results when the queue has
* multiple messages. Use a queue that already exists.
*/
- public void testListMessageCounterAsHTMLAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
+ public void XtextListMessageCounterAsHTMLAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
String jndiName = "ListMessageCounterMultipleMessagesExistingQueue";
expandNavTreeArrow(JMS_NAV_LABEL);
@@ -665,7 +663,7 @@
* operation for queues returns the correct results after creating
* a new queue.
*/
- public void testListMessageCounterHistoryAsHTMLAfterQueueCreation() throws Exception {
+ public void XtextListMessageCounterHistoryAsHTMLAfterQueueCreation() throws Exception {
String jndiName = "ListMessageCounterHistoryAfterQueueCreation";
ArrayList<String> expectedValue = new ArrayList<String>();
@@ -687,7 +685,7 @@
* operation for queues returns the correct results. Use a queue that already
* exists.
*/
- public void testListMessageCounterHistoryAsHTMLUsingExistingServiceFile() throws Exception {
+ public void XtextListMessageCounterHistoryAsHTMLUsingExistingServiceFile() throws Exception {
String jndiName = "ListMessageCounterHistoryExistingQueue";
ArrayList<String> expectedValue = new ArrayList<String>();
@@ -710,7 +708,7 @@
* operation for topics returns the correct results after creating
* a new topic.
*/
- public void testListDurableSubscriptionsAsHTMLAfterTopicCreation() throws Exception {
+ public void XtextListDurableSubscriptionsAsHTMLAfterTopicCreation() throws Exception {
String jndiName = "ListDurableSubscriptionsHtmlAfterTopicCreation";
// Create the topic first
@@ -728,7 +726,7 @@
* operation for topics returns the correct results when the topic
* has multiple durable subscribers.
*/
- public void testListDurableSubscriptionsAsHTMLAfterMultipleSubscribers()
+ public void XtextListDurableSubscriptionsAsHTMLAfterMultipleSubscribers()
throws Exception {
String jndiName = "ListDurableSubscriptionsHtmlAfterMultipleSubscribers";
@@ -743,7 +741,7 @@
* operation for topics returns the correct results when the topic
* has multiple durable subscribers. Use a topic that already exists.
*/
- public void testListDurableSubscriptionsAsHTMLAfterMultipleSubscribersUsingExistingServiceFile()
+ public void XtextListDurableSubscriptionsAsHTMLAfterMultipleSubscribersUsingExistingServiceFile()
throws Exception {
String jndiName = "ListDurableSubscriptionsHtmlMultipleSubscribersExistingTopic";
@@ -797,7 +795,7 @@
* operation for topics returns the correct results after creating
* a new topic.
*/
- public void testListNonDurableSubscriptionsAsHTMLAfterTopicCreation() throws Exception {
+ public void XtextListNonDurableSubscriptionsAsHTMLAfterTopicCreation() throws Exception {
String jndiName = "ListNonDurableSubscriptionsHtmlAfterTopicCreation";
// Create the topic first
@@ -815,7 +813,7 @@
* operation for topics returns the correct results when the topic
* has multiple non durable subscribers.
*/
- public void testListNonDurableSubscriptionsAsHTMLAfterMultipleSubscribers()
+ public void XtextListNonDurableSubscriptionsAsHTMLAfterMultipleSubscribers()
throws Exception {
String jndiName = "ListNonDurableSubscriptionsHtmlAfterMultipleSubscribers";
@@ -830,7 +828,7 @@
* operation for topics returns the correct results when the topic
* has multiple non durable subscribers. Use a topic that already exists.
*/
- public void testListNonDurableSubscriptionsAsHTMLAfterMultipleSubscribersUsingExistingServiceFile()
+ public void XtextListNonDurableSubscriptionsAsHTMLAfterMultipleSubscribersUsingExistingServiceFile()
throws Exception {
String jndiName = "ListNonDurableSubscriptionsHtmlMultipleSubscribersExistingTopic";
@@ -873,7 +871,7 @@
* operation for topics returns the correct results after creating
* a new topic.
*/
- public void testListAllSubscriptionsAsHTMLAfterTopicCreation() throws Exception {
+ public void XtextListAllSubscriptionsAsHTMLAfterTopicCreation() throws Exception {
String jndiName = "ListAllSubscriptionsHtmlAfterTopicCreation";
// Create the topic first
@@ -891,7 +889,7 @@
* operation for topics returns the correct results when the topic
* has multiple durable subscribers.
*/
- public void testListAllSubscriptionsAsHTMLAfterMultipleSubscribers()
+ public void XtextListAllSubscriptionsAsHTMLAfterMultipleSubscribers()
throws Exception {
String jndiName = "ListAllSubscriptionsHtmlAfterMultipleSubscribers";
@@ -906,7 +904,7 @@
* operation for topics returns the correct results when the topic
* has multiple durable subscribers. Use a topic that already exists.
*/
- public void testListAllSubscriptionsAsHTMLAfterMultipleSubscribersUsingExistingServiceFile()
+ public void XtextListAllSubscriptionsAsHTMLAfterMultipleSubscribersUsingExistingServiceFile()
throws Exception {
String jndiName = "ListAllSubscriptionsHtmlMultipleSubscribersExistingTopic";
@@ -1080,7 +1078,7 @@
* Assertion: Make sure that the "Start" operation for topics is executed
* successfully.
*/
- public void testTopicStartOperation() throws Exception {
+ public void XtextTopicStartOperation() throws Exception {
String jndiName = "TopicStart";
// Create the topic first
@@ -1095,7 +1093,7 @@
* Assertion: Make sure that the "Start" operation for topics is executed
* successfully. Use a topic that already exists.
*/
- public void testTopicStartOperationUsingExistingServiceFile() throws Exception {
+ public void XtextTopicStartOperationUsingExistingServiceFile() throws Exception {
String jndiName = "StartOperationExistingTopic";
expandNavTreeArrow(JMS_NAV_LABEL);
@@ -1109,7 +1107,7 @@
* Assertion: Make sure that the "Start" operation for queues is executed
* successfully.
*/
- public void testQueueStartOperation() throws Exception {
+ public void XtextQueueStartOperation() throws Exception {
String jndiName = "QueueStart";
// Create the queue first
@@ -1124,7 +1122,7 @@
* Assertion: Make sure that the "Start" operation for queues is executed
* successfully. Use a queue that already exists.
*/
- public void testQueueStartOperationUsingExistingServiceFile() throws Exception {
+ public void XtextQueueStartOperationUsingExistingServiceFile() throws Exception {
String jndiName = "StartOperationExistingQueue";
expandNavTreeArrow(JMS_NAV_LABEL);
@@ -1202,7 +1200,7 @@
* Assertion: Make sure that the "Stop" operation for topics is executed
* successfully.
*/
- public void testTopicStopOperation() throws Exception {
+ public void XtextTopicStopOperation() throws Exception {
String jndiName = "TopicStop";
// Create the topic first
@@ -1217,7 +1215,7 @@
* Assertion: Make sure that the "Stop" operation for topics is executed
* successfully. Use a topic that already exists.
*/
- public void testTopicStopOperationUsingExistingServiceFile() throws Exception {
+ public void XtextTopicStopOperationUsingExistingServiceFile() throws Exception {
String jndiName = "StopOperationExistingTopic";
expandNavTreeArrow(JMS_NAV_LABEL);
@@ -1231,7 +1229,7 @@
* Assertion: Make sure that the "Stop" operation for queues is executed
* successfully.
*/
- public void testQueueStopOperation() throws Exception {
+ public void XtextQueueStopOperation() throws Exception {
String jndiName = "QueueStop";
// Create the queue first
@@ -1246,7 +1244,7 @@
* Assertion: Make sure that the "Stop" operation for queues is executed
* successfully. Use a queue that already exists.
*/
- public void testQueueStopOperationUsingExistingServiceFile() throws Exception {
+ public void XtextQueueStopOperationUsingExistingServiceFile() throws Exception {
String jndiName = "StopOperationExistingQueue";
expandNavTreeArrow(JMS_NAV_LABEL);
@@ -1262,7 +1260,7 @@
* Assertion: Make sure that the "List All Messages" operation for topics
* returns the correct results after creating a new topic.
*/
- public void testListAllMessagesAfterTopicCreation() throws Exception {
+ public void XtextListAllMessagesAfterTopicCreation() throws Exception {
String jndiName = "ListAllMessagesAfterTopicCreation";
// Create the topic first
@@ -1284,7 +1282,7 @@
* Assertion: Make sure that the "List All Messages" operation for topics
* returns the correct results when the topic has multiple messages.
*/
- public void testTopicListAllMessagesAfterMultipleMessages() throws Exception {
+ public void XtextTopicListAllMessagesAfterMultipleMessages() throws Exception {
String jndiName = "TopicListAllMessagesAfterMultipleMessages";
// Create the topic first
@@ -1298,7 +1296,7 @@
* returns the correct results when the topic has multiple messages.
* Use a topic that already exists.
*/
- public void testTopicListAllMessagesAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
+ public void XtextTopicListAllMessagesAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
String jndiName = "ListAllMessagesMultipleMessagesExistingTopic";
expandNavTreeArrow(JMS_NAV_LABEL);
@@ -1338,7 +1336,7 @@
* Assertion: Make sure that the "List All Messages" operation for queues
* returns the correct results after creating a new queue.
*/
- public void testListAllMessagesAfterQueueCreation() throws Exception {
+ public void XtextListAllMessagesAfterQueueCreation() throws Exception {
String jndiName = "ListAllMessagesAfterQueueCreation";
// Create the queue first
@@ -1358,7 +1356,7 @@
* Assertion: Make sure that the "List All Messages" operation for queues
* returns the correct results when the queue has multiple messages.
*/
- public void testQueueListAllMessagesAfterMultipleMessages() throws Exception {
+ public void XtextQueueListAllMessagesAfterMultipleMessages() throws Exception {
String jndiName = "QueueListAllMessagesAfterMultipleMessages";
// Create the queue first
@@ -1372,7 +1370,7 @@
* returns the correct results when the queue has multiple messages.
* Use a queue that already exists.
*/
- public void testQueueListAllMessagesAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
+ public void XtextQueueListAllMessagesAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
String jndiName = "ListAllMessagesMultipleMessagesExistingQueue";
expandNavTreeArrow(JMS_NAV_LABEL);
@@ -1411,7 +1409,7 @@
* Assertion: Make sure that the "List Durable Messages" operation for topics
* returns the correct results after creating a new topic.
*/
- public void testListDurableMessagesAfterTopicCreation() throws Exception {
+ public void XtextListDurableMessagesAfterTopicCreation() throws Exception {
String jndiName = "ListDurableMessagesAfterTopicCreation";
// Create the topic first
@@ -1433,7 +1431,7 @@
* Assertion: Make sure that the "List Durable Messages" operation for topics
* returns the correct results when the topic has multiple messages.
*/
- public void testTopicListDurableMessagesAfterMultipleMessages() throws Exception {
+ public void XtextTopicListDurableMessagesAfterMultipleMessages() throws Exception {
String jndiName = "TopicListDurableMessagesAfterMultipleMessages";
// Create the topic first
@@ -1447,7 +1445,7 @@
* returns the correct results when the topic has multiple messages.
* Use a topic that already exists.
*/
- public void testTopicListDurableMessagesAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
+ public void XtextTopicListDurableMessagesAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
String jndiName = "ListDurableMessagesMultipleMessagesExistingTopic";
expandNavTreeArrow(JMS_NAV_LABEL);
@@ -1485,7 +1483,7 @@
* Assertion: Make sure that the "List Durable Messages" operation for
* queues returns the correct results after creating a new queue.
*/
- public void testListDurableMessagesAfterQueueCreation() throws Exception {
+ public void XtextListDurableMessagesAfterQueueCreation() throws Exception {
String jndiName = "ListDurableMessagesAfterQueueCreation";
// Create the queue first
@@ -1505,7 +1503,7 @@
* Assertion: Make sure that the "List Durable Messages" operation for queues
* returns the correct results when the queue has multiple messages.
*/
- public void testQueueListDurableMessagesAfterMultipleMessages() throws Exception {
+ public void XtextQueueListDurableMessagesAfterMultipleMessages() throws Exception {
String jndiName = "QueueListDurableMessagesAfterMultipleMessages";
// Create the queue first
@@ -1519,7 +1517,7 @@
* returns the correct results when the queue has multiple messages. Use a queue
* that already exists.
*/
- public void testQueueListDurableMessagesAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
+ public void XtextQueueListDurableMessagesAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
String jndiName = "ListDurableMessagesMultipleMessagesExistingQueue";
expandNavTreeArrow(JMS_NAV_LABEL);
@@ -1554,7 +1552,7 @@
* Assertion: Make sure that the "List Non Durable Messages" operation for
* topics returns the correct results after creating a new topic.
*/
- public void testListNonDurableMessagesAfterTopicCreation() throws Exception {
+ public void XtextListNonDurableMessagesAfterTopicCreation() throws Exception {
String jndiName = "ListNonDurableMessagesAfterTopicCreation";
// Create the topic first
@@ -1575,7 +1573,7 @@
* Assertion: Make sure that the "List Non Durable Messages" operation for
* topics returns the correct results when the topic has multiple messages.
*/
- public void testTopicListNonDurableMessagesAfterMultipleMessages() throws Exception {
+ public void XtextTopicListNonDurableMessagesAfterMultipleMessages() throws Exception {
String jndiName = "TopicListNonDurableMessagesAfterMultipleMessages";
// Create the topic first
@@ -1589,7 +1587,7 @@
* topics returns the correct results when the topic has multiple messages.
* Use a topic that already exists.
*/
- public void testTopicListNonDurableMessagesAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
+ public void XtextTopicListNonDurableMessagesAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
String jndiName = "ListNonDurableMessagesMultipleMessagesExistingTopic";
expandNavTreeArrow(JMS_NAV_LABEL);
@@ -1648,7 +1646,7 @@
* Assertion: Make sure that the "List Non Durable Messages" operation for
* queues returns the correct results after creating a new queue.
*/
- public void testListNonDurableMessagesAfterQueueCreation() throws Exception {
+ public void XtextListNonDurableMessagesAfterQueueCreation() throws Exception {
String jndiName = "ListNonDurableMessagesAfterQueueCreation";
// Create the queue first
@@ -1668,7 +1666,7 @@
* Assertion: Make sure that the "List Non Durable Messages" operation for
* queues returns the correct results when the queue has multiple messages.
*/
- public void testQueueListNonDurableMessagesAfterMultipleMessages() throws Exception {
+ public void XtextQueueListNonDurableMessagesAfterMultipleMessages() throws Exception {
String jndiName = "QueueListNonDurableMessagesAfterMultipleMessages";
// Create the queue first
@@ -1682,7 +1680,7 @@
* queues returns the correct results when the queue has multiple messages.
* Use a queue that already exists.
*/
- public void testQueueListNonDurableMessagesAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
+ public void XtextQueueListNonDurableMessagesAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
String jndiName = "ListNonDurableMessagesMultipleMessagesExistingQueue";
expandNavTreeArrow(JMS_NAV_LABEL);
@@ -1909,9 +1907,12 @@
// Get the rows and list them.
List<ContentTableRow> rows = opResultTable.getRows();
- int rowsCount = rows.size();
- log.info("List contains "+rowsCount+" subscriptions.");
+ int subscCount = rows.size() -1;
+ log.info("List contains "+subscCount+" subscriptions.");
for( ContentTableRow row : rows ) {
+ if( row.isHeader() )
+ continue;
+
// Id Durable Message Count Actions
String rowInfo = String.format(" Id: '%s' Durable: '%s' Message Count: '%s' Actions: '%s'",
row.getCellTextByColumnName("Id"),
@@ -1923,11 +1924,11 @@
// Check whether the list is empty / non-empty as expected.
if(shouldBeEmpty) {
- if( rowsCount != 0 ){
- throw new EmbJoprTestException("Expected empty list but found "+rowsCount+" subscriptions. See the log for more info. Page dumped.", this);
+ if( subscCount != 0 ){
+ throw new EmbJoprTestException("Expected empty list but found "+subscCount+" subscriptions. See the log for more info. Page dumped.", this);
}
} else {
- {
+ if( subscCount <= 0 ){
throw new EmbJoprTestException("Expected non-empty list. See the log for more info. Page dumped.", this);
}
}
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java 2009-07-30 21:19:20 UTC (rev 639)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java 2009-07-30 22:31:56 UTC (rev 640)
@@ -46,6 +46,7 @@
import org.jboss.mx.util.MBeanServerLocator;
import org.mozilla.javascript.NativeFunction;
import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
@@ -746,15 +747,46 @@
/**
- *
+ * EJTT parts which are based on an HTML element.
*/
- public interface HtmlElementBacked {
- public HtmlElement getElement();
- public HtmlAnchor getFirstLinkContaining();
- }
+ public interface HtmlElementBacked {
+ public HtmlElement getElement();
+ public HtmlElement getFirstByXPath( String xPath ) throws HtmlElementNotFoundException ;
+ public List<HtmlElement> getByXPath( String xPath ) throws HtmlElementNotFoundException;
+ }
+ /**
+ *
+ */
+ protected class HtmlElementBackedBase implements HtmlElementBacked {
+ protected HtmlTableRow element;
+ public HtmlTableRow getElement() { return element; }
+
+ public HtmlElementBackedBase(HtmlTableRow element) {
+ this.element = element;
+ }
+
+
+ public HtmlElement getFirstByXPath( String xPath ) throws HtmlElementNotFoundException {
+ HtmlElement elm = this.element.getFirstByXPath(xPath);
+ if( null == elm )
+ throw new HtmlElementNotFoundException("No element found using xPath: "+xPath);
+ return elm;
+ }
+ public List<HtmlElement> getByXPath( String xPath ) throws HtmlElementNotFoundException {
+ List<HtmlElement> elms = (List<HtmlElement>) this.element.getByXPath(xPath);
+ if( elms.size() == 0 )
+ throw new HtmlElementNotFoundException("No elements found using xPath: "+xPath);
+ return elms;
+ }
+
+ }
+
+
+
+
/**
* Inner class for manipulation with tab content box.
*/
@@ -1502,23 +1534,40 @@
+
/**
* Row of a content table.
* Contains convenience methods for accessing content table rows in EmbJopr.
*/
- public class ContentTableRow {
+ public class ContentTableRow extends HtmlElementBackedBase {
- private HtmlTableRow element;
- public HtmlTableRow getElement() { return element; }
-
private ContentTable containingTable;
private ContentTableRow(HtmlTableRow elm, ContentTable containingTable) {
- this.element = elm;
+ super(elm);
this.containingTable = containingTable;
}
+
/**
+ * Returns true if this row contains at least one TH element and no TD element.
+ */
+ public boolean isHeader(){
+ /* Does not work - returns: headers.getLength(): 8; cells.getLength(): 196;
+ NodeList headers = this.getElement().getElementsByTagName("th");
+ NodeList cells = this.getElement().getElementsByTagName("td");
+ log.debug("headers.getLength(): "+headers.getLength()+"; cells.getLength(): "+cells.getLength()+";");
+ return headers.getLength() != 0 && cells.getLength() == 0;
+ /**/
+
+ List<?> headers = this.getElement().getByXPath("./th");
+ List<?> cells = this.getElement().getByXPath("./td");
+ //log.debug("isHeader(): headers.size(): "+headers.size()+"; cells.size(): "+cells.size()+";");
+ return headers.size() != 0 && cells.size() == 0;
+ }
+
+
+ /**
* Finds a <button> or <input type="button"> with the given label.
* @param label The label of the button. Compared to a trimmed label text of the button.
* @returns the button element - either HtmlButtonInput or HtmlButton.
15 years, 5 months
EMBJOPR SVN: r639 - in trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit: exceptions and 1 other directories.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-07-30 17:19:20 -0400 (Thu, 30 Jul 2009)
New Revision: 639
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/jmsDestinations/JMSOperationsTest.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/exceptions/ActionNotAvailableException.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/exceptions/HtmlElementNotFoundException.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java
Log:
* JMSOperationsTest updated.
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/jmsDestinations/JMSOperationsTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/jmsDestinations/JMSOperationsTest.java 2009-07-30 19:29:15 UTC (rev 638)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/jmsDestinations/JMSOperationsTest.java 2009-07-30 21:19:20 UTC (rev 639)
@@ -44,6 +44,7 @@
import org.jboss.jms.server.messagecounter.MessageCounter;
import org.jboss.jms.destination.JBossDestination;
import javax.management.ObjectName;
+import org.jboss.jopr.jsfunit.util.EmbJoprTestToolkit.ContentTable;
import org.jboss.jopr.jsfunit.util.EmbJoprTestToolkit.ContentTableRow;
import org.jboss.jopr.jsfunit.util.EmbJoprTestToolkit;
@@ -1866,7 +1867,7 @@
/**
* Common code for the list subscriptions tests.
*
- * @param isEmptyList - whether or not the list of subscriptions that
+ * @param shouldBeEmpty - whether or not the list of subscriptions that
* gets displayed should be empty
*
* FAILS: This got implemented as structured result; before, it was only a string.
@@ -1876,20 +1877,20 @@
*/
private void performListSubscriptionsAndCheckResults(String jndiName,
String operationName,
- Boolean isEmptyList) throws Exception {
- performResourceOperation(JMS_NAV_LABEL, DestinationType.TOPIC.getNavLabel(),
- jndiName, operationName, Boolean.FALSE);
+ Boolean shouldBeEmpty) throws Exception {
+ performResourceOperation(JMS_NAV_LABEL, DestinationType.TOPIC.getNavLabel(),
+ jndiName, operationName, Boolean.FALSE);
- String actualOperationResults = ((HtmlDivision)client.getElement(OPERATION_RESULTS)).getTextContent();
- fail("Operation result used to be toString(), now it's a table. Need to fix the test method.");
+ //fail("Operation result used to be toString(), now it's a table. Need to fix the test method.");
/*
+ String actualOperationResults = ((HtmlDivision)client.getElement(OPERATION_RESULTS)).getTextContent();
String shortenedResult = actualOperationResults.substring(actualOperationResults.indexOf("Viewing"),
actualOperationResults.indexOf("]") + 1);
log.info("Operation result was: " + shortenedResult);
-
- if(!isEmptyList) {
+
+ if(!shouldBeEmpty) {
assertFalse("Expected non-empty list but was: '" + shortenedResult + "'",
actualOperationResults.contains(EMPTY_LIST));
} else {
@@ -1897,12 +1898,49 @@
actualOperationResults.contains(EMPTY_LIST));
}
/**/
+
+
+ // Find the result values table.
+ HtmlDivision opResDiv = (HtmlDivision) client.getElement("operationResults");
+ final String xPath = ".//table[ contains( @class, 'properties-table' ) ]//table[ contains( @class, 'property-map-summary-table' ) ]";
+ ContentTable opResultTable = ejtt.getTable((HtmlTable) opResDiv.getFirstByXPath(xPath) );
+ if( null == opResultTable )
+ throw new org.jboss.jopr.jsfunit.exceptions.HtmlElementNotFoundException("Can't find operation result table: "+xPath, this);
+
+ // Get the rows and list them.
+ List<ContentTableRow> rows = opResultTable.getRows();
+ int rowsCount = rows.size();
+ log.info("List contains "+rowsCount+" subscriptions.");
+ for( ContentTableRow row : rows ) {
+ // Id Durable Message Count Actions
+ String rowInfo = String.format(" Id: '%s' Durable: '%s' Message Count: '%s' Actions: '%s'",
+ row.getCellTextByColumnName("Id"),
+ row.getCellTextByColumnName("Durable"),
+ row.getCellTextByColumnName("Message Count"),
+ row.getCellTextByColumnName("Actions"));
+ log.info(" * "+ rowInfo );
+ }
+
+ // Check whether the list is empty / non-empty as expected.
+ if(shouldBeEmpty) {
+ if( rowsCount != 0 ){
+ throw new EmbJoprTestException("Expected empty list but found "+rowsCount+" subscriptions. See the log for more info. Page dumped.", this);
+ }
+ } else {
+ {
+ throw new EmbJoprTestException("Expected non-empty list. See the log for more info. Page dumped.", this);
+ }
+ }
+
// Clean up
disconnect();
deleteDestination(DestinationType.TOPIC, jndiName);
}
-
+
+
+
+
/**
* Common code for the operations tests.
*/
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/exceptions/ActionNotAvailableException.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/exceptions/ActionNotAvailableException.java 2009-07-30 19:29:15 UTC (rev 638)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/exceptions/ActionNotAvailableException.java 2009-07-30 21:19:20 UTC (rev 639)
@@ -1,5 +1,7 @@
package org.jboss.jopr.jsfunit.exceptions;
+import org.jboss.jopr.jsfunit.EmbjoprTestCase;
+
/**
* Signalizes that there was an action performed
* that was out of context - e.g. clicking on a button
@@ -17,6 +19,10 @@
super(message);
}
+ public ActionNotAvailableException(String message, EmbjoprTestCase test) {
+ super(message, test);
+ }
+
public ActionNotAvailableException(String message, Throwable cause) {
super(message, cause);
}
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/exceptions/HtmlElementNotFoundException.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/exceptions/HtmlElementNotFoundException.java 2009-07-30 19:29:15 UTC (rev 638)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/exceptions/HtmlElementNotFoundException.java 2009-07-30 21:19:20 UTC (rev 639)
@@ -1,6 +1,5 @@
package org.jboss.jopr.jsfunit.exceptions;
-import org.jboss.jopr.jsfunit.DebugUtils;
import org.jboss.jopr.jsfunit.EmbjoprTestCase;
/**
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java 2009-07-30 19:29:15 UTC (rev 638)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java 2009-07-30 21:19:20 UTC (rev 639)
@@ -1662,24 +1662,30 @@
/** Returns the HTML Select element of page size selection. */
public HtmlSelect getPageSizeSelect() throws HtmlElementNotFoundException {
- //return (HtmlSelect) client.getElement(ID_PAGE_SIZE_SELECT);
String xPath = ".//select[contains(@id, 'SummaryForm:currentPageSize')]";
- HtmlSelect select = (HtmlSelect) getTabMenu().getTabContentBox().getElement()
- .getFirstByXPath(xPath);
+ HtmlSelect select = (HtmlSelect) getTabMenu().getTabContentBox().getElement().getFirstByXPath(xPath);
if( null == select )
throw new HtmlElementNotFoundException("Can't find page size <select> using: "+xPath, currentTest);
return select;
}
/** Returns total items count, taken from the "Total: N" element. */
- public int getTotalItemsCount() throws ActionNotAvailableException
+ public int getTotalItemsCount() throws ActionNotAvailableException, HtmlElementNotFoundException
{
Element e = client.getElement(ID_PAGINATION_TOTAL_ITEMS);
- String textContent = e.getTextContent();
- log.debug("Element #"+ID_PAGINATION_TOTAL_ITEMS+" content: "+textContent);
+ String textContent_ = e.getTextContent();
+ log.debug("Element #"+ID_PAGINATION_TOTAL_ITEMS+" content: "+textContent_);
+
+ String xPath = ".//select[contains(@id, 'SummaryForm:paginationTotalItems')]";
+ HtmlDivision totalDiv = (HtmlDivision) getTabMenu().getTabContentBox().getElement().getFirstByXPath(xPath);
+ if( null == totalDiv )
+ throw new HtmlElementNotFoundException("Can't find items count div (Total: ...) using: "+xPath, currentTest);
+ String textContent = totalDiv.getTextContent();
+ log.debug("Element #...SummaryForm:paginationTotalItems content: "+textContent);
+
String[] parts = textContent.split(":");
if( parts.length < 2 )
- throw new ActionNotAvailableException("Total pagination items count expected after 'Total:' or similar.");
+ throw new ActionNotAvailableException("Total pagination items count expected after 'Total:' or similar.", currentTest);
String countStr = parts[1].trim();
try{
15 years, 5 months
EMBJOPR SVN: r638 - in trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit: as5 and 1 other directory.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-07-30 15:29:15 -0400 (Thu, 30 Jul 2009)
New Revision: 638
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbJoprTestConstants.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/JBossASNodeTest.java
Log:
* JBossASNodeTest updated.
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbJoprTestConstants.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbJoprTestConstants.java 2009-07-30 19:08:38 UTC (rev 637)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbJoprTestConstants.java 2009-07-30 19:29:15 UTC (rev 638)
@@ -22,6 +22,8 @@
//public static final String AS_NODE_NAME_FORMAT = "JBoss AS 5 (%s)";
public static final String AS_NODE_NAME_FORMAT = "JBoss EAP 5 (%s)";
+ //public static final String AS_NODE_DESCRIPTION = "JBoss Application Server";
+ public static final String AS_NODE_DESCRIPTION = "JBoss Enterprise Application Platform (EAP)";
public static final String LABEL_AS_SERVERS_SUMMARY = "JBoss Application Server";
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/JBossASNodeTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/JBossASNodeTest.java 2009-07-30 19:08:38 UTC (rev 637)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/JBossASNodeTest.java 2009-07-30 19:29:15 UTC (rev 638)
@@ -72,7 +72,7 @@
assertTrue("General Properties / Version startsWith('"+versionPrefix+"')",
properties.getProperty("Version","~not found~").startsWith(versionPrefix) );
- assertEquals("General Properties / Description", "JBoss Application Server", properties.get("Description") );
+ assertEquals("General Properties / Description", AS_NODE_DESCRIPTION, properties.get("Description") );
/*
15 years, 5 months
EMBJOPR SVN: r637 - in trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit: util and 1 other directory.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-07-30 15:08:38 -0400 (Thu, 30 Jul 2009)
New Revision: 637
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/RootNodeTest.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java
Log:
* RootNodeTest - Control tab test disabled.
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/RootNodeTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/RootNodeTest.java 2009-07-30 18:53:34 UTC (rev 636)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/RootNodeTest.java 2009-07-30 19:08:38 UTC (rev 637)
@@ -86,8 +86,9 @@
/**
* Checks the Manual Autorediscovery feature of the Control tab.
+ * DISABLED: Root (server) node's Control tab is disabled.
*/
- public void testRootNodeControlManualAutodiscovery() throws EmbJoprTestException {
+ public void DISABLEDtestRootNodeControlManualAutodiscovery() throws EmbJoprTestException {
try{
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java 2009-07-30 18:53:34 UTC (rev 636)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java 2009-07-30 19:08:38 UTC (rev 637)
@@ -7,6 +7,7 @@
import java.net.UnknownHostException;
import java.util.*;
+import java.util.logging.Level;
import javax.management.MalformedObjectNameException;
import javax.naming.NamingException;
import org.jboss.jopr.jsfunit.exceptions.*;
@@ -1900,7 +1901,12 @@
if( msg.getSeverity() == FacesMessage.SEVERITY_INFO ){
log.info( msg.getSummary() +"\n"+ msg.getDetail() );
}else{
- log.warn( warnPrefix + msg.getSummary() +"\n"+ msg.getDetail() );
+ try {
+ this.dumpPage(this.currentTest.getName() + "-logServerMsg.html");
+ } catch (IOException ex) {
+ log.error("Can't dump page: "+ex);
+ }
+ log.error( warnPrefix + msg.getSummary() +"\n"+ msg.getDetail() );
}
}
}
15 years, 5 months
EMBJOPR SVN: r636 - trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-07-30 14:53:34 -0400 (Thu, 30 Jul 2009)
New Revision: 636
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear/EarTest.java
Log:
* EarTest updated.
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear/EarTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear/EarTest.java 2009-07-30 18:46:53 UTC (rev 635)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear/EarTest.java 2009-07-30 18:53:34 UTC (rev 636)
@@ -798,8 +798,10 @@
final String DEPLOYABLE_NAME = EAR_WITH_WAR;
// Deploy the EAR.
- String earFilePath = ejtt.getTestDataDir() + "/ear/"+DEPLOYABLE_NAME;
- deployEar( earFilePath );
+ //String earFilePath = ejtt.getTestDataDir() + "/ear/"+DEPLOYABLE_NAME;
+ String earFilePath = ejtt.getTestFilePath(APP_TYPE, DEPLOYABLE_NAME);
+ //deployEar( earFilePath );
+ ejtt.deployment.deployViaEmbJopr(APP_TYPE, earFilePath);
// Get the HTTP port and the URL of the test page.
HttpServletRequest tmpRequest = (HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest();
@@ -827,7 +829,8 @@
}
finally {
try {
- undeployEar(DEPLOYABLE_NAME);
+ //undeployEar(DEPLOYABLE_NAME);
+ ejtt.deployment.undeployViaEmbJopr(APP_TYPE, DEPLOYABLE_NAME);
}catch( Exception ex ){
log.error("Caught an exception when undeploying: "+ex, ex);
}
15 years, 5 months
EMBJOPR SVN: r635 - in trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit: util and 1 other directory.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-07-30 14:46:53 -0400 (Thu, 30 Jul 2009)
New Revision: 635
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear/EarTest.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java
Log:
* EarTest#testEarDeployFineThenRedeployMalformedDescriptor() updated.
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear/EarTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear/EarTest.java 2009-07-30 16:43:44 UTC (rev 634)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear/EarTest.java 2009-07-30 18:46:53 UTC (rev 635)
@@ -185,10 +185,11 @@
/**
* TODO:
* 1) Deploy a valid EAR with a war in it (to check it's functionality).
- * 2) In the Control tab, update it with an EAR with malformed descriptor.
+ * 2) In the Content tab, update it with an EAR with malformed descriptor.
* 3) Check that the error message contains "***** ROLLED BACK TO ORIGINAL APPLICATION FILE. *****"
* 4) Check that the embedded WAR works to verify the rollback.
*
+ * FAILS: EMBJOPR-226; Should be fixed in trunk.
*/
public void testEarDeployFineThenRedeployMalformedDescriptor() throws IOException, EmbJoprTestException {
@@ -207,11 +208,17 @@
// Redeploy new version with malformed application.xml in the Content tab.
+ // Has to have the same name -> copy to a tmp dir.
earFilePath = ejtt.getTestDataDir() + "/ear/"+DEPLOYABLE_2_NAME;
String tmpFilePath = ejtt.getTempDir()+'/'+DEPLOYABLE_NAME;
FileUtils.copyFile( new File(earFilePath), new File(tmpFilePath) );
- ejtt.deployment.deployViaEmbJopr(APP_TYPE, tmpFilePath);
+ // Fill the upload input and click the update button.
+ ejtt.getTabMenu().getTabContentBox().getFirstTable().getFirstLinkContaining( DEPLOYABLE_NAME ).click();
+ ejtt.getTabMenu().clickContentTab();
+ ejtt.getTabMenu().getTabContentBox().getFirstFileInput().setValueAttribute( earFilePath );
+ ejtt.getTabMenu().getTabContentBox().getButtonByLabel("Update").click();
+
// We should get an error message.
checkClientAndServerMessages("Failed to update", "Failed to update", true);
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java 2009-07-30 16:43:44 UTC (rev 634)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java 2009-07-30 18:46:53 UTC (rev 635)
@@ -744,15 +744,20 @@
}
+ /**
+ *
+ */
+ public interface HtmlElementBacked {
+ public HtmlElement getElement();
+ public HtmlAnchor getFirstLinkContaining();
+ }
-
-
/**
* Inner class for manipulation with tab content box.
*/
- public class TabContentBox extends PageAware {
+ public class TabContentBox extends PageAware /*implements HtmlElementBacked*/ {
private HtmlElement element;
public HtmlElement getElement() { return element; }
@@ -996,6 +1001,14 @@
}
+
+ /** Returns first file upload input. */
+ public HtmlFileInput getFirstFileInput(){
+ String xPath = ".//input[ contains( @type, 'file') and position() = 1 ]";
+ return (HtmlFileInput) this.getElement().getFirstByXPath(xPath);
+ }
+
+
}// inner class TabContentBox
@@ -1073,6 +1086,8 @@
private Map<String, Integer> colIndexes = null;
//private boolean analyzedButNotFound = false;
+
+
/**
* Return the table cell given by the row and column.
*/
@@ -1085,6 +1100,16 @@
return tableCell.asText();
}
+
+
+ /** Returns first link containing given text. */
+ public HtmlAnchor getFirstLinkContaining( String label ){
+ String xPath = ".//a[ contains( normalize-space(), '"+label+"') and position() = 1 ]";
+ return (HtmlAnchor) this.getElement().getFirstByXPath(xPath);
+ }
+
+
+
/**
* Returns the first row that contains given text, or throws HtmlElementNotFoundException.
* @param text
15 years, 5 months
EMBJOPR SVN: r634 - in trunk/jbas5/etc/overlay/server: default/conf and 1 other directory.
by embjopr-commits@lists.jboss.org
Author: ips
Date: 2009-07-30 12:43:44 -0400 (Thu, 30 Jul 2009)
New Revision: 634
Modified:
trunk/jbas5/etc/overlay/server/all/conf/jboss-log4j.xml
trunk/jbas5/etc/overlay/server/default/conf/jboss-log4j.xml
Log:
suppress WARN messages from org.jboss.managed.plugins.factory.AbstractManagedObjectPopulator (see https://jira.jboss.org/jira/browse/JBAS-6833)
Modified: trunk/jbas5/etc/overlay/server/all/conf/jboss-log4j.xml
===================================================================
--- trunk/jbas5/etc/overlay/server/all/conf/jboss-log4j.xml 2009-07-29 23:51:28 UTC (rev 633)
+++ trunk/jbas5/etc/overlay/server/all/conf/jboss-log4j.xml 2009-07-30 16:43:44 UTC (rev 634)
@@ -344,6 +344,10 @@
<priority value="WARN"/>
</category>
+ <category name="org.jboss.managed.plugins.factory.AbstractManagedObjectPopulator">
+ <priority value="ERROR"/>
+ </category>
+
<!-- ======================= -->
<!-- Setup the Root category -->
<!-- ======================= -->
Modified: trunk/jbas5/etc/overlay/server/default/conf/jboss-log4j.xml
===================================================================
--- trunk/jbas5/etc/overlay/server/default/conf/jboss-log4j.xml 2009-07-29 23:51:28 UTC (rev 633)
+++ trunk/jbas5/etc/overlay/server/default/conf/jboss-log4j.xml 2009-07-30 16:43:44 UTC (rev 634)
@@ -344,6 +344,10 @@
<priority value="WARN"/>
</category>
+ <category name="org.jboss.managed.plugins.factory.AbstractManagedObjectPopulator">
+ <priority value="ERROR"/>
+ </category>
+
<!-- ======================= -->
<!-- Setup the Root category -->
<!-- ======================= -->
15 years, 5 months
EMBJOPR SVN: r633 - trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-07-29 19:51:28 -0400 (Wed, 29 Jul 2009)
New Revision: 633
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear/EarTest.java
Log:
* EarTest updated.
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear/EarTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear/EarTest.java 2009-07-29 23:37:53 UTC (rev 632)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear/EarTest.java 2009-07-29 23:51:28 UTC (rev 633)
@@ -252,7 +252,7 @@
* PASSED.
*/
- public void testEarNavigation() throws IOException, HtmlElementNotFoundException, ActionOutOfSyncException, ActionNotAvailableException, EmbJoprTestException, InterruptedException
+ public void testEarNavigation() throws IOException, EmbJoprTestException, InterruptedException
{
// JBossAS Servers node
@@ -322,48 +322,61 @@
}
- {
- // Go back to applications Sumary screen.
- ejtt.getNavTree().getNodeByLabel("Applications").click();
- }
+ }
+
+ /**
+ * Deploys an EAR and clicks a bit through the UI.
+ */
+ public void testEarDeploymentNavigation() throws IOException, EmbJoprTestException {
// Concrete appliction node.
{
- // Deploy the EAR.
- String earFilePath = System.getProperty(SYSPROP_TESTDATA_DIR) + "/ear/"+BASIC_EAR;
- deployEar( earFilePath );
- ejtt.getNavTree().getNodeByLabel(NAV_EAR).click();
+ final String DEPLOYABLE_NAME = BASIC_EAR;
- ContentTableRow earRow = ejtt.getDefaultContentTable().getFirstRowContainingLink(BASIC_EAR);
- assertTrue("Page doesn't list "+BASIC_EAR+" in Summary tab.", earRow != null );
+ // Go back to applications Sumary screen.
+ ejtt.getNavTree().getNodeByLabel(NAV_APPLICATIONS).click();
- // Go to the summary through listed item.
- earRow.getLinkByLabel(BASIC_EAR).click();
- // Check that we have the summary tab for the selected EAR.
- assertTrue( "EAR name ("+BASIC_EAR+" not found in the content box.",
- ejtt.getTabMenu().getTabContentBox().getElement().getTextContent().contains(BASIC_EAR) );
+ try {
+ // Deploy the EAR.
+ String earFilePath = System.getProperty(SYSPROP_TESTDATA_DIR) + "/ear/"+DEPLOYABLE_NAME;
+ //deployEar( earFilePath );
+ ejtt.deployment.deployViaEmbJopr(APP_TYPE, earFilePath);
- // Go to the summary through nav tree node.
- NavTreeNode earNode = ejtt.getNavTree().getNodeByLabel(NAV_EAR);
- if( !earNode.isExpanded() ){
- log.info("Expanding.");
- earNode.getArrowLink().click();
- Thread.sleep(2000);
- }
- ejtt.getNavTree().getNodeByLabel(BASIC_EAR).click();
- // Check that we have the summary tab for the selected EAR.
- ejtt.getTabMenu().getTabContentBox().getElement().getTextContent().contains(BASIC_EAR);
+ ejtt.getNavTree().getNodeByLabel(NAV_EAR).click();
- undeployEar(BASIC_EAR);
+ ContentTableRow earRow = ejtt.getDefaultContentTable().getFirstRowContainingLink(DEPLOYABLE_NAME);
+ assertTrue("Page doesn't list "+DEPLOYABLE_NAME+" in Summary tab.", earRow != null );
- }
+ // Go to the summary through listed item.
+ earRow.getLinkByLabel(DEPLOYABLE_NAME).click();
+ // Check that we have the summary tab for the selected EAR.
+ assertTrue( "EAR name '"+DEPLOYABLE_NAME+"' not found in the content box.",
+ ejtt.getTabMenu().getTabContentBox().getElement().getTextContent().contains(DEPLOYABLE_NAME) );
-
- }// testNavigationToEar()
+ // Go to the summary through nav tree node.
+ NavTreeNode earNode = ejtt.getNavTree().getNodeByLabel(NAV_EAR);
+ if( !earNode.isExpanded() ){
+ log.info("Expanding.");
+ earNode.getArrowLink().click();
+ ejtt.sleep(2000);
+ }
+ ejtt.getNavTree().getNodeByLabel(DEPLOYABLE_NAME).click();
+ // Check that we have the summary tab for the selected EAR.
+ ejtt.getTabMenu().getTabContentBox().getElement().getTextContent().contains(DEPLOYABLE_NAME);
+ }
+ finally {
+ try {
+ undeployEar(DEPLOYABLE_NAME);
+ }catch(Exception ex) {
+ log.error("Failed to undeploy "+DEPLOYABLE_NAME+": "+ex);
+ }
+ }
+ }
+ }//
15 years, 5 months
EMBJOPR SVN: r632 - in trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit: as5/app/ear and 1 other directories.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-07-29 19:37:53 -0400 (Wed, 29 Jul 2009)
New Revision: 632
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear/EarTest.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ejb/EjbTestBase.java
Log:
* EarTest updated.
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java 2009-07-29 22:41:58 UTC (rev 631)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java 2009-07-29 23:37:53 UTC (rev 632)
@@ -26,6 +26,7 @@
import com.gargoylesoftware.htmlunit.html.*;
import java.io.IOException;
import java.util.*;
+import java.util.logging.Level;
import org.jboss.logging.*;
import org.apache.cactus.ServletTestCase;
import org.jboss.jsfunit.framework.WebClientSpec;
@@ -582,6 +583,14 @@
assertTrue("Expected message: " + expectedServerMsg + " Actual: "+ message.getDetail(),
message.getDetail().contains(expectedServerMsg));
+ if( ! message.getDetail().contains(expectedServerMsg) ){
+ //throw new EmbJoprTestException( "Expected message: " + expectedServerMsg + " Actual: "+ message.getDetail(), this);
+ String fileName = this.getName() + "-msgCheck.html";
+ try {
+ ejtt.dumpPage( fileName );
+ } catch (IOException ex) { log.error(ex.toString()); }
+ fail( "\nExpected message: [" + expectedServerMsg + "]\nActual: ["+ message.getDetail() + "]\nPage dumped to '"+fileName+"'." );
+ }
assertEquals("Incorrect message severity. Message: "+message.getSummary(), expectedSeverity, message.getSeverity());
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear/EarTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear/EarTest.java 2009-07-29 22:41:58 UTC (rev 631)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear/EarTest.java 2009-07-29 23:37:53 UTC (rev 632)
@@ -219,7 +219,8 @@
String rolledBackMsg = "ROLLED BACK TO ORIGINAL APPLICATION FILE.";
checkClientAndServerMessages(rolledBackMsg, rolledBackMsg, true);
-
+ }
+ finally {
// The original EAR should remain deployed.
if( ejtt.deployment.isDeployedAccordingToEmbJopr(APP_TYPE, DEPLOYABLE_NAME)){
ejtt.deployment.undeployViaEmbJopr(APP_TYPE, DEPLOYABLE_NAME);
@@ -228,13 +229,7 @@
throw new EmbJoprTestException("The original EAR should remain deployed " +
"after unsuccessful deployment of bad version of the same EAR.");
}
-
- // Undeploy the original app.
- ejtt.deployment.undeployViaEmbJopr(APP_TYPE, DEPLOYABLE_NAME);
}
- finally {
-
- }
}
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ejb/EjbTestBase.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ejb/EjbTestBase.java 2009-07-29 22:41:58 UTC (rev 631)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ejb/EjbTestBase.java 2009-07-29 23:37:53 UTC (rev 632)
@@ -29,7 +29,6 @@
import java.util.*;
import javax.faces.application.FacesMessage;
import junit.framework.Test;
-import junit.framework.TestSuite;
import org.apache.commons.io.FileUtils;
import org.jboss.jopr.jsfunit.AppConstants.DeployableTypes;
import org.jboss.jopr.jsfunit.exceptions.*;
@@ -57,7 +56,8 @@
* @return the suite of tests being tested
*/
public static Test suite() {
- return new TestSuite(EjbTestBase.class);
+ throw new UnsupportedOperationException("suite() method must be overriden.");
+ //return new TestSuite(EjbTestBase.class);
}
15 years, 5 months