Make sure ThymeleafAutoConfiguration works if imported directly

Before this change if Layout dialect not available then the nested class is
loaded and barfs because it depended on the layout dialect (in a
@ConditionalOnClass annotation).
This commit is contained in:
Dave Syer
2013-05-31 16:16:19 +01:00
parent f12b3fbcd7
commit 969c7d6fa1
6 changed files with 73 additions and 3 deletions

View File

@@ -127,6 +127,19 @@ public class SampleIntegrationTests {
assertEquals("World!", result);
}
@Test
public void uiSample() throws Exception {
// To run this one from the command line you need to add target/test-classes to
// CLASSPATH
start("samples/ui.groovy");
String result = FileUtil.readEntirely(new URL("http://localhost:8080")
.openStream());
assertTrue("Wrong output: " + result, result.contains("Hello World"));
result = FileUtil.readEntirely(new URL(
"http://localhost:8080/css/bootstrap.min.css").openStream());
assertTrue("Wrong output: " + result, result.contains("container"));
}
@Test
public void actuatorSample() throws Exception {
start("samples/actuator.groovy");

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title th:text="${title}">Title</title>
<link rel="stylesheet" th:href="@{/resources/css/bootstrap.min.css}"
href="../../resources/css/bootstrap.min.css" />
</head>
<body>
<div class="container">
<div class="navbar">
<div class="navbar-inner">
<a class="brand" href="http://www.thymeleaf.org"> Thymeleaf -
Plain </a>
<ul class="nav">
<li><a th:href="@{/}" href="home.html"> Home </a></li>
</ul>
</div>
</div>
<h1 th:text="${title}">Title</h1>
<div th:text="${message}">Fake content</div>
<div id="created" th:text="${#dates.format(date)}">July 11,
2012 2:17:16 PM CDT</div>
</div>
</body>
</html>