incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1226576 - in /incubator/lcf/trunk: ./ tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/ tests/rss/src/test/java/org/apache/manifoldcf/rss_tests/
Date Mon, 02 Jan 2012 23:35:42 GMT
Author: kwright
Date: Mon Jan  2 23:35:41 2012
New Revision: 1226576

URL: http://svn.apache.org/viewvc?rev=1226576&view=rev
Log:
Add a UI test for the RSS connector.  Part of CONNECTORS-339.

Added:
    incubator/lcf/trunk/tests/rss/src/test/java/org/apache/manifoldcf/rss_tests/BaseUIDerby.java
  (with props)
    incubator/lcf/trunk/tests/rss/src/test/java/org/apache/manifoldcf/rss_tests/NavigationDerbyUI.java
  (with props)
Modified:
    incubator/lcf/trunk/build.xml
    incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/BaseUIDerby.java
    incubator/lcf/trunk/tests/rss/src/test/java/org/apache/manifoldcf/rss_tests/BaseDerby.java

Modified: incubator/lcf/trunk/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/build.xml?rev=1226576&r1=1226575&r2=1226576&view=diff
==============================================================================
--- incubator/lcf/trunk/build.xml (original)
+++ incubator/lcf/trunk/build.xml Mon Jan  2 23:35:41 2012
@@ -2317,6 +2317,40 @@
         </junit>
     </target>
 
+    <target name="run-rss-UI-tests-derby" depends="compile-rss-tests,calculate-rss-tests-condition"
if="rss-tests.include">
+        <mkdir dir="test-derby-output/rss"/>
+        <junit fork="true" maxmemory="128m" dir="test-derby-output/rss" outputtoformatters="true"
showoutput="true" haltonfailure="true">
+            <classpath>
+                <fileset dir="framework/lib">
+                    <include name="*.jar"/>
+                </fileset>
+	      <fileset dir="framework/build/jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="framework/build/test-jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/rss/build/jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/rss/build/test-jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/nulloutput/build/jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/nulloutput/build/test-jar">
+		<include name="*.jar"/>
+	      </fileset>
+                <pathelement location="build/rss-tests/classes"/>
+            </classpath>
+            <formatter type="brief" usefile="false"/>
+
+            <test name="org.apache.manifoldcf.rss_tests.NavigationDerbyUI" todir="test-derby-output/rss"/>
+            <!-- MHL -->
+        </junit>
+    </target>
+
     <target name="run-rss-loadtests-derby" depends="compile-rss-tests,calculate-rss-tests-condition"
if="rss-tests.include">
         <mkdir dir="test-derby-output/rss"/>
         <junit fork="true" maxmemory="384m" dir="test-derby-output/rss" outputtoformatters="true"
showoutput="true" haltonfailure="true">
@@ -3967,7 +4001,7 @@
 
     <target name="ldtest" depends="load-dr,load-hs"/>
 
-    <target name="uitest" depends="run-filesystem-UI-tests-derby"/>
+    <target name="uitest" depends="run-filesystem-UI-tests-derby,run-rss-UI-tests-derby"/>
     
     <target name="all" depends="build,javadoc,doc,image,test-dr,test-hs"/>
 

Modified: incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/BaseUIDerby.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/BaseUIDerby.java?rev=1226576&r1=1226575&r2=1226576&view=diff
==============================================================================
--- incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/BaseUIDerby.java
(original)
+++ incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/BaseUIDerby.java
Mon Jan  2 23:35:41 2012
@@ -27,8 +27,6 @@ import java.io.*;
 import java.util.*;
 import org.junit.*;
 
