incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1225244 - in /incubator/lcf/trunk: ./ framework/core/src/test/java/org/apache/manifoldcf/core/tests/ framework/core/src/test/resource/org/apache/manifoldcf/core/tests/ framework/crawler-ui/src/main/webapp/ tests/filesystem/src/test/java/or...
Date Wed, 28 Dec 2011 17:34:27 GMT
Author: kwright
Date: Wed Dec 28 17:34:27 2011
New Revision: 1225244

URL: http://svn.apache.org/viewvc?rev=1225244&view=rev
Log:
First run browser test (already detected a bug!).  Part of CONNECTORS-339.

Added:
    incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/BaseDerby.java
      - copied, changed from r1225189, incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/Base.java
    incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/BaseUIDerby.java
  (with props)
    incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/NavigationUI.java
  (with props)
Removed:
    incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/Base.java
Modified:
    incubator/lcf/trunk/build.xml
    incubator/lcf/trunk/framework/core/src/test/java/org/apache/manifoldcf/core/tests/HTMLTester.java
    incubator/lcf/trunk/framework/core/src/test/resource/org/apache/manifoldcf/core/tests/VirtualBrowser.py
    incubator/lcf/trunk/framework/crawler-ui/src/main/webapp/navigation.jsp
    incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/APISanityIT.java
    incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/ExpirationIT.java
    incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/HopcountIT.java
    incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/SanityIT.java

Modified: incubator/lcf/trunk/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/build.xml?rev=1225244&r1=1225243&r2=1225244&view=diff
==============================================================================
--- incubator/lcf/trunk/build.xml (original)
+++ incubator/lcf/trunk/build.xml Wed Dec 28 17:34:27 2011
@@ -2401,6 +2401,40 @@
         </junit>
     </target>
 
+    <target name="run-filesystem-UI-tests-derby" depends="compile-filesystem-tests,calculate-filesystem-tests-condition"
if="filesystem-tests.include">
+        <mkdir dir="test-output/filesystem"/>
+        <junit fork="true" maxmemory="128m" dir="test-output/filesystem" 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/filesystem/build/jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/filesystem/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/filesystem-tests/classes"/>
+            </classpath>
+            <formatter type="brief" usefile="false"/>
+
+            <test name="org.apache.manifoldcf.filesystem_tests.NavigationUI" todir="test-output/filesystem"/>
+            <!-- MHL -->
+        </junit>
+    </target>
+
     <target name="run-filesystem-loadtests-derby" depends="compile-filesystem-loadtests,calculate-filesystem-tests-condition"
if="filesystem-tests.include">
         <mkdir dir="test-output/filesystem"/>
         <junit fork="true" maxmemory="256m" dir="test-output/filesystem" outputtoformatters="true"
showoutput="true" haltonfailure="true">

Modified: incubator/lcf/trunk/framework/core/src/test/java/org/apache/manifoldcf/core/tests/HTMLTester.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/core/src/test/java/org/apache/manifoldcf/core/tests/HTMLTester.java?rev=1225244&r1=1225243&r2=1225244&view=diff
==============================================================================
--- incubator/lcf/trunk/framework/core/src/test/java/org/apache/manifoldcf/core/tests/HTMLTester.java
(original)
+++ incubator/lcf/trunk/framework/core/src/test/java/org/apache/manifoldcf/core/tests/HTMLTester.java
Wed Dec 28 17:34:27 2011
@@ -223,7 +223,10 @@ public class HTMLTester
     throws Exception
   {
     String windowVar = getNextVariableName();
-    emitLine(windowVar + " = " + virtualBrowserVarName + ".find_window("+windowName.getVarName()+")");
+    if (windowName != null)
+      emitLine(windowVar + " = " + virtualBrowserVarName + ".find_window("+windowName.getVarName()+")");
+    else
+      emitLine(windowVar + " = " + virtualBrowserVarName + ".find_window("+quotePythonString("")+")");
     return new Window(windowVar);
   }
 

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=1225244&r1=1225243&r2=1225244&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
Wed Dec 28 17:34:27 2011
@@ -23,6 +23,7 @@ import HTMLParser
 import base64
 import re
 import os
