[embjopr-commits] EMBJOPR SVN: r356 - 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
Mon Apr 27 13:36:48 EDT 2009


Author: fjuma
Date: 2009-04-27 13:36:48 -0400 (Mon, 27 Apr 2009)
New Revision: 356

Modified:
   trunk/core/src/main/webapp/secure/resourceInstanceOperation.xhtml
   trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/JMSTest.java
   trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/ResourceTestBase.java
Log:
Modifying the operations tests for JMS destinations to match the new layout for the operations page.


Modified: trunk/core/src/main/webapp/secure/resourceInstanceOperation.xhtml
===================================================================
--- trunk/core/src/main/webapp/secure/resourceInstanceOperation.xhtml	2009-04-27 16:54:42 UTC (rev 355)
+++ trunk/core/src/main/webapp/secure/resourceInstanceOperation.xhtml	2009-04-27 17:36:48 UTC (rev 356)
@@ -200,7 +200,7 @@
                           rendered="#{selectedHistory.status eq 'INPROGRESS'}">
                 <i>The operation has not completed yet.</i>
             </h:panelGroup>
-            <h:panelGroup layout="block"
+            <h:panelGroup id="operationResults" layout="block"
                           rendered="#{selectedHistory.status eq 'SUCCESS' and selectedHistory.results ne null and selectedHistory.operationDefinition.resultsConfigurationDefinition ne null}">
                 <onc:config configurationDefinition="#{selectedHistory.operationDefinition.resultsConfigurationDefinition}"
                             configuration="#{selectedHistory.results}"
@@ -209,7 +209,7 @@
                             nullConfigurationMessage="null config!"
                             nullConfigurationStyle="InfoBlock"/>
             </h:panelGroup>
-            <h:panelGroup layout="block"
+            <h:panelGroup id="noResults" layout="block"
                           rendered="#{selectedHistory.status eq 'SUCCESS' and (selectedHistory.results eq null or empty selectedHistory.results.map)}">
                 <i>The operation did not return any results.</i>
             </h:panelGroup>

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-27 16:54:42 UTC (rev 355)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/JMSTest.java	2009-04-27 17:36:48 UTC (rev 356)
@@ -1445,7 +1445,7 @@
          checkDestinationMetrics(jndiName, expectedMetrics, getQueueSummaryMetrics(),
                                  DestinationType.QUEUE);
      }
