sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r653712 - in /incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver: ./ helper/
Date Tue, 06 May 2008 08:48:13 GMT
Author: bdelacretaz
Date: Tue May  6 01:48:12 2008
New Revision: 653712

URL: http://svn.apache.org/viewvc?rev=653712&view=rev
Log:
SLING-387 - more ScriptSelectionTest, and adapt imports to mocks moved to commons/testing

Modified:
    incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/SlingServletResolverTest.java
    incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/helper/LocationTestBase.java
    incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/helper/LocationUtilCreateLocationResourceTest.java
    incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/helper/LocationUtilGetServletsTest.java
    incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/helper/ScriptSelectionTest.java

Modified: incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/SlingServletResolverTest.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/SlingServletResolverTest.java?rev=653712&r1=653711&r2=653712&view=diff
==============================================================================
--- incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/SlingServletResolverTest.java
(original)
+++ incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/SlingServletResolverTest.java
Tue May  6 01:48:12 2008
@@ -49,8 +49,6 @@
 
     public static final String SERVLET_NAME = "TestServlet";
 
-    private static final String ROOT = "/";
-
     private static final String SERVLET_EXTENSION = "html";
 
     private MockResourceResolver mockResourceResolver;

Modified: incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/helper/LocationTestBase.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/helper/LocationTestBase.java?rev=653712&r1=653711&r2=653712&view=diff
==============================================================================
--- incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/helper/LocationTestBase.java
(original)
+++ incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/helper/LocationTestBase.java
Tue May  6 01:48:12 2008
@@ -20,10 +20,10 @@
 
 import junit.framework.TestCase;
 
+import org.apache.sling.commons.testing.sling.MockResource;
+import org.apache.sling.commons.testing.sling.MockResourceResolver;
+import org.apache.sling.commons.testing.sling.MockSlingHttpServletRequest;
 import org.apache.sling.jcr.resource.JcrResourceUtil;
-import org.apache.sling.servlet.resolver.mock.MockResource;
-import org.apache.sling.servlet.resolver.mock.MockResourceResolver;
-import org.apache.sling.servlet.resolver.mock.MockSlingHttpServletRequest;
 
 public abstract class LocationTestBase extends TestCase {
 

Modified: incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/helper/LocationUtilCreateLocationResourceTest.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/helper/LocationUtilCreateLocationResourceTest.java?rev=653712&r1=653711&r2=653712&view=diff
==============================================================================
--- incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/helper/LocationUtilCreateLocationResourceTest.java
(original)
+++ incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/helper/LocationUtilCreateLocationResourceTest.java
Tue May  6 01:48:12 2008
@@ -22,8 +22,8 @@
 
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.resource.Resource;
-import org.apache.sling.servlet.resolver.mock.MockResource;
-import org.apache.sling.servlet.resolver.mock.MockSlingHttpServletRequest;
+import org.apache.sling.commons.testing.sling.MockResource;
+import org.apache.sling.commons.testing.sling.MockSlingHttpServletRequest;
 
 public class LocationUtilCreateLocationResourceTest extends TestCase {
 

Modified: incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/helper/LocationUtilGetServletsTest.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/helper/LocationUtilGetServletsTest.java?rev=653712&r1=653711&r2=653712&view=diff
==============================================================================
--- incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/helper/LocationUtilGetServletsTest.java
(original)
+++ incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/helper/LocationUtilGetServletsTest.java
Tue May  6 01:48:12 2008
@@ -24,7 +24,7 @@
 import java.util.Map;
 
 import org.apache.sling.api.resource.ResourceUtil;
-import org.apache.sling.servlet.resolver.mock.MockResource;
+import org.apache.sling.commons.testing.sling.MockResource;
 
 public class LocationUtilGetServletsTest extends LocationTestBase {
 

Modified: incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/helper/ScriptSelectionTest.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/helper/ScriptSelectionTest.java?rev=653712&r1=653711&r2=653712&view=diff
==============================================================================
--- incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/helper/ScriptSelectionTest.java
(original)
+++ incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/helper/ScriptSelectionTest.java
Tue May  6 01:48:12 2008
@@ -20,8 +20,8 @@
 
 import java.util.Collection;
 
-import org.apache.sling.servlet.resolver.mock.MockResource;
-import org.apache.sling.servlet.resolver.mock.MockSlingHttpServletRequest;
+import org.apache.sling.commons.testing.sling.MockResource;
+import org.apache.sling.commons.testing.sling.MockSlingHttpServletRequest;
 
 /** Various tests that explain and demonstrate how scripts are 
  *  selected
@@ -152,4 +152,25 @@
     public void testHtmlPostSelectors() {
         assertScript("POST", "print.a4", "html", SET_A, "/apps/foo/bar/POST.esp");
     }
+    
+    public void testHtmlPostSelectorsAreIgnored() {
+        final String [] scripts = {
+                "/apps/foo/bar/print/POST.esp"
+        };
+        assertScript("POST", "print.a4", "html", scripts, null);
+    }
+    
+    public void testHtmlPostExtensionIsIgnored() {
+        final String [] scripts = {
+                "/apps/foo/bar/POST.html.esp"
+        };
+        assertScript("POST", "print.a4", "html", scripts, null);
+    }
+    
+    public void testHtmlPostCannotIncludeResourceType() {
+        final String [] scripts = {
+                "/apps/foo/bar/bar.POST.esp"
+        };
+        assertScript("POST", "print.a4", "html", scripts, null);
+    }
 }



Mime
View raw message