incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r653689 - in /incubator/sling/trunk: commons/testing/ commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/ commons/testing/src/main/java/org/apache/sling/commons/testing/sling/ sling/servlet-resolver/ sling/servlet-resolver/...
Date Tue, 06 May 2008 06:55:43 GMT
Author: fmeschbe
Date: Mon May  5 23:55:42 2008
New Revision: 653689

URL: http://svn.apache.org/viewvc?rev=653689&view=rev
Log:
SLING-424 Move mock classes to commons/testing and add reference to commons/testing
to the servlet-resolver module

Added:
    incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/
    incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/MockBundle.java
      - copied, changed from r653478, incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/MockBundle.java
    incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/MockBundleContext.java
      - copied, changed from r653478, incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/MockBundleContext.java
    incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/MockComponentContext.java
      - copied, changed from r653478, incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/MockComponentContext.java
    incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/MockServiceReference.java
      - copied, changed from r653478, incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/MockServiceReference.java
    incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/MockServiceRegistration.java
      - copied, changed from r653478, incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/MockServiceRegistration.java
    incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/sling/
    incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/sling/MockRequestPathInfo.java
      - copied, changed from r653478, incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/MockRequestPathInfo.java
    incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/sling/MockResource.java
      - copied, changed from r653478, incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/MockResource.java
    incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/sling/MockResourceResolver.java
      - copied, changed from r653478, incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/MockResourceResolver.java
    incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/sling/MockSlingHttpServletRequest.java
      - copied, changed from r653478, incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/MockSlingHttpServletRequest.java
Removed:
    incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/
Modified:
    incubator/sling/trunk/commons/testing/pom.xml
    incubator/sling/trunk/sling/servlet-resolver/pom.xml
    incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/SlingServletResolverTest.java

Modified: incubator/sling/trunk/commons/testing/pom.xml
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/commons/testing/pom.xml?rev=653689&r1=653688&r2=653689&view=diff
==============================================================================
--- incubator/sling/trunk/commons/testing/pom.xml (original)
+++ incubator/sling/trunk/commons/testing/pom.xml Mon May  5 23:55:42 2008
@@ -1,21 +1,21 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <!--
-  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.
+    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.
 -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
@@ -33,7 +33,7 @@
 
     <name>Sling - testing utilities</name>
     <description>
-	Tools and utilities for automated testing of Sling modules
+        Tools and utilities for automated testing of Sling modules
     </description>
 
     <scm>
@@ -50,15 +50,41 @@
 
     <dependencies>
         <dependency>
-            <groupId>org.apache.jackrabbit</groupId>
-            <artifactId>jackrabbit-core</artifactId>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.api</artifactId>
+            <version>2.0.0-incubator-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.core</artifactId>
+            <version>2.0.0-incubator-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.jcr.api</artifactId>
             <version>2.0.0-incubator-SNAPSHOT</version>
         </dependency>
         <dependency>
+            <groupId>org.apache.jackrabbit</groupId>
+            <artifactId>jackrabbit-core</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.osgi.core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+        </dependency>
+
+        <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <scope>provided</scope>

Copied: incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/MockBundle.java
(from r653478, incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/MockBundle.java)
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/MockBundle.java?p2=incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/MockBundle.java&p1=incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/MockBundle.java&r1=653478&r2=653689&rev=653689&view=diff
==============================================================================
--- incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/MockBundle.java
(original)
+++ incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/MockBundle.java
Mon May  5 23:55:42 2008
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.servlet.resolver.mock;
+package org.apache.sling.commons.testing.osgi;
 
 import java.io.InputStream;
 import java.net.URL;

Copied: incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/MockBundleContext.java
(from r653478, incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/MockBundleContext.java)
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/MockBundleContext.java?p2=incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/MockBundleContext.java&p1=incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/MockBundleContext.java&r1=653478&r2=653689&rev=653689&view=diff
==============================================================================
--- incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/MockBundleContext.java
(original)
+++ incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/MockBundleContext.java
Mon May  5 23:55:42 2008
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.servlet.resolver.mock;
+package org.apache.sling.commons.testing.osgi;
 
 import java.io.File;
 import java.io.InputStream;

