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 2016/04/21 20:38:41 UTC

svn commit: r1740382 - in /sling/trunk/contrib: ./ scripting/org.apache.sling.scripting.thymeleaf.it/ scripting/org.apache.sling.scripting.thymeleaf.it/src/ scripting/org.apache.sling.scripting.thymeleaf.it/src/main/ scripting/org.apache.sling.scriptin...

Author: olli
Date: Thu Apr 21 18:38:40 2016
New Revision: 1740382

URL: http://svn.apache.org/viewvc?rev=1740382&view=rev
Log:
SLING-5680 Add Integration Tests for Scripting Thymeleaf

Added:
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/README.md
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/pom.xml
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/java/
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/java/org/
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/java/org/apache/
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/java/org/apache/sling/
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/java/org/apache/sling/scripting/
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/java/org/apache/sling/scripting/thymeleaf/
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/java/org/apache/sling/scripting/thymeleaf/it/
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/java/org/apache/sling/scripting/thymeleaf/it/page/
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/java/org/apache/sling/scripting/thymeleaf/it/page/Page.java
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/apps/
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/apps/jsp/
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/apps/jsp/page/
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/apps/jsp/page/resource/
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/apps/jsp/page/resource/html.jsp
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/apps/thymeleaf/
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/apps/thymeleaf/page/
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/apps/thymeleaf/page/adaptto/
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/apps/thymeleaf/page/adaptto/html.html
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/apps/thymeleaf/page/fragments/
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/apps/thymeleaf/page/fragments/head.html
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/apps/thymeleaf/page/include/
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/apps/thymeleaf/page/include/html.html
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/apps/thymeleaf/page/replace/
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/apps/thymeleaf/page/replace/html.html
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/apps/thymeleaf/page/text/
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/apps/thymeleaf/page/text/html.html
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/content/
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/content/thymeleaf.json
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/org/
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/org/apache/
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/org/apache/sling/
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/org/apache/sling/scripting/
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/org/apache/sling/scripting/thymeleaf/
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/org/apache/sling/scripting/thymeleaf/it/
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/org/apache/sling/scripting/thymeleaf/it/AdaptToModelIT.java
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/org/apache/sling/scripting/thymeleaf/it/SlingIncludeIT.java
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/org/apache/sling/scripting/thymeleaf/it/TemplateEngineIT.java
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/org/apache/sling/scripting/thymeleaf/it/ThymeleafReplaceIT.java
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/org/apache/sling/scripting/thymeleaf/it/ThymeleafScriptEngineFactoryIT.java
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/org/apache/sling/scripting/thymeleaf/it/ThymeleafTestSupport.java
    sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/org/apache/sling/scripting/thymeleaf/it/ThymeleafTextIT.java
Modified:
    sling/trunk/contrib/pom.xml

Modified: sling/trunk/contrib/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/pom.xml?rev=1740382&r1=1740381&r2=1740382&view=diff
==============================================================================
--- sling/trunk/contrib/pom.xml (original)
+++ sling/trunk/contrib/pom.xml Thu Apr 21 18:38:40 2016
@@ -144,6 +144,7 @@
           <module>scripting/scala/samples/hello-world</module>
           <module>scripting/scala/samples/forum</module>
           <module>scripting/org.apache.sling.scripting.thymeleaf</module>
+          <module>scripting/org.apache.sling.scripting.thymeleaf.it</module>
           <module>scripting/velocity</module>
           <module>scripting/xproc</module>
 

Added: sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/README.md
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/README.md?rev=1740382&view=auto
==============================================================================
--- sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/README.md (added)
+++ sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/README.md Thu Apr 21 18:38:40 2016
@@ -0,0 +1,4 @@
+Apache Sling Scripting Thymeleaf IT
+===================================
+
+Integration Tests for Apache Sling Scripting Thymeleaf

