incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1228004 - in /incubator/lcf/trunk/tests/wiki/src/test: java/org/apache/manifoldcf/wiki_tests/ resource/org/apache/manifoldcf/wiki_tests/
Date Fri, 06 Jan 2012 07:41:57 GMT
Author: kwright
Date: Fri Jan  6 07:41:56 2012
New Revision: 1228004

URL: http://svn.apache.org/viewvc?rev=1228004&view=rev
Log:
Complete wiki UI test.  Part of CONNECTORS-339.

Added:
    incubator/lcf/trunk/tests/wiki/src/test/resource/org/apache/manifoldcf/wiki_tests/get_namespaces.xml
  (with props)
Modified:
    incubator/lcf/trunk/tests/wiki/src/test/java/org/apache/manifoldcf/wiki_tests/MockWikiService.java
    incubator/lcf/trunk/tests/wiki/src/test/java/org/apache/manifoldcf/wiki_tests/NavigationDerbyUI.java
    incubator/lcf/trunk/tests/wiki/src/test/java/org/apache/manifoldcf/wiki_tests/SanityDerbyIT.java

Modified: incubator/lcf/trunk/tests/wiki/src/test/java/org/apache/manifoldcf/wiki_tests/MockWikiService.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/tests/wiki/src/test/java/org/apache/manifoldcf/wiki_tests/MockWikiService.java?rev=1228004&r1=1228003&r2=1228004&view=diff
==============================================================================
--- incubator/lcf/trunk/tests/wiki/src/test/java/org/apache/manifoldcf/wiki_tests/MockWikiService.java
(original)
+++ incubator/lcf/trunk/tests/wiki/src/test/java/org/apache/manifoldcf/wiki_tests/MockWikiService.java
Fri Jan  6 07:41:56 2012
@@ -57,9 +57,10 @@ public class MockWikiService
     Map<String,String> listResources,
     Map<String,String> timestampQueryResources,
     Map<String,String> urlQueryResources,
-    Map<String,String> docInfoQueryResources)
+    Map<String,String> docInfoQueryResources,
+    String namespaceResource)
   {
-    servlet.setResources(checkResources,listResources,timestampQueryResources,urlQueryResources,docInfoQueryResources);
+    servlet.setResources(checkResources,listResources,timestampQueryResources,urlQueryResources,docInfoQueryResources,namespaceResource);
   }
   
   protected static String sortStuff(String input)
@@ -85,6 +86,7 @@ public class MockWikiService
     protected Map<String,String> timestampQueryResources = null;
     protected Map<String,String> urlQueryResources = null;
     protected Map<String,String> docInfoQueryResources = null;
+    protected String namespaceResource = null;
     
     public WikiAPIServlet(Class theResourceClass)
     {
@@ -95,13 +97,15 @@ public class MockWikiService
       Map<String,String> listResources,
       Map<String,String> timestampQueryResources,
       Map<String,String> urlQueryResources,
-      Map<String,String> docInfoQueryResources)
+      Map<String,String> docInfoQueryResources,
+      String namespaceResource)
     {
       this.checkResources = checkResources;
       this.listResources = listResources;
       this.timestampQueryResources = timestampQueryResources;
       this.urlQueryResources = urlQueryResources;
       this.docInfoQueryResources = docInfoQueryResources;
+      this.namespaceResource = namespaceResource;
     }
     
     @Override
@@ -118,12 +122,11 @@ public class MockWikiService
         throw new IOException("Action parameter incorrect: "+action);
       String list = req.getParameter("list");
       String prop = req.getParameter("prop");
