Author: olli
Date: Wed Jul 6 09:32:43 2016
New Revision: 1751643
URL: http://svn.apache.org/viewvc?rev=1751643&view=rev
Log:
SLING-5680 Add Integration Tests for Scripting Thymeleaf
merge module org.apache.sling.scripting.thymeleaf.it into
org.apache.sling.scripting.thymeleaf
Added:
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/app/
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/app/Activator.java
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/app/FooBarLinkBuilder.java
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/app/Page.java
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/AdaptToModelIT.java
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/LinkBuilderIT.java
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/SlingIncludeIT.java
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/TemplateEngineIT.java
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/ThymeleafDecoupledTemplateLogicIT.java
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/ThymeleafReplaceIT.java
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/ThymeleafScriptEngineFactoryIT.java
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/ThymeleafTestSupport.java
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/ThymeleafTextIT.java
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/jsp/
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/jsp/page/
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/jsp/page/resource/
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/jsp/page/resource/html.jsp
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/ROOT.json
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/adaptto/
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/adaptto/html.html
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/decoupled/
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/decoupled/html.html
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/decoupled/html.th.xml
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/fragments/
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/fragments/head.html
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/include/
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/include/html.html
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/link/
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/link/html.html
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/main/
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/main/html.html
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/replace/
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/replace/html.html
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/text/
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/text/html.html
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/content/
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/content/thymeleaf.json
Removed:
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/
Modified:
sling/trunk/contrib/pom.xml
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/pom.xml
Modified: sling/trunk/contrib/pom.xml
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/pom.xml?rev=1751643&r1=1751642&r2=1751643&view=diff
==============================================================================
--- sling/trunk/contrib/pom.xml (original)
+++ sling/trunk/contrib/pom.xml Wed Jul 6 09:32:43 2016
@@ -147,7 +147,6 @@
<module>scripting/scala/samples/hello-world</module>
<module>scripting/scala/samples/forum</module>
<module>scripting/org.apache.sling.scripting.freemarker.it</module>
- <module>scripting/org.apache.sling.scripting.thymeleaf.it</module>
<module>scripting/velocity</module>
<module>scripting/xproc</module>
Modified:
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/pom.xml
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/pom.xml?rev=1751643&r1=1751642&r2=1751643&view=diff
==============================================================================
--- sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/pom.xml
(original)
+++ sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/pom.xml
Wed Jul 6 09:32:43 2016
@@ -38,12 +38,13 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <sling.java.version>7</sling.java.version>
+ <sling.java.version>8</sling.java.version>
<org.thymeleaf.version>3.0.0.RELEASE</org.thymeleaf.version>
<org.attoparser.version>2.0.0.RELEASE</org.attoparser.version>
<org.unbescape.version>1.1.3.RELEASE</org.unbescape.version>
<ognl.version>3.1.3</ognl.version>
<com.fasterxml.jackson.version>2.6.3</com.fasterxml.jackson.version>
+ <org.ops4j.pax.exam.version>4.9.1</org.ops4j.pax.exam.version>
</properties>
<scm>
@@ -55,6 +56,12 @@
<dependencies>
<!-- javax -->
<dependency>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ <version>1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<scope>provided</scope>
@@ -62,14 +69,20 @@
<!-- OSGi -->
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>osgi.core</artifactId>
- <version>6.0.0</version>
+ <artifactId>osgi.annotation</artifactId>
+ <version>6.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>osgi.annotation</artifactId>
- <version>6.0.1</version>
+ <artifactId>osgi.cmpn</artifactId>
+ <version>6.0.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>osgi.core</artifactId>
+ <version>6.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
@@ -91,6 +104,13 @@
<version>2.5</version>
<scope>provided</scope>
</dependency>
+ <!-- Apache Felix -->
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.framework</artifactId>
+ <version>5.4.0</version>
+ <scope>test</scope>
+ </dependency>
<!-- Apache Sling -->
<dependency>
<groupId>org.apache.sling</groupId>
@@ -100,6 +120,30 @@
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.auth.core</artifactId>
+ <version>1.3.12</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.engine</artifactId>
+ <version>2.4.6</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.i18n</artifactId>
+ <version>2.4.6</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.models.api</artifactId>
+ <version>1.2.2</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.scripting.api</artifactId>
<version>2.1.8</version>
<scope>provided</scope>
@@ -112,8 +156,8 @@
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
- <artifactId>org.apache.sling.i18n</artifactId>
- <version>2.4.6</version>
+ <artifactId>org.apache.sling.testing.paxexam</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<!-- Thymeleaf -->
@@ -147,6 +191,13 @@
<version>3.20.0-GA</version>
<scope>provided</scope>
</dependency>
+ <!-- jsoup -->
+ <dependency>
+ <groupId>org.jsoup</groupId>
+ <artifactId>jsoup</artifactId>
+ <version>1.9.1</version>
+ <scope>test</scope>
+ </dependency>
<!-- logging -->
<dependency>
<groupId>org.slf4j</groupId>
@@ -154,6 +205,48 @@
<version>1.7.21</version>
<scope>provided</scope>
</dependency>
+ <!-- testing -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicemix.bundles</groupId>
+ <artifactId>org.apache.servicemix.bundles.hamcrest</artifactId>
+ <version>1.3_1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.ops4j.pax.exam</groupId>
+ <artifactId>pax-exam</artifactId>
+ <version>${org.ops4j.pax.exam.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.ops4j.pax.exam</groupId>
+ <artifactId>pax-exam-cm</artifactId>
+ <version>${org.ops4j.pax.exam.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.ops4j.pax.exam</groupId>
+ <artifactId>pax-exam-container-forked</artifactId>
+ <version>${org.ops4j.pax.exam.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.ops4j.pax.exam</groupId>
+ <artifactId>pax-exam-junit4</artifactId>
+ <version>${org.ops4j.pax.exam.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.ops4j.pax.exam</groupId>
+ <artifactId>pax-exam-link-mvn</artifactId>
+ <version>${org.ops4j.pax.exam.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
@@ -198,6 +291,39 @@
</filters>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <version>2.18.1</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <systemProperties>
+ <property>
+ <name>bundle.filename</name>
+ <value>${basedir}/target/${project.build.finalName}.jar</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.servicemix.tooling</groupId>
+ <artifactId>depends-maven-plugin</artifactId>
+ <version>1.2</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate-depends-file</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
Added:
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/app/Activator.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/app/Activator.java?rev=1751643&view=auto
==============================================================================
---
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/app/Activator.java
(added)
+++
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/app/Activator.java
Wed Jul 6 09:32:43 2016
@@ -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.scripting.thymeleaf.it.app;
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceRegistration;
+import org.thymeleaf.linkbuilder.ILinkBuilder;
+
+public class Activator implements BundleActivator {
+
+ private ServiceRegistration linkBuilderRegistration;
+
+ @Override
+ public void start(final BundleContext bundleContext) throws Exception {
+ registerLinkBuilder(bundleContext);
+ }
+
+ @Override
+ public void stop(final BundleContext bundleContext) throws Exception {
+ if (linkBuilderRegistration != null) {
+ linkBuilderRegistration.unregister();
+ linkBuilderRegistration = null;
+ }
+ }
+
+ private void registerLinkBuilder(final BundleContext bundleContext) {
+ final FooBarLinkBuilder linkBuilder = new FooBarLinkBuilder();
+ final Dictionary<String, String> properties = new Hashtable<>();
+ properties.put(Constants.SERVICE_DESCRIPTION, "Apache Sling Scripting
Thymeleaf IT FooBarLinkBuilder");
+ properties.put(Constants.SERVICE_VENDOR, "The Apache Software
Foundation");
+ linkBuilderRegistration =
bundleContext.registerService(ILinkBuilder.class, linkBuilder, properties);
+ }
+
+}
Added:
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/app/FooBarLinkBuilder.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/app/FooBarLinkBuilder.java?rev=1751643&view=auto
==============================================================================
---
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/app/FooBarLinkBuilder.java
(added)
+++
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/app/FooBarLinkBuilder.java
Wed Jul 6 09:32:43 2016
@@ -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.scripting.thymeleaf.it.app;
+
+import java.util.Map;
+
+import org.thymeleaf.context.IExpressionContext;
+import org.thymeleaf.linkbuilder.ILinkBuilder;
+
+public class FooBarLinkBuilder implements ILinkBuilder {
+
+ public FooBarLinkBuilder() {
+ }
+
+ @Override
+ public String getName() {
+ return getClass().getSimpleName();
+ }
+
+ @Override
+ public Integer getOrder() {
+ return 0;
+ }
+
+ @Override
+ public String buildLink(final IExpressionContext expressionContext, final
String base, final Map<String, Object> parameters) {
+ if ("foo".equals(base)) {
+ return "foobar";
+ }
+ return null;
+ }
+
+}
Added:
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/app/Page.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/app/Page.java?rev=1751643&view=auto
==============================================================================
---
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/app/Page.java
(added)
+++
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/app/Page.java
Wed Jul 6 09:32:43 2016
@@ -0,0 +1,52 @@
+/*
+ * 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.scripting.thymeleaf.it.app;
+
+import org.apache.sling.api.SlingHttpServletRequest;
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.models.annotations.Model;
+import org.apache.sling.models.annotations.injectorspecific.SlingObject;
+
+import static
org.apache.sling.models.annotations.injectorspecific.InjectionStrategy.OPTIONAL;
+
+@Model(adaptables = {Resource.class, SlingHttpServletRequest.class})
+public class Page {
+
+ @SlingObject
+ protected Resource resource;
+
+ @SlingObject(injectionStrategy = OPTIONAL)
+ protected SlingHttpServletRequest request;
+
+ public Page() {
+ }
+
+ public String getName() {
+ return resource.getName();
+ }
+
+ public String getPath() {
+ return resource.getPath();
+ }
+
+ public String getTitle() {
+ return resource.getValueMap().get("title", String.class);
+ }
+
+}
Added:
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/AdaptToModelIT.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/AdaptToModelIT.java?rev=1751643&view=auto
==============================================================================
---
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/AdaptToModelIT.java
(added)
+++
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/AdaptToModelIT.java
Wed Jul 6 09:32:43 2016
@@ -0,0 +1,59 @@
+/*
+ * 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.scripting.thymeleaf.it.tests;
+
+import java.io.IOException;
+
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+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.hamcrest.Matchers.is;
+import static org.junit.Assert.assertThat;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class AdaptToModelIT extends ThymeleafTestSupport {
+
+ private Document document;
+
+ @Before
+ public void setup() throws IOException {
+ final String url =
String.format("http://localhost:%s/thymeleaf/adaptto.html", httpPort());
+ document = Jsoup.connect(url).get();
+ }
+
+ @Test
+ public void testTitle() {
+ assertThat(document.title(), is("Sling Models adaptTo()"));
+ }
+
+ @Test
+ public void testPageName() {
+ final Element name = document.getElementById("name");
+ assertThat("adaptto", is(name.text()));
+ }
+
+}
Added:
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/LinkBuilderIT.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/LinkBuilderIT.java?rev=1751643&view=auto
==============================================================================
---
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/LinkBuilderIT.java
(added)
+++
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/LinkBuilderIT.java
Wed Jul 6 09:32:43 2016
@@ -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.scripting.thymeleaf.it.tests;
+
+import java.io.IOException;
+
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+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.hamcrest.Matchers.is;
+import static org.junit.Assert.assertThat;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class LinkBuilderIT extends ThymeleafTestSupport {
+
+ private Document document;
+
+ @Before
+ public void setup() throws IOException {
+ final String url =
String.format("http://localhost:%s/thymeleaf/link.html", httpPort());
+ document = Jsoup.connect(url).get();
+ }
+
+ @Test
+ public void testFooLink() throws IOException {
+ final Element link = document.getElementById("foo");
+ assertThat(link.attributes().get("href"), is("foobar"));
+ }
+
+ @Test
+ public void testBarLink() throws IOException {
+ final Element link = document.getElementById("bar");
+ assertThat(link.attributes().get("href"), is("bar"));
+ }
+
+}
Added:
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/SlingIncludeIT.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/SlingIncludeIT.java?rev=1751643&view=auto
==============================================================================
---
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/SlingIncludeIT.java
(added)
+++
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/SlingIncludeIT.java
Wed Jul 6 09:32:43 2016
@@ -0,0 +1,68 @@
+/*
+ * 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.scripting.thymeleaf.it.tests;
+
+import java.io.IOException;
+
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+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.hamcrest.Matchers.is;
+import static org.junit.Assert.assertThat;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class SlingIncludeIT extends ThymeleafTestSupport {
+
+ private Document document;
+
+ @Before
+ public void setup() throws IOException {
+ final String url =
String.format("http://localhost:%s/thymeleaf/include.html", httpPort());
+ document = Jsoup.connect(url).get();
+ }
+
+ @Test
+ public void testJspIncludeSimple() {
+ final Element simple = document.getElementById("simple");
+ assertThat("/content/thymeleaf/include", is(simple.text()));
+ }
+
+ @Test
+ public void testJspIncludeWrap() {
+ final Element wrap = document.getElementById("wrap");
+ assertThat(1, is(wrap.children().size()));
+ assertThat("/content/thymeleaf/include", is(wrap.child(0).text()));
+ }
+
+ @Test
+ public void testJspIncludeUnwrap() {
+ final Element unwrap = document.getElementById("unwrap");
+ assertThat(0, is(unwrap.children().size()));
+ assertThat("/content/thymeleaf/include", is(unwrap.text()));
+ }
+
+}
Added:
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/TemplateEngineIT.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/TemplateEngineIT.java?rev=1751643&view=auto
==============================================================================
---
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/TemplateEngineIT.java
(added)
+++
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/TemplateEngineIT.java
Wed Jul 6 09:32:43 2016
@@ -0,0 +1,59 @@
+/*
+ * 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.scripting.thymeleaf.it.tests;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+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.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.greaterThan;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThat;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class TemplateEngineIT extends ThymeleafTestSupport {
+
+ @Test
+ public void testTemplateEngine() {
+ assertNotNull(templateEngine);
+ }
+
+ @Test
+ public void testTemplateResolvers() {
+ final int size =
templateEngine.getConfiguration().getTemplateResolvers().size();
+ assertThat(size, is(greaterThan(0)));
+ }
+
+ @Test
+ public void testMessageResolvers() {
+ final int size =
templateEngine.getConfiguration().getMessageResolvers().size();
+ assertThat(size, is(greaterThan(0)));
+ }
+
+ @Test
+ public void testDialects() {
+ final int size =
templateEngine.getConfiguration().getDialects().size();
+ assertThat(size, is(greaterThan(0)));
+ }
+
+}
Added:
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/ThymeleafDecoupledTemplateLogicIT.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/ThymeleafDecoupledTemplateLogicIT.java?rev=1751643&view=auto
==============================================================================
---
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/ThymeleafDecoupledTemplateLogicIT.java
(added)
+++
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/ThymeleafDecoupledTemplateLogicIT.java
Wed Jul 6 09:32:43 2016
@@ -0,0 +1,52 @@
+/*
+ * 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.scripting.thymeleaf.it.tests;
+
+import java.io.IOException;
+
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+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.hamcrest.Matchers.is;
+import static org.junit.Assert.assertThat;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class ThymeleafDecoupledTemplateLogicIT extends ThymeleafTestSupport {
+
+ private Document document;
+
+ @Before
+ public void setup() throws IOException {
+ final String url =
String.format("http://localhost:%s/thymeleaf/decoupled.html", httpPort());
+ document = Jsoup.connect(url).get();
+ }
+
+ @Test
+ public void testTitle() {
+ assertThat(document.title(), is("Thymeleaf Decoupled Template Logic"));
+ }
+
+}
Added:
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/ThymeleafReplaceIT.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/ThymeleafReplaceIT.java?rev=1751643&view=auto
==============================================================================
---
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/ThymeleafReplaceIT.java
(added)
+++
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/ThymeleafReplaceIT.java
Wed Jul 6 09:32:43 2016
@@ -0,0 +1,52 @@
+/*
+ * 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.scripting.thymeleaf.it.tests;
+
+import java.io.IOException;
+
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+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.hamcrest.Matchers.is;
+import static org.junit.Assert.assertThat;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class ThymeleafReplaceIT extends ThymeleafTestSupport {
+
+ private Document document;
+
+ @Before
+ public void setup() throws IOException {
+ final String url =
String.format("http://localhost:%s/thymeleaf/replace.html", httpPort());
+ document = Jsoup.connect(url).get();
+ }
+
+ @Test
+ public void testTitle() {
+ assertThat(document.title(), is("Head Title"));
+ }
+
+}
Added:
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/ThymeleafScriptEngineFactoryIT.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/ThymeleafScriptEngineFactoryIT.java?rev=1751643&view=auto
==============================================================================
---
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/ThymeleafScriptEngineFactoryIT.java
(added)
+++
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/ThymeleafScriptEngineFactoryIT.java
Wed Jul 6 09:32:43 2016
@@ -0,0 +1,62 @@
+/*
+ * 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.scripting.thymeleaf.it.tests;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+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.hamcrest.Matchers.hasItem;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.startsWith;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThat;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class ThymeleafScriptEngineFactoryIT extends ThymeleafTestSupport {
+
+ @Test
+ public void testScriptEngineFactory() {
+ assertNotNull(scriptEngineFactory);
+ }
+
+ @Test
+ public void testScriptEngineFactoryEngineName() {
+ assertThat("Apache Sling Scripting Thymeleaf",
is(scriptEngineFactory.getEngineName()));
+ }
+
+ @Test
+ public void testScriptEngineFactoryLanguageName() {
+ assertThat("Thymeleaf", is(scriptEngineFactory.getLanguageName()));
+ }
+
+ @Test
+ public void testScriptEngineFactoryLanguageVersion() {
+ assertThat(scriptEngineFactory.getLanguageVersion(),
startsWith("3.0"));
+ }
+
+ @Test
+ public void testScriptEngineFactoryNames() {
+ assertThat(scriptEngineFactory.getNames(), hasItem("thymeleaf"));
+ }
+
+}
Added:
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/ThymeleafTestSupport.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/ThymeleafTestSupport.java?rev=1751643&view=auto
==============================================================================
---
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/ThymeleafTestSupport.java
(added)
+++
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/ThymeleafTestSupport.java
Wed Jul 6 09:32:43 2016
@@ -0,0 +1,156 @@
+/*
+ * 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.scripting.thymeleaf.it.tests;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.ServerSocket;
+import java.util.Dictionary;
+
+import javax.inject.Inject;
+import javax.script.ScriptEngineFactory;
+
+import org.apache.sling.api.servlets.ServletResolver;
+import org.apache.sling.auth.core.AuthenticationSupport;
+import org.apache.sling.engine.SlingRequestProcessor;
+import org.apache.sling.scripting.thymeleaf.it.app.Activator;
+import org.apache.sling.testing.paxexam.SlingOptions;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.ProbeBuilder;
+import org.ops4j.pax.exam.TestProbeBuilder;
+import org.ops4j.pax.exam.util.Filter;
+import org.osgi.framework.Constants;
+import org.osgi.service.cm.ConfigurationAdmin;
+import org.osgi.service.http.HttpService;
+import org.thymeleaf.ITemplateEngine;
+
+import static org.apache.sling.testing.paxexam.SlingOptions.slingExtensionI18n;
+import static
org.apache.sling.testing.paxexam.SlingOptions.slingExtensionModels;
+import static org.apache.sling.testing.paxexam.SlingOptions.slingJcrOak;
+import static org.apache.sling.testing.paxexam.SlingOptions.slingLaunchpadOak;
+import static org.apache.sling.testing.paxexam.SlingOptions.slingScripting;
+import static org.apache.sling.testing.paxexam.SlingOptions.slingScriptingJsp;
+import static org.ops4j.pax.exam.CoreOptions.bundle;
+import static org.ops4j.pax.exam.CoreOptions.composite;
+import static org.ops4j.pax.exam.CoreOptions.junitBundles;
+import static org.ops4j.pax.exam.CoreOptions.keepCaches;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+import static org.ops4j.pax.exam.CoreOptions.workingDirectory;
+import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.newConfiguration;
+
+public abstract class ThymeleafTestSupport {
+
+ @Inject
+ protected ServletResolver servletResolver;
+
+ @Inject
+ protected SlingRequestProcessor slingRequestProcessor;
+
+ @Inject
+ protected AuthenticationSupport authenticationSupport;
+
+ @Inject
+ protected HttpService httpService;
+
+ @Inject
+ @Filter(value = "(names=thymeleaf)")
+ protected ScriptEngineFactory scriptEngineFactory;
+
+ @Inject
+ protected ITemplateEngine templateEngine;
+
+ @Inject
+ protected ConfigurationAdmin configurationAdmin;
+
+ protected static synchronized int findFreePort() {
+ try {
+ final ServerSocket serverSocket = new ServerSocket(0);
+ final int port = serverSocket.getLocalPort();
+ serverSocket.close();
+ return port;
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ protected int httpPort() throws IOException {
+ final Dictionary<String, Object> properties =
configurationAdmin.getConfiguration("org.apache.felix.http").getProperties();
+ return
Integer.parseInt(properties.get("org.osgi.service.http.port").toString());
+ }
+
+ @Configuration
+ public Option[] configuration() {
+ final String workingDirectory = String.format("target/paxexam/%s",
getClass().getSimpleName());
+ final String filename = System.getProperty("bundle.filename");
+ final File file = new File(filename);
+ return new Option[]{
+ keepCaches(),
+ workingDirectory(workingDirectory),
+ launchpad(workingDirectory),
+ // Sling Scripting Thymeleaf
+ bundle(file.toURI().toString()),
+
mavenBundle().groupId("org.javassist").artifactId("javassist").versionAsInProject(),
+ // testing
+
mavenBundle().groupId("org.jsoup").artifactId("jsoup").versionAsInProject(),
+
mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.hamcrest").versionAsInProject(),
+ junitBundles()
+ };
+ }
+
+ @ProbeBuilder
+ public TestProbeBuilder probeConfiguration(final TestProbeBuilder
testProbeBuilder) {
+ testProbeBuilder.setHeader(Constants.BUNDLE_ACTIVATOR,
Activator.class.getName());
+ testProbeBuilder.setHeader(Constants.EXPORT_PACKAGE,
"org.apache.sling.scripting.thymeleaf.it.app");
+ testProbeBuilder.setHeader("Sling-Model-Packages",
"org.apache.sling.scripting.thymeleaf.it.app");
+ testProbeBuilder.setHeader("Sling-Initial-Content", String.join(",",
+ "apps/jsp;path:=/apps/jsp;overwrite:=true;uninstall:=true",
+
"apps/thymeleaf;path:=/apps/thymeleaf;overwrite:=true;uninstall:=true",
+ "content;path:=/content;overwrite:=true;uninstall:=true"
+ ));
+ return testProbeBuilder;
+ }
+
+ protected static Option launchpad(final String workingDirectory) {
+ final int httpPort = findFreePort();
+ final String slingHome = String.format("%s/sling", workingDirectory);
+ final String repositoryHome = String.format("%s/repository",
slingHome);
+ final String localIndexDir = String.format("%s/index", repositoryHome);
+ return composite(
+ slingJcrOak(), // TODO if slingJcrOak() is called elsewhere,
ResourceResolverFactory will not be created
+ slingLaunchpadOak(),
+ slingExtensionI18n(),
+ slingExtensionModels(),
+ slingScripting(),
+ slingScriptingJsp(),
+ newConfiguration("org.apache.felix.http")
+ .put("org.osgi.service.http.port", httpPort)
+ .asOption(),
+
newConfiguration("org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService")
+ .put("repository.home", repositoryHome)
+ .put("name", "Default NodeStore")
+ .asOption(),
+
newConfiguration("org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexProviderService")
+ .put("localIndexDir", localIndexDir)
+ .asOption(),
+
mavenBundle().groupId("org.apache.jackrabbit").artifactId("oak-segment").version(SlingOptions.versionResolver)
+ );
+ }
+
+}
Added:
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/ThymeleafTextIT.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/ThymeleafTextIT.java?rev=1751643&view=auto
==============================================================================
---
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/ThymeleafTextIT.java
(added)
+++
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/ThymeleafTextIT.java
Wed Jul 6 09:32:43 2016
@@ -0,0 +1,59 @@
+/*
+ * 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.scripting.thymeleaf.it.tests;
+
+import java.io.IOException;
+
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+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.hamcrest.Matchers.is;
+import static org.junit.Assert.assertThat;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class ThymeleafTextIT extends ThymeleafTestSupport {
+
+ private Document document;
+
+ @Before
+ public void setup() throws IOException {
+ final String url =
String.format("http://localhost:%s/thymeleaf/text.html", httpPort());
+ document = Jsoup.connect(url).get();
+ }
+
+ @Test
+ public void testTitle() {
+ assertThat(document.title(), is("Thymeleaf Text"));
+ }
+
+ @Test
+ public void testResourceName() {
+ final Element name = document.getElementById("name");
+ assertThat("text", is(name.text()));
+ }
+
+}
Added:
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/jsp/page/resource/html.jsp
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/jsp/page/resource/html.jsp?rev=1751643&view=auto
==============================================================================
---
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/jsp/page/resource/html.jsp
(added)
+++
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/jsp/page/resource/html.jsp
Wed Jul 6 09:32:43 2016
@@ -0,0 +1,22 @@
+<%--
+ 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.
+--%><%@page session="false" %><%
+%><%@taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling" %><%
+%><sling:defineObjects/><%
+%><%= resource.getPath() %><%
+%>
\ No newline at end of file
Added:
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/ROOT.json
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/ROOT.json?rev=1751643&view=auto
==============================================================================
---
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/ROOT.json
(added)
+++
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/ROOT.json
Wed Jul 6 09:32:43 2016
@@ -0,0 +1,6 @@
+{
+ "jcr:primaryType": "sling:Folder",
+ "sling:scripting": [
+ "html=thymeleaf"
+ ]
+}
Added:
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/adaptto/html.html
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/adaptto/html.html?rev=1751643&view=auto
==============================================================================
---
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/adaptto/html.html
(added)
+++
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/adaptto/html.html
Wed Jul 6 09:32:43 2016
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<!--
+ 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.
+-->
+<html
data-th-with="page=${request.adaptTo(@org.apache.sling.scripting.thymeleaf.it.app.Page@class)}">
+<head>
+ <meta charset="UTF-8"/>
+ <title data-th-text="${page.title}">Thymeleaf With with Sling Model</title>
+</head>
+<body>
+<span id="name" data-th-text="${page.name}"></span>
+</body>
+</html>
Added:
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/decoupled/html.html
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/decoupled/html.html?rev=1751643&view=auto
==============================================================================
---
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/decoupled/html.html
(added)
+++
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/decoupled/html.html
Wed Jul 6 09:32:43 2016
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<!--
+ 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.
+-->
+<html>
+<head>
+ <title id="title">Thymeleaf</title>
+</head>
+<body>
+</body>
+</html>
Added:
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/decoupled/html.th.xml
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/decoupled/html.th.xml?rev=1751643&view=auto
==============================================================================
---
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/decoupled/html.th.xml
(added)
+++
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/decoupled/html.th.xml
Wed Jul 6 09:32:43 2016
@@ -0,0 +1,22 @@
+<?xml version="1.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.
+-->
+<thlogic xmlns:th="http://www.thymeleaf.org">
+ <attr sel="#title" th:text="${resource.getValueMap().get('title')}"></attr>
+</thlogic>
Added:
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/fragments/head.html
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/fragments/head.html?rev=1751643&view=auto
==============================================================================
---
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/fragments/head.html
(added)
+++
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/fragments/head.html
Wed Jul 6 09:32:43 2016
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<!--
+ 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.
+-->
+<html>
+<head data-th-fragment="default">
+ <meta charset="UTF-8"/>
+ <title>Head Title</title>
+</head>
+<body>
+</body>
+</html>
Added:
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/include/html.html
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/include/html.html?rev=1751643&view=auto
==============================================================================
---
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/include/html.html
(added)
+++
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/include/html.html
Wed Jul 6 09:32:43 2016
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<!--
+ 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.
+-->
+<html>
+<head>
+ <meta charset="UTF-8"/>
+ <title>Sling Include (with JSP)</title>
+</head>
+<body>
+<!-- simple include with resource type -->
+<span id="simple" data-sling-include="${resource}"
data-sling-resourceType="'jsp/page/resource'"></span>
+<!-- include (keeping container element) -->
+<div id="wrap">
+ <span data-sling-include="${resource}"
data-sling-resourceType="'jsp/page/resource'" data-sling-unwrap="false"></span>
+</div>
+<!-- include (unwrapping) -->
+<div id="unwrap">
+ <span data-sling-include="${resource}"
data-sling-resourceType="'jsp/page/resource'" data-sling-unwrap="true"></span>
+</div>
+</body>
+</html>
Added:
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/link/html.html
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/link/html.html?rev=1751643&view=auto
==============================================================================
---
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/link/html.html
(added)
+++
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/link/html.html
Wed Jul 6 09:32:43 2016
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<!--
+ 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.
+-->
+<html>
+<head>
+ <meta charset="UTF-8"/>
+ <title></title>
+</head>
+<body>
+<a id="foo" href="#" data-th-href="@{foo}">foo</a>
+<a id="bar" href="#" data-th-href="@{bar}">bar</a>
+</body>
+</html>
Added:
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/main/html.html
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/main/html.html?rev=1751643&view=auto
==============================================================================
---
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/main/html.html
(added)
+++
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/main/html.html
Wed Jul 6 09:32:43 2016
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<!--
+ 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.
+-->
+<html
data-th-with="page=${request.adaptTo(@org.apache.sling.scripting.thymeleaf.it.app.Page@class)}">
+<head>
+ <meta charset="UTF-8"/>
+ <title data-th-text="${page.title}">Page Title</title>
+</head>
+<body>
+<p data-th-text="${page.name}">Page Name</p>
+<p data-th-text="${page.path}">Page Path</p>
+</body>
+</html>
Added:
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/replace/html.html
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/replace/html.html?rev=1751643&view=auto
==============================================================================
---
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/replace/html.html
(added)
+++
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/replace/html.html
Wed Jul 6 09:32:43 2016
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<!--
+ 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.
+-->
+<html>
+<head data-th-replace="/apps/thymeleaf/page/fragments/head.html::default">
+ <title>Thymeleaf Replace</title>
+</head>
+<body>
+</body>
+</html>
Added:
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/text/html.html
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/text/html.html?rev=1751643&view=auto
==============================================================================
---
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/text/html.html
(added)
+++
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/apps/thymeleaf/page/text/html.html
Wed Jul 6 09:32:43 2016
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<!--
+ 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.
+-->
+<html>
+<head>
+ <meta charset="UTF-8"/>
+ <title data-th-text="${resource.getValueMap().get('title')}"></title>
+</head>
+<body>
+<span id="name" data-th-text="${resource.name}"></span>
+</body>
+</html>
Added:
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/content/thymeleaf.json
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/content/thymeleaf.json?rev=1751643&view=auto
==============================================================================
---
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/content/thymeleaf.json
(added)
+++
sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/test/resources/content/thymeleaf.json
Wed Jul 6 09:32:43 2016
@@ -0,0 +1,42 @@
+{
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "thymeleaf/page/main",
+ "sling:resourceSuperType": "thymeleaf/page",
+ "title": "Apache Sling Scripting Thymeleaf",
+ "adaptto": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "thymeleaf/page/adaptto",
+ "sling:resourceSuperType": "thymeleaf/page",
+ "title": "Sling Models adaptTo()"
+ },
+ "decoupled": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "thymeleaf/page/decoupled",
+ "sling:resourceSuperType": "thymeleaf/page",
+ "title": "Thymeleaf Decoupled Template Logic"
+ },
+ "include": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "thymeleaf/page/include",
+ "sling:resourceSuperType": "thymeleaf/page",
+ "title": "Sling Include"
+ },
+ "link": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "thymeleaf/page/link",
+ "sling:resourceSuperType": "thymeleaf/page",
+ "title": "Thymeleaf Link Builder"
+ },
+ "replace": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "thymeleaf/page/replace",
+ "sling:resourceSuperType": "thymeleaf/page",
+ "title": "Thymeleaf Replace"
+ },
+ "text": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "thymeleaf/page/text",
+ "sling:resourceSuperType": "thymeleaf/page",
+ "title": "Thymeleaf Text"
+ }
+}