You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ol...@apache.org on 2020/04/01 06:40:43 UTC

[sling-org-apache-sling-testing-paxexam] 05/10: SLING-9311 Provide Thymeleaf Option

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

olli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-paxexam.git

commit b30aecfcb4f4fd065e6297b618e8ba012104d4b9
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Tue Mar 31 11:20:13 2020 +0200

    SLING-9311 Provide Thymeleaf Option
---
 .../apache/sling/testing/paxexam/SlingOptions.java | 16 ++++---
 .../paxexam/it/tests/SlingOptionsThymeleafIT.java  | 49 ++++++++++++++++++++++
 2 files changed, 60 insertions(+), 5 deletions(-)

diff --git a/src/main/java/org/apache/sling/testing/paxexam/SlingOptions.java b/src/main/java/org/apache/sling/testing/paxexam/SlingOptions.java
index 6f49115..9985769 100644
--- a/src/main/java/org/apache/sling/testing/paxexam/SlingOptions.java
+++ b/src/main/java/org/apache/sling/testing/paxexam/SlingOptions.java
@@ -884,15 +884,11 @@ public class SlingOptions {
 
     public static ModifiableCompositeOption slingScriptingThymeleaf() {
         return composite(
+            thymeleaf(),
             sling(),
             slingScripting(),
             slingI18n(),
             mavenBundle().groupId("org.apache.sling").artifactId("org.apache.sling.scripting.thymeleaf").version(versionResolver),
-            mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.thymeleaf").version(versionResolver),
-            mavenBundle().groupId("org.attoparser").artifactId("attoparser").version(versionResolver),
-            mavenBundle().groupId("org.unbescape").artifactId("unbescape").version(versionResolver),
-            mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.ognl").version(versionResolver),
-            mavenBundle().groupId("org.javassist").artifactId("javassist").version(versionResolver),
             factoryConfiguration("org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended")
                 .put("user.mapping", new String[]{"org.apache.sling.scripting.thymeleaf=sling-scripting"})
                 .asOption()
@@ -1025,6 +1021,16 @@ public class SlingOptions {
         );
     }
 
+    public static ModifiableCompositeOption thymeleaf() {
+        return composite(
+            mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.thymeleaf").version(versionResolver),
+            mavenBundle().groupId("org.attoparser").artifactId("attoparser").version(versionResolver),
+            mavenBundle().groupId("org.unbescape").artifactId("unbescape").version(versionResolver),
+            mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.ognl").version(versionResolver),
+            mavenBundle().groupId("org.javassist").artifactId("javassist").version(versionResolver)
+        );
+    }
+
     public static ModifiableCompositeOption slingQuickstartOakTar(final String workingDirectory, final int httpPort) {
         final String slingHome = String.format("%s/sling", workingDirectory);
         final String repositoryHome = String.format("%s/repository", slingHome);
diff --git a/src/test/java/org/apache/sling/testing/paxexam/it/tests/SlingOptionsThymeleafIT.java b/src/test/java/org/apache/sling/testing/paxexam/it/tests/SlingOptionsThymeleafIT.java
new file mode 100644
index 0000000..d9f0b86
--- /dev/null
+++ b/src/test/java/org/apache/sling/testing/paxexam/it/tests/SlingOptionsThymeleafIT.java
@@ -0,0 +1,49 @@
+/*
+ * 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.paxexam.it.tests;
+
+import org.apache.sling.testing.paxexam.it.SlingOptionsTestSupport;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+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;
+
+import static org.apache.sling.testing.paxexam.SlingOptions.thymeleaf;
+import static org.ops4j.pax.exam.CoreOptions.options;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class SlingOptionsThymeleafIT extends SlingOptionsTestSupport {
+
+    @Configuration
+    public Option[] configuration() {
+        return options(
+            baseConfiguration(),
+            thymeleaf()
+        );
+    }
+
+    @Test
+    public void test() {
+    }
+
+}