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:28:32 UTC

[sling-org-apache-sling-testing-sling-mock] annotated tag org.apache.sling.testing.sling-mock-oak-1.0.0 created (now 7270d50)

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

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


      at 7270d50  (tag)
 tagging 740d4cd7d3c61b70758fe0fb74fca4ce6150904a (commit)
      by Stefan Seifert
      on Mon Oct 5 17:37:20 2015 +0000

- Log -----------------------------------------------------------------
org.apache.sling.testing.sling-mock-oak-1.0.0
-----------------------------------------------------------------------

This annotated tag includes the following new commits:

     new fd0d1a0  SLING-4605 - Add support for an Oak resource resolver type mock
     new e224c05  Mocks: use latest snapshots
     new c72f3a4  update to released mock versions
     new 335ff9d  switch back to latest sling-mock snapshot
     new 2f2f13b  svn:ignore
     new 9b901a8  SLING-4824 - Embed all needed classes in the sling-oak-mock jar
     new 929e4e1  update to latest development snapshots
     new 74e91c0  Update to Sling Parent 23
     new 2001197  Testing: remove superflous sling.java.version=6 as it's the default now
     new 3b08cf0  Update rat exclude rules
     new 69ff780  switch to released versions
     new 3da3620  add "dependency-reduced-pom.xml" to svn:ignore
     new db18087  set parent version to 24 and add empty relativePath where missing
     new 82ac036  SLING-5007 realx unit test to test root path child listing in sling-mock-jackrabbit and sling-mock-jackrabbit and sling-mock-oak because in real repositories multiple root test nodes may be created in parallel, or nodes already exist
     new 8d645b6  SLING-5007 use same unit tests for root node tests for all resource resolver types without counting the number of children.
     new 9484e6d  SLING-5064 sling-mock: Register JCR node types for OSGi bundles in class path
     new fa5c56d  SLING-5067 sling-mock: "uniqueRoot()" to simplify creation and cleanup of unique root paths in repository
     new 657461c  SLING-5064 manual registration of node types no longer required
     new 3e33871  SLING-5064 manual registration of node types no longer required; register namespaces and node types centrally depending on NodeTypeMode
     new 300fe88  SLING-5084 sling-mock-oak: Provide a minimal index configuration for Sling-related properties
     new cb1a8a2  SLING-4824/SLING-4827 do not embed org.apache.sling.jcr.resource dependency; it's a dependency of sling mock and not sling-mock-jackrabbit/oak and version used should be controlled by sling-mock
     new 2d405ea  SLING-5088 control SlingRepository resources via activate/deactivate methods; make sure all oak ExecutorServices are shutdown properly
     new 17335f6  Update the main reactor to parent 25
     new 4c2c442  SLING-5088 do not use ReflectiveOperationException which is a JDK 1.7 class
     new 31fb0b2  update dependencies
     new 3769038  [maven-release-plugin] prepare release org.apache.sling.testing.sling-mock-oak-1.0.0
     new 740d4cd  [maven-release-plugin] copy for tag org.apache.sling.testing.sling-mock-oak-1.0.0

The 27 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


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

[sling-org-apache-sling-testing-sling-mock] 01/27: SLING-4605 - Add support for an Oak resource resolver type mock

Posted by ro...@apache.org.
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-oak-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit fd0d1a01f1347cfb91d5ceed6807948f2a80b717
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Wed May 27 11:42:35 2015 +0000

    SLING-4605 - Add support for an Oak resource resolver type mock
    
    Initial revision of the sling-mock-oak module
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock-oak@1681992 13f79535-47bb-0310-9956-ffa450edef68
---
 README.txt                                         |  11 ++
 pom.xml                                            | 163 +++++++++++++++++++++
 .../sling/oak/OakMockResourceResolverAdapter.java  |  43 ++++++
 .../sling/testing/mock/sling/oak/package-info.java |  23 +++
 .../oak/contentimport/ContentLoaderBinaryTest.java |  55 +++++++
 .../contentimport/ContentLoaderJsonDamTest.java    |  58 ++++++++
 .../oak/contentimport/ContentLoaderJsonTest.java   |  58 ++++++++
 .../mock/sling/oak/resource/JcrNamespaceTest.java  |  34 +++++
 .../oak/resource/JcrResourceResolverTest.java      |  55 +++++++
 .../oak/resource/MultipleResourceResolverTest.java |  63 ++++++++
 .../resource/SlingCrudResourceResolverTest.java    |  55 +++++++
 src/test/resources/SLING-INF/nodetypes/app.cnd     |  26 ++++
 12 files changed, 644 insertions(+)

