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

embjopr-commits at lists.jboss.org embjopr-commits at lists.jboss.org
Fri Jun 5 14:37:31 EDT 2009


Author: ozizka at redhat.com
Date: 2009-06-05 14:37:30 -0400 (Fri, 05 Jun 2009)
New Revision: 509

Modified:
   trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java
Log:
EJTT updated - JSF error message after undeployment causes undeployViaEmbJopr() throw an exception.

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-06-05 18:20:40 UTC (rev 508)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java	2009-06-05 18:37:30 UTC (rev 509)
@@ -1750,13 +1750,14 @@
 
 
 
+
 		/**
 		 * Undeploys the deployable using EmbJopr's web UI.
 		 *
 		 * @param type  Type of the deployable - EAR, SAR, WAR, ...
 		 */
 		public void undeployViaEmbJopr( AppConstants.DeployableTypes type, String fileName )
-						throws IOException, HtmlElementNotFoundException, ActionNotAvailableException, ActionOutOfSyncException
+						throws IOException, HtmlElementNotFoundException, ActionNotAvailableException, ActionOutOfSyncException, EmbJoprTestException
 		{
 
 			// Navigate to Enterprise Archives
@@ -1770,14 +1771,23 @@
 			deleteButton.click();
 
 			// Log the message (with prefix of potential warning)
-			logServerMessage("Something went wrong with undeploy: ");
+			//logServerMessage("Something went wrong with undeploy: ");
+			// In case of error, throw an exception.
+			if( server.getFacesMessages().hasNext() ){
+				FacesMessage msg = server.getFacesMessages().next();
+				if( msg.getSeverity() == FacesMessage.SEVERITY_INFO ){
+					log.info( msg.getSummary() +"\n"+ msg.getDetail() );
+				}else{
+					throw new EmbJoprTestException( "Undeployment error: " + msg.getSummary() +"\n"+ msg.getDetail() );
+				}
+			}
 
+
 			// Sleep for 3 sec. TODO: write some waitForUndeployed()
 			sleep( 3000 );
 
 		}// undeployViaEmbJopr()
 
-
 		// TODO: The following was copied from EarTest.java; remove from there.
 
 




More information about the embjopr-commits mailing list