[embjopr-commits] EMBJOPR SVN: r387 - in trunk: jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5 and 1 other directory.

embjopr-commits at lists.jboss.org embjopr-commits at lists.jboss.org
Wed May 6 13:38:21 EDT 2009


Author: fjuma
Date: 2009-05-06 13:38:21 -0400 (Wed, 06 May 2009)
New Revision: 387

Modified:
   trunk/core/src/main/webapp/secure/resourceInstanceOperation.xhtml
   trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/ResourceTestBase.java
Log:
Modifying logging of error messages from failed operations.


Modified: trunk/core/src/main/webapp/secure/resourceInstanceOperation.xhtml
===================================================================
--- trunk/core/src/main/webapp/secure/resourceInstanceOperation.xhtml	2009-05-06 14:40:22 UTC (rev 386)
+++ trunk/core/src/main/webapp/secure/resourceInstanceOperation.xhtml	2009-05-06 17:38:21 UTC (rev 387)
@@ -214,7 +214,7 @@
         </h:panelGroup>
 
         <!-- Error -->
-        <h:panelGroup layout="block" rendered="#{selectedHistory.status eq 'FAILURE'}">
+        <h:panelGroup id="errorMessage" layout="block" rendered="#{selectedHistory.status eq 'FAILURE'}">
             <h3>#{messages['control.resourceInstance.previous.error']}</h3>
             <h:inputTextarea value="#{selectedHistory.errorMessage}" readonly="true"
                              rendered="#{selectedHistory.errorMessage ne null}"

Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/ResourceTestBase.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/ResourceTestBase.java	2009-05-06 14:40:22 UTC (rev 386)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/ResourceTestBase.java	2009-05-06 17:38:21 UTC (rev 387)
@@ -95,6 +95,7 @@
     public static final String REFRESH_OPERATIONS_TABLE = "refreshLink";
     public static final String RESOURCE_SUMMARY_FORM = "resourceSummaryForm";
     public static final String EDIT_RESOURCE_CONFIGURATION_FORM = "editResourceConfigurationForm";
+    public static final String ERROR_MESSAGE = "errorMessage";
 
     // Pagination constants
     public static final String MAX_ITEMS_PER_PAGE="50";
@@ -304,10 +305,18 @@
 
         // Make sure the operation completed successfully
         String status = getLatestOperationStatus();
-        String actualOperationResults = ((HtmlDivision)client.getElement(OPERATION_RESULTS)).getTextContent();       
-        String shortenedResult = actualOperationResults.substring(actualOperationResults.indexOf("Viewing"), 
-                actualOperationResults.indexOf("]") + 1);
-        assertTrue("The operation was not successful, result was [" + shortenedResult +"].", status.contains(SUCCESSFUL));
+
+        String errorMessage = "";
+
+        // Get the error message for operations that are not successful
+        if(status.contains(FAILED)) {
+            errorMessage = ((HtmlDivision)client.getElement(ERROR_MESSAGE)).getTextContent();
+        } else if(status.contains(INPROGRESS)) {
+            errorMessage = "The operation did not complete in the given time";
+        }
+
+        assertTrue("The operation was not successful, the result was [" + errorMessage + "].", 
+                   status.contains(SUCCESSFUL));
     }
     
     /**




More information about the embjopr-commits mailing list