+import sys
 
 # Class that describes answers to pop-up dialog boxes that may occur as a result of clicking
a link
 # or button.  If the answer is not found, this is considered a test error, and an exception
is thrown!
@@ -1060,7 +1061,7 @@ class VirtualBrowser:
 
     # Read a url with get.  Returns the data as a string.
     def fetch_data_with_get( self, url ):
-        print "Getting url '%s'..." % url
+        print >> sys.stderr, "Getting url '%s'..." % url
         req = urllib2.Request( url )
         if self.username != None:
             base64string = base64.encodestring('%s:%s' % (self.username, self.password))[:-1]

Modified: incubator/lcf/trunk/framework/crawler-ui/src/main/webapp/navigation.jsp
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/crawler-ui/src/main/webapp/navigation.jsp?rev=1225244&r1=1225243&r2=1225244&view=diff
==============================================================================
--- incubator/lcf/trunk/framework/crawler-ui/src/main/webapp/navigation.jsp (original)
+++ incubator/lcf/trunk/framework/crawler-ui/src/main/webapp/navigation.jsp Wed Dec 28 17:34:27
2011
@@ -31,7 +31,7 @@
 <p class="menumain"><nobr><%=Messages.getString(pageContext.getRequest().getLocale(),"navigation.Outputs")%></nobr></p>
 <ul class="menusecond">
 	<li class="menuitem">
-		<nobr><a class="menulink" href="listoutputs.jsp" alt="List authorities"><%=Messages.getString(pageContext.getRequest().getLocale(),"navigation.ListOutputConnections")%></a></nobr>
+		<nobr><a class="menulink" href="listoutputs.jsp" alt="List output connections"><%=Messages.getString(pageContext.getRequest().getLocale(),"navigation.ListOutputConnections")%></a></nobr>
 	</li>
 </ul>
 <p class="menumain"><nobr><%=Messages.getString(pageContext.getRequest().getLocale(),"navigation.Authorities")%></nobr></p>
@@ -69,10 +69,8 @@
 	<li class="menuitem">
 		<nobr><a class="menulink" href="simplereport.jsp" alt="Simple history"><%=Messages.getString(pageContext.getRequest().getLocale(),"navigation.SimpleHistory")%></a></nobr>
 	</li>
-<!-- hozawa
 	<li class="menuitem">
 		<nobr><a class="menulink" href="maxactivityreport.jsp" alt="Maximum activity"><%=Messages.getString(pageContext.getRequest().getLocale(),"navigation.MaximumActivity")%></a></nobr>
-//-->
 	</li>
 	<li class="menuitem">
 		<nobr><a class="menulink" href="maxbandwidthreport.jsp" alt="Maximum bandwidth"><%=Messages.getString(pageContext.getRequest().getLocale(),"navigation.MaximumBandwidth")%></a></nobr>

Modified: incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/APISanityIT.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/APISanityIT.java?rev=1225244&r1=1225243&r2=1225244&view=diff
==============================================================================
--- incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/APISanityIT.java
(original)
+++ incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/APISanityIT.java
Wed Dec 28 17:34:27 2011
@@ -28,7 +28,7 @@ import java.util.*;
 import org.junit.*;
 
 /** This is a very basic sanity check */
