incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r587125 - in /incubator/sling/whiteboard/microsling/src: main/java/org/apache/sling/microsling/request/ main/java/org/apache/sling/microsling/request/helpers/ test/java/org/apache/sling/microsling/request/helpers/
Date Mon, 22 Oct 2007 15:08:01 GMT
Author: bdelacretaz
Date: Mon Oct 22 08:07:59 2007
New Revision: 587125

URL: http://svn.apache.org/viewvc?rev=587125&view=rev
Log:
SLING-60 : rename SlingRequestPathInfoParser to MicroslingRequestPathInfo: at the design level
we don't care that the class is a parser

Added:
    incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/request/helpers/MicroslingRequestPathInfo.java
      - copied, changed from r587123, incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/request/helpers/SlingRequestPathInfoParser.java
    incubator/sling/whiteboard/microsling/src/test/java/org/apache/sling/microsling/request/helpers/MicroslingRequestPathInfoTest.java
      - copied, changed from r587123, incubator/sling/whiteboard/microsling/src/test/java/org/apache/sling/microsling/request/helpers/SlingRequestPathInfoParserTest.java
Removed:
    incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/request/helpers/SlingRequestPathInfoParser.java
    incubator/sling/whiteboard/microsling/src/test/java/org/apache/sling/microsling/request/helpers/SlingRequestPathInfoParserTest.java
Modified:
    incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/request/MicroslingRequestContext.java

Modified: incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/request/MicroslingRequestContext.java
URL: http://svn.apache.org/viewvc/incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/request/MicroslingRequestContext.java?rev=587125&r1=587124&r2=587125&view=diff
==============================================================================
--- incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/request/MicroslingRequestContext.java
(original)
+++ incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/request/MicroslingRequestContext.java
Mon Oct 22 08:07:59 2007
@@ -33,7 +33,7 @@
 import org.apache.sling.microsling.api.exceptions.SlingException;
 import org.apache.sling.microsling.api.requestparams.RequestParameterMap;
 import org.apache.sling.microsling.request.helpers.SlingRequestParameterMap;
-import org.apache.sling.microsling.request.helpers.SlingRequestPathInfoParser;
+import org.apache.sling.microsling.request.helpers.MicroslingRequestPathInfo;
 
 /** Additional Request-based info used by for SlingServlets */
 public class MicroslingRequestContext implements SlingRequestContext {
@@ -43,7 +43,7 @@
     private final ServletContext servletContext;
     private final Repository repository;
     private Resource resource;
-    private SlingRequestPathInfoParser requestPathInfo;
+    private MicroslingRequestPathInfo requestPathInfo;
     private final HttpServletRequest request;
     private final ServiceLocator serviceLocator;
     private RequestParameterMap parameterMap;
@@ -112,7 +112,7 @@
                 // TODO bitten by my own "throws Exception" stuff here ;-)
                 // To fix this, using more specific Exceptions should help
             }
-            requestPathInfo = new SlingRequestPathInfoParser(resource,request.getPathInfo());
+            requestPathInfo = new MicroslingRequestPathInfo(resource,request.getPathInfo());
         }
         return requestPathInfo;
     }

Copied: incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/request/helpers/MicroslingRequestPathInfo.java
(from r587123, incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/request/helpers/SlingRequestPathInfoParser.java)
URL: http://svn.apache.org/viewvc/incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/request/helpers/MicroslingRequestPathInfo.java?p2=incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/request/helpers/MicroslingRequestPathInfo.java&p1=incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/request/helpers/SlingRequestPathInfoParser.java&r1=587123&r2=587125&rev=587125&view=diff
==============================================================================
--- incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/request/helpers/SlingRequestPathInfoParser.java
(original)
+++ incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/request/helpers/MicroslingRequestPathInfo.java
Mon Oct 22 08:07:59 2007
@@ -35,9 +35,9 @@
  *  not used to locate the Resource, and we split that part in different
  *  subparts: selectors, extension and suffix.
  *  
- *  @see SlingRequestPathInfoParserTest for a number of examples.
+ *  @see MicroslingRequestPathInfoTest for a number of examples.
  */