diff --git a/README.txt b/README.txt
new file mode 100644
index 0000000..7a173cc
--- /dev/null
+++ b/README.txt
@@ -0,0 +1,11 @@
+Apache Sling Testing Sling Mock Jackrabbit Oak-based Resource Resolver
+
+Implements a resource resolver type for Jackrabbit Oak that can be used in unit tests based on Sling Mocks.
+
+This is a separate maven artifacts because it introduces a lot of further dependencies.
+
+Please note: This adapter for Jackrabbit Oak is still experimental, not all sling-mock features are working.
+(see disabled unit tests with comments)
+
+Documentation:
+http://sling.apache.org/documentation/development/sling-mock.html
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..39975f4
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,163 @@
+<?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.
+-->
+<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/xsd/maven-4.0.0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.sling</groupId>
+        <artifactId>sling</artifactId>
+        <version>22</version>
+        <relativePath/>
+    </parent>
+
+    <artifactId>org.apache.sling.testing.sling-mock-oak</artifactId>
+    <version>0.1.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+  
+    <name>Apache Sling Testing Sling Mock Oak-based Resource Resolver</name>
+    <description>Implements a resource resolver type for Jackrabbit Oak that can be used in unit tests based on Sling Mocks.</description>
+  
+    <properties>
+        <sling.java.version>6</sling.java.version>
+        <oak.version>1.2.2</oak.version>
+        <jackrabbit.version>2.10.1</jackrabbit.version>
+    </properties>
+
+    <scm>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock-oak</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock-oak</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/testing/mocks/sling-mock-oak</url>
+    </scm>
+
+    <dependencies>
+  
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.testing.sling-mock</artifactId>
+            <version>1.3.1-SNAPSHOT</version>
+            <scope>compile</scope>
+        </dependency>
+    
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.testing.sling-mock</artifactId>
+            <version>1.3.1-SNAPSHOT</version>
+            <classifier>tests</classifier>
+            <scope>test</scope>
+        </dependency>
+  
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.commons.testing</artifactId>
+            <version>2.0.16</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.jmock</groupId>
+                    <artifactId>jmock-junit4</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        
+        <!-- Depend on oak-jcr, which pulls in all needed Oak artifacts -->
+        <dependency>
+            <groupId>org.apache.jackrabbit</groupId>
+            <artifactId>oak-jcr</artifactId>
+            <version>${oak.version}</version>
+        </dependency>
+        
+        <!-- Ensure we depend on more recent jackrabbit artifacts required by Oak -->
+        <dependency>
+            <groupId>org.apache.jackrabbit</groupId>
+            <artifactId>jackrabbit-jcr-commons</artifactId>
+            <version>${jackrabbit.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.jackrabbit</groupId>
+            <artifactId>jackrabbit-api</artifactId>
+            <version>${jackrabbit.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>javax.jcr</groupId>
+            <artifactId>jcr</artifactId>
+            <version>2.0</version>
+            <scope>compile</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-all</artifactId>
+            <version>1.9.5</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.testing.logging-mock</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
+            <scope>test</scope>
+        </dependency>
+  
+    </dependencies>
+  
+    <build>
+        <plugins>
+    
+          <!-- Publish test artifact -->
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-jar-plugin</artifactId>
+            <executions>
+              <execution>
+                <goals>
+                  <goal>test-jar</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+    
+          <plugin>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>maven-bundle-plugin</artifactId>
+            <extensions>true</extensions>
+          </plugin>
+    
+          <plugin>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>maven-scr-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>generate-scr-scrdescriptor</id>
+                <goals>
+                  <goal>scr</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+    
+        </plugins>
+    </build>
+  
+</project>
diff --git a/src/main/java/org/apache/sling/testing/mock/sling/oak/OakMockResourceResolverAdapter.java b/src/main/java/org/apache/sling/testing/mock/sling/oak/OakMockResourceResolverAdapter.java
new file mode 100644
index 0000000..895608b
--- /dev/null
+++ b/src/main/java/org/apache/sling/testing/mock/sling/oak/OakMockResourceResolverAdapter.java
@@ -0,0 +1,43 @@
+/*
+ * 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.oak;
+
+import org.apache.jackrabbit.oak.jcr.Jcr;
+import org.apache.sling.api.resource.ResourceResolverFactory;
+import org.apache.sling.commons.testing.jcr.RepositoryUtil;
+import org.apache.sling.jcr.api.SlingRepository;
+import org.apache.sling.testing.mock.sling.spi.ResourceResolverTypeAdapter;
+
+/**
+ * Resource resolver type adapter for Jackrabbit Oak repository.
+ */
+public class OakMockResourceResolverAdapter implements ResourceResolverTypeAdapter {
+
+    @Override
+    public ResourceResolverFactory newResourceResolverFactory() {
+        return null;
+    }
+
+    @Override
+    public SlingRepository newSlingRepository() {
+        
+        return new RepositoryUtil.RepositoryWrapper(new Jcr().createRepository());
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/testing/mock/sling/oak/package-info.java b/src/main/java/org/apache/sling/testing/mock/sling/oak/package-info.java
new file mode 100644
index 0000000..55bdc9d
--- /dev/null
+++ b/src/main/java/org/apache/sling/testing/mock/sling/oak/package-info.java
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+/**
+ * Sling Mock Jackrabbit Oak-based Resource Resolver
+ */
+@aQute.bnd.annotation.Version("0.1")
+package org.apache.sling.testing.mock.sling.oak;
diff --git a/src/test/java/org/apache/sling/testing/mock/sling/oak/contentimport/ContentLoaderBinaryTest.java b/src/test/java/org/apache/sling/testing/mock/sling/oak/contentimport/ContentLoaderBinaryTest.java
new file mode 100644
index 0000000..9072a48
--- /dev/null
+++ b/src/test/java/org/apache/sling/testing/mock/sling/oak/contentimport/ContentLoaderBinaryTest.java
@@ -0,0 +1,55 @@
+/*
+ * 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.oak.contentimport;
+
+import java.io.IOException;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.commons.testing.jcr.RepositoryUtil;
+import org.apache.sling.testing.mock.sling.MockSling;
+import org.apache.sling.testing.mock.sling.ResourceResolverType;
+import org.apache.sling.testing.mock.sling.loader.AbstractContentLoaderBinaryTest;
+
+public class ContentLoaderBinaryTest extends AbstractContentLoaderBinaryTest {
+
+    @Override
+    protected ResourceResolverType getResourceResolverType() {
+        return ResourceResolverType.JCR_OAK;
+    }
+
+    @Override
+    protected ResourceResolver newResourceResolver() {
+        ResourceResolver resolver = MockSling.newResourceResolver(getResourceResolverType());
+
+        // register sling node types
+        try {
+            RepositoryUtil.registerSlingNodeTypes(resolver.adaptTo(Session.class));
+        } catch (IOException ex) {
+            throw new RuntimeException("Unable to register sling node types.", ex);
+        } catch (RepositoryException ex) {
+            throw new RuntimeException("Unable to register sling node types.", ex);
+        }
+
+        return resolver;
+    }
+
+}
diff --git a/src/test/java/org/apache/sling/testing/mock/sling/oak/contentimport/ContentLoaderJsonDamTest.java b/src/test/java/org/apache/sling/testing/mock/sling/oak/contentimport/ContentLoaderJsonDamTest.java
new file mode 100644
index 0000000..4cbd95c
--- /dev/null
+++ b/src/test/java/org/apache/sling/testing/mock/sling/oak/contentimport/ContentLoaderJsonDamTest.java
@@ -0,0 +1,58 @@
+/*
+ * 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.oak.contentimport;
+
+import java.io.IOException;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.commons.testing.jcr.RepositoryUtil;
+import org.apache.sling.testing.mock.sling.MockSling;
+import org.apache.sling.testing.mock.sling.ResourceResolverType;
+import org.apache.sling.testing.mock.sling.loader.AbstractContentLoaderJsonDamTest;
+
+public class ContentLoaderJsonDamTest extends AbstractContentLoaderJsonDamTest {
+
+    @Override
+    protected ResourceResolverType getResourceResolverType() {
+        return ResourceResolverType.JCR_OAK;
+    }
+
+    @Override
+    protected ResourceResolver newResourceResolver() {
+        ResourceResolver resolver = MockSling.newResourceResolver(getResourceResolverType());
+
+        // register sling and app node types
+        try {
+            Session session = resolver.adaptTo(Session.class);
+            RepositoryUtil.registerSlingNodeTypes(session);
+            RepositoryUtil.registerNodeType(session,
+                    ContentLoaderJsonTest.class.getResourceAsStream("/SLING-INF/nodetypes/app.cnd"));
+        } catch (IOException ex) {
+            throw new RuntimeException("Unable to register sling node types.", ex);
+        } catch (RepositoryException ex) {
+            throw new RuntimeException("Unable to register sling node types.", ex);
+        }
+
+        return resolver;
+    }
+
+}
diff --git a/src/test/java/org/apache/sling/testing/mock/sling/oak/contentimport/ContentLoaderJsonTest.java b/src/test/java/org/apache/sling/testing/mock/sling/oak/contentimport/ContentLoaderJsonTest.java
new file mode 100644
index 0000000..904f9c8
--- /dev/null
+++ b/src/test/java/org/apache/sling/testing/mock/sling/oak/contentimport/ContentLoaderJsonTest.java
@@ -0,0 +1,58 @@
+/*
+ * 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.oak.contentimport;
+
+import java.io.IOException;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.commons.testing.jcr.RepositoryUtil;
+import org.apache.sling.testing.mock.sling.MockSling;
+import org.apache.sling.testing.mock.sling.ResourceResolverType;
+import org.apache.sling.testing.mock.sling.loader.AbstractContentLoaderJsonTest;
+
+public class ContentLoaderJsonTest extends AbstractContentLoaderJsonTest {
+
+    @Override
+    protected ResourceResolverType getResourceResolverType() {
+        return ResourceResolverType.JCR_OAK;
+    }
+
+    @Override
+    protected ResourceResolver newResourceResolver() {
+        ResourceResolver resolver = MockSling.newResourceResolver(getResourceResolverType());
+
+        // register sling and app node types
+        try {
+            Session session = resolver.adaptTo(Session.class);
+            RepositoryUtil.registerSlingNodeTypes(session);
+            RepositoryUtil.registerNodeType(session,
+                    ContentLoaderJsonTest.class.getResourceAsStream("/SLING-INF/nodetypes/app.cnd"));
+        } catch (IOException ex) {
+            throw new RuntimeException("Unable to register sling node types.", ex);
+        } catch (RepositoryException ex) {
+            throw new RuntimeException("Unable to register sling node types.", ex);
+        }
+
+        return resolver;
+    }
+
+}
diff --git a/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/JcrNamespaceTest.java b/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/JcrNamespaceTest.java
new file mode 100644
index 0000000..e661d1c
--- /dev/null
+++ b/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/JcrNamespaceTest.java
@@ -0,0 +1,34 @@
+/*
+ * 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.oak.resource;
+
+import org.apache.sling.testing.mock.sling.ResourceResolverType;
+import org.apache.sling.testing.mock.sling.resource.AbstractJcrNamespaceTest;
+import org.junit.Ignore;
+
+//TEST IS DISABLED currently, it does not work with oak repository yet
+@Ignore
+public class JcrNamespaceTest extends AbstractJcrNamespaceTest {
+
+    @Override
+    protected ResourceResolverType getResourceResolverType() {
+        return ResourceResolverType.JCR_OAK;
+    }
+
+}
diff --git a/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/JcrResourceResolverTest.java b/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/JcrResourceResolverTest.java
new file mode 100644
index 0000000..894ef08
--- /dev/null
+++ b/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/JcrResourceResolverTest.java
@@ -0,0 +1,55 @@
+/*
+ * 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.oak.resource;
+
+import java.io.IOException;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.commons.testing.jcr.RepositoryUtil;
+import org.apache.sling.testing.mock.sling.MockSling;
+import org.apache.sling.testing.mock.sling.ResourceResolverType;
+import org.apache.sling.testing.mock.sling.resource.AbstractJcrResourceResolverTest;
+
+public class JcrResourceResolverTest extends AbstractJcrResourceResolverTest {
+
+    @Override
+    protected ResourceResolverType getResourceResolverType() {
+        return ResourceResolverType.JCR_OAK;
+    }
+
+    @Override
+    protected ResourceResolver newResourceResolver() {
+        ResourceResolver resolver = MockSling.newResourceResolver(getResourceResolverType());
+
+        // register sling node types
+        try {
+            RepositoryUtil.registerSlingNodeTypes(resolver.adaptTo(Session.class));
+        } catch (IOException ex) {
+            throw new RuntimeException("Unable to register sling node types.", ex);
+        } catch (RepositoryException ex) {
+            throw new RuntimeException("Unable to register sling node types.", ex);
+        }
+
+        return resolver;
+    }
+
+}
diff --git a/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/MultipleResourceResolverTest.java b/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/MultipleResourceResolverTest.java
new file mode 100644
index 0000000..090fb4d
--- /dev/null
+++ b/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/MultipleResourceResolverTest.java
@@ -0,0 +1,63 @@
+/*
+ * 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.oak.resource;
+
+import java.io.IOException;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.apache.sling.api.resource.LoginException;
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.api.resource.ResourceResolverFactory;
+import org.apache.sling.commons.testing.jcr.RepositoryUtil;
+import org.apache.sling.testing.mock.sling.MockSling;
+import org.apache.sling.testing.mock.sling.ResourceResolverType;
+import org.apache.sling.testing.mock.sling.resource.AbstractMultipleResourceResolverTest;
+import org.junit.Ignore;
+
+//TEST IS DISABLED currently, it does not work with jackrabbit repository yet
+@Ignore
+public class MultipleResourceResolverTest extends AbstractMultipleResourceResolverTest {
+
+    @Override
+    protected ResourceResolverType getResourceResolverType() {
+        return ResourceResolverType.JCR_OAK;
+    }
+
+    @Override
+    protected ResourceResolverFactory newResourceResolerFactory() {
+        ResourceResolverFactory factory = MockSling.newResourceResolverFactory(getResourceResolverType());
+
+        // register sling node types
+        try {
+            ResourceResolver resolver = factory.getResourceResolver(null);
+            RepositoryUtil.registerSlingNodeTypes(resolver.adaptTo(Session.class));
+        } catch (LoginException ex) {
+            throw new RuntimeException("Unable to register sling node types.", ex);
+        } catch (IOException ex) {
+            throw new RuntimeException("Unable to register sling node types.", ex);
+        } catch (RepositoryException ex) {
+            throw new RuntimeException("Unable to register sling node types.", ex);
+        }
+
+        return factory;
+    }
+
+}
diff --git a/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/SlingCrudResourceResolverTest.java b/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/SlingCrudResourceResolverTest.java
new file mode 100644
index 0000000..ec7755c
--- /dev/null
+++ b/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/SlingCrudResourceResolverTest.java
@@ -0,0 +1,55 @@
+/*
+ * 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.oak.resource;
+
+import java.io.IOException;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.commons.testing.jcr.RepositoryUtil;
+import org.apache.sling.testing.mock.sling.MockSling;
+import org.apache.sling.testing.mock.sling.ResourceResolverType;
+import org.apache.sling.testing.mock.sling.resource.AbstractSlingCrudResourceResolverTest;
+
+public class SlingCrudResourceResolverTest extends AbstractSlingCrudResourceResolverTest {
+
+    @Override
+    protected ResourceResolverType getResourceResolverType() {
+        return ResourceResolverType.JCR_OAK;
+    }
+
+    @Override
+    protected ResourceResolver newResourceResolver() {
+        ResourceResolver resolver = MockSling.newResourceResolver(getResourceResolverType());
+
+        // register sling node types
+        try {
+            RepositoryUtil.registerSlingNodeTypes(resolver.adaptTo(Session.class));
+        } catch (IOException ex) {
+            throw new RuntimeException("Unable to register sling node types.", ex);
+        } catch (RepositoryException ex) {
+            throw new RuntimeException("Unable to register sling node types.", ex);
+        }
+
+        return resolver;
+    }
+
+}
diff --git a/src/test/resources/SLING-INF/nodetypes/app.cnd b/src/test/resources/SLING-INF/nodetypes/app.cnd
new file mode 100644
index 0000000..105d39f
--- /dev/null
+++ b/src/test/resources/SLING-INF/nodetypes/app.cnd
@@ -0,0 +1,26 @@
+//
+//  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.
+//
+<app='http://example.com/jcr/app/1.0'>
+<dam='http://example.com/jcr/dam/1.0'>
+
+[app:Page] > nt:unstructured
+[app:PageContent] > nt:unstructured
+
+[dam:Asset] > nt:unstructured
+[dam:AssetContent] > nt:unstructured

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

[sling-org-apache-sling-testing-sling-mock] 19/27: SLING-5064 manual registration of node types no longer required; register namespaces and node types centrally depending on NodeTypeMode

Posted by ro...@apache.org.
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-oak-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 3e338711c0e384d4c620c5f1d875869289d5be9a
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Mon Sep 28 22:16:38 2015 +0000

    SLING-5064 manual registration of node types no longer required; register namespaces and node types centrally depending on NodeTypeMode
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock-oak@1705787 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |  12 ---
 .../sling/oak/OakMockResourceResolverAdapter.java  |  30 +-----
 .../testing/mock/sling/oak/RepositoryWrapper.java  | 102 +++++++++++++++++++++
 .../oak/contentimport/ContentLoaderBinaryTest.java |  24 -----
 .../contentimport/ContentLoaderJsonDamTest.java    |  29 +-----
 .../oak/contentimport/ContentLoaderJsonTest.java   |  27 ------
 .../mock/sling/oak/resource/JcrNamespaceTest.java  |   3 -
 .../oak/resource/MultipleResourceResolverTest.java |  34 +------
 src/test/resources/SLING-INF/nodetypes/app.cnd     |  26 ------
 9 files changed, 105 insertions(+), 182 deletions(-)

diff --git a/pom.xml b/pom.xml
index 5135d42..4081c11 100644
--- a/pom.xml
+++ b/pom.xml
@@ -62,18 +62,6 @@
             <scope>test</scope>
         </dependency>
 
-        <dependency>
-            <groupId>org.apache.sling</groupId>
-            <artifactId>org.apache.sling.commons.testing</artifactId>
-            <version>2.0.16</version>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.jmock</groupId>
-                    <artifactId>jmock-junit4</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-        
         <!-- Depend on oak-jcr, which pulls in all needed Oak artifacts -->
         <dependency>
             <groupId>org.apache.jackrabbit</groupId>
diff --git a/src/main/java/org/apache/sling/testing/mock/sling/oak/OakMockResourceResolverAdapter.java b/src/main/java/org/apache/sling/testing/mock/sling/oak/OakMockResourceResolverAdapter.java
index a017407..393fdc1 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/oak/OakMockResourceResolverAdapter.java
+++ b/src/main/java/org/apache/sling/testing/mock/sling/oak/OakMockResourceResolverAdapter.java
@@ -18,14 +18,9 @@
  */
 package org.apache.sling.testing.mock.sling.oak;
 
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
-
 import org.apache.jackrabbit.oak.jcr.Jcr;
 import org.apache.sling.api.resource.ResourceResolverFactory;
-import org.apache.sling.commons.testing.jcr.RepositoryUtil;
 import org.apache.sling.jcr.api.SlingRepository;
-import org.apache.sling.testing.mock.sling.context.NodeTypeDefinitionScanner;
 import org.apache.sling.testing.mock.sling.spi.ResourceResolverTypeAdapter;
 
 /**
@@ -40,30 +35,7 @@ public class OakMockResourceResolverAdapter implements ResourceResolverTypeAdapt
 
     @Override
     public SlingRepository newSlingRepository() {
-        SlingRepository slingRepository = new RepositoryUtil.RepositoryWrapper(new Jcr().createRepository());
-        registerJcrNodeTypes(slingRepository);
-        return slingRepository;
-    }
-
-    /**
-     * Registers all JCR node types found in classpath.
-     * @param slingRepository Sling repository
-     */
-    @SuppressWarnings("deprecation")
-    private static void registerJcrNodeTypes(SlingRepository slingRepository) {
-      Session session = null;
-      try {
-          session =  slingRepository.loginAdministrative(null);
-          NodeTypeDefinitionScanner.get().register(session);
-      }
-      catch (RepositoryException ex) {
-          throw new RuntimeException("Error registering JCR nodetypes: " + ex.getMessage(), ex);
-      }
-      finally {
-          if (session != null) {
-              session.logout();
-          }
-      }
+        return new RepositoryWrapper(new Jcr().createRepository());
     }
 
 }
diff --git a/src/main/java/org/apache/sling/testing/mock/sling/oak/RepositoryWrapper.java b/src/main/java/org/apache/sling/testing/mock/sling/oak/RepositoryWrapper.java
new file mode 100644
index 0000000..6c0d9d1
--- /dev/null
+++ b/src/main/java/org/apache/sling/testing/mock/sling/oak/RepositoryWrapper.java
@@ -0,0 +1,102 @@
+/*
+ * 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.oak;
+
+import javax.jcr.Credentials;
+import javax.jcr.LoginException;
+import javax.jcr.NoSuchWorkspaceException;
+import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.SimpleCredentials;
+import javax.jcr.Value;
+
+import org.apache.sling.jcr.api.SlingRepository;
+
+public final class RepositoryWrapper implements SlingRepository {
+
+    private static final String ADMIN_NAME = "admin";
+    private static final String ADMIN_PASSWORD = "admin";
+
+    protected final Repository wrapped;
+
+    public RepositoryWrapper(Repository r) {
+        wrapped = r;
+    }
+
+    public String getDescriptor(String key) {
+        return wrapped.getDescriptor(key);
+    }
+
+    public String[] getDescriptorKeys() {
+        return wrapped.getDescriptorKeys();
+    }
+
+    public String getDefaultWorkspace() {
+        return "default";
+    }
+
+    public Session login() throws LoginException, RepositoryException {
+        return wrapped.login();
+    }
+
+    public Session login(Credentials credentials, String workspaceName) 
+            throws LoginException, NoSuchWorkspaceException, RepositoryException {
+        return wrapped.login(credentials, (workspaceName == null ? getDefaultWorkspace() : workspaceName));
+    }
+
+    public Session login(Credentials credentials) 
+            throws LoginException, RepositoryException {
+        return wrapped.login(credentials);
+    }
+
+    public Session login(String workspaceName) 
+            throws LoginException, NoSuchWorkspaceException, RepositoryException {
+        return wrapped.login((workspaceName == null ? getDefaultWorkspace() : workspaceName));
+    }
+
+    public Session loginAdministrative(String workspaceName) 
+            throws RepositoryException {
+        final Credentials credentials = new SimpleCredentials(ADMIN_NAME, ADMIN_PASSWORD.toCharArray());
+        return this.login(credentials, (workspaceName == null ? getDefaultWorkspace() : workspaceName));
+    }
+
+    @Override
+    public Session loginService(String subServiceName, String workspaceName) 
+            throws LoginException, RepositoryException {
+        return loginAdministrative(workspaceName);
+    }
+    
+    public Value getDescriptorValue(String key) {
+        return wrapped.getDescriptorValue(key);
+    }
+
+    public Value[] getDescriptorValues(String key) {
+        return wrapped.getDescriptorValues(key);
+    }
+
+    public boolean isSingleValueDescriptor(String key) {
+        return wrapped.isSingleValueDescriptor(key);
+    }
+
+    public boolean isStandardDescriptor(String key) {
+        return wrapped.isStandardDescriptor(key);
+    }
+
+}
\ No newline at end of file
diff --git a/src/test/java/org/apache/sling/testing/mock/sling/oak/contentimport/ContentLoaderBinaryTest.java b/src/test/java/org/apache/sling/testing/mock/sling/oak/contentimport/ContentLoaderBinaryTest.java
index 9072a48..1515912 100644
--- a/src/test/java/org/apache/sling/testing/mock/sling/oak/contentimport/ContentLoaderBinaryTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/sling/oak/contentimport/ContentLoaderBinaryTest.java
@@ -18,14 +18,6 @@
  */
 package org.apache.sling.testing.mock.sling.oak.contentimport;
 
-import java.io.IOException;
-
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
-
-import org.apache.sling.api.resource.ResourceResolver;
-import org.apache.sling.commons.testing.jcr.RepositoryUtil;
-import org.apache.sling.testing.mock.sling.MockSling;
 import org.apache.sling.testing.mock.sling.ResourceResolverType;
 import org.apache.sling.testing.mock.sling.loader.AbstractContentLoaderBinaryTest;
 
@@ -36,20 +28,4 @@ public class ContentLoaderBinaryTest extends AbstractContentLoaderBinaryTest {
         return ResourceResolverType.JCR_OAK;
     }
 
-    @Override
-    protected ResourceResolver newResourceResolver() {
-        ResourceResolver resolver = MockSling.newResourceResolver(getResourceResolverType());
-
-        // register sling node types
-        try {
-            RepositoryUtil.registerSlingNodeTypes(resolver.adaptTo(Session.class));
-        } catch (IOException ex) {
-            throw new RuntimeException("Unable to register sling node types.", ex);
-        } catch (RepositoryException ex) {
-            throw new RuntimeException("Unable to register sling node types.", ex);
-        }
-
-        return resolver;
-    }
-
 }
diff --git a/src/test/java/org/apache/sling/testing/mock/sling/oak/contentimport/ContentLoaderJsonDamTest.java b/src/test/java/org/apache/sling/testing/mock/sling/oak/contentimport/ContentLoaderJsonDamTest.java
index 4cbd95c..76b3a5c 100644
--- a/src/test/java/org/apache/sling/testing/mock/sling/oak/contentimport/ContentLoaderJsonDamTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/sling/oak/contentimport/ContentLoaderJsonDamTest.java
@@ -18,14 +18,6 @@
  */
 package org.apache.sling.testing.mock.sling.oak.contentimport;
 
-import java.io.IOException;
-
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
-
-import org.apache.sling.api.resource.ResourceResolver;
-import org.apache.sling.commons.testing.jcr.RepositoryUtil;
-import org.apache.sling.testing.mock.sling.MockSling;
 import org.apache.sling.testing.mock.sling.ResourceResolverType;
 import org.apache.sling.testing.mock.sling.loader.AbstractContentLoaderJsonDamTest;
 
@@ -35,24 +27,5 @@ public class ContentLoaderJsonDamTest extends AbstractContentLoaderJsonDamTest {
     protected ResourceResolverType getResourceResolverType() {
         return ResourceResolverType.JCR_OAK;
     }
-
-    @Override
-    protected ResourceResolver newResourceResolver() {
-        ResourceResolver resolver = MockSling.newResourceResolver(getResourceResolverType());
-
-        // register sling and app node types
-        try {
-            Session session = resolver.adaptTo(Session.class);
-            RepositoryUtil.registerSlingNodeTypes(session);
-            RepositoryUtil.registerNodeType(session,
-                    ContentLoaderJsonTest.class.getResourceAsStream("/SLING-INF/nodetypes/app.cnd"));
-        } catch (IOException ex) {
-            throw new RuntimeException("Unable to register sling node types.", ex);
-        } catch (RepositoryException ex) {
-            throw new RuntimeException("Unable to register sling node types.", ex);
-        }
-
-        return resolver;
-    }
-
+    
 }
diff --git a/src/test/java/org/apache/sling/testing/mock/sling/oak/contentimport/ContentLoaderJsonTest.java b/src/test/java/org/apache/sling/testing/mock/sling/oak/contentimport/ContentLoaderJsonTest.java
index 904f9c8..a1a5189 100644
--- a/src/test/java/org/apache/sling/testing/mock/sling/oak/contentimport/ContentLoaderJsonTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/sling/oak/contentimport/ContentLoaderJsonTest.java
@@ -18,14 +18,6 @@
  */
 package org.apache.sling.testing.mock.sling.oak.contentimport;
 
-import java.io.IOException;
-
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
-
-import org.apache.sling.api.resource.ResourceResolver;
-import org.apache.sling.commons.testing.jcr.RepositoryUtil;
-import org.apache.sling.testing.mock.sling.MockSling;
 import org.apache.sling.testing.mock.sling.ResourceResolverType;
 import org.apache.sling.testing.mock.sling.loader.AbstractContentLoaderJsonTest;
 
@@ -36,23 +28,4 @@ public class ContentLoaderJsonTest extends AbstractContentLoaderJsonTest {
         return ResourceResolverType.JCR_OAK;
     }
 
-    @Override
-    protected ResourceResolver newResourceResolver() {
-        ResourceResolver resolver = MockSling.newResourceResolver(getResourceResolverType());
-
-        // register sling and app node types
-        try {
-            Session session = resolver.adaptTo(Session.class);
-            RepositoryUtil.registerSlingNodeTypes(session);
-            RepositoryUtil.registerNodeType(session,
-                    ContentLoaderJsonTest.class.getResourceAsStream("/SLING-INF/nodetypes/app.cnd"));
-        } catch (IOException ex) {
-            throw new RuntimeException("Unable to register sling node types.", ex);
-        } catch (RepositoryException ex) {
-            throw new RuntimeException("Unable to register sling node types.", ex);
-        }
-
-        return resolver;
-    }
-
 }
diff --git a/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/JcrNamespaceTest.java b/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/JcrNamespaceTest.java
index e661d1c..0325b18 100644
--- a/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/JcrNamespaceTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/JcrNamespaceTest.java
@@ -20,10 +20,7 @@ package org.apache.sling.testing.mock.sling.oak.resource;
 
 import org.apache.sling.testing.mock.sling.ResourceResolverType;
 import org.apache.sling.testing.mock.sling.resource.AbstractJcrNamespaceTest;
-import org.junit.Ignore;
 
-//TEST IS DISABLED currently, it does not work with oak repository yet
-@Ignore
 public class JcrNamespaceTest extends AbstractJcrNamespaceTest {
 
     @Override
diff --git a/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/MultipleResourceResolverTest.java b/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/MultipleResourceResolverTest.java
index 090fb4d..ebd4727 100644
--- a/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/MultipleResourceResolverTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/MultipleResourceResolverTest.java
@@ -18,46 +18,14 @@
  */
 package org.apache.sling.testing.mock.sling.oak.resource;
 
-import java.io.IOException;
-
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
-
-import org.apache.sling.api.resource.LoginException;
-import org.apache.sling.api.resource.ResourceResolver;
-import org.apache.sling.api.resource.ResourceResolverFactory;
-import org.apache.sling.commons.testing.jcr.RepositoryUtil;
-import org.apache.sling.testing.mock.sling.MockSling;
 import org.apache.sling.testing.mock.sling.ResourceResolverType;
 import org.apache.sling.testing.mock.sling.resource.AbstractMultipleResourceResolverTest;
-import org.junit.Ignore;
 
-//TEST IS DISABLED currently, it does not work with jackrabbit repository yet
-@Ignore
 public class MultipleResourceResolverTest extends AbstractMultipleResourceResolverTest {
 
     @Override
     protected ResourceResolverType getResourceResolverType() {
         return ResourceResolverType.JCR_OAK;
     }
-
-    @Override
-    protected ResourceResolverFactory newResourceResolerFactory() {
-        ResourceResolverFactory factory = MockSling.newResourceResolverFactory(getResourceResolverType());
-
-        // register sling node types
-        try {
-            ResourceResolver resolver = factory.getResourceResolver(null);
-            RepositoryUtil.registerSlingNodeTypes(resolver.adaptTo(Session.class));
-        } catch (LoginException ex) {
-            throw new RuntimeException("Unable to register sling node types.", ex);
-        } catch (IOException ex) {
-            throw new RuntimeException("Unable to register sling node types.", ex);
-        } catch (RepositoryException ex) {
-            throw new RuntimeException("Unable to register sling node types.", ex);
-        }
-
-        return factory;
-    }
-
+    
 }
diff --git a/src/test/resources/SLING-INF/nodetypes/app.cnd b/src/test/resources/SLING-INF/nodetypes/app.cnd
deleted file mode 100644
index 105d39f..0000000
--- a/src/test/resources/SLING-INF/nodetypes/app.cnd
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-//  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.
-//
-<app='http://example.com/jcr/app/1.0'>
-<dam='http://example.com/jcr/dam/1.0'>
-
-[app:Page] > nt:unstructured
-[app:PageContent] > nt:unstructured
-
-[dam:Asset] > nt:unstructured
-[dam:AssetContent] > nt:unstructured

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

[sling-org-apache-sling-testing-sling-mock] 08/27: Update to Sling Parent 23

Posted by ro...@apache.org.
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-oak-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 74e91c09e2b908ce4595c87698c6a9f6c58846c2
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Thu Jun 25 13:08:16 2015 +0000

    Update to Sling Parent 23
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock-oak@1687500 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 53dbcf0..d50a2db 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>22</version>
+        <version>23</version>
         <relativePath/>
     </parent>
 

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

[sling-org-apache-sling-testing-sling-mock] 20/27: SLING-5084 sling-mock-oak: Provide a minimal index configuration for Sling-related properties

Posted by ro...@apache.org.
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-oak-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 300fe88196dfbf1509118922c0103fbd7a3da7a7
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Thu Oct 1 17:43:53 2015 +0000

    SLING-5084 sling-mock-oak: Provide a minimal index configuration for Sling-related properties
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock-oak@1706299 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/oak/OakMockResourceResolverAdapter.java  | 47 +++++++++++++++++++++-
 1 file changed, 46 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/testing/mock/sling/oak/OakMockResourceResolverAdapter.java b/src/main/java/org/apache/sling/testing/mock/sling/oak/OakMockResourceResolverAdapter.java
index 393fdc1..5b4cd73 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/oak/OakMockResourceResolverAdapter.java
+++ b/src/main/java/org/apache/sling/testing/mock/sling/oak/OakMockResourceResolverAdapter.java
@@ -18,7 +18,15 @@
  */
 package org.apache.sling.testing.mock.sling.oak;
 
+import static java.util.Collections.singleton;
+import static org.apache.jackrabbit.oak.plugins.index.IndexConstants.INDEX_DEFINITIONS_NAME;
+import static org.apache.jackrabbit.oak.plugins.index.IndexUtils.createIndexDefinition;
+
+import javax.jcr.Repository;
+
 import org.apache.jackrabbit.oak.jcr.Jcr;
+import org.apache.jackrabbit.oak.spi.lifecycle.RepositoryInitializer;
+import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.sling.api.resource.ResourceResolverFactory;
 import org.apache.sling.jcr.api.SlingRepository;
 import org.apache.sling.testing.mock.sling.spi.ResourceResolverTypeAdapter;
@@ -35,7 +43,44 @@ public class OakMockResourceResolverAdapter implements ResourceResolverTypeAdapt
 
     @Override
     public SlingRepository newSlingRepository() {
-        return new RepositoryWrapper(new Jcr().createRepository());
+        Repository repository = new Jcr()
+        .with(new ExtraSlingContent())
+        .createRepository();
+        return new RepositoryWrapper(repository);
+    }
+
+    /**
+     * Adds some default indexes useful for by sling resource-jcr mapping.
+     * This is only a small subset of what is defined by default in the org.apache.sling.jcr.oak.server bundle.
+     */
+    private static final class ExtraSlingContent implements RepositoryInitializer {
+
+        @Override
+        public void initialize(NodeBuilder root) {
+            if (root.hasChildNode(INDEX_DEFINITIONS_NAME)) {
+                NodeBuilder index = root.child(INDEX_DEFINITIONS_NAME);
+
+                // jcr:
+                property(index, "jcrLanguage", "jcr:language");
+                property(index, "jcrLockOwner", "jcr:lockOwner");
+
+                // sling:
+                property(index, "slingAlias", "sling:alias");
+                property(index, "slingResource", "sling:resource");
+                property(index, "slingResourceType", "sling:resourceType");
+                property(index, "slingVanityPath", "sling:vanityPath");
+            }
+        }
+
+        /**
+         * A convenience method to create a non-unique property index.
+         */
+        private static void property(NodeBuilder index, String indexName, String propertyName) {
+            if (!index.hasChildNode(indexName)) {
+                createIndexDefinition(index, indexName, true, false, singleton(propertyName), null);
+            }
+        }
+
     }
 
 }

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

[sling-org-apache-sling-testing-sling-mock] 26/27: [maven-release-plugin] prepare release org.apache.sling.testing.sling-mock-oak-1.0.0

Posted by ro...@apache.org.
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-oak-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 3769038d7d983010c02a1f308dda0e581ab5933a
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Mon Oct 5 17:37:07 2015 +0000

    [maven-release-plugin] prepare release org.apache.sling.testing.sling-mock-oak-1.0.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock-oak@1706887 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 374 ++++++++++++++++++++++++++++++++--------------------------------
 1 file changed, 187 insertions(+), 187 deletions(-)

diff --git a/pom.xml b/pom.xml
index f660b6e..93f00df 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,187 +1,187 @@
-<?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.
--->
-<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/xsd/maven-4.0.0.xsd">
-
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.sling</groupId>
-        <artifactId>sling</artifactId>
-        <version>25</version>
-        <relativePath/>
-    </parent>
-
-    <artifactId>org.apache.sling.testing.sling-mock-oak</artifactId>
-    <version>0.1.0-SNAPSHOT</version>
-    <packaging>bundle</packaging>
-  
-    <name>Apache Sling Testing Sling Mock Oak-based Resource Resolver</name>
-    <description>Implements a resource resolver type for Jackrabbit Oak that can be used in unit tests based on Sling Mocks.</description>
-  
-    <properties>
-        <oak.version>1.2.2</oak.version>
-        <jackrabbit.version>2.10.1</jackrabbit.version>
-    </properties>
-
-    <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock-oak</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock-oak</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/testing/mocks/sling-mock-oak</url>
-    </scm>
-
-    <dependencies>
-
-        <dependency>
-            <groupId>org.apache.sling</groupId>
-            <artifactId>org.apache.sling.testing.sling-mock</artifactId>
-            <version>1.6.0</version>
-            <scope>compile</scope>
-        </dependency>
-    
-        <dependency>
-            <groupId>org.apache.sling</groupId>
-            <artifactId>org.apache.sling.testing.sling-mock</artifactId>
-            <version>1.6.0</version>
-            <classifier>tests</classifier>
-            <scope>test</scope>
-        </dependency>
-
-        <!-- Depend on oak-jcr, which pulls in all needed Oak artifacts -->
-        <dependency>
-            <groupId>org.apache.jackrabbit</groupId>
-            <artifactId>oak-jcr</artifactId>
-            <version>${oak.version}</version>
-        </dependency>
-        
-        <!-- Ensure we depend on more recent jackrabbit artifacts required by Oak -->
-        <dependency>
-            <groupId>org.apache.jackrabbit</groupId>
-            <artifactId>jackrabbit-jcr-commons</artifactId>
-            <version>${jackrabbit.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.jackrabbit</groupId>
-            <artifactId>jackrabbit-api</artifactId>
-            <version>${jackrabbit.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>javax.jcr</groupId>
-            <artifactId>jcr</artifactId>
-            <version>2.0</version>
-            <scope>compile</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-all</artifactId>
-            <version>1.9.5</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.sling</groupId>
-            <artifactId>org.apache.sling.testing.logging-mock</artifactId>
-            <version>1.0.0</version>
-            <scope>test</scope>
-        </dependency>
-  
-    </dependencies>
-  
-    <build>
-        <plugins>
-    
-          <!-- Publish test artifact -->
-          <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-jar-plugin</artifactId>
-            <executions>
-              <execution>
-                <goals>
-                  <goal>test-jar</goal>
-                </goals>
-              </execution>
-            </executions>
-          </plugin>
-    
-          <plugin>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>maven-bundle-plugin</artifactId>
-            <extensions>true</extensions>
-          </plugin>
-    
-          <plugin>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>maven-scr-plugin</artifactId>
-            <executions>
-              <execution>
-                <id>generate-scr-scrdescriptor</id>
-                <goals>
-                  <goal>scr</goal>
-                </goals>
-              </execution>
-            </executions>
-          </plugin>
-
-          <plugin>
-              <groupId>org.apache.maven.plugins</groupId>
-              <artifactId>maven-shade-plugin</artifactId>
-              <version>2.4.1</version>
-              <configuration>
-                <!--
-                    embed all jackrabbit artifacts to prevent classpath clashes
-                    also include selected Sling bundles which are required
-                    at runtime. Note that we don't relocate the packages
-                    since org.apache.sling.jcr.resource already embeds some
-                    jackrabbit classes which lead to a non-working jar
-                -->
-                <artifactSet>
-                    <includes>
-                        <include>org.apache.jackrabbit:*</include>
-                    </includes>
-                </artifactSet>
-              </configuration>
-              <executions>
-                <execution>
-                    <phase>package</phase>
-                    <goals>
-                        <goal>shade</goal>
-                    </goals>
-                </execution>
-              </executions>
-          </plugin>
-
-          <plugin>
-                <groupId>org.apache.rat</groupId>
-                <artifactId>apache-rat-plugin</artifactId>
-                <configuration>
-                    <excludes>
-                        <exclude>dependency-reduced-pom.xml</exclude>
-                    </excludes>
-                </configuration>
-          </plugin>
-        </plugins>
-    </build>
-  
-</project>
+<?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.
+-->
+<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/xsd/maven-4.0.0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.sling</groupId>
+        <artifactId>sling</artifactId>
+        <version>25</version>
+        <relativePath />
+    </parent>
+
+    <artifactId>org.apache.sling.testing.sling-mock-oak</artifactId>
+    <version>1.0.0</version>
+    <packaging>bundle</packaging>
+  
+    <name>Apache Sling Testing Sling Mock Oak-based Resource Resolver</name>
+    <description>Implements a resource resolver type for Jackrabbit Oak that can be used in unit tests based on Sling Mocks.</description>
+  
+    <properties>
+        <oak.version>1.2.2</oak.version>
+        <jackrabbit.version>2.10.1</jackrabbit.version>
+    </properties>
+
+    <scm>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.sling-mock-oak-1.0.0</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.sling-mock-oak-1.0.0</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.testing.sling-mock-oak-1.0.0</url>
+    </scm>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.testing.sling-mock</artifactId>
+            <version>1.6.0</version>
+            <scope>compile</scope>
+        </dependency>
+    
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.testing.sling-mock</artifactId>
+            <version>1.6.0</version>
+            <classifier>tests</classifier>
+            <scope>test</scope>
+        </dependency>
+
+        <!-- Depend on oak-jcr, which pulls in all needed Oak artifacts -->
+        <dependency>
+            <groupId>org.apache.jackrabbit</groupId>
+            <artifactId>oak-jcr</artifactId>
+            <version>${oak.version}</version>
+        </dependency>
+        
+        <!-- Ensure we depend on more recent jackrabbit artifacts required by Oak -->
+        <dependency>
+            <groupId>org.apache.jackrabbit</groupId>
+            <artifactId>jackrabbit-jcr-commons</artifactId>
+            <version>${jackrabbit.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.jackrabbit</groupId>
+            <artifactId>jackrabbit-api</artifactId>
+            <version>${jackrabbit.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>javax.jcr</groupId>
+            <artifactId>jcr</artifactId>
+            <version>2.0</version>
+            <scope>compile</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-all</artifactId>
+            <version>1.9.5</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.testing.logging-mock</artifactId>
+            <version>1.0.0</version>
+            <scope>test</scope>
+        </dependency>
+  
+    </dependencies>
+  
+    <build>
+        <plugins>
+    
+          <!-- Publish test artifact -->
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-jar-plugin</artifactId>
+            <executions>
+              <execution>
+                <goals>
+                  <goal>test-jar</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+    
+          <plugin>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>maven-bundle-plugin</artifactId>
+            <extensions>true</extensions>
+          </plugin>
+    
+          <plugin>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>maven-scr-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>generate-scr-scrdescriptor</id>
+                <goals>
+                  <goal>scr</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+
+          <plugin>
+              <groupId>org.apache.maven.plugins</groupId>
+              <artifactId>maven-shade-plugin</artifactId>
+              <version>2.4.1</version>
+              <configuration>
+                <!--
+                    embed all jackrabbit artifacts to prevent classpath clashes
+                    also include selected Sling bundles which are required
+                    at runtime. Note that we don't relocate the packages
+                    since org.apache.sling.jcr.resource already embeds some
+                    jackrabbit classes which lead to a non-working jar
+                -->
+                <artifactSet>
+                    <includes>
+                        <include>org.apache.jackrabbit:*</include>
+                    </includes>
+                </artifactSet>
+              </configuration>
+              <executions>
+                <execution>
+                    <phase>package</phase>
+                    <goals>
+                        <goal>shade</goal>
+                    </goals>
+                </execution>
+              </executions>
+          </plugin>
+
+          <plugin>
+                <groupId>org.apache.rat</groupId>
+                <artifactId>apache-rat-plugin</artifactId>
+                <configuration>
+                    <excludes>
+                        <exclude>dependency-reduced-pom.xml</exclude>
+                    </excludes>
+                </configuration>
+          </plugin>
+        </plugins>
+    </build>
+  
+</project>

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

[sling-org-apache-sling-testing-sling-mock] 16/27: SLING-5064 sling-mock: Register JCR node types for OSGi bundles in class path

Posted by ro...@apache.org.
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-oak-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 9484e6db5c181eb96e245e175b2043f12cde3d84
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Sat Sep 26 15:30:02 2015 +0000

    SLING-5064 sling-mock: Register JCR node types for OSGi bundles in class path
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock-oak@1705475 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/oak/OakMockResourceResolverAdapter.java  | 30 ++++++++++++++++++++--
 1 file changed, 28 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/sling/testing/mock/sling/oak/OakMockResourceResolverAdapter.java b/src/main/java/org/apache/sling/testing/mock/sling/oak/OakMockResourceResolverAdapter.java
index 895608b..a017407 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/oak/OakMockResourceResolverAdapter.java
+++ b/src/main/java/org/apache/sling/testing/mock/sling/oak/OakMockResourceResolverAdapter.java
@@ -18,10 +18,14 @@
  */
 package org.apache.sling.testing.mock.sling.oak;
 
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
 import org.apache.jackrabbit.oak.jcr.Jcr;
 import org.apache.sling.api.resource.ResourceResolverFactory;
 import org.apache.sling.commons.testing.jcr.RepositoryUtil;
 import org.apache.sling.jcr.api.SlingRepository;
+import org.apache.sling.testing.mock.sling.context.NodeTypeDefinitionScanner;
 import org.apache.sling.testing.mock.sling.spi.ResourceResolverTypeAdapter;
 
 /**
@@ -36,8 +40,30 @@ public class OakMockResourceResolverAdapter implements ResourceResolverTypeAdapt
 
     @Override
     public SlingRepository newSlingRepository() {
-        
-        return new RepositoryUtil.RepositoryWrapper(new Jcr().createRepository());
+        SlingRepository slingRepository = new RepositoryUtil.RepositoryWrapper(new Jcr().createRepository());
+        registerJcrNodeTypes(slingRepository);
+        return slingRepository;
+    }
+
+    /**
+     * Registers all JCR node types found in classpath.
+     * @param slingRepository Sling repository
+     */
+    @SuppressWarnings("deprecation")
+    private static void registerJcrNodeTypes(SlingRepository slingRepository) {
+      Session session = null;
+      try {
+          session =  slingRepository.loginAdministrative(null);
+          NodeTypeDefinitionScanner.get().register(session);
+      }
+      catch (RepositoryException ex) {
+          throw new RuntimeException("Error registering JCR nodetypes: " + ex.getMessage(), ex);
+      }
+      finally {
+          if (session != null) {
+              session.logout();
+          }
+      }
     }
 
 }

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

[sling-org-apache-sling-testing-sling-mock] 27/27: [maven-release-plugin] copy for tag org.apache.sling.testing.sling-mock-oak-1.0.0

Posted by ro...@apache.org.
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-oak-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 740d4cd7d3c61b70758fe0fb74fca4ce6150904a
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Mon Oct 5 17:37:20 2015 +0000

    [maven-release-plugin] copy for tag org.apache.sling.testing.sling-mock-oak-1.0.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.sling-mock-oak-1.0.0@1706888 13f79535-47bb-0310-9956-ffa450edef68

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

[sling-org-apache-sling-testing-sling-mock] 10/27: Update rat exclude rules

Posted by ro...@apache.org.
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-oak-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 3b08cf06937fee341ae95bc43de0221a7c89a9ec
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Thu Jun 25 15:13:17 2015 +0000

    Update rat exclude rules
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock-oak@1687547 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/pom.xml b/pom.xml
index 17d8fd3..66de223 100644
--- a/pom.xml
+++ b/pom.xml
@@ -184,6 +184,16 @@
                 </execution>
               </executions>
           </plugin>
+
+          <plugin>
+                <groupId>org.apache.rat</groupId>
+                <artifactId>apache-rat-plugin</artifactId>
+                <configuration>
+                    <excludes>
+                        <exclude>dependency-reduced-pom.xml</exclude>
+                    </excludes>
+                </configuration>
+          </plugin>
         </plugins>
     </build>
   

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

[sling-org-apache-sling-testing-sling-mock] 24/27: SLING-5088 do not use ReflectiveOperationException which is a JDK 1.7 class

Posted by ro...@apache.org.
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-oak-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 4c2c44271fb42e1c49635910338fe63e18b15cfc
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Mon Oct 5 12:55:20 2015 +0000

    SLING-5088 do not use ReflectiveOperationException which is a JDK 1.7 class
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock-oak@1706830 13f79535-47bb-0310-9956-ffa450edef68
---
 .../apache/sling/testing/mock/sling/oak/OakMockSlingRepository.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/sling/testing/mock/sling/oak/OakMockSlingRepository.java b/src/main/java/org/apache/sling/testing/mock/sling/oak/OakMockSlingRepository.java
index fdcecb1..1bee5d8 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/oak/OakMockSlingRepository.java
+++ b/src/main/java/org/apache/sling/testing/mock/sling/oak/OakMockSlingRepository.java
@@ -78,8 +78,8 @@ public final class OakMockSlingRepository implements SlingRepository {
             ExecutorService executor = (ExecutorService)executorField.get(this.oak);
             executor.shutdownNow();
         }
-        catch (ReflectiveOperationException ex) {
-            log.error("Memory leak: Unable to shutdown executor service from field '" + fieldName + "' in " + this.oak, ex);
+        catch (Throwable ex) {
+            log.error("Potential Memory leak: Unable to shutdown executor service from field '" + fieldName + "' in " + this.oak, ex);
         }
     }
 

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

[sling-org-apache-sling-testing-sling-mock] 14/27: SLING-5007 realx unit test to test root path child listing in sling-mock-jackrabbit and sling-mock-jackrabbit and sling-mock-oak because in real repositories multiple root test nodes may be created in parallel, or nodes already exist

Posted by ro...@apache.org.
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-oak-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 82ac036b7bef786ea8068e92344260349c1d0bca
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Wed Sep 9 10:22:46 2015 +0000

    SLING-5007 realx unit test to test root path child listing in sling-mock-jackrabbit and sling-mock-jackrabbit and sling-mock-oak because in real repositories multiple root test nodes may be created in parallel, or nodes already exist
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock-oak@1701971 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                                |  4 ++--
 .../oak/resource/SlingCrudResourceResolverTest.java    | 18 ++++++++++++++++++
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index c74fa28..5135d42 100644
--- a/pom.xml
+++ b/pom.xml
@@ -50,14 +50,14 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.sling-mock</artifactId>
-            <version>1.4.0</version>
+            <version>1.5.1-SNAPSHOT</version>
             <scope>compile</scope>
         </dependency>
     
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.sling-mock</artifactId>
-            <version>1.4.0</version>
+            <version>1.5.1-SNAPSHOT</version>
             <classifier>tests</classifier>
             <scope>test</scope>
         </dependency>
diff --git a/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/SlingCrudResourceResolverTest.java b/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/SlingCrudResourceResolverTest.java
index ec7755c..9519dd6 100644
--- a/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/SlingCrudResourceResolverTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/SlingCrudResourceResolverTest.java
@@ -18,17 +18,23 @@
  */
 package org.apache.sling.testing.mock.sling.oak.resource;
 
+import static org.junit.Assert.assertFalse;
+
 import java.io.IOException;
+import java.util.List;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 
+import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.commons.testing.jcr.RepositoryUtil;
 import org.apache.sling.testing.mock.sling.MockSling;
 import org.apache.sling.testing.mock.sling.ResourceResolverType;
 import org.apache.sling.testing.mock.sling.resource.AbstractSlingCrudResourceResolverTest;
 
+import com.google.common.collect.Lists;
+
 public class SlingCrudResourceResolverTest extends AbstractSlingCrudResourceResolverTest {
 
     @Override
@@ -52,4 +58,16 @@ public class SlingCrudResourceResolverTest extends AbstractSlingCrudResourceReso
         return resolver;
     }
 
+    @Override
+    public void testListChildren_RootNode() throws IOException {
+        Resource resource1 = resourceResolver.getResource("/");
+
+        // relax test conditions to check only for none-empty because in real repository multiple test notes may be created in parallel
+        List<Resource> children = Lists.newArrayList(resource1.listChildren());
+        assertFalse(children.isEmpty());
+
+        children = Lists.newArrayList(resource1.getChildren());
+        assertFalse(children.isEmpty());
+    }
+    
 }

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

[sling-org-apache-sling-testing-sling-mock] 02/27: Mocks: use latest snapshots

Posted by ro...@apache.org.
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-oak-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit e224c05f067021bbf803f3e8216b700628633785
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Wed May 27 13:26:03 2015 +0000

    Mocks: use latest snapshots
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock-oak@1682015 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 39975f4..9eb10f1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -47,7 +47,7 @@
     </scm>
 
     <dependencies>
-  
+
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.sling-mock</artifactId>
@@ -62,7 +62,7 @@
             <classifier>tests</classifier>
             <scope>test</scope>
         </dependency>
-  
+
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.commons.testing</artifactId>

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

[sling-org-apache-sling-testing-sling-mock] 12/27: add "dependency-reduced-pom.xml" to svn:ignore

Posted by ro...@apache.org.
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-oak-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 3da36201a6f1311df263e5b0d0b13f62a7caa50d
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Mon Jun 29 08:09:10 2015 +0000

    add "dependency-reduced-pom.xml" to svn:ignore
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock-oak@1688102 13f79535-47bb-0310-9956-ffa450edef68

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

[sling-org-apache-sling-testing-sling-mock] 09/27: Testing: remove superflous sling.java.version=6 as it's the default now

Posted by ro...@apache.org.
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-oak-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 2001197d3ab4a18e31658465d0bdb6857f749213
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Thu Jun 25 13:17:42 2015 +0000

    Testing: remove superflous sling.java.version=6 as it's the default now
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock-oak@1687511 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index d50a2db..17d8fd3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -35,7 +35,6 @@
     <description>Implements a resource resolver type for Jackrabbit Oak that can be used in unit tests based on Sling Mocks.</description>
   
     <properties>
-        <sling.java.version>6</sling.java.version>
         <oak.version>1.2.2</oak.version>
         <jackrabbit.version>2.10.1</jackrabbit.version>
     </properties>

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

[sling-org-apache-sling-testing-sling-mock] 15/27: SLING-5007 use same unit tests for root node tests for all resource resolver types without counting the number of children.

Posted by ro...@apache.org.
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-oak-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 8d645b6b1093a744f5ba29db1576c64d198a4848
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Wed Sep 16 09:35:50 2015 +0000

    SLING-5007 use same unit tests for root node tests for all resource resolver types without counting the number of children.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock-oak@1703373 13f79535-47bb-0310-9956-ffa450edef68
---
 .../oak/resource/SlingCrudResourceResolverTest.java    | 18 ------------------
 1 file changed, 18 deletions(-)

diff --git a/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/SlingCrudResourceResolverTest.java b/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/SlingCrudResourceResolverTest.java
index 9519dd6..ec7755c 100644
--- a/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/SlingCrudResourceResolverTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/SlingCrudResourceResolverTest.java
@@ -18,23 +18,17 @@
  */
 package org.apache.sling.testing.mock.sling.oak.resource;
 
-import static org.junit.Assert.assertFalse;
-
 import java.io.IOException;
-import java.util.List;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 
-import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.commons.testing.jcr.RepositoryUtil;
 import org.apache.sling.testing.mock.sling.MockSling;
 import org.apache.sling.testing.mock.sling.ResourceResolverType;
 import org.apache.sling.testing.mock.sling.resource.AbstractSlingCrudResourceResolverTest;
 
-import com.google.common.collect.Lists;
-
 public class SlingCrudResourceResolverTest extends AbstractSlingCrudResourceResolverTest {
 
     @Override
@@ -58,16 +52,4 @@ public class SlingCrudResourceResolverTest extends AbstractSlingCrudResourceReso
         return resolver;
     }
 
-    @Override
-    public void testListChildren_RootNode() throws IOException {
-        Resource resource1 = resourceResolver.getResource("/");
-
-        // relax test conditions to check only for none-empty because in real repository multiple test notes may be created in parallel
-        List<Resource> children = Lists.newArrayList(resource1.listChildren());
-        assertFalse(children.isEmpty());
-
-        children = Lists.newArrayList(resource1.getChildren());
-        assertFalse(children.isEmpty());
-    }
-    
 }

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

[sling-org-apache-sling-testing-sling-mock] 11/27: switch to released versions

Posted by ro...@apache.org.
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-oak-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 69ff780542b1f46cb684dae90b565b6f2627bce8
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Mon Jun 29 08:08:35 2015 +0000

    switch to released versions
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock-oak@1688101 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 66de223..4282a02 100644
--- a/pom.xml
+++ b/pom.xml
@@ -50,14 +50,14 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.sling-mock</artifactId>
-            <version>1.4.1-SNAPSHOT</version>
+            <version>1.4.0</version>
             <scope>compile</scope>
         </dependency>
     
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.sling-mock</artifactId>
-            <version>1.4.1-SNAPSHOT</version>
+            <version>1.4.0</version>
             <classifier>tests</classifier>
             <scope>test</scope>
         </dependency>

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

[sling-org-apache-sling-testing-sling-mock] 06/27: SLING-4824 - Embed all needed classes in the sling-oak-mock jar

Posted by ro...@apache.org.
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-oak-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 9b901a8f68f92e2d41e14accb0c2d353f8e56f5f
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Fri Jun 19 14:18:27 2015 +0000

    SLING-4824 - Embed all needed classes in the sling-oak-mock jar
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock-oak@1686422 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 30 +++++++++++++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 5890259..ffe073c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -156,7 +156,35 @@
               </execution>
             </executions>
           </plugin>
-    
+
+          <plugin>
+              <groupId>org.apache.maven.plugins</groupId>
+              <artifactId>maven-shade-plugin</artifactId>
+              <version>2.4</version>
+              <configuration>
+                <!--
+                    embed all jackrabbit artifacts to prevent classpath clashes
+                    also include selected Sling bundles which are required
+                    at runtime. Note that we don't relocate the packages
+                    since org.apache.sling.jcr.resource already embeds some
+                    jackrabbit classes which lead to a non-working jar
+                -->
+                <artifactSet>
+                    <includes>
+                        <include>org.apache.jackrabbit:*</include>
+                        <include>org.apache.sling:org.apache.sling.jcr.resource</include>
+                    </includes>
+                </artifactSet>
+              </configuration>
+              <executions>
+                <execution>
+                    <phase>package</phase>
+                    <goals>
+                        <goal>shade</goal>
+                    </goals>
+                </execution>
+              </executions>
+          </plugin>
         </plugins>
     </build>
   

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

[sling-org-apache-sling-testing-sling-mock] 03/27: update to released mock versions

Posted by ro...@apache.org.
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-oak-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit c72f3a4562ec781c54c241ed34b87dac1c15fa7b
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Sat May 30 10:03:55 2015 +0000

    update to released mock versions
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock-oak@1682594 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pom.xml b/pom.xml
index 9eb10f1..d192285 100644
--- a/pom.xml
+++ b/pom.xml
@@ -51,14 +51,14 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.sling-mock</artifactId>
-            <version>1.3.1-SNAPSHOT</version>
+            <version>1.3.0</version>
             <scope>compile</scope>
         </dependency>
     
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.sling-mock</artifactId>
-            <version>1.3.1-SNAPSHOT</version>
+            <version>1.3.0</version>
             <classifier>tests</classifier>
             <scope>test</scope>
         </dependency>
@@ -116,7 +116,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.logging-mock</artifactId>
-            <version>1.0.0-SNAPSHOT</version>
+            <version>1.0.0</version>
             <scope>test</scope>
         </dependency>
   

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

[sling-org-apache-sling-testing-sling-mock] 18/27: SLING-5064 manual registration of node types no longer required

Posted by ro...@apache.org.
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-oak-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 657461c00847da826f66d805f04c848a89527100
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Mon Sep 28 20:37:05 2015 +0000

    SLING-5064 manual registration of node types no longer required
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock-oak@1705764 13f79535-47bb-0310-9956-ffa450edef68
---
 .../oak/resource/JcrResourceResolverTest.java      | 24 ----------------------
 .../resource/SlingCrudResourceResolverTest.java    | 24 ----------------------
 2 files changed, 48 deletions(-)

diff --git a/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/JcrResourceResolverTest.java b/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/JcrResourceResolverTest.java
index 894ef08..7d055d6 100644
--- a/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/JcrResourceResolverTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/JcrResourceResolverTest.java
@@ -18,14 +18,6 @@
  */
 package org.apache.sling.testing.mock.sling.oak.resource;
 
-import java.io.IOException;
-
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
-
-import org.apache.sling.api.resource.ResourceResolver;
-import org.apache.sling.commons.testing.jcr.RepositoryUtil;
-import org.apache.sling.testing.mock.sling.MockSling;
 import org.apache.sling.testing.mock.sling.ResourceResolverType;
 import org.apache.sling.testing.mock.sling.resource.AbstractJcrResourceResolverTest;
 
@@ -36,20 +28,4 @@ public class JcrResourceResolverTest extends AbstractJcrResourceResolverTest {
         return ResourceResolverType.JCR_OAK;
     }
 
-    @Override
-    protected ResourceResolver newResourceResolver() {
-        ResourceResolver resolver = MockSling.newResourceResolver(getResourceResolverType());
-
-        // register sling node types
-        try {
-            RepositoryUtil.registerSlingNodeTypes(resolver.adaptTo(Session.class));
-        } catch (IOException ex) {
-            throw new RuntimeException("Unable to register sling node types.", ex);
-        } catch (RepositoryException ex) {
-            throw new RuntimeException("Unable to register sling node types.", ex);
-        }
-
-        return resolver;
-    }
-
 }
diff --git a/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/SlingCrudResourceResolverTest.java b/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/SlingCrudResourceResolverTest.java
index ec7755c..10a01dc 100644
--- a/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/SlingCrudResourceResolverTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/SlingCrudResourceResolverTest.java
@@ -18,14 +18,6 @@
  */
 package org.apache.sling.testing.mock.sling.oak.resource;
 
-import java.io.IOException;
-
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
-
-import org.apache.sling.api.resource.ResourceResolver;
-import org.apache.sling.commons.testing.jcr.RepositoryUtil;
-import org.apache.sling.testing.mock.sling.MockSling;
 import org.apache.sling.testing.mock.sling.ResourceResolverType;
 import org.apache.sling.testing.mock.sling.resource.AbstractSlingCrudResourceResolverTest;
 
@@ -36,20 +28,4 @@ public class SlingCrudResourceResolverTest extends AbstractSlingCrudResourceReso
         return ResourceResolverType.JCR_OAK;
     }
 