Added: sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/pom.xml?rev=1740382&view=auto
==============================================================================
--- sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/pom.xml (added)
+++ sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/pom.xml Thu Apr 21 18:38:40 2016
@@ -0,0 +1,257 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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>26</version>
+    <relativePath/>
+  </parent>
+
+  <artifactId>org.apache.sling.scripting.thymeleaf.it</artifactId>
+  <version>0.0.1-SNAPSHOT</version>
+  <packaging>bundle</packaging>
+
+  <name>Apache Sling Scripting Thymeleaf IT</name>
+  <description>Apache Sling Scripting Thymeleaf IT</description>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+    <sling.java.version>7</sling.java.version>
+    <org.apache.karaf.version>4.0.4</org.apache.karaf.version>
+    <org.ops4j.pax.exam.version>4.8.0</org.ops4j.pax.exam.version>
+  </properties>
+
+  <scm>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it</developerConnection>
+    <url>http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it</url>
+  </scm>
+
+  <dependencies>
+    <!-- javax -->
+    <dependency>
+      <groupId>javax.inject</groupId>
+      <artifactId>javax.inject</artifactId>
+      <version>1</version>
+      <scope>provided</scope>
+    </dependency>
+    <!-- Apache Karaf -->
+    <dependency>
+      <groupId>org.apache.karaf</groupId>
+      <artifactId>apache-karaf</artifactId>
+      <type>tar.gz</type>
+      <version>${org.apache.karaf.version}</version>
+      <scope>test</scope>
+      <exclusions>
+        <exclusion>
+          <groupId>org.apache.karaf</groupId>
+          <artifactId>org.apache.karaf.client</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <!-- Apache Sling -->
+    <dependency>
+      <groupId>org.apache.sling</groupId>
+      <artifactId>org.apache.sling.api</artifactId>
+      <version>2.11.0</version>
+      <scope>provided</scope>
+    </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.jcr.api</artifactId>
+      <version>2.3.0</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.sling</groupId>
+      <artifactId>org.apache.sling.launchpad.karaf-features</artifactId>
+      <version>0.1.1-SNAPSHOT</version>
+      <type>xml</type>
+      <classifier>features</classifier>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.sling</groupId>
+      <artifactId>org.apache.sling.launchpad.karaf-integration-tests</artifactId>
+      <version>0.1.1-SNAPSHOT</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.sling</groupId>
+      <artifactId>org.apache.sling.models.api</artifactId>
+      <version>1.2.2</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.sling</groupId>
+      <artifactId>org.apache.sling.scripting.thymeleaf</artifactId>
+      <version>0.1.7-SNAPSHOT</version>
+      <scope>test</scope>
+    </dependency>
+    <!-- bnd -->
+    <dependency>
+      <groupId>biz.aQute.bnd</groupId>
+      <artifactId>biz.aQute.bndlib</artifactId>
+      <version>2.4.1</version>
+      <scope>test</scope>
+    </dependency>
+    <!-- javassist -->
+    <dependency>
+      <groupId>org.javassist</groupId>
+      <artifactId>javassist</artifactId>
+      <version>3.20.0-GA</version>
+      <scope>test</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>
+      <artifactId>slf4j-simple</artifactId>
+      <scope>test</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-container-karaf</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>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.3</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <extensions>true</extensions>
+        <configuration>
+          <instructions>
+            <Sling-Initial-Content>
+              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
+            </Sling-Initial-Content>
+            <Sling-Model-Packages>
+              org.apache.sling.scripting.thymeleaf.it.page
+            </Sling-Model-Packages>
+          </instructions>
+        </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>
+
+  <profiles>
+    <profile>
+      <id>it</id>
+      <activation>
+        <jdk>[1.8,)</jdk>
+      </activation>
+      <build>
+        <plugins>
+          <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>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+
+</project>