-public class SlingRequestPathInfoParser implements SlingRequestPathInfo {
+public class MicroslingRequestPathInfo implements SlingRequestPathInfo {
     
     private final String unusedContentPath;
     private final String selectorString;
@@ -68,7 +68,7 @@
     }
     
     /** break requestPath as required by SlingRequestPathInfo */
-    public SlingRequestPathInfoParser(Resource r,String requestPath) throws PatternSyntaxException
{
+    public MicroslingRequestPathInfo(Resource r,String requestPath) throws PatternSyntaxException
{
         if(parsingPatternException != null) {
             throw parsingPatternException;
         }

Copied: incubator/sling/whiteboard/microsling/src/test/java/org/apache/sling/microsling/request/helpers/MicroslingRequestPathInfoTest.java
(from r587123, incubator/sling/whiteboard/microsling/src/test/java/org/apache/sling/microsling/request/helpers/SlingRequestPathInfoParserTest.java)
URL: http://svn.apache.org/viewvc/incubator/sling/whiteboard/microsling/src/test/java/org/apache/sling/microsling/request/helpers/MicroslingRequestPathInfoTest.java?p2=incubator/sling/whiteboard/microsling/src/test/java/org/apache/sling/microsling/request/helpers/MicroslingRequestPathInfoTest.java&p1=incubator/sling/whiteboard/microsling/src/test/java/org/apache/sling/microsling/request/helpers/SlingRequestPathInfoParserTest.java&r1=587123&r2=587125&rev=587125&view=diff
==============================================================================
--- incubator/sling/whiteboard/microsling/src/test/java/org/apache/sling/microsling/request/helpers/SlingRequestPathInfoParserTest.java
(original)
+++ incubator/sling/whiteboard/microsling/src/test/java/org/apache/sling/microsling/request/helpers/MicroslingRequestPathInfoTest.java
Mon Oct 22 08:07:59 2007
@@ -24,8 +24,8 @@
 import org.apache.sling.microsling.api.ResourceMetadata;
 import org.apache.sling.microsling.api.SlingRequestPathInfo;
 
-/** Test the SlingRequestPathInfoParser */
-public class SlingRequestPathInfoParserTest extends TestCase {
+/** Test the MicroslingRequestPathInfo */
+public class MicroslingRequestPathInfoTest extends TestCase {
 
     static class MockResource implements Resource {
         
@@ -59,34 +59,34 @@
     }
     
     public void testSimplePath() {
-        SlingRequestPathInfo p = new SlingRequestPathInfoParser(new MockResource(""),"/some/path.print.a4.html/some/suffix");
+        SlingRequestPathInfo p = new MicroslingRequestPathInfo(new MockResource(""),"/some/path.print.a4.html/some/suffix");
         assertEquals("/some/path",p.getUnusedContentPath());
         assertEquals("",p.getResourcePath());
     }
     
     public void testNullResource() {
-        SlingRequestPathInfo p = new SlingRequestPathInfoParser(null,"/some/path.print.a4.html/some/suffix");
+        SlingRequestPathInfo p = new MicroslingRequestPathInfo(null,"/some/path.print.a4.html/some/suffix");
         assertEquals("/some/path",p.getUnusedContentPath());
         assertEquals(null,p.getResourcePath());
     }
     
     public void testSimpleSuffix() {
-        SlingRequestPathInfo p = new SlingRequestPathInfoParser(new MockResource(""),"/some/path.print.a4.html/some/suffix");
+        SlingRequestPathInfo p = new MicroslingRequestPathInfo(new MockResource(""),"/some/path.print.a4.html/some/suffix");
         assertEquals("/some/suffix",p.getSuffix());
     }
     
     public void testSimpleSelectorString() {
-        SlingRequestPathInfo p = new SlingRequestPathInfoParser(new MockResource(""),"/some/path.print.a4.html/some/suffix");
+        SlingRequestPathInfo p = new MicroslingRequestPathInfo(new MockResource(""),"/some/path.print.a4.html/some/suffix");
         assertEquals("print.a4",p.getSelectorString());
     }
     
     public void testSimpleExtension() {
-        SlingRequestPathInfo p = new SlingRequestPathInfoParser(new MockResource(""),"/some/path.print.a4.html/some/suffix");
+        SlingRequestPathInfo p = new MicroslingRequestPathInfo(new MockResource(""),"/some/path.print.a4.html/some/suffix");
         assertEquals("html",p.getExtension());
     }
     
     public void testAllOptions() {
-        SlingRequestPathInfo p = new SlingRequestPathInfoParser(new MockResource(""),"/some/path.print.a4.html/some/suffix");
+        SlingRequestPathInfo p = new MicroslingRequestPathInfo(new MockResource(""),"/some/path.print.a4.html/some/suffix");
         assertEquals("/some/path",p.getUnusedContentPath());
         assertEquals("print.a4",p.getSelectorString());
         assertEquals("html",p.getExtension());
@@ -94,7 +94,7 @@
     }
     
     public void testAllEmpty() {
-        SlingRequestPathInfo p = new SlingRequestPathInfoParser(new MockResource(""),null);
+        SlingRequestPathInfo p = new MicroslingRequestPathInfo(new MockResource(""),null);
         assertEquals("",p.getUnusedContentPath());
         assertEquals("",p.getSelectorString());
         assertEquals("",p.getExtension());
@@ -102,7 +102,7 @@
     }
     
     public void testPathOnly() {
-        SlingRequestPathInfo p = new SlingRequestPathInfoParser(new MockResource(""),"/some/path/here");
+        SlingRequestPathInfo p = new MicroslingRequestPathInfo(new MockResource(""),"/some/path/here");
         assertEquals("/some/path/here",p.getUnusedContentPath());
         assertEquals("",p.getSelectorString());
         assertEquals("",p.getExtension());
@@ -110,7 +110,7 @@
     }
     
     public void testPathAndExtensionOnly() {
-        SlingRequestPathInfo p = new SlingRequestPathInfoParser(new MockResource(""),"/some/path/here.html");
+        SlingRequestPathInfo p = new MicroslingRequestPathInfo(new MockResource(""),"/some/path/here.html");
         assertEquals("/some/path/here",p.getUnusedContentPath());
         assertEquals("",p.getSelectorString());
         assertEquals("html",p.getExtension());
@@ -118,7 +118,7 @@
     }
     
     public void testPathAndOneSelectorOnly() {
-        SlingRequestPathInfo p = new SlingRequestPathInfoParser(new MockResource(""),"/some/path/here.print.html");
+        SlingRequestPathInfo p = new MicroslingRequestPathInfo(new MockResource(""),"/some/path/here.print.html");
         assertEquals("/some/path/here",p.getUnusedContentPath());
         assertEquals("print",p.getSelectorString());
         assertEquals("html",p.getExtension());
@@ -126,7 +126,7 @@
     }
     
     public void testPathExtAndSuffix() {
-        SlingRequestPathInfo p = new SlingRequestPathInfoParser(new MockResource(""),"/some/path/here.html/something");
+        SlingRequestPathInfo p = new MicroslingRequestPathInfo(new MockResource(""),"/some/path/here.html/something");
         assertEquals("/some/path/here",p.getUnusedContentPath());
         assertEquals("",p.getSelectorString());
         assertEquals("html",p.getExtension());
@@ -134,14 +134,14 @@
     }
     
     public void testSelectorsSplit() {
-        SlingRequestPathInfo p = new SlingRequestPathInfoParser(new MockResource(""),"/some/path.print.a4.html/some/suffix");
+        SlingRequestPathInfo p = new MicroslingRequestPathInfo(new MockResource(""),"/some/path.print.a4.html/some/suffix");
         assertEquals(2,p.getSelectors().length);
         assertEquals("print",p.getSelector(0));
         assertEquals("a4",p.getSelector(1));
     }
     
     public void testPartialResolutionA() {
-        SlingRequestPathInfo p = new SlingRequestPathInfoParser(new MockResource("/some"),"/some/path.print.a4.html/some/suffix");
+        SlingRequestPathInfo p = new MicroslingRequestPathInfo(new MockResource("/some"),"/some/path.print.a4.html/some/suffix");
         assertEquals("/some",p.getResourcePath());
         assertEquals("print.a4",p.getSelectorString());
         assertEquals("html",p.getExtension());
@@ -150,7 +150,7 @@
     }
     
     public void testPartialResolutionB() {
-        SlingRequestPathInfo p = new SlingRequestPathInfoParser(new MockResource("/some/path"),"/some/path.print.a4.html/some/suffix");
+        SlingRequestPathInfo p = new MicroslingRequestPathInfo(new MockResource("/some/path"),"/some/path.print.a4.html/some/suffix");
         assertEquals("print.a4",p.getSelectorString());
         assertEquals("html",p.getExtension());
         assertEquals("/some/suffix",p.getSuffix());
@@ -158,7 +158,7 @@
     }
     
     public void testPartialResolutionC() {
-        SlingRequestPathInfo p = new SlingRequestPathInfoParser(new MockResource("/some/path.print"),"/some/path.print.a4.html/some/suffix");
+        SlingRequestPathInfo p = new MicroslingRequestPathInfo(new MockResource("/some/path.print"),"/some/path.print.a4.html/some/suffix");
         assertEquals("a4",p.getSelectorString());
         assertEquals("html",p.getExtension());
         assertEquals("/some/suffix",p.getSuffix());
@@ -166,7 +166,7 @@
     }
     
     public void testPartialResolutionD() {
-        SlingRequestPathInfo p = new SlingRequestPathInfoParser(new MockResource("/some/path.print.a"),"/some/path.print.a4.html/some/suffix");
+        SlingRequestPathInfo p = new MicroslingRequestPathInfo(new MockResource("/some/path.print.a"),"/some/path.print.a4.html/some/suffix");
         assertEquals("",p.getSelectorString());
         assertEquals("html",p.getExtension());
         assertEquals("/some/suffix",p.getSuffix());
@@ -174,7 +174,7 @@
     }
     
     public void testPartialResolutionE() {
-        SlingRequestPathInfo p = new SlingRequestPathInfoParser(new MockResource("/some/path.print.a4.html"),"/some/path.print.a4.html/some/suffix");
+        SlingRequestPathInfo p = new MicroslingRequestPathInfo(new MockResource("/some/path.print.a4.html"),"/some/path.print.a4.html/some/suffix");
         assertEquals("",p.getSelectorString());
         assertEquals("",p.getExtension());
         assertEquals("",p.getSuffix());



Mime
View raw message