-    @Override
-    protected ResourceResolver newResourceResolver() {
-        ResourceResolver resolver = MockSling.newResourceResolver(getResourceResolverType());
-
-        // register sling node types
-        try {
-            RepositoryUtil.registerSlingNodeTypes(resolver.adaptTo(Session.class));
-        } catch (IOException ex) {
-            throw new RuntimeException("Unable to register sling node types.", ex);
-        } catch (RepositoryException ex) {
-            throw new RuntimeException("Unable to register sling node types.", ex);
-        }
-
-        return resolver;
-    }
-
 }

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

[sling-org-apache-sling-testing-sling-mock] 17/27: SLING-5067 sling-mock: "uniqueRoot()" to simplify creation and cleanup of unique root paths in repository

Posted by ro...@apache.org.
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-oak-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit fa5c56d1fbe9ab4b3fdc1a5d40e483a9af775473
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Sun Sep 27 09:46:11 2015 +0000

    SLING-5067 sling-mock: "uniqueRoot()" to simplify creation and cleanup of unique root paths in repository
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock-oak@1705520 13f79535-47bb-0310-9956-ffa450edef68
---
 .../mock/sling/oak/resource/UniqueRootTest.java    | 31 ++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/UniqueRootTest.java b/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/UniqueRootTest.java
