incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1228764 - in /incubator/lcf/trunk: ./ tests/activedirectory/ tests/activedirectory/src/ tests/activedirectory/src/test/ tests/activedirectory/src/test/java/ tests/activedirectory/src/test/java/org/ tests/activedirectory/src/test/java/org/a...
Date Sun, 08 Jan 2012 01:30:49 GMT
Author: kwright
Date: Sun Jan  8 01:30:49 2012
New Revision: 1228764

URL: http://svn.apache.org/viewvc?rev=1228764&view=rev
Log:
Add active directory UI test.  Part of CONNECTORS-339.

Added:
    incubator/lcf/trunk/tests/activedirectory/
    incubator/lcf/trunk/tests/activedirectory/src/
    incubator/lcf/trunk/tests/activedirectory/src/test/
    incubator/lcf/trunk/tests/activedirectory/src/test/java/
    incubator/lcf/trunk/tests/activedirectory/src/test/java/org/
    incubator/lcf/trunk/tests/activedirectory/src/test/java/org/apache/
    incubator/lcf/trunk/tests/activedirectory/src/test/java/org/apache/manifoldcf/
    incubator/lcf/trunk/tests/activedirectory/src/test/java/org/apache/manifoldcf/activedirectory_tests/
    incubator/lcf/trunk/tests/activedirectory/src/test/java/org/apache/manifoldcf/activedirectory_tests/BaseUIDerby.java
  (with props)
    incubator/lcf/trunk/tests/activedirectory/src/test/java/org/apache/manifoldcf/activedirectory_tests/NavigationDerbyUI.java
  (with props)
Modified:
    incubator/lcf/trunk/build.xml

Modified: incubator/lcf/trunk/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/build.xml?rev=1228764&r1=1228763&r2=1228764&view=diff
==============================================================================
--- incubator/lcf/trunk/build.xml (original)
+++ incubator/lcf/trunk/build.xml Sun Jan  8 01:30:49 2012
@@ -1951,6 +1951,14 @@
       </condition>
     </target>
 
+    <target name="calculate-activedirectory-tests-condition" depends="calculate-activedirectory-condition">
+      <condition property="activedirectory-tests.include">
+        <and>
+            <isset property="activedirectory.include"/>
+        </and>
+      </condition>
+    </target>
+
     <target name="calculate-solr-tests-condition" depends="calculate-filesystem-condition,calculate-solr-condition">
       <condition property="solr-tests.include">
         <and>
@@ -2052,6 +2060,32 @@
         </javac>
     </target>
 
+    <target name="compile-activedirectory-tests" depends="build-framework,build-activedirectory-connector,calculate-activedirectory-tests-condition,build-tests-activedirectory-connector"
if="activedirectory-tests.include">
+        <mkdir dir="build/activedirectory-tests/classes"/>
+        <javac srcdir="tests/activedirectory/src/test/java" destdir="build/activedirectory-tests/classes"
target="1.5" source="1.5" debug="true" debuglevel="lines,vars,source">
+            <classpath>
+                 <fileset dir="framework/lib"> 
+                    <include name="*.jar"/> 
+                </fileset>
+                <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/activedirectory/build/jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/activedirectory/build/test-jar">
+		<include name="*.jar"/>
+	      </fileset>
+            </classpath>
+        </javac>
+    </target>
+
     <target name="compile-solr-tests" depends="build-framework,build-filesystem-connector,build-solr-connector,calculate-solr-tests-condition,build-tests-filesystem-connector,build-tests-solr-connector"
if="solr-tests.include">
         <mkdir dir="build/solr-tests/classes"/>
         <javac srcdir="tests/solr/src/test/java" destdir="build/solr-tests/classes" target="1.5"
source="1.5" debug="true" debuglevel="lines,vars,source">
@@ -2281,7 +2315,35 @@
             </classpath>
         </javac>
     </target>
-    
+
+    <target name="run-activedirectory-UI-tests-derby" depends="compile-activedirectory-tests,calculate-activedirectory-tests-condition"
if="activedirectory-tests.include">
+        <mkdir dir="test-derby-output/activedirectory"/>
+        <junit fork="true" maxmemory="128m" dir="test-derby-output/activedirectory" 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/activedirectory/build/jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/activedirectory/build/test-jar">
+		<include name="*.jar"/>
+	      </fileset>
+                <pathelement location="build/activedirectory-tests/classes"/>
+            </classpath>
+            <formatter type="brief" usefile="false"/>
+
+            <test name="org.apache.manifoldcf.activedirectory_tests.NavigationDerbyUI"
todir="test-derby-output/activedirectory"/>
+            <!-- MHL -->
+        </junit>
+    </target>
+
     <target name="run-filesystem-tests-derby" depends="compile-filesystem-tests,calculate-filesystem-tests-condition"