Copied: incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/MockComponentContext.java
(from r653478, incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/MockComponentContext.java)
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/MockComponentContext.java?p2=incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/MockComponentContext.java&p1=incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/MockComponentContext.java&r1=653478&r2=653689&rev=653689&view=diff
==============================================================================
--- incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/MockComponentContext.java
(original)
+++ incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/MockComponentContext.java
Mon May  5 23:55:42 2008
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.servlet.resolver.mock;
+package org.apache.sling.commons.testing.osgi;
 
 import java.util.Dictionary;
 import java.util.Properties;
@@ -24,7 +24,6 @@
 import javax.servlet.Servlet;
 
 import org.apache.sling.core.CoreConstants;
-import org.apache.sling.servlet.resolver.SlingServletResolverTest;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
@@ -55,11 +54,11 @@
 
     public Object locateService(String name, ServiceReference reference) {
         String referenceName = (String) reference.getProperty(CoreConstants.SLING_SERLVET_NAME);
-        if (referenceName.equals(SlingServletResolverTest.SERVLET_NAME)) {
+        if (referenceName != null && referenceName.equals(name)) {
             return this.servlet;
-        } else {
-            return null;
         }
+
+        return null;
     }
 
     public BundleContext getBundleContext() {

Copied: incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/MockServiceReference.java
(from r653478, incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/MockServiceReference.java)
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/MockServiceReference.java?p2=incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/MockServiceReference.java&p1=incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/MockServiceReference.java&r1=653478&r2=653689&rev=653689&view=diff
==============================================================================
--- incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/MockServiceReference.java
(original)
+++ incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/MockServiceReference.java
Mon May  5 23:55:42 2008
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.servlet.resolver.mock;
+package org.apache.sling.commons.testing.osgi;
 
 import java.util.Collections;
 import java.util.Dictionary;

Copied: incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/MockServiceRegistration.java
(from r653478, incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/MockServiceRegistration.java)
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/MockServiceRegistration.java?p2=incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/MockServiceRegistration.java&p1=incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/MockServiceRegistration.java&r1=653478&r2=653689&rev=653689&view=diff
==============================================================================
--- incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/MockServiceRegistration.java
(original)
+++ incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/MockServiceRegistration.java
Mon May  5 23:55:42 2008
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.servlet.resolver.mock;
+package org.apache.sling.commons.testing.osgi;
 
 import java.util.Dictionary;
 

Copied: incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/sling/MockRequestPathInfo.java
(from r653478, incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/MockRequestPathInfo.java)
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/sling/MockRequestPathInfo.java?p2=incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/sling/MockRequestPathInfo.java&p1=incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/MockRequestPathInfo.java&r1=653478&r2=653689&rev=653689&view=diff
==============================================================================
--- incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/MockRequestPathInfo.java
(original)
+++ incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/sling/MockRequestPathInfo.java
Mon May  5 23:55:42 2008
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.servlet.resolver.mock;
+package org.apache.sling.commons.testing.sling;
 
 import org.apache.sling.api.request.RequestPathInfo;
 

Copied: incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/sling/MockResource.java
(from r653478, incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/MockResource.java)
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/sling/MockResource.java?p2=incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/sling/MockResource.java&p1=incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/MockResource.java&r1=653478&r2=653689&rev=653689&view=diff
==============================================================================
--- incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/MockResource.java
(original)
+++ incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/sling/MockResource.java
Mon May  5 23:55:42 2008
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.servlet.resolver.mock;
+package org.apache.sling.commons.testing.sling;
 
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.resource.SyntheticResource;

Copied: incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/sling/MockResourceResolver.java
(from r653478, incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/MockResourceResolver.java)
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/sling/MockResourceResolver.java?p2=incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/sling/MockResourceResolver.java&p1=incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/MockResourceResolver.java&r1=653478&r2=653689&rev=653689&view=diff
==============================================================================
--- incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/MockResourceResolver.java
(original)
+++ incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/sling/MockResourceResolver.java
Mon May  5 23:55:42 2008
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.servlet.resolver.mock;
+package org.apache.sling.commons.testing.sling;
 
 import java.util.Collection;
 import java.util.Iterator;

Copied: incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/sling/MockSlingHttpServletRequest.java
(from r653478, incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/MockSlingHttpServletRequest.java)
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/sling/MockSlingHttpServletRequest.java?p2=incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/sling/MockSlingHttpServletRequest.java&p1=incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/MockSlingHttpServletRequest.java&r1=653478&r2=653689&rev=653689&view=diff
==============================================================================
--- incubator/sling/trunk/sling/servlet-resolver/src/test/java/org/apache/sling/servlet/resolver/mock/MockSlingHttpServletRequest.java
(original)
+++ incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/sling/MockSlingHttpServletRequest.java
Mon May  5 23:55:42 2008
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.servlet.resolver.mock;
+package org.apache.sling.commons.testing.sling;
 
 import java.io.BufferedReader;
 import java.security.Principal;
@@ -50,7 +50,7 @@
     private Resource resource;
 
     private String method;
-    
+
     private final RequestPathInfo requestPathInfo;
 
     private final String queryString;
@@ -71,18 +71,24 @@
         this.requestPathInfo = new MockRequestPathInfo(selectors, extension,
             suffix);
         this.queryString = queryString;
-        
+
         setMethod(null);
     }
 
     public void setResourceResolver(MockResourceResolver resolver) {
         this.mockResourceResolver = resolver;
+
+        // recreate request resource with the new resolver
+        if (resource.getResourceResolver() == null) {
+            this.resource = new SyntheticResource(resolver, resource.getPath(),
+                resource.getResourceType());
+        }
     }
-    
+
     public void setResource(Resource resource) {
         this.resource = resource;
     }
-    
+
     public void setSecure(boolean secure) {
         this.secure = secure;
     }
@@ -90,7 +96,7 @@
     public void setMethod(String method) {
         this.method = (method == null) ? "GET" : method.toUpperCase();
     }
-    
+
     public Cookie getCookie(String name) {
         return null;
     }
@@ -136,7 +142,7 @@
     public ResourceBundle getResourceBundle(Locale locale) {
         return null;
     }
-    
+
     public ResourceBundle getResourceBundle(String baseName, Locale locale) {
         return null;
     }

Modified: incubator/sling/trunk/sling/servlet-resolver/pom.xml
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sling/servlet-resolver/pom.xml?rev=653689&r1=653688&r2=653689&view=diff
==============================================================================
--- incubator/sling/trunk/sling/servlet-resolver/pom.xml (original)
+++ incubator/sling/trunk/sling/servlet-resolver/pom.xml Mon May  5 23:55:42 2008
@@ -119,6 +119,12 @@
             <artifactId>slf4j-simple</artifactId>
         </dependency>
         <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.commons.testing</artifactId>
+            <version>2.0.0-incubator-SNAPSHOT</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
         </dependency>

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=653689&r1=653688&r2=653689&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
Mon May  5 23:55:42 2008
@@ -30,13 +30,13 @@
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceUtil;
 import org.apache.sling.api.servlets.OptingServlet;
+import org.apache.sling.commons.testing.osgi.MockBundle;
+import org.apache.sling.commons.testing.osgi.MockComponentContext;
+import org.apache.sling.commons.testing.osgi.MockServiceReference;
+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.core.CoreConstants;
-import org.apache.sling.servlet.resolver.mock.MockBundle;
-import org.apache.sling.servlet.resolver.mock.MockComponentContext;
-import org.apache.sling.servlet.resolver.mock.MockResource;
-import org.apache.sling.servlet.resolver.mock.MockResourceResolver;
-import org.apache.sling.servlet.resolver.mock.MockServiceReference;
-import org.apache.sling.servlet.resolver.mock.MockSlingHttpServletRequest;
 import org.apache.sling.servlet.resolver.resource.MockServletResource;
 import org.osgi.framework.Constants;
 
@@ -71,7 +71,7 @@
         serviceReference.setProperty(
             ServletResolverConstants.SLING_SERVLET_EXTENSIONS,
             SERVLET_EXTENSION);
-        mockComponentContext.locateService("MockService", serviceReference);
+        mockComponentContext.locateService(SERVLET_NAME, serviceReference);
 
         servletResolver.bindServlet(serviceReference);
         servletResolver.activate(mockComponentContext);



Mime
View raw message