-     
+    
      /**
       * Test Name: testQueueMetricsAfterCreatingReceiver
       * Assertion: Verify that queue metrics are correct after creating
@@ -2677,13 +2677,10 @@
          performResourceOperation(JMS_NAV_LABEL, destinationType.getNavLabel(), 
                                   jndiName, operationName, takesParameters);
          
-         // Click on the "Show/Hide Details" link
-         HtmlAnchor detailsLink = getLinkInsideForm(OPERATION_HISTORY_FORM, OPERATION_DETAILS);
-         detailsLink.click();
-         
          // Get the result of the operation
-         HtmlForm form = (HtmlForm)client.getElement(OPERATION_HISTORY_FORM);
-         HtmlInput input = (HtmlInput)form.getFirstByXPath(".//input[@class='property-value-input']");
+         HtmlDivision historyPanel = (HtmlDivision)client.getElement(OPERATION_HISTORY_FORM);
+         HtmlInput input = (HtmlInput)historyPanel.getFirstByXPath(".//input[@class='property-value-input']"); 
+
          assertNotNull("Could not get the result of the operation", input);
          
          String result = input.getValueAttribute();
@@ -2715,13 +2712,9 @@
          performResourceOperation(JMS_NAV_LABEL, destinationType.getNavLabel(), 
                                   jndiName, operationName, takesParameters);
          
-         // Click on the "Show/Hide Details" link
-         HtmlAnchor detailsLink = getLinkInsideForm(OPERATION_HISTORY_FORM, OPERATION_DETAILS);
-         detailsLink.click();
-         
          // Get the result of the operation
-         HtmlForm form = (HtmlForm)client.getElement(OPERATION_HISTORY_FORM);
-         HtmlInput input = (HtmlInput)form.getFirstByXPath(".//input[@class='property-value-input']");
+         HtmlDivision historyPanel = (HtmlDivision)client.getElement(OPERATION_HISTORY_FORM);
+         HtmlInput input = (HtmlInput)historyPanel.getFirstByXPath(".//input[@class='property-value-input']");
          assertNotNull("Could not get the result of the operation", input);
          
          String result = input.getValueAttribute();
@@ -3028,13 +3021,8 @@
          performResourceOperation(JMS_NAV_LABEL, DestinationType.TOPIC.getNavLabel(), 
                                   jndiName, operationName, Boolean.FALSE);
 
-         // Make sure the operation parameters and results are displayed
-         // correctly
-         HtmlAnchor detailsLink = getLinkInsideForm(OPERATION_HISTORY_FORM, OPERATION_DETAILS);
-         detailsLink.click();
+         String actualOperationResults = ((HtmlDivision)client.getElement(OPERATION_RESULTS)).getTextContent();
          
-         String actualOperationResults = ((HtmlSpan)client.getElement(OPERATION_RESULTS)).getTextContent();
-         
          String shortenedResult = actualOperationResults.substring(actualOperationResults.indexOf("Viewing"), 
                                                                    actualOperationResults.indexOf("]") + 1);
          log.info("Operation result was: " + shortenedResult);

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-04-27 16:54:42 UTC (rev 355)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/ResourceTestBase.java	2009-04-27 17:36:48 UTC (rev 356)
@@ -68,7 +68,7 @@
     public static final String OPERATION_DETAILS = "(Show/Hide Details)";
     
     // Operations table constants
-    public static final String OPERATION_HISTORY_FORM = "operationHistoryForm";
+    public static final String OPERATION_HISTORY_FORM = "historyDetailsPanel";
     public static final String DATA_TABLE = "dataTable";
     public static final String INPROGRESS = "In Progress";
     public static final String SUCCESSFUL = "Successful";
@@ -79,7 +79,8 @@
     public static final String NO_PARAMETERS = "noParameters";
     public static final String NO_RESULTS = "noResults";
     public static final String OPERATION_RESULTS = "operationResults";
-    public static final String NONE = "None";
+    public static final String NO_RESULTS_MESSAGE = "The operation did not return any results";
+    public static final String NO_PARAMETERS_MESSAGE = "This operation does not take any parameters";
     public static final String EMPTY_LIST = "[]";
     public static final String TABLE_CELL_DELIM = "<td>";
     public static final String TABLE_CELL_END_DELIM = "</td>";
@@ -420,18 +421,15 @@
         
         // Make sure the operation parameters and results are displayed
         // correctly
-        HtmlAnchor detailsLink = getLinkInsideForm(OPERATION_HISTORY_FORM, OPERATION_DETAILS);
-        detailsLink.click();
-        
         String actualOperationParameters = ((HtmlSpan)client.getElement(NO_PARAMETERS)).getTextContent();
-        String actualOperationResults = ((HtmlSpan)client.getElement(NO_RESULTS)).getTextContent();
+        String actualOperationResults = ((HtmlDivision)client.getElement(NO_RESULTS)).getTextContent();
       
         assertTrue("Incorrect operation parameters displayed in the operations history table: "
-                   + "expected: " + NONE + " but was: " + actualOperationParameters,
-                   actualOperationParameters.contains(NONE));
+                   + "expected: " + NO_PARAMETERS_MESSAGE + " but was: " + actualOperationParameters,
+                   actualOperationParameters.contains(NO_PARAMETERS_MESSAGE));
         assertTrue("Incorrect operation results displayed in the operations history table: "
-                   + "expected: " + NONE + " but was: " + actualOperationResults,
-                   actualOperationResults.contains(NONE));
+                   + "expected: " + NO_RESULTS_MESSAGE + " but was: " + actualOperationResults,
+                   actualOperationResults.contains(NO_RESULTS_MESSAGE));
     }
     
     /**




More information about the embjopr-commits mailing list