EMBJOPR SVN: r339 - trunk/core/src/main/java/org/jboss/on/embedded/ui.
by embjopr-commits@lists.jboss.org
Author: ips
Date: 2009-04-24 18:37:41 -0400 (Fri, 24 Apr 2009)
New Revision: 339
Modified:
trunk/core/src/main/java/org/jboss/on/embedded/ui/NavigationContent.java
Log:
give a couple vars better names
Modified: trunk/core/src/main/java/org/jboss/on/embedded/ui/NavigationContent.java
===================================================================
--- trunk/core/src/main/java/org/jboss/on/embedded/ui/NavigationContent.java 2009-04-24 21:26:16 UTC (rev 338)
+++ trunk/core/src/main/java/org/jboss/on/embedded/ui/NavigationContent.java 2009-04-24 22:37:41 UTC (rev 339)
@@ -70,9 +70,9 @@
{
log.trace("Resource of type [" + typeOfNewResource + "] added beneath Resource [" + parentResource
+ "] - updating nav tree...");
- JONTreeNode parentNode = findNode(getResourcePath(parentResource));
- JONTreeNode node = findNodeByResourceTypeAndParent(typeOfNewResource, parentNode);
- node.reInitializeChildrenMap();
+ JONTreeNode parentResourceNode = findNode(getResourcePath(parentResource));
+ JONTreeNode resourceTypeNode = findNodeByResourceTypeAndParent(typeOfNewResource, parentResourceNode);
+ resourceTypeNode.reInitializeChildrenMap();
}
@Observer(ResourceManager.RESOURCE_DELETED_EVENT)
15 years
EMBJOPR SVN: r338 - trunk/core/src/main/java/org/jboss/on/embedded.
by embjopr-commits@lists.jboss.org
Author: jason.greene(a)jboss.com
Date: 2009-04-24 17:26:16 -0400 (Fri, 24 Apr 2009)
New Revision: 338
Modified:
trunk/core/src/main/java/org/jboss/on/embedded/LazyStartupFilter.java
trunk/core/src/main/java/org/jboss/on/embedded/LazyStartupListener.java
Log:
Don't initialize on undeploy
Modified: trunk/core/src/main/java/org/jboss/on/embedded/LazyStartupFilter.java
===================================================================
--- trunk/core/src/main/java/org/jboss/on/embedded/LazyStartupFilter.java 2009-04-24 21:20:37 UTC (rev 337)
+++ trunk/core/src/main/java/org/jboss/on/embedded/LazyStartupFilter.java 2009-04-24 21:26:16 UTC (rev 338)
@@ -68,12 +68,20 @@
public void destroy()
{
+ if (! initialized)
+ {
+ filter = null;
+ config = null;
+ return;
+ }
+
try
{
init();
}
catch (ServletException e)
{
+ log.error("Filter through an exception during init: ", e);
}
filter.destroy();
@@ -102,7 +110,7 @@
}
catch (Exception e)
{
- throw new IllegalArgumentException("Could not instantiated filter: " + filterName, e);
+ log.error("Could not instantiated filter: " + filterName, e);
}
filter.init(config);
Modified: trunk/core/src/main/java/org/jboss/on/embedded/LazyStartupListener.java
===================================================================
--- trunk/core/src/main/java/org/jboss/on/embedded/LazyStartupListener.java 2009-04-24 21:20:37 UTC (rev 337)
+++ trunk/core/src/main/java/org/jboss/on/embedded/LazyStartupListener.java 2009-04-24 21:26:16 UTC (rev 338)
@@ -127,15 +127,11 @@
{
objs[i] = Class.forName(names[i]).newInstance();
}
- catch (InstantiationException e)
+ catch (Exception e)
{
+ log.error("Could not find/load listener: "+ names[i], e);
}
- catch (IllegalAccessException e)
- {
- }
- catch (ClassNotFoundException e)
- {
- }
+
}
for (Object obj : objs)
@@ -251,6 +247,12 @@
public void contextDestroyed(ServletContextEvent event)
{
+ if (! initialized)
+ {
+ contextEvents.clear();
+ return;
+ }
+
initialize();
ArrayList<ServletContextListener> listeners = contextListeners;
15 years
EMBJOPR SVN: r336 - trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-04-24 15:22:01 -0400 (Fri, 24 Apr 2009)
New Revision: 336
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java
Log:
EJTT: Updated methods covering operation history table
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-24 19:01:32 UTC (rev 335)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java 2009-04-24 19:22:01 UTC (rev 336)
@@ -1098,8 +1098,8 @@
throw new HtmlElementNotFoundException(
"Operation table has no rows (no operations are listed).");
- //String xPath = "tbody/tr[contains(@class, 'rich-table-firstrow')]";
- String xPath = "tbody/tr[contains(@class, 'operationStatusColumn')]";
+ String xPath = "tbody/tr[contains(@class, 'rich-table-firstrow')]";
+ //String xPath = "tbody/tr[contains(@class, 'operationStatusColumn')]";
HtmlTableRow tr = this.element.getFirstByXPath(xPath);
if( null == tr ){
15 years
EMBJOPR SVN: r335 - trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-04-24 15:01:32 -0400 (Fri, 24 Apr 2009)
New Revision: 335
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java
Log:
EJTT: Updated methods covering operation history table -> fixing "Can't find the ops history table element, searched ID: operationHistoryForm:dataTable"
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-24 18:39:53 UTC (rev 334)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java 2009-04-24 19:01:32 UTC (rev 335)
@@ -678,7 +678,8 @@
public OperationsHistoryTable getOperationsHistoryTable() throws HtmlElementNotFoundException {
// Find the ops history table.
- String elemID = "operationHistoryForm:dataTable";
+ //String elemID = "operationHistoryForm:dataTable";
+ String elemID = "historiesForm:dataTable";
Element elem = client.getElement(elemID);
if( null == elem ){
throw new HtmlElementNotFoundException(
@@ -692,7 +693,7 @@
/**
- * Finds first button with given label inside this box.
+ * Finds first button with given label inside this tab box.
* @param label
* @return
* @throws org.jboss.jopr.jsfunit.exceptions.HtmlElementNotFoundException
@@ -1073,13 +1074,18 @@
+
+
+
+
/**
* Table which shows the result of an operation.
*/
public class OperationsHistoryTable extends ContentTable {
- public OperationsHistoryTable(HtmlTable element) {
+ public OperationsHistoryTable(HtmlTable element) throws HtmlElementNotFoundException {
super(element);
+ analyzeColumns();
}
/**
@@ -1092,7 +1098,9 @@
throw new HtmlElementNotFoundException(
"Operation table has no rows (no operations are listed).");
- String xPath = "tbody/tr[contains(@class, 'rich-table-firstrow')]";
+ //String xPath = "tbody/tr[contains(@class, 'rich-table-firstrow')]";
+ String xPath = "tbody/tr[contains(@class, 'operationStatusColumn')]";
+
HtmlTableRow tr = this.element.getFirstByXPath(xPath);
if( null == tr ){
throw new HtmlElementNotFoundException(
@@ -1101,9 +1109,17 @@
return tr;
}
- public OperationStatusType getLastOperationStatus() throws HtmlElementNotFoundException {
+
+ public OperationStatusType getLastOperationStatus() throws HtmlElementNotFoundException
+ {
+ // TODO: Ugly - we should get the cell, not whole row.
HtmlTableRow tr = getLastOperationRow();
- OperationStatusType status = OperationStatusType.fromStatusText( tr.getTextContent() );
+ //OperationStatusType status = OperationStatusType.fromStatusText( tr.getTextContent() );
+
+ int statusColIndex = this.getColumnIndexByName("Status");
+ String statusText = this.getRows().get(0).getCell(statusColIndex).getTextContent().trim();
+ OperationStatusType status = OperationStatusType.fromStatusText( statusText );
+
if( null == status )
throw new HtmlElementNotFoundException(
"Operation status not recognized. Row text: "+tr.getTextContent(), currentTest);
@@ -1113,6 +1129,7 @@
public boolean wasLastOperationSuccesful() throws HtmlElementNotFoundException
{
HtmlTableRow tr = getLastOperationRow();
+ // Kind of simple hack.
return tr.getTextContent().contains("Success");
}
15 years
EMBJOPR SVN: r334 - trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-04-24 14:39:53 -0400 (Fri, 24 Apr 2009)
New Revision: 334
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java
Log:
EJTT: currentTest added on several places to trigger page dump upon HtmlElementNotFoundException
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-24 17:54:27 UTC (rev 333)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java 2009-04-24 18:39:53 UTC (rev 334)
@@ -682,7 +682,7 @@
Element elem = client.getElement(elemID);
if( null == elem ){
throw new HtmlElementNotFoundException(
- "Can't find the ops history table element, searched ID: " + elemID);
+ "Can't find the ops history table element, searched ID: " + elemID, currentTest);
}
return new OperationsHistoryTable( (HtmlTable)elem );
@@ -705,7 +705,7 @@
HtmlButtonInput button = this.element.getFirstByXPath(".//input[normalize-space(@value)='"+label+"']");
if( null == button )
- throw new HtmlElementNotFoundException("Button labelled '"+label+"' not found.");
+ throw new HtmlElementNotFoundException("Button labelled '"+label+"' not found.", currentTest);
return button;
@@ -744,7 +744,7 @@
HtmlTable tableElm = (HtmlTable) client.getElement("resourceSummaryForm:dataTable");
if( null == tableElm ){
throw new HtmlElementNotFoundException(
- "Data table not found (looking for ID 'resourceSummaryForm:dataTable'");
+ "Data table not found (looking for ID 'resourceSummaryForm:dataTable'", currentTest);
}
ContentTable table = new ContentTable(tableElm);
@@ -849,7 +849,7 @@
throws HtmlElementNotFoundException
{
if( 0 == element.getRowCount() )
- throw new HtmlElementNotFoundException("Table has no rows.");
+ throw new HtmlElementNotFoundException("Table has no rows.", currentTest);
// TODO: Escape the single quotes. By doubling?
// http://books.google.com/books?id=jzqFMlM0gb0C&pg=PA308&lpg=PA308&dq=xquer...
@@ -921,7 +921,7 @@
HtmlTableRow elm = (HtmlTableRow) element.getFirstByXPath(xPath);
if( null == elm )
throw new HtmlElementNotFoundException(
- "Can't find row containing link '"+linkLabel+"' using XPath: "+xPath);
+ "Can't find row containing link '"+linkLabel+"' using XPath: "+xPath, currentTest);
return new ContentTableRow(elm, this);
}
@@ -942,7 +942,7 @@
if( 0 == colHeaders.size() ){
//this.analyzedButNotFound = true;
- throw new HtmlElementNotFoundException("Table has no column headers.");
+ throw new HtmlElementNotFoundException("Table has no column headers.", currentTest);
}
List<String> colLabels_ = new ArrayList(colHeaders.size());
@@ -977,7 +977,7 @@
Integer index = this.colIndexes.get(colName);
if( null == index )
- throw new HtmlElementNotFoundException("No column named '"+colName+"'.");
+ throw new HtmlElementNotFoundException("No column named '"+colName+"'.", currentTest);
return index;
}
@@ -1096,7 +1096,7 @@
HtmlTableRow tr = this.element.getFirstByXPath(xPath);
if( null == tr ){
throw new HtmlElementNotFoundException(
- "Operation status row not recognized; used XPath: "+xPath);
+ "Operation status row not recognized; used XPath: "+xPath, currentTest);
}
return tr;
}
@@ -1106,7 +1106,7 @@
OperationStatusType status = OperationStatusType.fromStatusText( tr.getTextContent() );
if( null == status )
throw new HtmlElementNotFoundException(
- "Operation status not recognized. Row text: "+tr.getTextContent());
+ "Operation status not recognized. Row text: "+tr.getTextContent(), currentTest);
return status;
}
15 years
EMBJOPR SVN: r333 - trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/exceptions.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-04-24 13:54:27 -0400 (Fri, 24 Apr 2009)
New Revision: 333
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/exceptions/EmbJoprTestException.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/exceptions/HtmlElementNotFoundException.java
Log:
Optional page dump upon a throw moved from HtmlElementNotFoundException to EmbJoprTestException.
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/exceptions/EmbJoprTestException.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/exceptions/EmbJoprTestException.java 2009-04-24 16:46:46 UTC (rev 332)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/exceptions/EmbJoprTestException.java 2009-04-24 17:54:27 UTC (rev 333)
@@ -22,7 +22,10 @@
package org.jboss.jopr.jsfunit.exceptions;
+import org.jboss.jopr.jsfunit.DebugUtils;
+import org.jboss.jopr.jsfunit.EmbjoprTestCase;
+
/**
* Root Exception for Exceptions thrown in Embedded Jopr tests.
* Used to distinguish "expected" exceptions from those unhandled / unexpected.
@@ -35,6 +38,21 @@
super(cause);
}
+ /** Writes the current page to a file named "<testName>-ElNotFound.html". */
+ public EmbJoprTestException(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 EmbJoprTestException(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-04-24 16:46:46 UTC (rev 332)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/exceptions/HtmlElementNotFoundException.java 2009-04-24 17:54:27 UTC (rev 333)
@@ -17,18 +17,8 @@
}
/** 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, EmbjoprTestCase test){
+ super(message, test);
}
public HtmlElementNotFoundException(String message, Throwable cause) {
15 years
EMBJOPR SVN: r332 - in trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit: as5 and 1 other directories.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-04-24 12:46:46 -0400 (Fri, 24 Apr 2009)
New Revision: 332
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/HelloJoprTest.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/ApplicationsPageTest.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/JBossASNodeTest.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/ServerNodeSummaryTest.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:
Several tests adapted to recent changes.
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/HelloJoprTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/HelloJoprTest.java 2009-04-24 14:48:00 UTC (rev 331)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/HelloJoprTest.java 2009-04-24 16:46:46 UTC (rev 332)
@@ -41,6 +41,8 @@
import junit.framework.Test;
import junit.framework.TestSuite;
import org.apache.cactus.ServletTestCase;
+import org.jboss.jopr.jsfunit.exceptions.HtmlElementNotFoundException;
+import org.jboss.jopr.jsfunit.util.EmbJoprTestToolkit;
import org.jboss.jsfunit.framework.WebClientSpec;
import org.jboss.jsfunit.jsfsession.JSFClientSession;
import org.jboss.jsfunit.jsfsession.JSFServerSession;
@@ -95,13 +97,19 @@
return new TestSuite( HelloJoprTest.class );
}
- public void testDeployWAR() throws IOException
+ public void testDeployWAR() throws IOException, HtmlElementNotFoundException
{
- // click the nave tree
- HtmlAnchor warLink = getNavTreeLink("Web Application (WAR)");
+
+ EmbJoprTestToolkit ejtt = new EmbJoprTestToolkit(client, server);
+
+ // Click the nav tree.
+ String linkLabel = "Web Application (WAR)s";
+ //HtmlAnchor warLink = getNavTreeLink(linkLabel);
+ HtmlAnchor warLink = ejtt.navTree.getNodeLink(linkLabel);
warLink.click();
// click on the "Add new resource" button
+ DebugUtils.writeFile("target/testDeployWAR-beforeAdd.html", client.getPageAsText());///
client.click("actionHeaderForm:addNewContent"); // 404 if setThrowExceptionOnFailingStatusCode(true) above
// upload hellothere.war
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/ApplicationsPageTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/ApplicationsPageTest.java 2009-04-24 14:48:00 UTC (rev 331)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/ApplicationsPageTest.java 2009-04-24 16:46:46 UTC (rev 332)
@@ -22,8 +22,10 @@
package org.jboss.jopr.jsfunit.as5;
+import java.io.File;
import java.io.IOException;
import java.util.*;
+import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils;
import org.jboss.jopr.jsfunit.AppConstants.DeployableTypes;
import org.jboss.jopr.jsfunit.ApplicationTestBaseAS5;
@@ -80,6 +82,18 @@
*/
public void testAppsPagination() throws EmbJoprTestException, IOException {
+ // Deploy enough apps.
+ // TODO: Create test which would only deploy many apps at once (hotdeploy/embjopr/both?).
+ // TODO: Undeploy.
+ for (int i = 0; i < 8; i++) {
+ // Deploy the same APP multiple times.
+ String fileSrcPath = ejtt.getTestDataDir() +"/ear/"+ BASIC_EAR;
+ String fileDestPath = ejtt.getTempDir() + "/appPagination/appPagination"+i+".ear";
+ FileUtils.copyFile( new File(fileSrcPath), new File(fileDestPath) );
+ ejtt.deployment.deployViaEmbJoprRepeatedly( DeployableTypes.EAR, fileDestPath );
+ }
+
+
// Navigate to apps summary tab
NavTreeNode appsNode = ejtt.navTree.getNodeByLabel(NAV_APPLICATIONS);
assertNotNull(appsNode);
@@ -147,6 +161,18 @@
*/
public void testAppsListing() throws EmbJoprTestException, IOException {
+ // Deploy enough apps.
+ // TODO: Create test which would only deploy many apps at once (hotdeploy/embjopr/both?).
+ // TODO: Undeploy.
+ for (int i = 0; i < 8; i++) {
+ // Deploy the same APP multiple times.
+ String fileSrcPath = ejtt.getTestDataDir() +"/ear/"+ BASIC_EAR;
+ String fileDestPath = ejtt.getTempDir() + "/appPagination/testAppsListing"+i+".ear";
+ FileUtils.copyFile( new File(fileSrcPath), new File(fileDestPath) );
+ ejtt.deployment.deployViaEmbJoprRepeatedly( DeployableTypes.EAR, fileDestPath );
+ }
+
+
// Navigate to apps summary tab
NavTreeNode appsNode = ejtt.navTree.getNodeByLabel(NAV_APPLICATIONS);
assertNotNull(appsNode);
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-04-24 14:48:00 UTC (rev 331)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/JBossASNodeTest.java 2009-04-24 16:46:46 UTC (rev 332)
@@ -134,6 +134,8 @@
// Refresh the page
+ // TODO: Do it several times avoid accidentally same value.
+
((HtmlPage)client.getContentPage()).refresh();
// Read new values.
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/ServerNodeSummaryTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/ServerNodeSummaryTest.java 2009-04-24 14:48:00 UTC (rev 331)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/ServerNodeSummaryTest.java 2009-04-24 16:46:46 UTC (rev 332)
@@ -1,8 +1,5 @@
package org.jboss.jopr.jsfunit.as5;
-import java.io.FileNotFoundException;
-import java.util.logging.Level;
-import java.util.logging.Logger;
import org.jboss.jopr.jsfunit.exceptions.HtmlElementNotFoundException;
import org.jboss.jopr.jsfunit.exceptions.ActionOutOfSyncException;
import com.gargoylesoftware.htmlunit.html.*;
@@ -13,7 +10,6 @@
import java.net.InetAddress;
import java.net.URL;
import java.net.UnknownHostException;
-import org.jboss.jopr.jsfunit.DebugUtils;
import org.jboss.jopr.jsfunit.exceptions.EmbJoprTestException;
import org.jboss.jopr.jsfunit.EmbjoprTestCase;
@@ -96,6 +92,10 @@
try{
navTree.clickRootNode();
+
+ if( tabMenu.isTabDisabled("Control") )
+ fail("Root (server) node's Control tab is disabled.");
+
tabMenu.clickTab("Control");
TabContentBox box = tabMenu.getTabContentBox();
@@ -122,6 +122,10 @@
try{
navTree.clickRootNode();
+
+ if( tabMenu.isTabDisabled("Control") )
+ fail("Root (server) node's Control tab is disabled.");
+
tabMenu.clickTab("Control");
TabContentBox box = tabMenu.getTabContentBox();
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-24 14:48:00 UTC (rev 331)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/WarTest.java 2009-04-24 16:46:46 UTC (rev 332)
@@ -1142,7 +1142,7 @@
// Check whether the WAR is listed in EmbJopr.
log.debug("Looking for listed WAR: "+warFileName);
- boolean listed = ejtt.deployment.isDeployedAccordingToEmbJopr(DeployableTypes.WAR, warFileName, isJBoss4);
+ boolean listed = ejtt.deployment.isDeployedAccordingToEmbJopr(DeployableTypes.WAR, warFileName, true);
if( listed )
return true;
else
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-24 14:48:00 UTC (rev 331)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java 2009-04-24 16:46:46 UTC (rev 332)
@@ -1295,8 +1295,12 @@
/** Returns the HTML Select element of page size selection. */
public HtmlSelect getPageSizeSelect() throws HtmlElementNotFoundException {
//return (HtmlSelect) client.getElement(ID_PAGE_SIZE_SELECT);
- return (HtmlSelect) getTabMenu().getTabContentBox().getElement()
- .getFirstByXPath(".//select[contains(@id, 'SummaryForm:currentPageSize')]");
+ String xPath = ".//select[contains(@id, 'SummaryForm:currentPageSize')]";
+ 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. */
@@ -1562,6 +1566,63 @@
+
+ public void deployViaEmbJoprRepeatedly( final AppConstants.DeployableTypes type, final String filePath )
+ throws IOException, HtmlElementNotFoundException, EmbJoprTestException
+ {
+
+ if( !(new File(filePath)).exists())
+ throw new FileNotFoundException(filePath);
+
+ File appFile = new File(filePath);
+ final String fileName = appFile.getName();
+
+ try {
+
+ // Try it 5x in 5 second interval.
+ new ActiveConditionChecker( new DescribedCondition(type.name()+" '"+fileName+"' succesfuly deployed") {
+ public boolean isTrue() throws Exception {
+ deployViaEmbJopr( type, filePath );
+
+ // Check whether deployment ended with success message.
+ /* Now broken, EmbJopr reports an error even when deployed successfully:
+ * Failed to create Resource hellothere.war - cause:
+ java.lang.RuntimeException:java.lang.NullPointerException
+ -> java.lang.NullPointerException:null
+ * See EMBJOPR-116
+ */
+ /*
+ if( server.getFacesMessages().hasNext() ){
+ FacesMessage msg = server.getFacesMessages().next();
+ if( msg.getSeverity() == FacesMessage.SEVERITY_INFO )
+ return true;
+ else
+ ejtt.logServerMessage("Deployment error: ");
+ }
+ */
+
+ // Check whether the WAR is listed in EmbJopr.
+ log.debug("Looking for listed WAR: "+fileName);
+ boolean listed = deployment.isDeployedAccordingToEmbJopr(DeployableTypes.WAR, fileName, true);
+ if( listed )
+ return true;
+ else
+ return false;
+ }
+ }).dumpPageOnTimeout(currentTest).throwOnTimeout().waitWithTimeout(5000, 8);
+
+ }
+ catch( Exception ex ){
+ throw new EmbJoprTestException(ex.getClass().getName()+": "+ex.getMessage(), ex);
+ }
+
+
+
+ }
+
+
+
+
/**
* Undeploys the deployable using EmbJopr's web UI.
*
15 years
EMBJOPR SVN: r331 - trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-04-24 10:48:00 -0400 (Fri, 24 Apr 2009)
New Revision: 331
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/JBossASNodeTest.java
Log:
JBoss AS node test updated
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-04-24 14:40:09 UTC (rev 330)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/JBossASNodeTest.java 2009-04-24 14:48:00 UTC (rev 331)
@@ -158,9 +158,9 @@
log.info( String.format("Mem free: %f, %f", memFree1, memFree2) );
log.info( String.format("Mem total: %f, %f", memTotal1, memTotal2) );
- assertTrue("New thread count should be >= old. Is: "+threads1 +","+ threads2, threads1 > threads2);
- assertTrue("New free mem should be <= old. Is: "+memFree1 +","+ memFree2, memFree1 < memFree2);
- assertTrue("New total mem should be = old. Is: "+memTotal1 +","+ memTotal2, memTotal1 == memTotal2);
+ assertTrue("New thread count should be >= old. Is: "+threads1 +" -> "+ threads2, threads1 != threads2);
+ assertTrue("New free mem should be <= old. Is: "+memFree1 +" -> "+ memFree2, memFree1 != memFree2);
+ //assertTrue("New total mem should be = old. Is: "+memTotal1 +","+ memTotal2, memTotal1 == memTotal2);
}
15 years
EMBJOPR SVN: r330 - trunk/jbas5/etc/overlay/bin.
by embjopr-commits@lists.jboss.org
Author: ips
Date: 2009-04-24 10:40:09 -0400 (Fri, 24 Apr 2009)
New Revision: 330
Modified:
trunk/jbas5/etc/overlay/bin/run.bat
Log:
wipe out admin-console.war if it exists
Modified: trunk/jbas5/etc/overlay/bin/run.bat
===================================================================
--- trunk/jbas5/etc/overlay/bin/run.bat 2009-04-23 21:04:06 UTC (rev 329)
+++ trunk/jbas5/etc/overlay/bin/run.bat 2009-04-24 14:40:09 UTC (rev 330)
@@ -27,6 +27,10 @@
echo Deleting %JBOSS_HOME%\server\default\deploy\jopr-embedded-jbas5.war...
rmdir /s /q %JBOSS_HOME%\server\default\deploy\jopr-embedded-jbas5.war >nul
)
+ if exist "%JBOSS_HOME%\server\default\deploy\admin-console.war" (
+ echo Deleting %JBOSS_HOME%\server\default\deploy\admin-console.war...
+ rmdir /s /q %JBOSS_HOME%\server\default\deploy\admin-console.war >nul
+ )
)
if "%OS%" == "Windows_NT" (
15 years
EMBJOPR SVN: r329 - trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5.
by embjopr-commits@lists.jboss.org
Author: smcgowan(a)redhat.com
Date: 2009-04-23 17:04:06 -0400 (Thu, 23 Apr 2009)
New Revision: 329
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/DatasourceTest.java
Log:
change operation_form to operationsForm
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/DatasourceTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/DatasourceTest.java 2009-04-23 21:00:19 UTC (rev 328)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/DatasourceTest.java 2009-04-23 21:04:06 UTC (rev 329)
@@ -121,7 +121,7 @@
navigateToPage(datasourceName, datasourceType, "controlTab");
- HtmlForm form = (HtmlForm)client.getElement("operation_form");
+ HtmlForm form = (HtmlForm)client.getElement("operationsForm");
String xpath = ".//input[@value=\"" + operationName + "\"]";
HtmlButtonInput operationButton = (HtmlButtonInput)form.getFirstByXPath(xpath);
15 years