-import org.apache.manifoldcf.core.tests.HTMLTester;
-
 /** Tests that run the "agents daemon" should be derived from this */
 public class BaseUIDerby extends org.apache.manifoldcf.crawler.tests.ConnectorBaseUIDerby
 {

Modified: incubator/lcf/trunk/tests/rss/src/test/java/org/apache/manifoldcf/rss_tests/BaseDerby.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/tests/rss/src/test/java/org/apache/manifoldcf/rss_tests/BaseDerby.java?rev=1226576&r1=1226575&r2=1226576&view=diff
==============================================================================
--- incubator/lcf/trunk/tests/rss/src/test/java/org/apache/manifoldcf/rss_tests/BaseDerby.java
(original)
+++ incubator/lcf/trunk/tests/rss/src/test/java/org/apache/manifoldcf/rss_tests/BaseDerby.java
Mon Jan  2 23:35:41 2012
@@ -32,7 +32,7 @@ public class BaseDerby extends org.apach
 {
   protected String[] getConnectorNames()
   {
-    return new String[]{"File Connector"};
+    return new String[]{"RSS Connector"};
   }
   
   protected String[] getConnectorClasses()

Added: incubator/lcf/trunk/tests/rss/src/test/java/org/apache/manifoldcf/rss_tests/BaseUIDerby.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/tests/rss/src/test/java/org/apache/manifoldcf/rss_tests/BaseUIDerby.java?rev=1226576&view=auto
==============================================================================
--- incubator/lcf/trunk/tests/rss/src/test/java/org/apache/manifoldcf/rss_tests/BaseUIDerby.java
(added)
+++ incubator/lcf/trunk/tests/rss/src/test/java/org/apache/manifoldcf/rss_tests/BaseUIDerby.java
Mon Jan  2 23:35:41 2012
@@ -0,0 +1,53 @@
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.apache.manifoldcf.rss_tests;
+
+import org.apache.manifoldcf.core.interfaces.*;
+import org.apache.manifoldcf.agents.interfaces.*;
+import org.apache.manifoldcf.crawler.interfaces.*;
+import org.apache.manifoldcf.crawler.system.ManifoldCF;
+
+import java.io.*;
+import java.util.*;
+import org.junit.*;
+
+/** Tests that run the "agents daemon" should be derived from this */
+public class BaseUIDerby extends org.apache.manifoldcf.crawler.tests.ConnectorBaseUIDerby
+{
+  protected String[] getConnectorNames()
+  {
+    return new String[]{"RSS Connector"};
+  }
+  
+  protected String[] getConnectorClasses()
+  {
+    return new String[]{"org.apache.manifoldcf.crawler.connectors.rss.RSSConnector"};
+  }
+  
+  protected String[] getOutputNames()
+  {
+    return new String[]{"Null Output"};
+  }
+  
+  protected String[] getOutputClasses()
+  {
+    return new String[]{"org.apache.manifoldcf.agents.output.nullconnector.NullConnector"};
+  }
+
+}

Propchange: incubator/lcf/trunk/tests/rss/src/test/java/org/apache/manifoldcf/rss_tests/BaseUIDerby.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/trunk/tests/rss/src/test/java/org/apache/manifoldcf/rss_tests/BaseUIDerby.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: incubator/lcf/trunk/tests/rss/src/test/java/org/apache/manifoldcf/rss_tests/NavigationDerbyUI.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/tests/rss/src/test/java/org/apache/manifoldcf/rss_tests/NavigationDerbyUI.java?rev=1226576&view=auto
==============================================================================
--- incubator/lcf/trunk/tests/rss/src/test/java/org/apache/manifoldcf/rss_tests/NavigationDerbyUI.java
(added)
+++ incubator/lcf/trunk/tests/rss/src/test/java/org/apache/manifoldcf/rss_tests/NavigationDerbyUI.java
Mon Jan  2 23:35:41 2012
@@ -0,0 +1,265 @@
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.apache.manifoldcf.rss_tests;
+
+import org.apache.manifoldcf.core.interfaces.*;
+import org.apache.manifoldcf.agents.interfaces.*;
+import org.apache.manifoldcf.crawler.interfaces.*;
+import org.apache.manifoldcf.crawler.system.ManifoldCF;
+
+import java.io.*;
+import java.util.*;
+import org.junit.*;
+
+import org.apache.manifoldcf.core.tests.HTMLTester;
+
+/** Basic UI navigation tests */
+public class NavigationDerbyUI extends BaseUIDerby
+{
+
+  @Test
+  public void createConnectionsAndJob()
+    throws Exception
+  {
+    testerInstance.newTest(Locale.US);
+    
+    HTMLTester.Window window;
+    HTMLTester.Link link;
+    HTMLTester.Form form;
+    HTMLTester.Textarea textarea;
+    HTMLTester.Selectbox selectbox;
+    HTMLTester.Button button;
+    HTMLTester.Radiobutton radiobutton;
+    HTMLTester.Loop loop;
+    
+    window = testerInstance.openMainWindow("http://localhost:8346/mcf-crawler-ui/index.jsp");
+    
+    // Define an output connection via the UI
+    link = window.findLink(testerInstance.createStringDescription("List output connections"));
+    link.click();
+    window = testerInstance.findWindow(null);
+    link = window.findLink(testerInstance.createStringDescription("Add an output connection"));
+    link.click();
+    // Fill in a name
+    window = testerInstance.findWindow(null);
+    form = window.findForm(testerInstance.createStringDescription("editconnection"));
+    textarea = form.findTextarea(testerInstance.createStringDescription("connname"));
+    textarea.setValue(testerInstance.createStringDescription("MyOutputConnection"));
+    link = window.findLink(testerInstance.createStringDescription("Type tab"));
+    link.click();
+    // Select a type
+    window = testerInstance.findWindow(null);
+    form = window.findForm(testerInstance.createStringDescription("editconnection"));
+    selectbox = form.findSelectbox(testerInstance.createStringDescription("classname"));
+    selectbox.selectValue(testerInstance.createStringDescription("org.apache.manifoldcf.agents.output.nullconnector.NullConnector"));
+    button = window.findButton(testerInstance.createStringDescription("Continue to next page"));
+    button.click();
+    // Visit the Throttling tab
+    window = testerInstance.findWindow(null);
+    link = window.findLink(testerInstance.createStringDescription("Throttling tab"));
+    link.click();
+    // Go back to the Name tab
+    window = testerInstance.findWindow(null);
+    link = window.findLink(testerInstance.createStringDescription("Name tab"));
+    link.click();
+    // Now save the connection.
+    window = testerInstance.findWindow(null);
+    button = window.findButton(testerInstance.createStringDescription("Save this output connection"));
+    button.click();
+    
+    // Define a repository connection via the UI
+    window = testerInstance.findWindow(null);
+    link = window.findLink(testerInstance.createStringDescription("List repository connections"));
+    link.click();
+    window = testerInstance.findWindow(null);
+    link = window.findLink(testerInstance.createStringDescription("Add a connection"));
+    link.click();
+    // Fill in a name
+    window = testerInstance.findWindow(null);
+    form = window.findForm(testerInstance.createStringDescription("editconnection"));
+    textarea = form.findTextarea(testerInstance.createStringDescription("connname"));
+    textarea.setValue(testerInstance.createStringDescription("MyRepositoryConnection"));
+    link = window.findLink(testerInstance.createStringDescription("Type tab"));
+    link.click();
+    // Select a type
+    window = testerInstance.findWindow(null);
+    form = window.findForm(testerInstance.createStringDescription("editconnection"));
+    selectbox = form.findSelectbox(testerInstance.createStringDescription("classname"));
+    selectbox.selectValue(testerInstance.createStringDescription("org.apache.manifoldcf.crawler.connectors.rss.RSSConnector"));
+    button = window.findButton(testerInstance.createStringDescription("Continue to next page"));
+    button.click();
+    // Visit the Throttling tab
+    window = testerInstance.findWindow(null);
+    link = window.findLink(testerInstance.createStringDescription("Throttling tab"));
+    link.click();
+    // Visit the rest of the tabs - Email first
+    window = testerInstance.findWindow(null);
+    link = window.findLink(testerInstance.createStringDescription("Email tab"));
+    link.click();
+    window = testerInstance.findWindow(null);
+    form = window.findForm(testerInstance.createStringDescription("editconnection"));
+    textarea = form.findTextarea(testerInstance.createStringDescription("email"));
+    textarea.setValue(testerInstance.createStringDescription("foo@bar.com"));
+    // Robots
+    link = window.findLink(testerInstance.createStringDescription("Robots tab"));
+    link.click();
+    window = testerInstance.findWindow(null);
+    form = window.findForm(testerInstance.createStringDescription("editconnection"));
+    selectbox = form.findSelectbox(testerInstance.createStringDescription("robotsusage"));
+    selectbox.selectValue(testerInstance.createStringDescription("none"));
+    // Bandwidth
+    link = window.findLink(testerInstance.createStringDescription("Bandwidth tab"));
+    link.click();
+    window = testerInstance.findWindow(null);
+    form = window.findForm(testerInstance.createStringDescription("editconnection"));
+    // Proxy
+    link = window.findLink(testerInstance.createStringDescription("Proxy tab"));
+    link.click();
+    window = testerInstance.findWindow(null);
+    form = window.findForm(testerInstance.createStringDescription("editconnection"));
+    // Go back to the Name tab
+    link = window.findLink(testerInstance.createStringDescription("Name tab"));
+    link.click();
+    // Now save the connection.
+    window = testerInstance.findWindow(null);
+    button = window.findButton(testerInstance.createStringDescription("Save this connection"));
+    button.click();
+    
+    // Create a job
+    window = testerInstance.findWindow(null);
+    link = window.findLink(testerInstance.createStringDescription("List jobs"));
+    link.click();
+    // Add a job
+    window = testerInstance.findWindow(null);
+    link = window.findLink(testerInstance.createStringDescription("Add a job"));
+    link.click();
+    // Fill in a name
+    window = testerInstance.findWindow(null);
+    form = window.findForm(testerInstance.createStringDescription("editjob"));
+    textarea = form.findTextarea(testerInstance.createStringDescription("description"));
+    textarea.setValue(testerInstance.createStringDescription("MyJob"));
+    link = window.findLink(testerInstance.createStringDescription("Connection tab"));
+    link.click();
+    // Select the connections
+    window = testerInstance.findWindow(null);
+    form = window.findForm(testerInstance.createStringDescription("editjob"));
+    selectbox = form.findSelectbox(testerInstance.createStringDescription("outputname"));
+    selectbox.selectValue(testerInstance.createStringDescription("MyOutputConnection"));
+    selectbox = form.findSelectbox(testerInstance.createStringDescription("connectionname"));
+    selectbox.selectValue(testerInstance.createStringDescription("MyRepositoryConnection"));
+    button = window.findButton(testerInstance.createStringDescription("Continue to next screen"));
+    button.click();
+    // Visit all the tabs.  Scheduling tab first
+    window = testerInstance.findWindow(null);
+    link = window.findLink(testerInstance.createStringDescription("Scheduling tab"));
+    link.click();
+    window = testerInstance.findWindow(null);
+    form = window.findForm(testerInstance.createStringDescription("editjob"));
+    selectbox = form.findSelectbox(testerInstance.createStringDescription("dayofweek"));
+    selectbox.selectValue(testerInstance.createStringDescription("0"));
+    selectbox = form.findSelectbox(testerInstance.createStringDescription("hourofday"));
+    selectbox.selectValue(testerInstance.createStringDescription("1"));
+    selectbox = form.findSelectbox(testerInstance.createStringDescription("minutesofhour"));
+    selectbox.selectValue(testerInstance.createStringDescription("30"));
+    selectbox = form.findSelectbox(testerInstance.createStringDescription("monthofyear"));
+    selectbox.selectValue(testerInstance.createStringDescription("11"));
+    selectbox = form.findSelectbox(testerInstance.createStringDescription("dayofmonth"));
+    selectbox.selectValue(testerInstance.createStringDescription("none"));
+    textarea = form.findTextarea(testerInstance.createStringDescription("duration"));
+    textarea.setValue(testerInstance.createStringDescription("120"));
+    button = window.findButton(testerInstance.createStringDescription("Add new schedule record"));
+    button.click();
+    window = testerInstance.findWindow(null);
+    // URLs tab
+    link = window.findLink(testerInstance.createStringDescription("URLs 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"));
+    // Canonicalization tab
+    link = window.findLink(testerInstance.createStringDescription("Canonicalization tab"));
+    link.click();
+    window = testerInstance.findWindow(null);
+    button = window.findButton(testerInstance.createStringDescription("Add url regexp"));
+    button.click();
+    window = testerInstance.findWindow(null);
+    // URL Mappings tab
+    link = window.findLink(testerInstance.createStringDescription("URL Mappings tab"));
+    link.click();
+    window = testerInstance.findWindow(null);
+    // Time Values tab
+    link = window.findLink(testerInstance.createStringDescription("Time Values tab"));
+    link.click();
+    window = testerInstance.findWindow(null);
+    // Security tab
+    link = window.findLink(testerInstance.createStringDescription("Security tab"));
+    link.click();
+    window = testerInstance.findWindow(null);
+    // Metadata tab
+    link = window.findLink(testerInstance.createStringDescription("Metadata tab"));
+    link.click();
+    window = testerInstance.findWindow(null);
+    // Dechromed Content tab
+    link = window.findLink(testerInstance.createStringDescription("Dechromed Content tab"));
+    link.click();
+    window = testerInstance.findWindow(null);
+
+    // Save the job
+    button = window.findButton(testerInstance.createStringDescription("Save this job"));
+    button.click();
+
+    // Delete the job
+    window = testerInstance.findWindow(null);
+    HTMLTester.StringDescription jobID = window.findMatch(testerInstance.createStringDescription("<!--jobid=(.*?)-->"),0);
+    testerInstance.printValue(jobID);
+    link = window.findLink(testerInstance.createStringDescription("Delete this job"));
+    link.click();
+    
+    // Wait for the job to go away
+    loop = testerInstance.beginLoop(120);
+    window = testerInstance.findWindow(null);
+    link = window.findLink(testerInstance.createStringDescription("Manage jobs"));
+    link.click();
+    window = testerInstance.findWindow(null);
+    HTMLTester.StringDescription isJobNotPresent = window.isNotPresent(jobID);
+    testerInstance.printValue(isJobNotPresent);
+    loop.breakWhenTrue(isJobNotPresent);
+    loop.endLoop();
+    
+    // Delete the repository connection
+    window = testerInstance.findWindow(null);
+    link = window.findLink(testerInstance.createStringDescription("List repository connections"));
+    link.click();
+    window = testerInstance.findWindow(null);
+    link = window.findLink(testerInstance.createStringDescription("Delete MyRepositoryConnection"));
+    link.click();
+    
+    // Delete the output connection
+    window = testerInstance.findWindow(null);
+    link = window.findLink(testerInstance.createStringDescription("List output connections"));
+    link.click();
+    window = testerInstance.findWindow(null);
+    link = window.findLink(testerInstance.createStringDescription("Delete MyOutputConnection"));
+    link.click();
+    
+    testerInstance.executeTest();
+  }
+  
+}

Propchange: incubator/lcf/trunk/tests/rss/src/test/java/org/apache/manifoldcf/rss_tests/NavigationDerbyUI.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/trunk/tests/rss/src/test/java/org/apache/manifoldcf/rss_tests/NavigationDerbyUI.java
------------------------------------------------------------------------------
    svn:keywords = Id



Mime
View raw message