incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1227453 - in /incubator/lcf/trunk: connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/ framework/core/src/test/resource/org/apache/manifoldcf/core/tests/ framework/ui-core/src/main/native2asci...
Date Thu, 05 Jan 2012 02:39:05 GMT
Author: kwright
Date: Thu Jan  5 02:39:04 2012
New Revision: 1227453

URL: http://svn.apache.org/viewvc?rev=1227453&view=rev
Log:
Complete web crawler UI test, and fix two problems the test picked up: html form, and capitalization
of job editing Cancel button.

Modified:
    incubator/lcf/trunk/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/WebcrawlerConnector.java
    incubator/lcf/trunk/framework/core/src/test/resource/org/apache/manifoldcf/core/tests/VirtualBrowser.py
    incubator/lcf/trunk/framework/ui-core/src/main/native2ascii/org/apache/manifoldcf/ui/i18n/common_en_US.properties
    incubator/lcf/trunk/tests/webcrawler/src/test/java/org/apache/manifoldcf/webcrawler_tests/NavigationDerbyUI.java

Modified: incubator/lcf/trunk/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/WebcrawlerConnector.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/WebcrawlerConnector.java?rev=1227453&r1=1227452&r2=1227453&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/WebcrawlerConnector.java
(original)
+++ incubator/lcf/trunk/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/WebcrawlerConnector.java
Thu Jan  5 02:39:04 2012
@@ -3710,6 +3710,7 @@ public class WebcrawlerConnector extends
 "      <input type=\"checkbox\" name=\"matchinghosts\" value=\"true\""+(includeMatching?"
checked=\"yes\"":"")+"/>\n"+
 "      <input type=\"hidden\" name=\"matchinghosts_present\" value=\"true\"/>\n"+
 "    </td>\n"+
+"  </tr>\n"+
 "</table>\n"
       );
     }