Added: sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/java/org/apache/sling/scripting/thymeleaf/it/page/Page.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/java/org/apache/sling/scripting/thymeleaf/it/page/Page.java?rev=1740382&view=auto
==============================================================================
--- sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/java/org/apache/sling/scripting/thymeleaf/it/page/Page.java (added)
+++ sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/java/org/apache/sling/scripting/thymeleaf/it/page/Page.java Thu Apr 21 18:38:40 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.page;
+
+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.it/src/main/resources/apps/jsp/page/resource/html.jsp
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/apps/jsp/page/resource/html.jsp?rev=1740382&view=auto
==============================================================================
--- sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/apps/jsp/page/resource/html.jsp (added)
+++ sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/apps/jsp/page/resource/html.jsp Thu Apr 21 18:38:40 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.it/src/main/resources/apps/thymeleaf/page/adaptto/html.html
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/apps/thymeleaf/page/adaptto/html.html?rev=1740382&view=auto
==============================================================================
--- sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/apps/thymeleaf/page/adaptto/html.html (added)
+++ sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/apps/thymeleaf/page/adaptto/html.html Thu Apr 21 18:38:40 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.page.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.it/src/main/resources/apps/thymeleaf/page/fragments/head.html
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/apps/thymeleaf/page/fragments/head.html?rev=1740382&view=auto
==============================================================================
--- sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/apps/thymeleaf/page/fragments/head.html (added)
+++ sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/apps/thymeleaf/page/fragments/head.html Thu Apr 21 18:38:40 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.it/src/main/resources/apps/thymeleaf/page/include/html.html
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/apps/thymeleaf/page/include/html.html?rev=1740382&view=auto
==============================================================================
--- sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/apps/thymeleaf/page/include/html.html (added)
+++ sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/apps/thymeleaf/page/include/html.html Thu Apr 21 18:38:40 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.it/src/main/resources/apps/thymeleaf/page/replace/html.html
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/apps/thymeleaf/page/replace/html.html?rev=1740382&view=auto
==============================================================================
--- sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/apps/thymeleaf/page/replace/html.html (added)
+++ sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/apps/thymeleaf/page/replace/html.html Thu Apr 21 18:38:40 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.it/src/main/resources/apps/thymeleaf/page/text/html.html
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/apps/thymeleaf/page/text/html.html?rev=1740382&view=auto
==============================================================================
--- sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/apps/thymeleaf/page/text/html.html (added)
+++ sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/apps/thymeleaf/page/text/html.html Thu Apr 21 18:38:40 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.it/src/main/resources/content/thymeleaf.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/content/thymeleaf.json?rev=1740382&view=auto
==============================================================================
--- sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/content/thymeleaf.json (added)
+++ sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/main/resources/content/thymeleaf.json Thu Apr 21 18:38:40 2016
@@ -0,0 +1,30 @@
+{
+    "jcr:primaryType": "nt:unstructured",
+    "sling:resourceType": "thymeleaf/page/main",
+    "sling:resourceSuperType": "thymeleaf/page",
+    "title": "Apache Sling Scripting Thymeleaf",
+    "text": {
+        "jcr:primaryType": "nt:unstructured",
+        "sling:resourceType": "thymeleaf/page/text",
+        "sling:resourceSuperType": "thymeleaf/page",
+        "title": "Thymeleaf Text"
+    },
+    "replace": {
+        "jcr:primaryType": "nt:unstructured",
+        "sling:resourceType": "thymeleaf/page/replace",
+        "sling:resourceSuperType": "thymeleaf/page",
+        "title": "Thymeleaf Replace"
+    },
+    "include": {
+        "jcr:primaryType": "nt:unstructured",
+        "sling:resourceType": "thymeleaf/page/include",
+        "sling:resourceSuperType": "thymeleaf/page",
+        "title": "Sling Include"
+    },
+    "adaptto": {
+        "jcr:primaryType": "nt:unstructured",
+        "sling:resourceType": "thymeleaf/page/adaptto",
+        "sling:resourceSuperType": "thymeleaf/page",
+        "title": "Sling Models adaptTo()"
+    }
+}