new file mode 100644
index 0000000..cf70e5a
--- /dev/null
+++ b/src/test/java/org/apache/sling/testing/mock/sling/oak/resource/UniqueRootTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.oak.resource;
+
+import org.apache.sling.testing.mock.sling.ResourceResolverType;
+import org.apache.sling.testing.mock.sling.resource.AbstractUniqueRootTest;
+
+public class UniqueRootTest extends AbstractUniqueRootTest {
+
+    @Override
+    protected ResourceResolverType getResourceResolverType() {
+        return ResourceResolverType.JCR_OAK;
+    }
+
+}

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

[sling-org-apache-sling-testing-sling-mock] 22/27: SLING-5088 control SlingRepository resources via activate/deactivate methods; make sure all oak ExecutorServices are shutdown properly

Posted by ro...@apache.org.
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-oak-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 2d405ea10a51e3ec5fe850315a269d7ed628410b
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Fri Oct 2 23:31:40 2015 +0000

    SLING-5088 control SlingRepository resources via activate/deactivate methods; make sure all oak ExecutorServices are shutdown properly
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock-oak@1706505 13f79535-47bb-0310-9956-ffa450edef68
---
 .../testing/mock/sling/oak/ExtraSlingContent.java  | 60 ++++++++++++++++++
 .../sling/oak/OakMockResourceResolverAdapter.java  | 48 +-------------
 ...oryWrapper.java => OakMockSlingRepository.java} | 74 +++++++++++++++++-----
 .../sling/testing/mock/sling/oak/package-info.java |  2 +-
 4 files changed, 121 insertions(+), 63 deletions(-)

