You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 10:25:19 UTC

[sling-org-apache-sling-testing-sling-mock] 12/14: add test to make sure "NONE" resource resolver type works

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-1.9.6
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 93b82f1279f69b737559ad0676685efb33f9fe92
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Mon Mar 27 15:03:42 2017 +0000

    add test to make sure "NONE" resource resolver type works
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/branches/testing/mocks/sling-mock-1.x@1788942 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/context/NoResourceResolverTypeTest.java  | 40 ++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/src/test/java/org/apache/sling/testing/mock/sling/context/NoResourceResolverTypeTest.java b/src/test/java/org/apache/sling/testing/mock/sling/context/NoResourceResolverTypeTest.java
new file mode 100644
index 0000000..23369ea
--- /dev/null
+++ b/src/test/java/org/apache/sling/testing/mock/sling/context/NoResourceResolverTypeTest.java
@@ -0,0 +1,40 @@
+/*
+ * 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.
+ */
+package org.apache.sling.testing.mock.sling.context;
+
+import static org.junit.Assert.assertNull;
+
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.testing.mock.sling.ResourceResolverType;
+import org.apache.sling.testing.mock.sling.junit.SlingContext;
+import org.junit.Rule;
+import org.junit.Test;
+
+public class NoResourceResolverTypeTest {
+
+    @Rule
+    public SlingContext context = new SlingContext(ResourceResolverType.NONE);
+    
+    @Test
+    public void testRoot() {
+        Resource root = context.resourceResolver().getResource("/");
+        assertNull(root);
+    }
+    
+}

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.