-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added tests for the implementation of #809 in OGNL-based scenarios
- Loading branch information
1 parent
bbe4567
commit 0fe0a8a
Showing
14 changed files
with
150 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/test/resources/templateengine/features/accessrestrictions/accessrestrictions37.thtest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
%EXTENDS ../html5.01.common | ||
# ------------------------------------------------------------ | ||
%INPUT | ||
<p th:text="${new java.lang.String('hello')}">ALLOWED</p> | ||
# ------------------------------------------------------------ | ||
%OUTPUT | ||
<p>hello</p> |
7 changes: 7 additions & 0 deletions
7
src/test/resources/templateengine/features/accessrestrictions/accessrestrictions38.thtest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
%EXTENDS ../html5.01.common | ||
# ------------------------------------------------------------ | ||
%INPUT | ||
<p th:text="${__${new java.lang.String('hello')}__}">NOT ALLOWED</p> | ||
# ------------------------------------------------------------ | ||
%EXCEPTION org.thymeleaf.exceptions.TemplateProcessingException | ||
%EXCEPTION_MESSAGE_PATTERN (.*)\Qforbidden in this context\E(.*) |
7 changes: 7 additions & 0 deletions
7
src/test/resources/templateengine/features/accessrestrictions/accessrestrictions39.thtest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
%EXTENDS ../html5.01.common | ||
# ------------------------------------------------------------ | ||
%INPUT | ||
<p th:at0="${new java.lang.String('hello')}">NOT ALLOWED</p> | ||
# ------------------------------------------------------------ | ||
%EXCEPTION org.thymeleaf.exceptions.TemplateProcessingException | ||
%EXCEPTION_MESSAGE_PATTERN (.*)\Qforbidden in this context\E(.*) |
7 changes: 7 additions & 0 deletions
7
src/test/resources/templateengine/features/accessrestrictions/accessrestrictions40.thtest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
%EXTENDS ../html5.01.common | ||
# ------------------------------------------------------------ | ||
%INPUT | ||
<p th:attr="at0=${new java.lang.String('hello')}">NOT ALLOWED</p> | ||
# ------------------------------------------------------------ | ||
%EXCEPTION org.thymeleaf.exceptions.TemplateProcessingException | ||
%EXCEPTION_MESSAGE_PATTERN (.*)\Qforbidden in this context\E(.*) |
7 changes: 7 additions & 0 deletions
7
src/test/resources/templateengine/features/accessrestrictions/accessrestrictions41.thtest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
%EXTENDS ../html5.01.common | ||
# ------------------------------------------------------------ | ||
%INPUT | ||
<p th:href="~{${new java.lang.String('hello')}}">NOT ALLOWED</p> | ||
# ------------------------------------------------------------ | ||
%EXCEPTION org.thymeleaf.exceptions.TemplateProcessingException | ||
%EXCEPTION_MESSAGE_PATTERN (.*)\Qforbidden in this context\E(.*) |
7 changes: 7 additions & 0 deletions
7
src/test/resources/templateengine/features/accessrestrictions/accessrestrictions42.thtest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
%EXTENDS ../html5.01.common | ||
# ------------------------------------------------------------ | ||
%INPUT | ||
<p th:insert="${new java.lang.String('hello')}">NOT ALLOWED</p> | ||
# ------------------------------------------------------------ | ||
%EXCEPTION org.thymeleaf.exceptions.TemplateProcessingException | ||
%EXCEPTION_MESSAGE_PATTERN (.*)\Qforbidden in this context\E(.*) |
7 changes: 7 additions & 0 deletions
7
src/test/resources/templateengine/features/accessrestrictions/accessrestrictions43.thtest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
%EXTENDS ../html5.01.common | ||
# ------------------------------------------------------------ | ||
%INPUT | ||
<p th:text="@{${new java.lang.String('hello')}}">NOT ALLOWED</p> | ||
# ------------------------------------------------------------ | ||
%EXCEPTION org.thymeleaf.exceptions.TemplateProcessingException | ||
%EXCEPTION_MESSAGE_PATTERN (.*)\Qforbidden in this context\E(.*) |
7 changes: 7 additions & 0 deletions
7
src/test/resources/templateengine/features/accessrestrictions/accessrestrictions44.thtest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
%EXTENDS ../html5.01.common | ||
# ------------------------------------------------------------ | ||
%INPUT | ||
<p th:text="${@org.thymeleaf.TemplateEngine@TIMER_LOGGER_NAME}">ALLOWED</p> | ||
# ------------------------------------------------------------ | ||
%OUTPUT | ||
<p>org.thymeleaf.TemplateEngine.TIMER</p> |
7 changes: 7 additions & 0 deletions
7
src/test/resources/templateengine/features/accessrestrictions/accessrestrictions45.thtest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
%EXTENDS ../html5.01.common | ||
# ------------------------------------------------------------ | ||
%INPUT | ||
<p th:text="${__${@org.thymeleaf.TemplateEngine@TIMER_LOGGER_NAME}__}">NOT ALLOWED</p> | ||
# ------------------------------------------------------------ | ||
%EXCEPTION org.thymeleaf.exceptions.TemplateProcessingException | ||
%EXCEPTION_MESSAGE_PATTERN (.*)\Qforbidden in this context\E(.*) |
7 changes: 7 additions & 0 deletions
7
src/test/resources/templateengine/features/accessrestrictions/accessrestrictions46.thtest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
%EXTENDS ../html5.01.common | ||
# ------------------------------------------------------------ | ||
%INPUT | ||
<p th:at0="${@org.thymeleaf.TemplateEngine@TIMER_LOGGER_NAME}">NOT ALLOWED</p> | ||
# ------------------------------------------------------------ | ||
%EXCEPTION org.thymeleaf.exceptions.TemplateProcessingException | ||
%EXCEPTION_MESSAGE_PATTERN (.*)\Qforbidden in this context\E(.*) |
7 changes: 7 additions & 0 deletions
7
src/test/resources/templateengine/features/accessrestrictions/accessrestrictions47.thtest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
%EXTENDS ../html5.01.common | ||
# ------------------------------------------------------------ | ||
%INPUT | ||
<p th:href="~{${@org.thymeleaf.TemplateEngine@TIMER_LOGGER_NAME}}">NOT ALLOWED</p> | ||
# ------------------------------------------------------------ | ||
%EXCEPTION org.thymeleaf.exceptions.TemplateProcessingException | ||
%EXCEPTION_MESSAGE_PATTERN (.*)\Qforbidden in this context\E(.*) |
7 changes: 7 additions & 0 deletions
7
src/test/resources/templateengine/features/accessrestrictions/accessrestrictions48.thtest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
%EXTENDS ../html5.01.common | ||
# ------------------------------------------------------------ | ||
%INPUT | ||
<p th:text="@{${@org.thymeleaf.TemplateEngine@TIMER_LOGGER_NAME}}">NOT ALLOWED</p> | ||
# ------------------------------------------------------------ | ||
%EXCEPTION org.thymeleaf.exceptions.TemplateProcessingException | ||
%EXCEPTION_MESSAGE_PATTERN (.*)\Qforbidden in this context\E(.*) |
14 changes: 10 additions & 4 deletions
14
src/test/resources/templateengine/features/util/util02.thtest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
%TEMPLATE_MODE TEXT | ||
# ------------------------------------------------------------ | ||
%CONTEXT | ||
hourOfDayField = @java.util.Calendar@HOUR_OF_DAY | ||
minuteField = @java.util.Calendar@MINUTE | ||
secondField = @java.util.Calendar@SECOND | ||
millisecondField = @java.util.Calendar@MILLISECOND | ||
# ------------------------------------------------------------ | ||
%INPUT | ||
[# th:with="date = ${#calendars.createToday()}" | ||
th:text="${date.get(@java.util.Calendar@HOUR_OF_DAY) + ' ' + | ||
date.get(@java.util.Calendar@MINUTE) + ' ' + | ||
date.get(@java.util.Calendar@SECOND) + ' ' + | ||
date.get(@java.util.Calendar@MILLISECOND)}"]should all be zero[/] | ||
th:text="${date.get(hourOfDayField) + ' ' + | ||
date.get(minuteField) + ' ' + | ||
date.get(secondField) + ' ' + | ||
date.get(millisecondField)}"]should all be zero[/] | ||
# ------------------------------------------------------------ | ||
%OUTPUT | ||
0 0 0 0 |