if="filesystem-tests.include">
         <mkdir dir="test-derby-output/filesystem"/>
         <junit fork="true" maxmemory="128m" dir="test-derby-output/filesystem" outputtoformatters="true"
showoutput="true" haltonfailure="true">
@@ -4223,7 +4285,7 @@
 
     <target name="ldtest" depends="load-dr,load-hs"/>
 
-    <target name="uitest" depends="run-filesystem-UI-tests-derby,run-rss-UI-tests-derby,run-webcrawler-UI-tests-derby,run-wiki-UI-tests-derby,run-solr-UI-tests-derby,run-cmis-UI-tests-derby"/>
+    <target name="uitest" depends="run-filesystem-UI-tests-derby,run-activedirectory-UI-tests-derby,run-rss-UI-tests-derby,run-webcrawler-UI-tests-derby,run-wiki-UI-tests-derby,run-solr-UI-tests-derby,run-cmis-UI-tests-derby"/>
     
     <target name="all" depends="build,javadoc,doc,image,test-dr,test-hs"/>
 

Added: incubator/lcf/trunk/tests/activedirectory/src/test/java/org/apache/manifoldcf/activedirectory_tests/BaseUIDerby.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/tests/activedirectory/src/test/java/org/apache/manifoldcf/activedirectory_tests/BaseUIDerby.java?rev=1228764&view=auto
==============================================================================
--- incubator/lcf/trunk/tests/activedirectory/src/test/java/org/apache/manifoldcf/activedirectory_tests/BaseUIDerby.java
(added)
+++ incubator/lcf/trunk/tests/activedirectory/src/test/java/org/apache/manifoldcf/activedirectory_tests/BaseUIDerby.java
Sun Jan  8 01:30:49 2012
@@ -0,0 +1,43 @@
+/* $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.activedirectory_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[] getAuthorityClasses()
+  {
+    return new String[]{"org.apache.manifoldcf.authorities.authorities.activedirectory.ActiveDirectoryAuthority"};
+  }
+  
+  protected String[] getAuthorityNames()
+  {
+    return new String[]{"AD authority"};
+  }
+
+}

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

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

Added: incubator/lcf/trunk/tests/activedirectory/src/test/java/org/apache/manifoldcf/activedirectory_tests/NavigationDerbyUI.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/tests/activedirectory/src/test/java/org/apache/manifoldcf/activedirectory_tests/NavigationDerbyUI.java?rev=1228764&view=auto
==============================================================================
--- incubator/lcf/trunk/tests/activedirectory/src/test/java/org/apache/manifoldcf/activedirectory_tests/NavigationDerbyUI.java
(added)
+++ incubator/lcf/trunk/tests/activedirectory/src/test/java/org/apache/manifoldcf/activedirectory_tests/NavigationDerbyUI.java
Sun Jan  8 01:30:49 2012
@@ -0,0 +1,106 @@
+/* $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.activedirectory_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 authority connection via the UI
+    window = testerInstance.findWindow(null);
+    link = window.findLink(testerInstance.createStringDescription("List authorities"));
+    link.click();
+    window = testerInstance.findWindow(null);
+    link = window.findLink(testerInstance.createStringDescription("Add a new 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("MyAuthorityConnection"));
+    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.authorities.authorities.activedirectory.ActiveDirectoryAuthority"));
+    button = window.findButton(testerInstance.createStringDescription("Continue to next page"));
+    button.click();
+    // Server tab
+    window = testerInstance.findWindow(null);
+    link = window.findLink(testerInstance.createStringDescription("Domain Controller tab"));
+    link.click();
+    window = testerInstance.findWindow(null);
+    form = window.findForm(testerInstance.createStringDescription("editconnection"));
+    textarea = form.findTextarea(testerInstance.createStringDescription("domaincontrollername"));
+    textarea.setValue(testerInstance.createStringDescription("localhost"));
+    textarea = form.findTextarea(testerInstance.createStringDescription("username"));
+    textarea.setValue(testerInstance.createStringDescription("foo"));
+    textarea = form.findTextarea(testerInstance.createStringDescription("authentication"));
+    textarea.setValue(testerInstance.createStringDescription("bar"));
+
+    // 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 authority
connection"));
+    button.click();
+
+    // Delete the authority connection
+    window = testerInstance.findWindow(null);
+    link = window.findLink(testerInstance.createStringDescription("List authorities"));
+    link.click();
+    window = testerInstance.findWindow(null);
+    link = window.findLink(testerInstance.createStringDescription("Delete MyAuthorityConnection"));
+    link.click();
+
+    testerInstance.executeTest();
+  }
+  
+}

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

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



Mime
View raw message