Added: sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/org/apache/sling/scripting/thymeleaf/it/AdaptToModelIT.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/org/apache/sling/scripting/thymeleaf/it/AdaptToModelIT.java?rev=1740382&view=auto
==============================================================================
--- sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/org/apache/sling/scripting/thymeleaf/it/AdaptToModelIT.java (added)
+++ sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/org/apache/sling/scripting/thymeleaf/it/AdaptToModelIT.java Thu Apr 21 18:38:40 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;
+
+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.it/src/test/java/org/apache/sling/scripting/thymeleaf/it/SlingIncludeIT.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/org/apache/sling/scripting/thymeleaf/it/SlingIncludeIT.java?rev=1740382&view=auto
==============================================================================
--- sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/org/apache/sling/scripting/thymeleaf/it/SlingIncludeIT.java (added)
+++ sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/org/apache/sling/scripting/thymeleaf/it/SlingIncludeIT.java Thu Apr 21 18:38:40 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;
+
+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.it/src/test/java/org/apache/sling/scripting/thymeleaf/it/TemplateEngineIT.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/org/apache/sling/scripting/thymeleaf/it/TemplateEngineIT.java?rev=1740382&view=auto
==============================================================================
--- sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/org/apache/sling/scripting/thymeleaf/it/TemplateEngineIT.java (added)
+++ sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/org/apache/sling/scripting/thymeleaf/it/TemplateEngineIT.java Thu Apr 21 18:38:40 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;
+
+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.it/src/test/java/org/apache/sling/scripting/thymeleaf/it/ThymeleafReplaceIT.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/org/apache/sling/scripting/thymeleaf/it/ThymeleafReplaceIT.java?rev=1740382&view=auto
==============================================================================
--- sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/org/apache/sling/scripting/thymeleaf/it/ThymeleafReplaceIT.java (added)
+++ sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/org/apache/sling/scripting/thymeleaf/it/ThymeleafReplaceIT.java Thu Apr 21 18:38:40 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;
+
+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.it/src/test/java/org/apache/sling/scripting/thymeleaf/it/ThymeleafScriptEngineFactoryIT.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/org/apache/sling/scripting/thymeleaf/it/ThymeleafScriptEngineFactoryIT.java?rev=1740382&view=auto
==============================================================================
--- sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/org/apache/sling/scripting/thymeleaf/it/ThymeleafScriptEngineFactoryIT.java (added)
+++ sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/org/apache/sling/scripting/thymeleaf/it/ThymeleafScriptEngineFactoryIT.java Thu Apr 21 18:38:40 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;
+
+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.it/src/test/java/org/apache/sling/scripting/thymeleaf/it/ThymeleafTestSupport.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/org/apache/sling/scripting/thymeleaf/it/ThymeleafTestSupport.java?rev=1740382&view=auto
==============================================================================
--- sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/org/apache/sling/scripting/thymeleaf/it/ThymeleafTestSupport.java (added)
+++ sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/org/apache/sling/scripting/thymeleaf/it/ThymeleafTestSupport.java Thu Apr 21 18:38:40 2016
@@ -0,0 +1,75 @@
+/*
+ * 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;
+
+import java.io.File;
+
+import javax.inject.Inject;
+import javax.script.ScriptEngineFactory;
+
+import org.apache.sling.auth.core.AuthenticationSupport;
+import org.apache.sling.engine.SlingRequestProcessor;
+import org.apache.sling.launchpad.karaf.testing.KarafTestSupport;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.OptionUtils;
+import org.ops4j.pax.exam.util.Filter;
+import org.thymeleaf.ITemplateEngine;
+
+import static org.ops4j.pax.exam.CoreOptions.bundle;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
+
+public abstract class ThymeleafTestSupport extends KarafTestSupport {
+
+    @Inject
+    protected SlingRequestProcessor slingRequestProcessor;
+
+    @Inject
+    protected AuthenticationSupport authenticationSupport;
+
+    @Inject
+    @Filter(value = "(names=thymeleaf)")
+    protected ScriptEngineFactory scriptEngineFactory;
+
+    @Inject
+    protected ITemplateEngine templateEngine;
+
+    @Configuration
+    public Option[] configuration() {
+        final String filename = System.getProperty("bundle.filename");
+        final File file = new File(filename);
+        return OptionUtils.combine(baseConfiguration(),
+            editConfigurationFilePut("etc/org.ops4j.pax.logging.cfg", "log4j.rootLogger", "ERROR, out, sift, osgi:*"),
+            bundle(file.toURI().toString()),
+            addSlingFeatures(
+                "sling-launchpad-oak-tar",
+                "sling-scripting",
+                "sling-extension-i18n",
+                "sling-extension-models",
+                "sling-scripting-jsp"
+            ),
+            mavenBundle().groupId("org.apache.sling").artifactId("org.apache.sling.scripting.thymeleaf").versionAsInProject(),
+            mavenBundle().groupId("org.javassist").artifactId("javassist").versionAsInProject(),
+            mavenBundle().groupId("org.jsoup").artifactId("jsoup").versionAsInProject(),
+            mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.hamcrest").versionAsInProject()
+        );
+    }
+
+}

Added: sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/org/apache/sling/scripting/thymeleaf/it/ThymeleafTextIT.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/org/apache/sling/scripting/thymeleaf/it/ThymeleafTextIT.java?rev=1740382&view=auto
==============================================================================
--- sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/org/apache/sling/scripting/thymeleaf/it/ThymeleafTextIT.java (added)
+++ sling/trunk/contrib/scripting/org.apache.sling.scripting.thymeleaf.it/src/test/java/org/apache/sling/scripting/thymeleaf/it/ThymeleafTextIT.java Thu Apr 21 18:38:40 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;
+
+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()));
+    }
+
+}