diff --git a/src/main/java/org/apache/sling/testing/mock/sling/oak/ExtraSlingContent.java b/src/main/java/org/apache/sling/testing/mock/sling/oak/ExtraSlingContent.java
new file mode 100644
index 0000000..8500ab6
--- /dev/null
+++ b/src/main/java/org/apache/sling/testing/mock/sling/oak/ExtraSlingContent.java
@@ -0,0 +1,60 @@
+/*
+ * 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.oak;
+
+import static java.util.Collections.singleton;
+import static org.apache.jackrabbit.oak.plugins.index.IndexConstants.INDEX_DEFINITIONS_NAME;
+import static org.apache.jackrabbit.oak.plugins.index.IndexUtils.createIndexDefinition;
+
+import org.apache.jackrabbit.oak.spi.lifecycle.RepositoryInitializer;
+import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
+
+/**
+ * Adds some default indexes useful for by sling resource-jcr mapping.
+ * This is only a small subset of what is defined by default in the org.apache.sling.jcr.oak.server bundle.
+ */
+final class ExtraSlingContent implements RepositoryInitializer {
+
+    @Override
+    public void initialize(NodeBuilder root) {
+        if (root.hasChildNode(INDEX_DEFINITIONS_NAME)) {
+            NodeBuilder index = root.child(INDEX_DEFINITIONS_NAME);
+
+            // jcr:
+            property(index, "jcrLanguage", "jcr:language");
+            property(index, "jcrLockOwner", "jcr:lockOwner");
+
+            // sling:
+            property(index, "slingAlias", "sling:alias");
+            property(index, "slingResource", "sling:resource");
+            property(index, "slingResourceType", "sling:resourceType");
+            property(index, "slingVanityPath", "sling:vanityPath");
+        }
+    }
+
+    /**
+     * A convenience method to create a non-unique property index.
+     */
+    private static void property(NodeBuilder index, String indexName, String propertyName) {
+        if (!index.hasChildNode(indexName)) {
+            createIndexDefinition(index, indexName, true, false, singleton(propertyName), null);
+        }
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/testing/mock/sling/oak/OakMockResourceResolverAdapter.java b/src/main/java/org/apache/sling/testing/mock/sling/oak/OakMockResourceResolverAdapter.java
index 5b4cd73..cefb70b 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/oak/OakMockResourceResolverAdapter.java
+++ b/src/main/java/org/apache/sling/testing/mock/sling/oak/OakMockResourceResolverAdapter.java
@@ -18,15 +18,6 @@
  */
 package org.apache.sling.testing.mock.sling.oak;
 
-import static java.util.Collections.singleton;
-import static org.apache.jackrabbit.oak.plugins.index.IndexConstants.INDEX_DEFINITIONS_NAME;
-import static org.apache.jackrabbit.oak.plugins.index.IndexUtils.createIndexDefinition;
-
-import javax.jcr.Repository;
-
-import org.apache.jackrabbit.oak.jcr.Jcr;
-import org.apache.jackrabbit.oak.spi.lifecycle.RepositoryInitializer;
-import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.sling.api.resource.ResourceResolverFactory;
 import org.apache.sling.jcr.api.SlingRepository;
 import org.apache.sling.testing.mock.sling.spi.ResourceResolverTypeAdapter;
@@ -43,44 +34,7 @@ public class OakMockResourceResolverAdapter implements ResourceResolverTypeAdapt
 
     @Override
     public SlingRepository newSlingRepository() {
-        Repository repository = new Jcr()
-        .with(new ExtraSlingContent())
-        .createRepository();
-        return new RepositoryWrapper(repository);
-    }
-
-    /**
-     * Adds some default indexes useful for by sling resource-jcr mapping.
-     * This is only a small subset of what is defined by default in the org.apache.sling.jcr.oak.server bundle.
-     */
-    private static final class ExtraSlingContent implements RepositoryInitializer {
-
-        @Override
-        public void initialize(NodeBuilder root) {
-            if (root.hasChildNode(INDEX_DEFINITIONS_NAME)) {
-                NodeBuilder index = root.child(INDEX_DEFINITIONS_NAME);
-
-                // jcr:
-                property(index, "jcrLanguage", "jcr:language");
-                property(index, "jcrLockOwner", "jcr:lockOwner");
-
-                // sling:
-                property(index, "slingAlias", "sling:alias");
-                property(index, "slingResource", "sling:resource");
-                property(index, "slingResourceType", "sling:resourceType");
-                property(index, "slingVanityPath", "sling:vanityPath");
-            }
-        }
-
-        /**
-         * A convenience method to create a non-unique property index.
-         */
-        private static void property(NodeBuilder index, String indexName, String propertyName) {
-            if (!index.hasChildNode(indexName)) {
-                createIndexDefinition(index, indexName, true, false, singleton(propertyName), null);
-            }
-        }
-
+        return new OakMockSlingRepository();
     }
 
 }
diff --git a/src/main/java/org/apache/sling/testing/mock/sling/oak/RepositoryWrapper.java b/src/main/java/org/apache/sling/testing/mock/sling/oak/OakMockSlingRepository.java
similarity index 52%
rename from src/main/java/org/apache/sling/testing/mock/sling/oak/RepositoryWrapper.java
rename to src/main/java/org/apache/sling/testing/mock/sling/oak/OakMockSlingRepository.java
index 6c0d9d1..fdcecb1 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/oak/RepositoryWrapper.java
+++ b/src/main/java/org/apache/sling/testing/mock/sling/oak/OakMockSlingRepository.java
@@ -18,6 +18,9 @@
  */
 package org.apache.sling.testing.mock.sling.oak;
 
+import java.lang.reflect.Field;
+import java.util.concurrent.ExecutorService;
+
 import javax.jcr.Credentials;
 import javax.jcr.LoginException;
 import javax.jcr.NoSuchWorkspaceException;
@@ -27,25 +30,66 @@ import javax.jcr.Session;
 import javax.jcr.SimpleCredentials;
 import javax.jcr.Value;
 
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Deactivate;
+import org.apache.felix.scr.annotations.Service;
+import org.apache.jackrabbit.api.JackrabbitRepository;
+import org.apache.jackrabbit.oak.Oak;
+import org.apache.jackrabbit.oak.jcr.Jcr;
 import org.apache.sling.jcr.api.SlingRepository;
+import org.osgi.service.component.ComponentContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
-public final class RepositoryWrapper implements SlingRepository {
+@Component
+@Service(SlingRepository.class)
+public final class OakMockSlingRepository implements SlingRepository {
 
     private static final String ADMIN_NAME = "admin";
     private static final String ADMIN_PASSWORD = "admin";
 
-    protected final Repository wrapped;
+    private Oak oak;
+    private Repository repository;
+    
+    private static final Logger log = LoggerFactory.getLogger(OakMockSlingRepository.class);
+    
+    @Activate
+    protected void activate(ComponentContext componentContext) {
+        this.oak = new Oak();
+        Jcr jcr = new Jcr(oak).with(new ExtraSlingContent());
+        this.repository = jcr.createRepository();
+    }
 
-    public RepositoryWrapper(Repository r) {
-        wrapped = r;
+    @Deactivate
+    protected void deactivate(ComponentContext componentContext) {
+        // shutdown OAK JCR repository
+        ((JackrabbitRepository)repository).shutdown();
+        
+        // shutdown further OAK executor services via reflection
+        shutdownExecutorService("executor");
+        shutdownExecutorService("scheduledExecutor");
     }
+    
+    private void shutdownExecutorService(String fieldName) {
+        try {
+            Field executorField = Oak.class.getDeclaredField(fieldName); 
+            executorField.setAccessible(true);
+            ExecutorService executor = (ExecutorService)executorField.get(this.oak);
+            executor.shutdownNow();
+        }
+        catch (ReflectiveOperationException ex) {
+            log.error("Memory leak: Unable to shutdown executor service from field '" + fieldName + "' in " + this.oak, ex);
+        }
+    }
+
 
     public String getDescriptor(String key) {
-        return wrapped.getDescriptor(key);
+        return repository.getDescriptor(key);
     }
 
     public String[] getDescriptorKeys() {
-        return wrapped.getDescriptorKeys();
+        return repository.getDescriptorKeys();
     }
 
     public String getDefaultWorkspace() {
@@ -53,22 +97,22 @@ public final class RepositoryWrapper implements SlingRepository {
     }
 
     public Session login() throws LoginException, RepositoryException {
-        return wrapped.login();
+        return repository.login();
     }
 
     public Session login(Credentials credentials, String workspaceName) 
             throws LoginException, NoSuchWorkspaceException, RepositoryException {
-        return wrapped.login(credentials, (workspaceName == null ? getDefaultWorkspace() : workspaceName));
+        return repository.login(credentials, (workspaceName == null ? getDefaultWorkspace() : workspaceName));
     }
 
     public Session login(Credentials credentials) 
             throws LoginException, RepositoryException {
-        return wrapped.login(credentials);
+        return repository.login(credentials);
     }
 
     public Session login(String workspaceName) 
             throws LoginException, NoSuchWorkspaceException, RepositoryException {
-        return wrapped.login((workspaceName == null ? getDefaultWorkspace() : workspaceName));
+        return repository.login((workspaceName == null ? getDefaultWorkspace() : workspaceName));
     }
 
     public Session loginAdministrative(String workspaceName) 
@@ -84,19 +128,19 @@ public final class RepositoryWrapper implements SlingRepository {
     }
     
     public Value getDescriptorValue(String key) {
-        return wrapped.getDescriptorValue(key);
+        return repository.getDescriptorValue(key);
     }
 
     public Value[] getDescriptorValues(String key) {
-        return wrapped.getDescriptorValues(key);
+        return repository.getDescriptorValues(key);
     }
 
     public boolean isSingleValueDescriptor(String key) {
-        return wrapped.isSingleValueDescriptor(key);
+        return repository.isSingleValueDescriptor(key);
     }
 
     public boolean isStandardDescriptor(String key) {
-        return wrapped.isStandardDescriptor(key);
+        return repository.isStandardDescriptor(key);
     }
 
-}
\ No newline at end of file
+}
diff --git a/src/main/java/org/apache/sling/testing/mock/sling/oak/package-info.java b/src/main/java/org/apache/sling/testing/mock/sling/oak/package-info.java
index 55bdc9d..b4e676f 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/oak/package-info.java
+++ b/src/main/java/org/apache/sling/testing/mock/sling/oak/package-info.java
@@ -19,5 +19,5 @@
 /**
  * Sling Mock Jackrabbit Oak-based Resource Resolver
  */
-@aQute.bnd.annotation.Version("0.1")
+@aQute.bnd.annotation.Version("1.0")
 package org.apache.sling.testing.mock.sling.oak;

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

[sling-org-apache-sling-testing-sling-mock] 07/27: update to latest development snapshots

Posted by ro...@apache.org.
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-oak-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 929e4e131de607966d0d0c1ad044d969f883ffa1
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Wed Jun 24 08:53:04 2015 +0000

    update to latest development snapshots
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock-oak@1687211 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index ffe073c..53dbcf0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -51,14 +51,14 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.sling-mock</artifactId>
-            <version>1.3.1-SNAPSHOT</version>
+            <version>1.4.1-SNAPSHOT</version>
             <scope>compile</scope>
         </dependency>
     
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.sling-mock</artifactId>
-            <version>1.3.1-SNAPSHOT</version>
+            <version>1.4.1-SNAPSHOT</version>
             <classifier>tests</classifier>
             <scope>test</scope>
         </dependency>

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

[sling-org-apache-sling-testing-sling-mock] 25/27: update dependencies

Posted by ro...@apache.org.
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-oak-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 31fb0b218c888988e89e691e6f559ea032c4d0e4
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Mon Oct 5 17:31:35 2015 +0000

    update dependencies
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock-oak@1706883 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 6520ec7..f660b6e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -50,14 +50,14 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.sling-mock</artifactId>
-            <version>1.5.1-SNAPSHOT</version>
+            <version>1.6.0</version>
             <scope>compile</scope>
         </dependency>
     
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.sling-mock</artifactId>
-            <version>1.5.1-SNAPSHOT</version>
+            <version>1.6.0</version>
             <classifier>tests</classifier>
             <scope>test</scope>
         </dependency>

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

[sling-org-apache-sling-testing-sling-mock] 21/27: SLING-4824/SLING-4827 do not embed org.apache.sling.jcr.resource dependency; it's a dependency of sling mock and not sling-mock-jackrabbit/oak and version used should be controlled by sling-mock

Posted by ro...@apache.org.
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-oak-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit cb1a8a26a0c8db5c604431e1cfce4514e375dd20
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Thu Oct 1 20:33:56 2015 +0000

    SLING-4824/SLING-4827 do not embed org.apache.sling.jcr.resource dependency; it's a dependency of sling mock and not sling-mock-jackrabbit/oak and version used should be controlled by sling-mock
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock-oak@1706320 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 4081c11..70a1673 100644
--- a/pom.xml
+++ b/pom.xml
@@ -147,7 +147,7 @@
           <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-shade-plugin</artifactId>
-              <version>2.4</version>
+              <version>2.4.1</version>
               <configuration>
                 <!--
                     embed all jackrabbit artifacts to prevent classpath clashes
@@ -159,7 +159,6 @@
                 <artifactSet>
                     <includes>
                         <include>org.apache.jackrabbit:*</include>
-                        <include>org.apache.sling:org.apache.sling.jcr.resource</include>
                     </includes>
                 </artifactSet>
               </configuration>

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

[sling-org-apache-sling-testing-sling-mock] 13/27: set parent version to 24 and add empty relativePath where missing

Posted by ro...@apache.org.
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-oak-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit db180873dbe49ac8c84fe66d0f9dc6df55171c6b
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Tue Jul 7 08:09:17 2015 +0000

    set parent version to 24 and add empty relativePath where missing
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock-oak@1689593 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 4282a02..c74fa28 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>23</version>
+        <version>24</version>
         <relativePath/>
     </parent>
 

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

[sling-org-apache-sling-testing-sling-mock] 05/27: svn:ignore

Posted by ro...@apache.org.
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-oak-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 2f2f13b6a28a2a8aa91caf1638814ce590247f07
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Thu Jun 4 14:07:57 2015 +0000

    svn:ignore
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock-oak@1683552 13f79535-47bb-0310-9956-ffa450edef68

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

[sling-org-apache-sling-testing-sling-mock] 04/27: switch back to latest sling-mock snapshot

Posted by ro...@apache.org.
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-oak-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 335ff9d978537a87138917fb6513b13babdcddf2
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Sat May 30 10:04:47 2015 +0000

    switch back to latest sling-mock snapshot
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock-oak@1682595 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index d192285..5890259 100644
--- a/pom.xml
+++ b/pom.xml
@@ -51,14 +51,14 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.sling-mock</artifactId>
-            <version>1.3.0</version>
+            <version>1.3.1-SNAPSHOT</version>
             <scope>compile</scope>
         </dependency>
     
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.sling-mock</artifactId>
-            <version>1.3.0</version>
+            <version>1.3.1-SNAPSHOT</version>
             <classifier>tests</classifier>
             <scope>test</scope>
         </dependency>

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

[sling-org-apache-sling-testing-sling-mock] 23/27: Update the main reactor to parent 25

Posted by ro...@apache.org.
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-oak-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 17335f60a73db4d83b6b4cbe60f0d2e11f741e52
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Mon Oct 5 10:03:45 2015 +0000

    Update the main reactor to parent 25
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock-oak@1706780 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 70a1673..6520ec7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>24</version>
+        <version>25</version>
         <relativePath/>
     </parent>
 

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