You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ss...@apache.org on 2017/03/27 15:03:42 UTC
svn commit: r1788942 -
/sling/branches/testing/mocks/sling-mock-1.x/src/test/java/org/apache/sling/testing/mock/sling/context/NoResourceResolverTypeTest.java
Author: sseifert
Date: Mon Mar 27 15:03:42 2017
New Revision: 1788942
URL: http://svn.apache.org/viewvc?rev=1788942&view=rev
Log:
add test to make sure "NONE" resource resolver type works
Added:
sling/branches/testing/mocks/sling-mock-1.x/src/test/java/org/apache/sling/testing/mock/sling/context/NoResourceResolverTypeTest.java (with props)
Added: sling/branches/testing/mocks/sling-mock-1.x/src/test/java/org/apache/sling/testing/mock/sling/context/NoResourceResolverTypeTest.java
URL: http://svn.apache.org/viewvc/sling/branches/testing/mocks/sling-mock-1.x/src/test/java/org/apache/sling/testing/mock/sling/context/NoResourceResolverTypeTest.java?rev=1788942&view=auto
==============================================================================
--- sling/branches/testing/mocks/sling-mock-1.x/src/test/java/org/apache/sling/testing/mock/sling/context/NoResourceResolverTypeTest.java (added)
+++ sling/branches/testing/mocks/sling-mock-1.x/src/test/java/org/apache/sling/testing/mock/sling/context/NoResourceResolverTypeTest.java Mon Mar 27 15:03:42 2017
@@ -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);
+ }
+
+}
Propchange: sling/branches/testing/mocks/sling-mock-1.x/src/test/java/org/apache/sling/testing/mock/sling/context/NoResourceResolverTypeTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/branches/testing/mocks/sling-mock-1.x/src/test/java/org/apache/sling/testing/mock/sling/context/NoResourceResolverTypeTest.java
------------------------------------------------------------------------------
--- svn:keywords (added)
+++ svn:keywords Mon Mar 27 15:03:42 2017
@@ -0,0 +1 @@
+LastChangedDate LastChangedRevision LastChangedBy HeadURL Id Author
Propchange: sling/branches/testing/mocks/sling-mock-1.x/src/test/java/org/apache/sling/testing/mock/sling/context/NoResourceResolverTypeTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain