SLING-1212 - upgrading to Jackrabbit 2. Also includes re-revert of SLING-1363 and implementation of SLING-1330. Thanks to Felix for getting this started.

git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@911430 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/NamespaceMappingTest.java b/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/NamespaceMappingTest.java
index 8640fb9..232297c 100644
--- a/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/NamespaceMappingTest.java
+++ b/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/NamespaceMappingTest.java
@@ -25,7 +25,7 @@
 import org.apache.commons.httpclient.NameValuePair;
 
 /**
- * Test that Namespace Mappings are working properly.
+ * Test that both Sling-Namespaces and {@link NamespaceMapper} work.
  */
 public class NamespaceMappingTest extends AbstractAuthenticatedTest {
 
@@ -51,6 +51,26 @@
         assertTrue("Content contains " + expected + " (" + content + ")", content.contains(expected));
     }
 
+    /**
+     * Verify that {@link NamespaceMapper} works.
+     */
+    public void testNamespaceFromNamespaceMapper() throws IOException {
+        final String expected = "test2=http://sling.apache.org/test/two";
+        final String content = getContent(HTTP_BASE_URL + "/testing/NamespaceTestServlet/output",
+                CONTENT_TYPE_PLAIN);
+        assertTrue("Content contains " + expected + " (" + content + ")", content.contains(expected));
+    }
+
+    /**
+     * Verify that {@link NamespaceMapper} works with impersonation.
+     */
+    public void testNamespaceFromNamespaceMapperWithImpersonation() throws IOException {
+        final String expected = "test2=http://sling.apache.org/test/two";
+        final String content = getContent(HTTP_BASE_URL + "/testing/NamespaceTestServlet/output?sudo=" + testUserId,
+                CONTENT_TYPE_PLAIN);
+        assertTrue("Content contains " + expected + " (" + content + ")", content.contains(expected));
+    }
+
     String testUserId = null;
 
     @Override