You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2020/01/21 12:12:51 UTC

[sling-org-apache-sling-jcr-repoinit] 01/04: SLING-9015 - refactor tests

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

bdelacretaz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-repoinit.git

commit 421f8b22ad17e41e39135e1fb95074ea6e93cb5a
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Mon Jan 20 15:08:49 2020 +0100

    SLING-9015 - refactor tests
---
 .../apache/sling/jcr/repoinit/it/RepoInitTestSupport.java   | 13 ++++++++-----
 .../sling/jcr/repoinit/it/RepositoryInitializerIT.java      | 10 ++++++++++
 2 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/src/test/java/org/apache/sling/jcr/repoinit/it/RepoInitTestSupport.java b/src/test/java/org/apache/sling/jcr/repoinit/it/RepoInitTestSupport.java
index a22ea4f..e467d08 100644
--- a/src/test/java/org/apache/sling/jcr/repoinit/it/RepoInitTestSupport.java
+++ b/src/test/java/org/apache/sling/jcr/repoinit/it/RepoInitTestSupport.java
@@ -16,6 +16,7 @@
  */
 package org.apache.sling.jcr.repoinit.it;
 
+import org.apache.commons.lang3.ArrayUtils;
 import org.apache.sling.testing.paxexam.SlingOptions;
 import org.apache.sling.testing.paxexam.TestSupport;
 import org.ops4j.pax.exam.Configuration;
@@ -33,7 +34,7 @@ public abstract class RepoInitTestSupport extends TestSupport {
     @Configuration
     public Option[] configuration() {
         SlingOptions.versionResolver.setVersionFromProject("org.apache.jackrabbit", "jackrabbit-api");
-        return new Option[]{
+        final Option[] options = {
             baseConfiguration(),
             slingQuickstart(),
             testBundle("bundle.filename"),
@@ -41,11 +42,13 @@ public abstract class RepoInitTestSupport extends TestSupport {
             junitBundles(),
             newConfiguration("org.apache.sling.jcr.base.internal.LoginAdminWhitelist")
                 .put("whitelist.bundles.regexp", "^PAXEXAM.*$")
-                .asOption(),        
-            newConfiguration("org.apache.sling.jcr.repoinit.impl.RepositoryInitializer")
-                .put("references", RepositoryInitializerIT.REPOINIT_SRC_URLS)
-                .asOption(),
+                .asOption()
         };
+        return ArrayUtils.addAll(options, additionalOptions());
+    }
+
+    protected Option[] additionalOptions() {
+        return new Option[] {};
     }
 
     protected Option slingQuickstart() {
diff --git a/src/test/java/org/apache/sling/jcr/repoinit/it/RepositoryInitializerIT.java b/src/test/java/org/apache/sling/jcr/repoinit/it/RepositoryInitializerIT.java
index 292ddb2..74e567d 100644
--- a/src/test/java/org/apache/sling/jcr/repoinit/it/RepositoryInitializerIT.java
+++ b/src/test/java/org/apache/sling/jcr/repoinit/it/RepositoryInitializerIT.java
@@ -17,6 +17,7 @@
 package org.apache.sling.jcr.repoinit.it;
 
 import static org.junit.Assert.assertTrue;
+import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.newConfiguration;
 
 import javax.inject.Inject;
 import javax.jcr.Session;
@@ -27,6 +28,7 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.junit.PaxExam;
 import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
 import org.ops4j.pax.exam.spi.reactors.PerClass;
@@ -48,6 +50,14 @@ public class RepositoryInitializerIT extends RepoInitTestSupport {
     @Inject
     private SlingRepository repository;
 
+    protected Option[] additionalOptions() {
+        return new Option[] {
+            newConfiguration("org.apache.sling.jcr.repoinit.impl.RepositoryInitializer")
+            .put("references", RepositoryInitializerIT.REPOINIT_SRC_URLS)
+            .asOption()
+        };
+    }
+
     @Before
     public void setup() throws Exception {
         session = repository.login(new SimpleCredentials("admin", "admin".toCharArray()));