-public class APISanityIT extends Base
+public class APISanityIT extends BaseDerby
 {
   
   @Before

Copied: incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/BaseDerby.java
(from r1225189, incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/Base.java)
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/BaseDerby.java?p2=incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/BaseDerby.java&p1=incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/Base.java&r1=1225189&r2=1225244&rev=1225244&view=diff
==============================================================================
--- incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/Base.java
(original)
+++ incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/BaseDerby.java
Wed Dec 28 17:34:27 2011
@@ -39,7 +39,7 @@ import org.apache.commons.httpclient.*;
 import org.apache.commons.httpclient.methods.*;
 
 /** Tests that run the "agents daemon" should be derived from this */
-public class Base extends org.apache.manifoldcf.crawler.tests.ConnectorBase
+public class BaseDerby extends org.apache.manifoldcf.crawler.tests.ConnectorBase
 {
   public static final String agentShutdownSignal = "agent-process";
   public static final int testPort = 8346;

Added: 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=1225244&view=auto
==============================================================================
--- incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/BaseUIDerby.java
(added)
+++ incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/BaseUIDerby.java
Wed Dec 28 17:34:27 2011
@@ -0,0 +1,55 @@
+/* $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.filesystem_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;
+
+/** Tests that run the "agents daemon" should be derived from this */
+public class BaseUIDerby extends BaseDerby
+{
+  protected HTMLTester testerInstance = null;
+  
+  @Before
+  public void setupHTMLTester()
+    throws Exception
+  {
+    testerInstance = new HTMLTester();
+    testerInstance.setup();
+  }
+  
+  @After
+  public void teardownHTMLTester()
+    throws Exception
+  {
+    if (testerInstance != null)
+    {
+      testerInstance.teardown();
+      testerInstance = null;
+    }
+  }
+}

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

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

Modified: incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/ExpirationIT.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/ExpirationIT.java?rev=1225244&r1=1225243&r2=1225244&view=diff
==============================================================================
--- incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/ExpirationIT.java
(original)
+++ incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/ExpirationIT.java
Wed Dec 28 17:34:27 2011
@@ -28,7 +28,7 @@ import java.util.*;
 import org.junit.*;
 
 /** This is a test which checks to see if document expiration works properly. */
-public class ExpirationIT extends Base
+public class ExpirationIT extends BaseDerby
 {
   
   @Before

Modified: incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/HopcountIT.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/HopcountIT.java?rev=1225244&r1=1225243&r2=1225244&view=diff
==============================================================================
--- incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/HopcountIT.java
(original)
+++ incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/HopcountIT.java
Wed Dec 28 17:34:27 2011
@@ -28,7 +28,7 @@ import java.util.*;
 import org.junit.*;
 
 /** This is a test which checks to be sure hopcount functionality is working properly. */
-public class HopcountIT extends Base
+public class HopcountIT extends BaseDerby
 {
   
   @Before

Added: incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/NavigationUI.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/NavigationUI.java?rev=1225244&view=auto
==============================================================================
--- incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/NavigationUI.java
(added)
+++ incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/NavigationUI.java
Wed Dec 28 17:34:27 2011
@@ -0,0 +1,55 @@
+/* $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.filesystem_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 NavigationUI extends BaseUIDerby
+{
+
+  @Test
+  public void createConnectionsAndJob()
+    throws Exception
+  {
+    testerInstance.newTest();
+    HTMLTester.Window window;
+    HTMLTester.Link link;
+    window = testerInstance.openMainWindow("http://localhost:8346/mcf-crawler-ui/index.jsp",Locale.US);
+    // 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();
+    window = testerInstance.findWindow(null);
+    
+    testerInstance.executeTest();
+  }
+  
+}

Propchange: incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/NavigationUI.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/NavigationUI.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/SanityIT.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/SanityIT.java?rev=1225244&r1=1225243&r2=1225244&view=diff
==============================================================================
--- incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/SanityIT.java
(original)
+++ incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/SanityIT.java
Wed Dec 28 17:34:27 2011
@@ -28,7 +28,7 @@ import java.util.*;
 import org.junit.*;
 
 /** This is a very basic sanity check */
-public class SanityIT extends Base
+public class SanityIT extends BaseDerby
 {
   
   @Before



Mime
View raw message