EMBJOPR SVN: r288 - in trunk/jsfunit: testdata/jboss-configuration/deploy and 1 other directory.
by embjopr-commits@lists.jboss.org
Author: fjuma
Date: 2009-04-14 17:04:48 -0400 (Tue, 14 Apr 2009)
New Revision: 288
Added:
trunk/jsfunit/testdata/jboss-configuration/deploy/messaging-service.xml
Modified:
trunk/jsfunit/pom.xml
Log:
Setting the "EnableMessageCounters" property to true for the JMS metrics tests.
Modified: trunk/jsfunit/pom.xml
===================================================================
--- trunk/jsfunit/pom.xml 2009-04-14 19:06:45 UTC (rev 287)
+++ trunk/jsfunit/pom.xml 2009-04-14 21:04:48 UTC (rev 288)
@@ -325,6 +325,10 @@
<file>${basedir}/testdata/jboss-configuration/conf/props/jmx-console-users.properties</file>
<tofile>conf/props/jmx-console-users.properties</tofile>
</configfile>
+ <configfile>
+ <file>${basedir}/testdata/jboss-configuration/deploy/messaging-service.xml</file>
+ <tofile>deploy/messaging/messaging-service.xml</tofile>
+ </configfile>
</configfiles>
<!-- Deploy the test files -->
Added: trunk/jsfunit/testdata/jboss-configuration/deploy/messaging-service.xml
===================================================================
--- trunk/jsfunit/testdata/jboss-configuration/deploy/messaging-service.xml (rev 0)
+++ trunk/jsfunit/testdata/jboss-configuration/deploy/messaging-service.xml 2009-04-14 21:04:48 UTC (rev 288)
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ The JBoss Messaging service deployment descriptor.
+
+ $Id: messaging-service.xml 85945 2009-03-16 19:45:12Z dimitris(a)jboss.org $
+ -->
+
+<server>
+
+ <!-- ServerPeer MBean configuration
+ ============================== -->
+
+ <mbean code="org.jboss.jms.server.ServerPeer"
+ name="jboss.messaging:service=ServerPeer"
+ xmbean-dd="xmdesc/ServerPeer-xmbean.xml">
+
+ <!-- The unique id of the server peer - in a cluster each node MUST have a unique value - must be an integer -->
+
+ <attribute name="ServerPeerID">${jboss.messaging.ServerPeerID:0}</attribute>
+
+ <!-- The default JNDI context to use for queues when they are deployed without specifying one -->
+
+ <attribute name="DefaultQueueJNDIContext">/queue</attribute>
+
+ <!-- The default JNDI context to use for topics when they are deployed without specifying one -->
+
+ <attribute name="DefaultTopicJNDIContext">/topic</attribute>
+
+ <attribute name="PostOffice">jboss.messaging:service=PostOffice</attribute>
+
+ <!-- The default Dead Letter Queue (DLQ) to use for destinations.
+ This can be overridden on a per destinatin basis -->
+
+ <attribute name="DefaultDLQ">jboss.messaging.destination:service=Queue,name=DLQ</attribute>
+
+ <!-- The default maximum number of times to attempt delivery of a message before sending to the DLQ (if configured).
+ This can be overridden on a per destinatin basis -->
+
+ <attribute name="DefaultMaxDeliveryAttempts">10</attribute>
+
+ <!-- The default Expiry Queue to use for destinations. This can be overridden on a per destinatin basis -->
+
+ <attribute name="DefaultExpiryQueue">jboss.messaging.destination:service=Queue,name=ExpiryQueue</attribute>
+
+ <!-- The default redelivery delay to impose. This can be overridden on a per destination basis -->
+
+ <attribute name="DefaultRedeliveryDelay">0</attribute>
+
+ <!-- The periodicity of the message counter manager enquiring on queues for statistics -->
+
+ <attribute name="MessageCounterSamplePeriod">5000</attribute>
+
+ <!-- The maximum amount of time for a client to wait for failover to start on the server side after
+ it has detected failure -->
+
+ <attribute name="FailoverStartTimeout">60000</attribute>
+
+ <!-- The maximum amount of time for a client to wait for failover to complete on the server side after
+ it has detected failure -->
+
+ <attribute name="FailoverCompleteTimeout">300000</attribute>
+
+ <attribute name="StrictTck">false</attribute>
+
+ <!-- The maximum number of days results to maintain in the message counter history -->
+
+ <attribute name="DefaultMessageCounterHistoryDayLimit">-1</attribute>
+
+ <!-- The name of the connection factory to use for creating connections between nodes to pull messages -->
+
+ <attribute name="ClusterPullConnectionFactoryName">jboss.messaging.connectionfactory:service=ClusterPullConnectionFactory</attribute>
+
+ <!-- When redistributing messages in the cluster. Do we need to preserve the order of messages received
+ by a particular consumer from a particular producer? -->
+
+ <attribute name="DefaultPreserveOrdering">false</attribute>
+
+ <!-- Max. time to hold previously delivered messages back waiting for clients to reconnect after failover -->
+
+ <attribute name="RecoverDeliveriesTimeout">300000</attribute>
+
+ <!-- Set to true to enable message counters that can be viewed via JMX -->
+
+ <attribute name="EnableMessageCounters">true</attribute>
+
+ <!-- The password used by the message sucker connections to create connections.
+ THIS SHOULD ALWAYS BE CHANGED AT INSTALL TIME TO SECURE SYSTEM
+ <attribute name="SuckerPassword"></attribute>
+ -->
+
+ <!-- The name of the server aspects configuration resource
+ <attribute name="ServerAopConfig">aop/jboss-aop-messaging-server.xml</attribute>
+ -->
+ <!-- The name of the client aspects configuration resource
+ <attribute name="ClientAopConfig">aop/jboss-aop-messaging-client.xml</attribute>
+ -->
+
+ <depends optional-attribute-name="PersistenceManager">jboss.messaging:service=PersistenceManager</depends>
+
+ <depends optional-attribute-name="JMSUserManager">jboss.messaging:service=JMSUserManager</depends>
+
+ <depends>jboss.messaging:service=Connector,transport=bisocket</depends>
+ <depends optional-attribute-name="SecurityStore"
+ proxy-type="org.jboss.jms.server.SecurityStore">jboss.messaging:service=SecurityStore</depends>
+ </mbean>
+
+</server>
15 years, 8 months
EMBJOPR SVN: r287 - in trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit: as5 and 1 other directory.
by embjopr-commits@lists.jboss.org
Author: fjuma
Date: 2009-04-14 15:06:45 -0400 (Tue, 14 Apr 2009)
New Revision: 287
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/JMSTest.java
Log:
Made minor changes to enableOrDisableFormInput() and fillOutForm() in EmbjoprTestCase.java.
Modified the JMS tests so that they no longer attempt to set the "messageCounterHistoryDayLimit" property during Topic/Queue creation.
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java 2009-04-14 15:25:09 UTC (rev 286)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java 2009-04-14 19:06:45 UTC (rev 287)
@@ -300,7 +300,7 @@
HtmlInput input = enableOrDisableFormInput(propertyName,
Boolean.TRUE);
- assertFalse(input.isDisabled());
+ //assertFalse("Could not enable: " + propertyName, input.isDisabled());
setFormInput(input, properties.get(propertyName));
}
@@ -387,12 +387,12 @@
// input element.
if(isRadioButton) {
- xpath = ".//input[@onchange=\"setInputUnset(document.getElementById('"
+ xpath = ".//input[@onclick=\"setInputUnset(document.getElementById('"
+ id
+ "'), this.checked);setInputUnset(document.getElementById('"
+ id.substring(0, id.lastIndexOf(":")) + ":1'), this.checked);\"]";
} else {
- xpath = ".//input[@onchange=\"setInputUnset(document.getElementById('"
+ xpath = ".//input[@onclick=\"setInputUnset(document.getElementById('"
+ id + "'), this.checked);\"]";
}
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/JMSTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/JMSTest.java 2009-04-14 15:25:09 UTC (rev 286)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/JMSTest.java 2009-04-14 19:06:45 UTC (rev 287)
@@ -166,7 +166,8 @@
propertiesMap.put("downCacheSize", SimpleValueSupport.wrap(new Integer(1500)));
propertiesMap.put("fullSize", SimpleValueSupport.wrap(new Integer(76000)));
propertiesMap.put("maxSize", SimpleValueSupport.wrap(new Integer(76000)));
- propertiesMap.put("messageCounterHistoryDayLimit", SimpleValueSupport.wrap(new Integer(5)));
+ /** propertiesMap.put("messageCounterHistoryDayLimit", SimpleValueSupport.wrap(new Integer(5))); **/
+ propertiesMap.put("maxDeliveryAttempts", SimpleValueSupport.wrap(new Integer(5)));
propertiesMap.put("pageSize", SimpleValueSupport.wrap(new Integer(1500)));
createDestination(DestinationType.QUEUE, QUEUE_DEFAULT_TEMPLATE, propertiesMap);
@@ -207,10 +208,13 @@
*/
protected Map<String, MetaValue> getSpecificComponentProperties(String componentName,
ComponentType type) throws Exception {
+
+ // @TODO: add messageCounterHistoryDayLimit to this list if this property
+ // becomes configurable again
String[] specificProperties = new String[] {"name", "JNDIName", "clustered",
"downCacheSize", "fullSize",
"maxDeliveryAttempts", "maxSize",
- "messageCounterHistoryDayLimit", "pageSize",
+ "pageSize",
"redeliveryDelay", "DLQ", "expiryQueue", "serverPeer"};
return super.getSpecificComponentProperties(componentName, type, specificProperties);
}
@@ -463,7 +467,7 @@
propertiesMap.put("fullSize", SimpleValueSupport.wrap(new Integer(80000)));
propertiesMap.put("maxDeliveryAttempts", SimpleValueSupport.wrap(new Integer(15)));
propertiesMap.put("maxSize", SimpleValueSupport.wrap(new Integer(80000)));
- propertiesMap.put("messageCounterHistoryDayLimit", SimpleValueSupport.wrap(new Integer(0)));
+ /** propertiesMap.put("messageCounterHistoryDayLimit", SimpleValueSupport.wrap(new Integer(0))); **/
propertiesMap.put("pageSize", SimpleValueSupport.wrap(new Integer(2500)));
propertiesMap.put("redeliveryDelay", SimpleValueSupport.wrap(new Long(50000)));
@@ -526,7 +530,6 @@
Map<String, MetaValue> propertiesMap = new LinkedHashMap<String, MetaValue>();
propertiesMap.put("name", SimpleValueSupport.wrap(jndiName));
propertiesMap.put("JNDIName", SimpleValueSupport.wrap(jndiName));
- propertiesMap.put("downCacheSize", SimpleValueSupport.wrap(new Integer(2500)));
propertiesMap.put("DLQ", SimpleValueSupport.wrap(DLQ));
propertiesMap.put("expiryQueue", SimpleValueSupport.wrap(EXPIRY_QUEUE));
propertiesMap.put("serverPeer", SimpleValueSupport.wrap(SERVER_PEER));
@@ -570,7 +573,7 @@
*/
private void createDestinationMissingRequiredValue(DestinationType destinationType,
String destinationTemplate) throws IOException, EmbJoprTestException {
- // Leave the JNDI name unset
+ // Leave the JNDI name and name unset
Map<String, MetaValue> propertiesMap = new LinkedHashMap<String, MetaValue>();
propertiesMap.put("clustered", SimpleValueSupport.wrap(Boolean.TRUE));
propertiesMap.put("fullSize", SimpleValueSupport.wrap(new Integer(80000)));
@@ -668,7 +671,7 @@
propertiesMap.put("name", SimpleValueSupport.wrap(jndiName));
propertiesMap.put("JNDIName", SimpleValueSupport.wrap(jndiName));
propertiesMap.put("clustered", SimpleValueSupport.wrap(Boolean.TRUE));
- propertiesMap.put("messageCounterHistoryDayLimit", SimpleValueSupport.wrap(new Integer(0)));
+ /** propertiesMap.put("messageCounterHistoryDayLimit", SimpleValueSupport.wrap(new Integer(0))); **/
propertiesMap.put("redeliveryDelay", SimpleValueSupport.wrap(new Long(50000)));
propertiesMap.put("downCacheSize", SimpleValueSupport.wrap(new Integer(1500)));
@@ -821,9 +824,9 @@
Map<String, MetaValue> propertiesMap = getSpecificComponentProperties(jndiName, QUEUE_COMPONENT_TYPE);
// The properties we are going to change
- // (Before: messageCounterHistoryDayLimit=-1, redeliveryDelay=-1 )
+ // (Before: maxDeliveryAttempts=-1, redeliveryDelay=-1 )
Map<String, MetaValue> propertiesMapChanges = new LinkedHashMap<String, MetaValue>();
- propertiesMapChanges.put("messageCounterHistoryDayLimit", SimpleValueSupport.wrap(new Integer(0)));
+ propertiesMapChanges.put("maxDeliveryAttempts", SimpleValueSupport.wrap(new Integer(0)));
propertiesMapChanges.put("redeliveryDelay", SimpleValueSupport.wrap(new Long(40000)));
expandNavTreeArrow(JMS_NAV_LABEL);
@@ -873,9 +876,9 @@
Map<String, MetaValue> propertiesMap = createQueue(jndiName);
// The properties we are going to change
- // (Before: messageCounterHistoryDayLimit=5, redeliveryDelay=-1 )
+ // (Before: maxDeliveryAttempts=5, redeliveryDelay=-1 )
Map<String, MetaValue> propertiesMapChanges = new LinkedHashMap<String, MetaValue>();
- propertiesMapChanges.put("messageCounterHistoryDayLimit", SimpleValueSupport.wrap(new Integer(0)));
+ propertiesMapChanges.put("maxDeliveryAttempts", SimpleValueSupport.wrap(new Integer(0)));
propertiesMapChanges.put("redeliveryDelay", SimpleValueSupport.wrap(new Long(40000)));
changeDestinationProperties(jndiName, DestinationType.QUEUE,
@@ -971,9 +974,8 @@
Map<String, MetaValue> propertiesMap = getSpecificComponentProperties(jndiName,
componentType);
- String[] propertiesToUnset = new String[] { "maxDeliveryAttempts", "messageCounterHistoryDayLimit" };
+ String[] propertiesToUnset = new String[] { "maxDeliveryAttempts" };
propertiesMap.remove("maxDeliveryAttempts");
- propertiesMap.remove("messageCounterHistoryDayLimit");
expandNavTreeArrow(JMS_NAV_LABEL);
unsetDestinationProperties(destinationType, jndiName, propertiesMap,
15 years, 8 months
EMBJOPR SVN: r286 - trunk/jsfunit/testdata/ear.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-04-14 11:25:09 -0400 (Tue, 14 Apr 2009)
New Revision: 286
Added:
trunk/jsfunit/testdata/ear/EarExtDependencies.ear
Log:
Removed unused exploded war dir.
Added: trunk/jsfunit/testdata/ear/EarExtDependencies.ear
===================================================================
(Binary files differ)
Property changes on: trunk/jsfunit/testdata/ear/EarExtDependencies.ear
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 8 months
EMBJOPR SVN: r284 - trunk/jsfunit/testdata.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-04-09 06:34:05 -0400 (Thu, 09 Apr 2009)
New Revision: 284
Removed:
trunk/jsfunit/testdata/unpacked-web1.war/
Log:
Removed unused exploded war dir.
15 years, 8 months
EMBJOPR SVN: r283 - in trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit: as5 and 2 other directories.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-04-08 13:45:15 -0400 (Wed, 08 Apr 2009)
New Revision: 283
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/EarTest.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/exceptions/HtmlElementNotFoundException.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/ActiveConditionChecker.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java
Log:
EAR and WAR tests updated, EJTT 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-04-08 00:45:35 UTC (rev 282)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java 2009-04-08 17:45:15 UTC (rev 283)
@@ -113,7 +113,7 @@
WebClientSpec wcSpec = new WebClientSpec("/", BrowserVersion.FIREFOX_3);
// This is temporary because embedded Jopr can't find /js/rhq.js
- wcSpec.getWebClient().setThrowExceptionOnFailingStatusCode(false);
+ wcSpec.getWebClient().setThrowExceptionOnFailingStatusCode(true);
// Always press OK for confirm dialogs
wcSpec.getWebClient().setConfirmHandler(new SimpleConfirmHandler(true));
@@ -125,6 +125,7 @@
this.server = jsfSession.getJSFServerSession();
this.ejtt = new EmbJoprTestToolkit(client, server);
+ this.ejtt.setCurrentTest(this);
}
@Override
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/EarTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/EarTest.java 2009-04-08 00:45:35 UTC (rev 282)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/EarTest.java 2009-04-08 17:45:15 UTC (rev 283)
@@ -37,6 +37,7 @@
import junit.framework.TestSuite;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.math.NumberUtils;
+import org.apache.commons.lang.math.RandomUtils;
import org.jboss.jopr.jsfunit.AppConstants.DeployableTypes;
import org.jboss.jopr.jsfunit.exceptions.*;
import org.jboss.jopr.jsfunit.util.EmbJoprTestToolkit;
@@ -92,7 +93,7 @@
*
* FAILED: JMX doesn't report EAR as deployed: eardeployment.ear
*/
- public void testBasicEarDeployment() throws IOException, EmbJoprTestException
+ public void XtestBasicEarDeployment() throws IOException, EmbJoprTestException
{
try {
@@ -171,7 +172,7 @@
* PASSED.
*/
- public void testNavigationToEar() throws IOException, HtmlElementNotFoundException, ActionOutOfSyncException, ActionNotAvailableException, EmbJoprTestException, InterruptedException
+ public void XtestNavigationToEar() throws IOException, HtmlElementNotFoundException, ActionOutOfSyncException, ActionNotAvailableException, EmbJoprTestException, InterruptedException
{
// JBossAS Servers node
@@ -297,7 +298,7 @@
* junit.framework.ComparisonFailure: expected:<eardeployment.ear> but was:<ondra-redhat>
at org.jboss.jopr.jsfunit.as5.EarTest.testEarSummaryTab(EarTest.java:323)
*/
- public void testEarSummaryTab() throws EmbJoprTestException, IOException, Exception {
+ public void XtestEarSummaryTab() throws EmbJoprTestException, IOException, Exception {
final int DEPLOY_TIMEOUT_SEC = 20;
@@ -388,7 +389,7 @@
*
* FAILS because some of the values are read-only. EMBJOPR-96
*/
- public void testEarConfigurationTab() throws IOException, EmbJoprTestException {
+ public void XtestEarConfigurationTab() throws IOException, EmbJoprTestException {
// Deploy the EAR.
String earFilePath = ejtt.getTestDataDir() +"/ear/"+ BASIC_EAR;
@@ -441,7 +442,7 @@
*
* FAILS because some of the values are read-only. EMBJOPR-96
*/
- public void testEarConfigurationTabCancel() throws IOException, EmbJoprTestException {
+ public void XtestEarConfigurationTabCancel() throws IOException, EmbJoprTestException {
// Deploy the EAR.
String earFilePath = ejtt.getTestDataDir() +"/ear/"+ BASIC_EAR;
@@ -491,8 +492,10 @@
* Redeploys EAR.
*
* Fails because of EMBJOPR-109 - HTTP Status 500 - Error in Seam/JSF
+ * Fails because of EMBJOPR-42 - javax.el.ELException: org.jboss.seam.RequiredException:
+ * @Out attribute requires non-null value: updateBackingContentAction.packageDetails
*/
- public void testEarRedeployment() throws IOException, EmbJoprTestException {
+ public void XtestEarRedeployment() throws IOException, EmbJoprTestException {
// Deploy the EAR.
String earFilePath = ejtt.getTestDataDir() +"/ear/"+ BASIC_EAR;
@@ -568,7 +571,7 @@
/**
* Checks EAR metrics tab.
*/
- public void testEarMetricsTab() throws IOException, EmbJoprTestException {
+ public void XtestEarMetricsTab() throws IOException, EmbJoprTestException {
// Deploy the EAR.
String earFilePath = ejtt.getTestDataDir() + "/ear/"+BASIC_EAR;
@@ -663,11 +666,12 @@
// We have to use hotdeploy - can't upload a directory.
log.info("Unzipping ear/"+EAR_UNPACKED_ZIP);
unzipToDeployDir("ear/"+EAR_UNPACKED_ZIP, "");
+ ejtt.sleep(5000); // 5 sec is default deployment scanner interval.
try {
// Loop, wait for the app to appear.
log.info("Waiting for EAR to appear.");
- ejtt.deployment.waitActivelyForDeployment( DeployableTypes.EAR, EAR_UNPACKED, 5000, 5 );
+ ejtt.deployment.waitActivelyForDeployment( DeployableTypes.EAR, EAR_UNPACKED, 5000, 8, this);
ejtt.getNavTree().getNodeByLabel(NAV_EAR).click();
@@ -729,11 +733,10 @@
}
finally {
- DebugUtils.writeFile("target/testEarWithWar-beforeUndeployment.html", client.getPageAsText() );///
- undeployEar(BASIC_EAR);
+ //DebugUtils.writeFile("target/testEarWithWar-beforeUndeployment.html", client.getPageAsText() );///
+ undeployEar(DEPLOYABLE_NAME);
}
-
}
@@ -744,6 +747,11 @@
+ /**
+ * Stops and Starts an EAR with WAR in the Control tab.
+ *
+ * FAILS because of EMBJOPR-133.
+ */
public void testStopAndStartEar() throws IOException, EmbJoprTestException
{
final String DEPLOYABLE_NAME = EAR_WITH_WAR_COUNTER;
@@ -797,11 +805,13 @@
// Check the latest message.
/*
HtmlTable operationHistoryTable = ejtt.getTabMenu().getTabContentBox().getOperationHistoryTable().getElement();
- HtmlTableRow tr = operationHistoryTable.getFirstByXPath("tr[contains(@class, 'rich-table-firstrow')]");
+ HtmlTableRow tr = operationHistoryTable.getFirstByXPath("tbody/tr[contains(@class, 'rich-table-firstrow')]");
assertTrue( tr.getTextContent().contains("Success") );
/**/
DebugUtils.writeFile("target/testStopAndStartEar-opsTable.html", client.getPageAsText() );///
- assertTrue( ejtt.getTabMenu().getTabContentBox().getOperationsHistoryTable().wasLastOperationSuccesful() );
+ OperationStatusType status = ejtt.getTabMenu().getTabContentBox().getOperationsHistoryTable().getLastOperationStatus();
+ assertEquals("Stop operation did not succeed, the status is: "+status, OperationStatusType.SUCCESS, status);
+ //assertTrue( ejtt.getTabMenu().getTabContentBox().getOperationsHistoryTable().wasLastOperationSuccesful() );
// Assert that the app is stopped.
@@ -813,9 +823,15 @@
ejtt.tabMenu.getTabContentBox().getButtonByLabel("Start").click();
// Check the latest message. TODO: EJTT class for ops history table?
+ /*
HtmlTable operationHistoryTable = ejtt.getTabMenu().getTabContentBox().getOperationsHistoryTable().getElement();
- HtmlTableRow tr = operationHistoryTable.getFirstByXPath("tr[contains(@class, 'rich-table-firstrow')]");
+ HtmlTableRow tr = operationHistoryTable.getFirstByXPath("tbody/tr[contains(@class, 'rich-table-firstrow')]");
assertTrue( tr.getTextContent().contains("Success") );
+ */
+ DebugUtils.writeFile("target/testStopAndStartEar-opsTable2.html", client.getPageAsText() );///
+ status = ejtt.getTabMenu().getTabContentBox().getOperationsHistoryTable().getLastOperationStatus();
+ assertEquals("Start operation did not succeed, the status is: "+status, OperationStatusType.SUCCESS, status);
+ //assertTrue( ejtt.getTabMenu().getTabContentBox().getOperationsHistoryTable().wasLastOperationSuccesful() );
// Assert that the app is running.
@@ -838,6 +854,8 @@
/**
* Restarts the EAR in Control tab and checks whether it was really restarted.
+ *
+ * FAILS because of EMBJOPR-133.
*/
public void testRestartEar() throws IOException, EmbJoprTestException
{
@@ -889,11 +907,17 @@
ejtt.tabMenu.getTabContentBox().getButtonByLabel("Restart").click();
// Check the latest message. TODO: EJTT class for ops history table?
+ /*
HtmlTable operationHistoryTable = ejtt.getTabMenu().getTabContentBox().getOperationsHistoryTable().getElement();
- HtmlTableRow tr = operationHistoryTable.getFirstByXPath("tr[contains(@class, 'rich-table-firstrow')]");
+ HtmlTableRow tr = operationHistoryTable.getFirstByXPath("tbody/tr[contains(@class, 'rich-table-firstrow')]");
assertTrue( tr.getTextContent().contains("Success") );
+ */
+ //assertTrue( ejtt.getTabMenu().getTabContentBox().getOperationsHistoryTable().wasLastOperationSuccesful() );
+ OperationStatusType status = ejtt.getTabMenu().getTabContentBox().getOperationsHistoryTable().getLastOperationStatus();
+ assertEquals("Stop operation did not succeed, the status is: "+status, OperationStatusType.SUCCESS, status);
+
// Assert that the app is running.
page = (HtmlPage)webClient.getPage(testPageUrl);
assert( 200 == page.getWebResponse().getStatusCode() );
@@ -1182,6 +1206,14 @@
ejtt.getTabMenu().clickSummaryTab();
+ /// Debug log - we're getting HTTP 500 here :/
+ String dumpFile = "target/undeployEar-"+(1000+RandomUtils.nextInt(1000))+".html";
+ log.debug("Dumping page to "+dumpFile);
+ DebugUtils.writeFile( dumpFile, client.getPageAsText());
+ int httpStatusCode = client.getContentPage().getWebResponse().getStatusCode();
+ if( 200 != httpStatusCode )
+ log.warn("Status code before undeployment is: "+httpStatusCode);
+
HtmlButtonInput deleteButton = getAppDeleteButton( earFileName );
deleteButton.click();
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-04-08 00:45:35 UTC (rev 282)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/exceptions/HtmlElementNotFoundException.java 2009-04-08 17:45:15 UTC (rev 283)
@@ -1,6 +1,7 @@
package org.jboss.jopr.jsfunit.exceptions;
-import org.jboss.jopr.jsfunit.exceptions.EmbJoprTestException;
+import org.jboss.jopr.jsfunit.DebugUtils;
+import org.jboss.jopr.jsfunit.EmbjoprTestCase;
/**
*
@@ -15,6 +16,21 @@
super(message);
}
+ /** Writes the current page to a file named "<testName>-ElNotFound.html". */
+ public HtmlElementNotFoundException(String message, EmbjoprTestCase test)
+ /*throws FileNotFoundException, IOException*/
+ {
+ super(message);
+
+ if( null == test ) return;
+
+ try {
+ DebugUtils.writeFile("target/"+test.getName() + "-ElmNotFoundEx.html", test.getClient().getPageAsText());
+ } catch (Throwable ex) {
+ // ...
+ }
+ }
+
public HtmlElementNotFoundException(String message, Throwable cause) {
super(message, cause);
}
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/ActiveConditionChecker.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/ActiveConditionChecker.java 2009-04-08 00:45:35 UTC (rev 282)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/ActiveConditionChecker.java 2009-04-08 17:45:15 UTC (rev 283)
@@ -84,7 +84,7 @@
// This has nothing to do with condition checking, but is convenient shorthand...
public ActiveConditionChecker dumpPageOnTimeout(EmbjoprTestCase test) {
if( null == test ) return this;
- return dumpPageOnTimeout( test.getName()+".html", test.getClient() );
+ return dumpPageOnTimeout( test.getName()+"-timeout.html", test.getClient() );
}
// This has nothing to do with condition checking, but is convenient shorthand...
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-04-08 00:45:35 UTC (rev 282)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java 2009-04-08 17:45:15 UTC (rev 283)
@@ -6,7 +6,6 @@
import com.gargoylesoftware.htmlunit.Page;
import java.util.*;
-import java.util.logging.Level;
import org.jboss.jopr.jsfunit.exceptions.*;
import com.gargoylesoftware.htmlunit.html.*;
import com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine;
@@ -59,6 +58,9 @@
public EmbJoprTestToolkit getEjtt(){ return this; }
+ private EmbjoprTestCase currentTest = null;
+ public EmbjoprTestCase getCurrentTest() { return currentTest; }
+ public void setCurrentTest(EmbjoprTestCase currentTest) { this.currentTest = currentTest; }
@@ -244,7 +246,7 @@
DomElement navTreeForm = (DomElement)client.getElement(ID_NAV_TREE_FORM);
if( null == navTreeForm ){
try {
- DebugUtils.writeFile("getNodeByLabel-IDnotFound.html", client.getPageAsText());
+ DebugUtils.writeFile("target/getNodeByLabel-IDnotFound.html", client.getPageAsText());
}catch(Exception ex){
log.error("Caught when writing file: "+ex);
}
@@ -410,10 +412,13 @@
public TabContentBox getTabContentBox() throws HtmlElementNotFoundException
{
HtmlElement contentElement = (HtmlElement) client.getElement("content");
+ if( null == contentElement )
+ throw new HtmlElementNotFoundException("#content element not found.", currentTest);
+
String xPath = "div[@class='tabmenubox' or @class='notabmenubox']";
HtmlElement tabContentBox = (HtmlElement) contentElement.getFirstByXPath(xPath);
if( null == tabContentBox )
- throw new HtmlElementNotFoundException("Tab content box not found using XPath: "+xPath);
+ throw new HtmlElementNotFoundException("Tab content box not found using XPath: "+xPath, currentTest);
return new TabContentBox(tabContentBox);
}
@@ -1016,15 +1021,21 @@
+ /**
+ * Table which shows the result of an operation.
+ */
public class OperationsHistoryTable extends ContentTable {
public OperationsHistoryTable(HtmlTable element) {
super(element);
}
-
- public boolean wasLastOperationSuccesful() throws HtmlElementNotFoundException
- {
+ /**
+ * Returns the status row of the last operation.
+ * @throws org.jboss.jopr.jsfunit.exceptions.HtmlElementNotFoundException
+ * when the table has no rows or XPath fails to find the status row.
+ */
+ public HtmlTableRow getLastOperationRow() throws HtmlElementNotFoundException{
if( 0 == this.getRows().size() )
throw new HtmlElementNotFoundException(
"Operation table has no rows (no operations are listed).");
@@ -1035,13 +1046,51 @@
throw new HtmlElementNotFoundException(
"Operation status row not recognized; used XPath: "+xPath);
}
+ return tr;
+ }
+
+ public OperationStatusType getLastOperationStatus() throws HtmlElementNotFoundException {
+ HtmlTableRow tr = getLastOperationRow();
+ OperationStatusType status = OperationStatusType.fromStatusText( tr.getTextContent() );
+ if( null == status )
+ throw new HtmlElementNotFoundException(
+ "Operation status not recognized. Row text: "+tr.getTextContent());
+ return status;
+ }
+
+ public boolean wasLastOperationSuccesful() throws HtmlElementNotFoundException
+ {
+ HtmlTableRow tr = getLastOperationRow();
return tr.getTextContent().contains("Success");
}
+ }
+
+ /**
+ * Generalization of status result types.
+ */
+ public enum OperationStatusType {
+ SUCCESS("Success"), FAILURE("Failed"), IN_PROGRESS("In progress");
+ private String statusText;
+ public String getStatusText() { return statusText; }
+
+ OperationStatusType( String statusText ){
+ this.statusText = statusText;
+ }
+
+ public static OperationStatusType fromStatusText( String text ){
+ for( OperationStatusType type : OperationStatusType.values() ){
+ if( text.toLowerCase().contains( type.getStatusText().toLowerCase() ) )
+ return type;
+ }
+ //log.debug("Unrecognized operation status: "+text);
+ return null;
+ }
}
+
/**
* Row of a content table.
* Contains convenience methods for accessing content table rows in EmbJopr.
@@ -1324,7 +1373,7 @@
try { DebugUtils.writeFile(dumpFileName, client.getPageAsText()); }
catch (Exception ex) { log.warn("getLinkInsideForm(): "+ ex.toString()); }
- throw new HtmlElementNotFoundException("Form element of given ID not found: "+formId);
+ throw new HtmlElementNotFoundException("Form element of given ID not found: "+formId, this.getCurrentTest());
}
String xPath = ".//a[contains(normalize-space(), '"+linkLabel+"')]";
@@ -1610,7 +1659,7 @@
}
catch( EmbJoprTestException ex ){ throw ex; }
catch( IOException ex ){ throw ex; }
- // Wrap all exceptions to EmbJoprTestException.
+ // Wrap all other exceptions to EmbJoprTestException.
catch( Exception ex ){
throw new EmbJoprTestException("Exception thrown while actively waiting for condition.", ex);
}
15 years, 8 months
EMBJOPR SVN: r282 - in trunk/jsfunit: src/test/java/org/jboss/jopr/jsfunit/as5 and 1 other directory.
by embjopr-commits@lists.jboss.org
Author: smcgowan(a)redhat.com
Date: 2009-04-07 20:45:35 -0400 (Tue, 07 Apr 2009)
New Revision: 282
Modified:
trunk/jsfunit/pom.xml
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/EjbTest.java
Log:
fix build issues
Modified: trunk/jsfunit/pom.xml
===================================================================
--- trunk/jsfunit/pom.xml 2009-04-07 21:43:45 UTC (rev 281)
+++ trunk/jsfunit/pom.xml 2009-04-08 00:45:35 UTC (rev 282)
@@ -299,7 +299,7 @@
<properties>
<cargo.java.home>${JAVA_HOME}</cargo.java.home>
<!-- Raise permgen size, allow classes unloading and permgen sweep -->
- <cargo.jvmargs>-Dcom.sun.management.jmxremote -XX:PermSize=128m -XX:MaxPermSize=256m</cargo.jvmargs>
+ <cargo.jvmargs>-Dcom.sun.management.jmxremote -Dxb.builder.useUnorderedSequence=true -XX:PermSize=128m -XX:MaxPermSize=256m</cargo.jvmargs>
<!-- -XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled -->
<!-- JBoss configuration - default, all, minimal, ... -->
<cargo.jboss.configuration>${cargo.jboss.configuration}</cargo.jboss.configuration>
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/EjbTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/EjbTest.java 2009-04-07 21:43:45 UTC (rev 281)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/EjbTest.java 2009-04-08 00:45:35 UTC (rev 282)
@@ -67,7 +67,7 @@
log.info(DebugUtils.getCurrentMethodFullName());
// Navigate to EJB Applications
- HtmlAnchor ejbLink = getNavTreeLink(NAV_EJB);
+ HtmlAnchor ejbLink = getNavTreeLink(NAV_EJB2);
ejbLink.click();
// click on the "Add new resource" button
@@ -114,7 +114,7 @@
HtmlButtonInput deleteButton = getAppDeleteButton(BASIC_JAR);
deleteButton.click();
- assertTrue(client.getPageAsText().contains("Successfully deleted " + NAV_EJB+ " '" + BASIC_JAR +"'."));
+ assertTrue(client.getPageAsText().contains("Successfully deleted " + NAV_EJB2 + " '" + BASIC_JAR +"'."));
//assertFalse(isEJBDeployed(BASIC_JAR);
}
15 years, 8 months
EMBJOPR SVN: r281 - trunk/jbas5/etc/overlay/bin.
by embjopr-commits@lists.jboss.org
Author: ips
Date: 2009-04-07 17:43:45 -0400 (Tue, 07 Apr 2009)
New Revision: 281
Modified:
trunk/jbas5/etc/overlay/bin/run.bat
Log:
merge w/ latest run.bat from jbas-5.1 branch, which added a couple new sysprops to JAVA_OPTS
Modified: trunk/jbas5/etc/overlay/bin/run.bat
===================================================================
--- trunk/jbas5/etc/overlay/bin/run.bat 2009-04-07 21:02:49 UTC (rev 280)
+++ trunk/jbas5/etc/overlay/bin/run.bat 2009-04-07 21:43:45 UTC (rev 281)
@@ -115,6 +115,9 @@
rem Warn when resolving remote XML dtd/schemas
set JAVA_OPTS=%JAVA_OPTS% -Dorg.jboss.resolver.warning=true
+rem This should be removed when JBoss configuration XML files can be validated JBAS-6744
+set JAVA_OPTS=%JAVA_OPTS% -Dxb.builder.useUnorderedSequence=true
+
rem With Sun JVMs reduce the RMI GCs to once per hour
set JAVA_OPTS=%JAVA_OPTS% -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000
15 years, 8 months
EMBJOPR SVN: r280 - trunk/core/src/main/webapp/WEB-INF.
by embjopr-commits@lists.jboss.org
Author: ips
Date: 2009-04-07 17:02:49 -0400 (Tue, 07 Apr 2009)
New Revision: 280
Modified:
trunk/core/src/main/webapp/WEB-INF/exceptions.xml
Log:
remove bogus entry that was causing https://jira.jboss.org/jira/browse/EMBJOPR-109 (see also https://jira.jboss.org/jira/browse/JBSEAM-3845)
Modified: trunk/core/src/main/webapp/WEB-INF/exceptions.xml
===================================================================
--- trunk/core/src/main/webapp/WEB-INF/exceptions.xml 2009-04-07 17:12:28 UTC (rev 279)
+++ trunk/core/src/main/webapp/WEB-INF/exceptions.xml 2009-04-07 21:02:49 UTC (rev 280)
@@ -18,37 +18,22 @@
~ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-->
<exceptions>
- <exception class="javax.persistence.EntityNotFoundException">
- <http-error error-code="404"/>
- </exception>
- <exception class="javax.persistence.PersistenceException">
- <render>PersistenceException was thrown #{messages['exception.page']}</render>
- <end-conversation/>
- </exception>
- <exception class="java.lang.NullPointerException">
- <redirect view-id="/error.xhtml">
-
- </redirect>
- </exception>
-
- <!-- security redirect stuff -->
+ <!-- Authorization Exceptions -->
<exception class="org.jboss.seam.security.NotLoggedInException">
<redirect view-id="/login.xhtml">
</redirect>
</exception>
-
<exception class="org.jboss.seam.security.AuthorizationException">
<end-conversation/>
<redirect view-id="/login.xhtml">
- <message>You must be logged in to perform this action</message>
+ <message>You must be logged in to perform this action.</message>
</redirect>
</exception>
- <!--Catchall Exception-->
+ <!-- Catch-all for all other Exceptions-->
<exception class="java.lang.Exception">
<end-conversation/>
<redirect view-id="/error.xhtml">
-
</redirect>
</exception>
</exceptions>
15 years, 8 months
EMBJOPR SVN: r279 - in trunk: jbas5/etc/overlay/server/default/deploy and 1 other directories.
by embjopr-commits@lists.jboss.org
Author: ips
Date: 2009-04-07 13:12:28 -0400 (Tue, 07 Apr 2009)
New Revision: 279
Added:
trunk/jbas5/etc/overlay/server/default/deploy/ROOT.war/
trunk/jbas5/etc/overlay/server/default/deploy/ROOT.war/index.html
Modified:
trunk/core/src/main/webapp/WEB-INF/classes/messages.properties
Log:
update copyright date in footer from 2008 to 2009; add ROOT.war/index.html that includes link to /admin-console to overlay dir
Modified: trunk/core/src/main/webapp/WEB-INF/classes/messages.properties
===================================================================
--- trunk/core/src/main/webapp/WEB-INF/classes/messages.properties 2009-04-07 16:50:10 UTC (rev 278)
+++ trunk/core/src/main/webapp/WEB-INF/classes/messages.properties 2009-04-07 17:12:28 UTC (rev 279)
@@ -23,7 +23,7 @@
product.name=${product.name}
product.version=${product.version}
product.buildNumber=${buildNumber}
-product.copyright=© 2002-2008 Red Hat Middleware, LLC. All rights reserved. JBoss is a registered trademark of Red Hat, Inc.
+product.copyright=© 2002-2009 Red Hat Middleware, LLC. All rights reserved. JBoss is a registered trademark of Red Hat, Inc.
default.windowTitle=${product.name}
#default.header=${product.name}
Added: trunk/jbas5/etc/overlay/server/default/deploy/ROOT.war/index.html
===================================================================
--- trunk/jbas5/etc/overlay/server/default/deploy/ROOT.war/index.html (rev 0)
+++ trunk/jbas5/etc/overlay/server/default/deploy/ROOT.war/index.html 2009-04-07 17:12:28 UTC (rev 279)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>Welcome to JBoss™</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <link rel="StyleSheet" href="css/jboss.css" type="text/css"/>
+</head>
+
+<body>
+<!-- header begin -->
+ <a href="http://www.jboss.org">
+ <img src="images/logo.gif" alt="JBoss" id="logo" width="226" height="105" />
+ </a>
+ <div id="header"> </div>
+ <div id="navigation_bar"></div>
+<!-- header end -->
+
+ <h3>JBoss Online Resources</h3>
+ <ul>
+ <li><a href="http://www.jboss.org/jbossas/docs">JBoss AS Documentation</a></li>
+ <li><a href="http://wiki.jboss.org">JBoss Wiki</a></li>
+ <li><a href="http://jira.jboss.org/jira/browse/JBAS">JBoss JIRA</a></li>
+ <li><a href="http://www.jboss.org/index.html?module=bb">JBoss Forums</a></li>
+ </ul>
+
+ <h3>JBoss Management</h3>
+ <ul>
+ <li><a href="/status">Tomcat status</a>
+ <a href="/status?full=true">(full)</a>
+ <a href="/status?XML=true">(XML)</a></li>
+ <li><a href="/admin-console/">Administration Console</a></li>
+ <li><a href="/jmx-console/">JMX Console</a></li>
+ <li><a href="/web-console/">JBoss Web Console</a></li>
+ </ul>
+
+<!-- footer begin -->
+ <div id="footer">
+ <div id="credits">
+ <a href="http://www.jboss.org/jbossas">JBoss™ Application Server</a>
+ </div>
+ <div id="footer_bar"> </div>
+ </div>
+<!-- footer end -->
+</body>
+
+</html>
Property changes on: trunk/jbas5/etc/overlay/server/default/deploy/ROOT.war/index.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Name: svn:keywords
+ Date Author Id Revision HeadURL
Name: svn:eol-style
+ LF
15 years, 8 months
EMBJOPR SVN: r278 - in trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit: as5 and 2 other directories.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-04-07 12:50:10 -0400 (Tue, 07 Apr 2009)
New Revision: 278
Added:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/tc/
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/AppConstants.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/ApplicationTestBaseAS5.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/EarTest.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/WarTest.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java
Log:
WAR tests updated, EJTT updated
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/AppConstants.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/AppConstants.java 2009-04-06 21:23:13 UTC (rev 277)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/AppConstants.java 2009-04-07 16:50:10 UTC (rev 278)
@@ -41,11 +41,12 @@
// Mandatory: first, fourth
// Nav tree link label, testdata/$dir, extension, suffix, mime type.
- EAR(AppConstants.NAV_EAR, "ear", ".ear", null, "application/ear"),
- WAR(AppConstants.NAV_WAR, "war", ".war", null, "application/war"),
- EJB(AppConstants.NAV_EJB, "ejb", ".jar", null, " application/java-archive"),
- SAR(AppConstants.NAV_SAR, "sar", ".sar", "-service.xml", "application/sar"),
- RAR(AppConstants.NAV_RAR, "rar", ".rar", null, "application/rar"),
+ EAR(AppConstants.NAV_EAR, "ear", ".ear", null, "application/ear"),
+ WAR(AppConstants.NAV_WAR, "war", ".war", null, "application/war"),
+ EJB2(AppConstants.NAV_EJB2, "ejb2", ".jar", null, " application/java-archive"),
+ EJB3(AppConstants.NAV_EJB3, "ejb3", ".jar", null, " application/java-archive"),
+ SAR(AppConstants.NAV_SAR, "sar", ".sar", "-service.xml", "application/sar"),
+ RAR(AppConstants.NAV_RAR, "rar", ".rar", null, "application/rar"),
MC_BEAN(AppConstants.NAV_MC, "mc", "", null, "application/java-archive");
// -- Fields --
@@ -99,7 +100,9 @@
// Navigation
public static final String NAV_APPLICATIONS = "Applications";
- public static final String NAV_EJB = "EJB Application (EJB JAR)s";
+ //public static final String NAV_EJB = "EJB Application (EJB JAR)s";
+ public static final String NAV_EJB2 = "EJB 2.x Application (EJB JAR)s";
+ public static final String NAV_EJB3 = "EJB 3.x Application (EJB JAR)s";
public static final String NAV_EAR = "Enterprise Application (EAR)s";
public static final String NAV_SAR = "JBoss Service (SAR)s";
public static final String NAV_MC = "Microconainer Beans (MC_Bean)s";
@@ -111,13 +114,20 @@
public static final String WAR_FILENAME_MALFORMED_APP = "malformed-web-xml.war";
// Test Archives
+
+ // EJB 3.0
public static final String BASIC_JAR = "deployment-ejb.jar";
+ public static final String BASIC_EJB3 = "basic-ejb3.jar";
+
+
+ // EAR
public static final String BASIC_EAR = "eardeployment.ear";
public static final String EAR_UNPACKED = "unpacked-ear1.ear";
public static final String EAR_UNPACKED_ZIP = "unpacked-ear1.ear.zip";
public static final String EAR_WITH_WAR = "EarWithWarNB.ear";
public static final String EAR_WITH_WAR_COUNTER = "EarWithWar-Counter.ear";
+ // WAR
public static final String BASIC_WAR = "hellothere.war";
public static final String BASIC_WAR_02 = "hellothere02.war";
public static final String BASIC_WAR_03 = "hellothere03.war";
@@ -136,6 +146,10 @@
public static final String WAR_UNPACKED_ZIP = "unpacked-web1.war.zip";
+
+
+
+
// Defaults
public static final String[] WAR_DEFAULTS = new String[]{
"ROOT.war", "invoker.war",
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/ApplicationTestBaseAS5.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/ApplicationTestBaseAS5.java 2009-04-06 21:23:13 UTC (rev 277)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/ApplicationTestBaseAS5.java 2009-04-07 16:50:10 UTC (rev 278)
@@ -155,23 +155,6 @@
}
-
-
-
-
-
-
-
-
-
- /* ---- Copied from ServerNodeSummaryTest.java, before moving to EmbjoprTestCase.java --- */
-
-
-
-
-
-
-
}// ApplicationTestBaseAS5
Property changes on: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5
___________________________________________________________________
Name: svn:ignore
- JMXUtilsAS5.java
+ Ejb30Test.java
JMXUtilsAS5.java
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/EarTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/EarTest.java 2009-04-06 21:23:13 UTC (rev 277)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/EarTest.java 2009-04-07 16:50:10 UTC (rev 278)
@@ -299,7 +299,7 @@
*/
public void testEarSummaryTab() throws EmbJoprTestException, IOException, Exception {
- final int DEPLOY_TIMEOUT_SEC = 10;
+ final int DEPLOY_TIMEOUT_SEC = 20;
// Deploy the EAR
String earFilePath = System.getProperty(SYSPROP_TESTDATA_DIR) + "/ear/"+BASIC_EAR;
@@ -489,6 +489,8 @@
/**
* Redeploys EAR.
+ *
+ * Fails because of EMBJOPR-109 - HTTP Status 500 - Error in Seam/JSF
*/
public void testEarRedeployment() throws IOException, EmbJoprTestException {
@@ -517,7 +519,11 @@
}
finally {
- undeployEar(BASIC_EAR);
+ try {
+ undeployEar(BASIC_EAR); // EMBJOPR-109 here.
+ }catch( Exception ex ){
+ log.error("Caught exception when undeploying: "+ex, ex);
+ }
}
}
@@ -547,7 +553,11 @@
}
finally {
- undeployEar(BASIC_EAR);
+ try {
+ undeployEar(BASIC_EAR);
+ }catch( Exception ex ){
+ log.error("Caught exception when undeploying: "+ex, ex);
+ }
}
}
@@ -581,14 +591,18 @@
getTableUnderHeader("Trait Values").getElement();
ContentInfoTable infoTable = ejtt.getContentInfoTable( tbl );
Properties props = infoTable.getProperties();
+ log.debug("EAR Metrics tab - Trait Values: "+ props.toString());
String path = ejtt.getDeployDir()+"/"+BASIC_EAR;
- assertEquals(path, props.getProperty("Path").trim());
+ assertEquals(path, props.getProperty("Path"));
-
}
finally {
- undeployEar(BASIC_EAR);
+ try {
+ undeployEar(BASIC_EAR);
+ }catch( Exception ex ){
+ log.error("Caught exception when undeploying: "+ex, ex);
+ }
}
}
@@ -626,7 +640,11 @@
}
finally {
- undeployEar(BASIC_EAR);
+ try {
+ undeployEar(BASIC_EAR);
+ }catch( Exception ex ){
+ log.error("Caught exception when undeploying: "+ex, ex);
+ }
}
}
@@ -711,6 +729,7 @@
}
finally {
+ DebugUtils.writeFile("target/testEarWithWar-beforeUndeployment.html", client.getPageAsText() );///
undeployEar(BASIC_EAR);
}
@@ -759,8 +778,8 @@
assertTrue("Page should contain 'HELLO WORLD'", page.asText().contains("HELLO WORLD"));
// Refresh the page several times to increase the counter.
- page.refresh();
- page.refresh();
+ page = (HtmlPage) page.refresh();
+ page = (HtmlPage) page.refresh();
// Get the counter number.
Integer count1 = NumberUtils.createInteger(page.getBody().getHtmlElementById("count").getTextContent());
@@ -781,7 +800,8 @@
HtmlTableRow tr = operationHistoryTable.getFirstByXPath("tr[contains(@class, 'rich-table-firstrow')]");
assertTrue( tr.getTextContent().contains("Success") );
/**/
- assertTrue( ejtt.getTabMenu().getTabContentBox().getOperationHistoryTable().wasLastOperationSuccesful() );
+ DebugUtils.writeFile("target/testStopAndStartEar-opsTable.html", client.getPageAsText() );///
+ assertTrue( ejtt.getTabMenu().getTabContentBox().getOperationsHistoryTable().wasLastOperationSuccesful() );
// Assert that the app is stopped.
@@ -793,7 +813,7 @@
ejtt.tabMenu.getTabContentBox().getButtonByLabel("Start").click();
// Check the latest message. TODO: EJTT class for ops history table?
- HtmlTable operationHistoryTable = ejtt.getTabMenu().getTabContentBox().getOperationHistoryTable().getElement();
+ HtmlTable operationHistoryTable = ejtt.getTabMenu().getTabContentBox().getOperationsHistoryTable().getElement();
HtmlTableRow tr = operationHistoryTable.getFirstByXPath("tr[contains(@class, 'rich-table-firstrow')]");
assertTrue( tr.getTextContent().contains("Success") );
@@ -852,8 +872,8 @@
assertTrue("Page should contain 'HELLO WORLD'", page.asText().contains("HELLO WORLD"));
// Refresh the page several times to increase the counter.
- page.refresh();
- page.refresh();
+ page = (HtmlPage) page.refresh();
+ page = (HtmlPage) page.refresh();
// Get the counter number.
Integer count1 = NumberUtils.createInteger(page.getBody().getHtmlElementById("count").getTextContent());
@@ -869,7 +889,7 @@
ejtt.tabMenu.getTabContentBox().getButtonByLabel("Restart").click();
// Check the latest message. TODO: EJTT class for ops history table?
- HtmlTable operationHistoryTable = ejtt.getTabMenu().getTabContentBox().getOperationHistoryTable().getElement();
+ HtmlTable operationHistoryTable = ejtt.getTabMenu().getTabContentBox().getOperationsHistoryTable().getElement();
HtmlTableRow tr = operationHistoryTable.getFirstByXPath("tr[contains(@class, 'rich-table-firstrow')]");
assertTrue( tr.getTextContent().contains("Success") );
@@ -1087,7 +1107,9 @@
File dirToDelete = new File( deployDir, deployableName);
// Just not to delete something accidentally...
- assertTrue( deployDir.contains("/server/"));
+ // Not true for Cargo maven plugin.
+ //assertTrue( deployDir+" contains '/server/'", deployDir.contains("/server/"));
+
// Check if not outside deploy dir.
if( !dirToDelete.getCanonicalPath().startsWith( deployDir ) )
throw new IllegalArgumentException(
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/WarTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/WarTest.java 2009-04-06 21:23:13 UTC (rev 277)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/WarTest.java 2009-04-07 16:50:10 UTC (rev 278)
@@ -73,7 +73,7 @@
* deployed. Undeploy the archive.
*
*/
- public void testBasicWarDeployment()
+ public void testBasicWarDeployment()
throws IOException, HtmlElementNotFoundException, ActionNotAvailableException
{
@@ -121,9 +121,12 @@
+ /**
+ * Tries to deploy a invalid WAR (with invalid descriptor)
+ * and checks that EmbJopr rejects this deployment.
+ */
+ public void testBadWarRedeploy() throws IOException, EmbJoprTestException {
- public void testBadWarRedeploy() throws IOException, HtmlElementNotFoundException, ActionNotAvailableException {
-
final String DEPLOYABLE_NAME = AppConstants.WAR_FILENAME_MALFORMED_APP;
try {
@@ -286,7 +289,7 @@
/**
* Tests the values shown in the Summary tab of WAR.
*
- * FAILS because of: EMBJOPR-110
+ * FAILS because of: EMBJOPR-110 (missing / at the beginning of the path)
*/
public void testWarSummaryTab() throws EmbJoprTestException, IOException, Exception {
@@ -671,6 +674,8 @@
/**
* Checks WAR metrics tab.
+ *
+ * FAILS because of: EMBJOPR-110 (missing / at the beginning of the path)
*/
public void testWarMetricsTab() throws IOException, EmbJoprTestException {
@@ -823,6 +828,10 @@
+ /**
+ * Stops and starts the WAR using buttons in the Control tab, and checks
+ * whether it's really stopped and started by sending HTTP requests.
+ */
public void testStopAndStartWar() throws IOException, EmbJoprTestException
{
final String DEPLOYABLE_NAME = BASIC_WAR_STOPSTART;
@@ -857,11 +866,12 @@
assertTrue("Page should contain 'HELLO WORLD'", page.asText().contains("HELLO WORLD"));
// Refresh the page several times to increase the counter.
- page.refresh();
- page.refresh();
+ page = (HtmlPage) page.refresh();
+ page = (HtmlPage) page.refresh();
// Get the counter number.
- Integer count1 = NumberUtils.createInteger(page.getBody().getHtmlElementById("count").getTextContent());
+ String count1text = page.getBody().getHtmlElementById("count").getTextContent();
+ Integer count1 = NumberUtils.createInteger( count1text );
@@ -879,7 +889,7 @@
HtmlTableRow tr = operationHistoryTable.getFirstByXPath("tr[contains(@class, 'rich-table-firstrow')]");
assertTrue( tr.getTextContent().contains("Success") );
/**/
- assertTrue( ejtt.getTabMenu().getTabContentBox().getOperationHistoryTable().wasLastOperationSuccesful() );
+ assertTrue( ejtt.getTabMenu().getTabContentBox().getOperationsHistoryTable().wasLastOperationSuccesful() );
// Assert that the app is stopped.
@@ -891,9 +901,12 @@
ejtt.tabMenu.getTabContentBox().getButtonByLabel("Start").click();
// Check the latest message. TODO: EJTT class for ops history table?
- HtmlTable operationHistoryTable = ejtt.getTabMenu().getTabContentBox().getOperationHistoryTable().getElement();
- HtmlTableRow tr = operationHistoryTable.getFirstByXPath("tr[contains(@class, 'rich-table-firstrow')]");
+ /*
+ HtmlTable operationHistoryTable = ejtt.getTabMenu().getTabContentBox().getOperationsHistoryTable().getElement();
+ HtmlTableRow tr = operationHistoryTable.getFirstByXPath("tbody/tr[contains(@class, 'rich-table-firstrow')]");
assertTrue( tr.getTextContent().contains("Success") );
+ */
+ assertTrue( ejtt.getTabMenu().getTabContentBox().getOperationsHistoryTable().wasLastOperationSuccesful() );
// Assert that the app is running.
@@ -902,9 +915,11 @@
assertTrue(page.asText().contains("HELLO WORLD"));
// Get the counter number.
- Integer count2 = NumberUtils.createInteger(page.getBody().getHtmlElementById("count").getTextContent());
+ String count2text = page.getBody().getHtmlElementById("count").getTextContent();
+ Integer count2 = NumberUtils.createInteger( count2text );
- assertTrue( "Counter is reset upon app restart, thus should be lower after.", count1 > count2 );
+ assertTrue( "Counter is reset upon app restart, thus should be lower after. " +
+ "Old: "+count1text+" New: "+count2text, count1 > count2 );
}
@@ -915,7 +930,8 @@
/**
- * Restarts the WAR in Control tab and checks whether it was really restarted.
+ * Restarts the WAR using button in the Control tab,
+ * and checks whether it's really restarted by checking whether JSP variable was reset.
*/
public void testRestartWar() throws IOException, EmbJoprTestException
{
@@ -950,11 +966,12 @@
assertTrue("Page should contain 'HELLO WORLD'", page.asText().contains("HELLO WORLD"));
// Refresh the page several times to increase the counter.
- page.refresh();
- page.refresh();
+ page = (HtmlPage) page.refresh();
+ page = (HtmlPage) page.refresh();
// Get the counter number.
- Integer count1 = NumberUtils.createInteger(page.getBody().getHtmlElementById("count").getTextContent());
+ String count1text = page.getBody().getHtmlElementById("count").getTextContent();
+ Integer count1 = NumberUtils.createInteger( count1text );
@@ -967,9 +984,12 @@
ejtt.tabMenu.getTabContentBox().getButtonByLabel("Restart").click();
// Check the latest message. TODO: EJTT class for ops history table?
- HtmlTable operationHistoryTable = ejtt.getTabMenu().getTabContentBox().getOperationHistoryTable().getElement();
- HtmlTableRow tr = operationHistoryTable.getFirstByXPath("tr[contains(@class, 'rich-table-firstrow')]");
+ /*
+ HtmlTable operationHistoryTable = ejtt.getTabMenu().getTabContentBox().getOperationsHistoryTable().getElement();
+ HtmlTableRow tr = operationHistoryTable.getFirstByXPath("tbody/tr[contains(@class, 'rich-table-firstrow')]");
assertTrue( tr.getTextContent().contains("Success") );
+ */
+ assertTrue( ejtt.getTabMenu().getTabContentBox().getOperationsHistoryTable().wasLastOperationSuccesful() );
// Assert that the app is running.
@@ -978,13 +998,20 @@
assertTrue(page.asText().contains("HELLO WORLD"));
// Get the counter number.
- Integer count2 = NumberUtils.createInteger(page.getBody().getHtmlElementById("count").getTextContent());
+ String count2text = page.getBody().getHtmlElementById("count").getTextContent();
+ Integer count2 = NumberUtils.createInteger( count2text );
- assertTrue( "Counter is reset upon app restart, thus should be lower after.", count1 > count2 );
+ assertTrue( "Counter is reset upon app restart, thus should be lower after. " +
+ "Old: "+count1text+" New: "+count2text, count1 > count2 );
}
finally {
- undeployWAR(DEPLOYABLE_NAME);
+ try {
+ undeployWAR(DEPLOYABLE_NAME);
+ } catch( Exception ex ){
+ DebugUtils.writeFile("testRestartWar-undeploy.html", client.getPageAsText());///
+ log.debug("Cathed an expected exception when trying to undeploy "+DEPLOYABLE_NAME+": "+ex );
+ }
}
}
@@ -1002,7 +1029,7 @@
// Deploy the WAR.
String WARFilePath = ejtt.getTestDataDir() + "/war/"+DEPLOYABLE_NAME;
- deployWarRepeatedly( WARFilePath );
+ deployWAR( WARFilePath );
try {
Property changes on: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/tc
___________________________________________________________________
Name: svn:ignore
+ ejb3
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-04-06 21:23:13 UTC (rev 277)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java 2009-04-07 16:50:10 UTC (rev 278)
@@ -242,6 +242,14 @@
public NavTreeNode getNodeByLabel( String label, boolean throwIfNotFound ) throws HtmlElementNotFoundException{
DomElement navTreeForm = (DomElement)client.getElement(ID_NAV_TREE_FORM);
+ if( null == navTreeForm ){
+ try {
+ DebugUtils.writeFile("getNodeByLabel-IDnotFound.html", client.getPageAsText());
+ }catch(Exception ex){
+ log.error("Caught when writing file: "+ex);
+ }
+ throw new HtmlElementNotFoundException("Nav tree form not found using ID: "+ID_NAV_TREE_FORM);
+ }
// A table which has an anchor containing given text.
// Note: Different node types have different id endings - typeSummaryLink, categorySummaryLink, ...
@@ -625,20 +633,44 @@
* @see ContentTable#ContentTable()
*/
public ContentTable getDefaultTable() throws HtmlElementNotFoundException{
- return new ContentTable();
+
+ // Find the data table - try some known IDs.
+ String[] elemIDs = { ContentTable.ID_CATEGORY_DATA_TABLE,
+ ContentTable.ID_RESOURCE_DATA_TABLE };
+ Element elem = null;
+ for( String elemID : elemIDs ){
+ elem = client.getElement(elemID);
+ if( null != elem )
+ break;
+ }
+ if( null == elem )
+ throw new HtmlElementNotFoundException(
+ "Can't find the content table element, searched IDs: "
+ + StringUtils.join(elemIDs, ", ") );
+
+ return new ContentTable( (HtmlTable)elem );
+
}
/**
* Returns the operation history table from the Content tab.
*/
- public OperationsHistoryTable getOperationHistoryTable() throws HtmlElementNotFoundException
- {
- //HtmlTable table = (HtmlTable) client.getElement("operationHistoryForm:dataTable");
- //return new OperationsHistoryTable(table);
- return new OperationsHistoryTable();
+ public OperationsHistoryTable getOperationsHistoryTable() throws HtmlElementNotFoundException {
+
+ // Find the ops history table.
+ String elemID = "operationHistoryForm:dataTable";
+ Element elem = client.getElement(elemID);
+ if( null == elem ){
+ throw new HtmlElementNotFoundException(
+ "Can't find the ops history table element, searched ID: " + elemID);
+ }
+
+ return new OperationsHistoryTable( (HtmlTable)elem );
+
}
+
/**
* Finds first button with given label inside this box.
* @param label
@@ -748,6 +780,7 @@
* If not, it simply returns the first in the order of IDs searched.
* You can always specify the element using ContentTable( HtmlTable element ).
*/
+ /*
public ContentTable() throws HtmlElementNotFoundException {
// Find the data table - try some known IDs.
@@ -761,10 +794,11 @@
if( null == elem )
throw new HtmlElementNotFoundException(
"Can't find the content table element, searched IDs: "
- + elemIDs.toString() );
+ + StringUtils.join(elemIDs, ", ") );
this.element = (HtmlTable)elem;
}
+ */
// Columns maps
@@ -927,11 +961,9 @@
*
* This is a shortcut for ejtt.getTabMenu().getTabContentBox().getDefaultTable(),
* which we can do because it searches the element using ID.
- *
- * @see ContentTable#ContentTable()
*/
public ContentTable getDefaultContentTable() throws HtmlElementNotFoundException{
- return new ContentTable();
+ return this.getTabMenu().getTabContentBox().getDefaultTable();
}
@@ -958,7 +990,7 @@
Properties props = new Properties();
// The template has label in span/strong and the value as text in td.
- String xPath = ".//tr/td[span/strong | strong]";
+ String xPath = ".//tr/td[span/strong | strong | b]";
//String xPath = ".//tr/td[span/strong] | .//tr/td[.//strong]";
List<HtmlTableCell> cells = (List<HtmlTableCell>) this.getElement().getByXPath(xPath);
for( HtmlTableCell cell : cells ){
@@ -986,19 +1018,6 @@
public class OperationsHistoryTable extends ContentTable {
- public OperationsHistoryTable() throws HtmlElementNotFoundException {
-
- // Find the ops history table.
- String elemID = "operationHistoryForm:dataTable";
- Element elem = client.getElement(elemID);
- if( null == elem ){
- throw new HtmlElementNotFoundException(
- "Can't find the ops history table element, searched ID: " + elemID);
- }
-
- this.element = (HtmlTable)elem;
- }
-
public OperationsHistoryTable(HtmlTable element) {
super(element);
}
@@ -1010,7 +1029,7 @@
throw new HtmlElementNotFoundException(
"Operation table has no rows (no operations are listed).");
- String xPath = "tr[contains(@class, 'rich-table-firstrow')]";
+ String xPath = "tbody/tr[contains(@class, 'rich-table-firstrow')]";
HtmlTableRow tr = this.element.getFirstByXPath(xPath);
if( null == tr ){
throw new HtmlElementNotFoundException(
15 years, 8 months