-      if (prop == null && list == null)
-        throw new IOException("Must have either prop or list");
-      if (prop != null && list != null)
-        throw new IOException("Cannot have both prop and list");
+      String siprop = req.getParameter("siprop");
       if (prop != null)
       {
+	if (siprop != null || list != null)
+	  throw new IOException("Cannot have both prop and list or siprop");
         String pageIds = req.getParameter("pageids");
         if (prop.equals("revisions"))
         {
@@ -172,6 +175,8 @@ public class MockWikiService
       }
       else if (list != null)
       {
+	if (prop != null || siprop != null)
+	  throw new IOException("Cannot have both list and prop or siprop");
         if (!list.equals("allpages"))
           throw new IOException("List parameter incorrect: "+list);
         String apfrom = req.getParameter("apfrom");
@@ -189,6 +194,15 @@ public class MockWikiService
           throw new IOException("Could not find a matching resource for the list parameters;
apfrom = '"+apfrom+"'");
 
       }
+      else if (siprop != null)
+      {
+	if (prop != null || list != null)
+	  throw new IOException("Cannot have both siprop and list or prop");
+	String meta = req.getParameter("meta");
+	if (meta == null || !meta.equals("siteinfo"))
+	  throw new IOException("meta parameter missing or incorrect");
+	resourceName = namespaceResource;
+      }
 
       // Select the resource
       if (resourceName == null)

Modified: incubator/lcf/trunk/tests/wiki/src/test/java/org/apache/manifoldcf/wiki_tests/NavigationDerbyUI.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/tests/wiki/src/test/java/org/apache/manifoldcf/wiki_tests/NavigationDerbyUI.java?rev=1228004&r1=1228003&r2=1228004&view=diff
==============================================================================
--- incubator/lcf/trunk/tests/wiki/src/test/java/org/apache/manifoldcf/wiki_tests/NavigationDerbyUI.java
(original)
+++ incubator/lcf/trunk/tests/wiki/src/test/java/org/apache/manifoldcf/wiki_tests/NavigationDerbyUI.java
Fri Jan  6 07:41:56 2012
@@ -38,7 +38,8 @@ public class NavigationDerbyUI extends B
   protected static Map<String,String> initialTimestampQueryResources;
   protected static Map<String,String> initialURLQueryResources;
   protected static Map<String,String> initialDocInfoQueryResources;
-  
+  protected static final String namespaceResource = "get_namespaces.xml";
+
   static
   {
     initialCheckResources = new HashMap<String,String>();
@@ -62,7 +63,8 @@ public class NavigationDerbyUI extends B
       initialListResources,
       initialTimestampQueryResources,
       initialURLQueryResources,
-      initialDocInfoQueryResources);
+      initialDocInfoQueryResources,
+      namespaceResource);
 
     testerInstance.newTest(Locale.US);
     
@@ -203,8 +205,16 @@ public class NavigationDerbyUI extends B
     button = window.findButton(testerInstance.createStringDescription("Add new schedule record"));
     button.click();
     window = testerInstance.findWindow(null);
-    // MHL for the wiki job tabs
-    
+    // The Namespace and Titles tab
+    link = window.findLink(testerInstance.createStringDescription("Namespace and Titles tab"));
+    link.click();
+    window = testerInstance.findWindow(null);
+    form = window.findForm(testerInstance.createStringDescription("editjob"));
+    // Look for the 'add' button
+    button = window.findButton(testerInstance.createStringDescription("Add namespace/prefix"));
+    button.click();
+    window = testerInstance.findWindow(null);
+
     // Save the job
     button = window.findButton(testerInstance.createStringDescription("Save this job"));
     button.click();

Modified: incubator/lcf/trunk/tests/wiki/src/test/java/org/apache/manifoldcf/wiki_tests/SanityDerbyIT.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/tests/wiki/src/test/java/org/apache/manifoldcf/wiki_tests/SanityDerbyIT.java?rev=1228004&r1=1228003&r2=1228004&view=diff
==============================================================================
--- incubator/lcf/trunk/tests/wiki/src/test/java/org/apache/manifoldcf/wiki_tests/SanityDerbyIT.java
(original)
+++ incubator/lcf/trunk/tests/wiki/src/test/java/org/apache/manifoldcf/wiki_tests/SanityDerbyIT.java
Fri Jan  6 07:41:56 2012
@@ -37,7 +37,7 @@ public class SanityDerbyIT extends BaseD
   protected static Map<String,String> initialTimestampQueryResources;
   protected static Map<String,String> initialURLQueryResources;
   protected static Map<String,String> initialDocInfoQueryResources;
-  
+  protected static final String namespaceResource = "get_namespaces.xml";
   static
   {
     initialCheckResources = new HashMap<String,String>();
@@ -184,7 +184,8 @@ public class SanityDerbyIT extends BaseD
         initialListResources,
         initialTimestampQueryResources,
         initialURLQueryResources,
-        initialDocInfoQueryResources);
+        initialDocInfoQueryResources,
+	namespaceResource);
         
       // Now, start the job, and wait until it completes.
       jobManager.manualStart(job.getID());

Added: incubator/lcf/trunk/tests/wiki/src/test/resource/org/apache/manifoldcf/wiki_tests/get_namespaces.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/tests/wiki/src/test/resource/org/apache/manifoldcf/wiki_tests/get_namespaces.xml?rev=1228004&view=auto
==============================================================================
--- incubator/lcf/trunk/tests/wiki/src/test/resource/org/apache/manifoldcf/wiki_tests/get_namespaces.xml
(added)
+++ incubator/lcf/trunk/tests/wiki/src/test/resource/org/apache/manifoldcf/wiki_tests/get_namespaces.xml
Fri Jan  6 07:41:56 2012
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<!--
+ 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.
+-->
+
+<api>
+  <query>
+    <namespaces>
+      <ns id="-2" case="first-letter" canonical="Media" xml:space="preserve">Media</ns>
+      <ns id="-1" case="first-letter" canonical="Special" xml:space="preserve">Special</ns>
+      <ns id="0" case="first-letter" subpages="" content="" xml:space="preserve" />
+      <ns id="1" case="first-letter" subpages="" canonical="Talk" xml:space="preserve">Talk</ns>
+      <ns id="2" case="first-letter" subpages="" canonical="User" xml:space="preserve">User</ns>
+      <ns id="90" case="first-letter" canonical="Thread" xml:space="preserve">Thread</ns>
+      <ns id="91" case="first-letter" canonical="Thread talk" xml:space="preserve">Thread
talk</ns>
+    </namespaces>
+  </query>
+</api>

Propchange: incubator/lcf/trunk/tests/wiki/src/test/resource/org/apache/manifoldcf/wiki_tests/get_namespaces.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/trunk/tests/wiki/src/test/resource/org/apache/manifoldcf/wiki_tests/get_namespaces.xml
------------------------------------------------------------------------------
    svn:keywords = Id



Mime
View raw message