Modified: incubator/lcf/trunk/framework/core/src/test/resource/org/apache/manifoldcf/core/tests/VirtualBrowser.py
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/core/src/test/resource/org/apache/manifoldcf/core/tests/VirtualBrowser.py?rev=1227453&r1=1227452&r2=1227453&view=diff
==============================================================================
--- incubator/lcf/trunk/framework/core/src/test/resource/org/apache/manifoldcf/core/tests/VirtualBrowser.py
(original)
+++ incubator/lcf/trunk/framework/core/src/test/resource/org/apache/manifoldcf/core/tests/VirtualBrowser.py
Thu Jan  5 02:39:04 2012
@@ -294,6 +294,11 @@ class VirtualCheckbox( VirtualFormDataEl
         assert isinstance( bodytext, unicode ) or isinstance( bodytext, str )
         self.bodytext = bodytext
 
+    def get_property( self, property_name ):
+        if property_name == "checked":
+            return Javascript.JSBoolean(self.selected)
+        return VirtualFormDataElement.get_property( self, property_name )
+
 # Radio
 class VirtualRadiobutton( VirtualFormDataElement ):
 
@@ -576,6 +581,7 @@ class VirtualForm:
         # These elements all have scrapable data, and are organized by
         # key (which comes from the element).
         self.data_elements = { }
+        self.javascript_data_elements = { }
         self.window_instance = window_instance
         self.form_name = name
         self.action_url = action_url
@@ -654,11 +660,11 @@ class VirtualForm:
 
     # Private API
 
-
     # Find an element based on its data name.
-    # This will NEVER return checkboxes or radio buttons!
+    # This will return the FIRST matching checkbox or radio button, which seems to be the
+    # browser convention.
     def find_element_by_dataname( self, data_name ):
-        return self.data_elements[ data_name ]
+        return self.javascript_data_elements[ data_name ]
 
     # Execute javascript expression in the form context.
     # Returns a JSObject representing the result.
@@ -669,6 +675,8 @@ class VirtualForm:
     def add_element( self, element ):
         assert isinstance( element, VirtualFormDataElement )
         self.data_elements[ element.get_key( ) ] = element
+        if not self.javascript_data_elements.has_key( element.get_name( ) ):
+            self.javascript_data_elements[ element.get_name( ) ] = element
 
     # This method is called just before a radio button is selected.
     # It must deselect all radio buttons that share this element name.

Modified: incubator/lcf/trunk/framework/ui-core/src/main/native2ascii/org/apache/manifoldcf/ui/i18n/common_en_US.properties
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/ui-core/src/main/native2ascii/org/apache/manifoldcf/ui/i18n/common_en_US.properties?rev=1227453&r1=1227452&r2=1227453&view=diff
==============================================================================
--- incubator/lcf/trunk/framework/ui-core/src/main/native2ascii/org/apache/manifoldcf/ui/i18n/common_en_US.properties
(original)
+++ incubator/lcf/trunk/framework/ui-core/src/main/native2ascii/org/apache/manifoldcf/ui/i18n/common_en_US.properties
Thu Jan  5 02:39:04 2012
@@ -208,7 +208,7 @@ editjob.NoOutputConnectionsDefinedCreate
 editjob.NameColon=Name:
 editjob.MaximumHopCountForType=Maximum hop count for type
 editjob.colon=:
-editjob.cancel=cancel
+editjob.cancel=Cancel
 editjob.CancelJobEditing=Cancel job editing
 editjob.OutputConnectionColon=Output connection:
 editjob.NoneSelected=None selected

Modified: incubator/lcf/trunk/tests/webcrawler/src/test/java/org/apache/manifoldcf/webcrawler_tests/NavigationDerbyUI.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/tests/webcrawler/src/test/java/org/apache/manifoldcf/webcrawler_tests/NavigationDerbyUI.java?rev=1227453&r1=1227452&r2=1227453&view=diff
==============================================================================
--- incubator/lcf/trunk/tests/webcrawler/src/test/java/org/apache/manifoldcf/webcrawler_tests/NavigationDerbyUI.java
(original)
+++ incubator/lcf/trunk/tests/webcrawler/src/test/java/org/apache/manifoldcf/webcrawler_tests/NavigationDerbyUI.java
Thu Jan  5 02:39:04 2012
@@ -46,6 +46,7 @@ public class NavigationDerbyUI extends B
     HTMLTester.Selectbox selectbox;
     HTMLTester.Button button;
     HTMLTester.Radiobutton radiobutton;
+    HTMLTester.Checkbox checkbox;
     HTMLTester.Loop loop;
     
     window = testerInstance.openMainWindow("http://localhost:8346/mcf-crawler-ui/index.jsp");
@@ -128,6 +129,21 @@ public class NavigationDerbyUI extends B
     link.click();
     window = testerInstance.findWindow(null);
     form = window.findForm(testerInstance.createStringDescription("editconnection"));
+    // Access Credentials
+    link = window.findLink(testerInstance.createStringDescription("Access Credentials tab"));
+    link.click();
+    window = testerInstance.findWindow(null);
+    form = window.findForm(testerInstance.createStringDescription("editconnection"));
+    // Certificates
+    link = window.findLink(testerInstance.createStringDescription("Certificates tab"));
+    link.click();
+    window = testerInstance.findWindow(null);
+    form = window.findForm(testerInstance.createStringDescription("editconnection"));
+    checkbox = form.findCheckbox(testerInstance.createStringDescription("all_trust"),testerInstance.createStringDescription("true"));
+    checkbox.select();
+    button = window.findButton(testerInstance.createStringDescription("Add url regular expression
for truststore"));
+    button.click();
+    window = testerInstance.findWindow(null);
     // Go back to the Name tab
     link = window.findLink(testerInstance.createStringDescription("Name tab"));
     link.click();
@@ -181,13 +197,18 @@ public class NavigationDerbyUI extends B
     button = window.findButton(testerInstance.createStringDescription("Add new schedule record"));
     button.click();
     window = testerInstance.findWindow(null);
+    // HopFilters tab
+    link = window.findLink(testerInstance.createStringDescription("Hop Filters tab"));
+    link.click();
+    window = testerInstance.findWindow(null);
+    form = window.findForm(testerInstance.createStringDescription("editjob"));
     // Seeds tab
     link = window.findLink(testerInstance.createStringDescription("Seeds tab"));
     link.click();
     window = testerInstance.findWindow(null);
     form = window.findForm(testerInstance.createStringDescription("editjob"));
-    //textarea = form.findTextarea(testerInstance.createStringDescription("rssurls"));
-    //textarea.setValue(testerInstance.createStringDescription("http://www.cnn.com"));
+    textarea = form.findTextarea(testerInstance.createStringDescription("seeds"));
+    textarea.setValue(testerInstance.createStringDescription("http://www.cnn.com"));
     // Canonicalization tab
     link = window.findLink(testerInstance.createStringDescription("Canonicalization tab"));
     link.click();
@@ -195,14 +216,30 @@ public class NavigationDerbyUI extends B
     button = window.findButton(testerInstance.createStringDescription("Add url regexp"));
     button.click();
     window = testerInstance.findWindow(null);
+    form = window.findForm(testerInstance.createStringDescription("editjob"));
     // Security tab
     link = window.findLink(testerInstance.createStringDescription("Security tab"));
     link.click();
     window = testerInstance.findWindow(null);
+    form = window.findForm(testerInstance.createStringDescription("editjob"));
     // Metadata tab
     link = window.findLink(testerInstance.createStringDescription("Metadata tab"));
     link.click();
     window = testerInstance.findWindow(null);
+    form = window.findForm(testerInstance.createStringDescription("editjob"));
+    // Inclusions tab
+    link = window.findLink(testerInstance.createStringDescription("Inclusions tab"));
+    link.click();
+    window = testerInstance.findWindow(null);
+    form = window.findForm(testerInstance.createStringDescription("editjob"));
+    checkbox = form.findCheckbox(testerInstance.createStringDescription("matchinghosts"),
+      testerInstance.createStringDescription("true"));
+    checkbox.select();
+    // Exclusions tab
+    link = window.findLink(testerInstance.createStringDescription("Exclusions tab"));
+    link.click();
+    window = testerInstance.findWindow(null);
+    form = window.findForm(testerInstance.createStringDescription("editjob"));
 
     // Save the job
     button = window.findButton(testerInstance.createStringDescription("Save this job"));



Mime
View raw message