Search in sources :

Example 1 with PrecedenceDialect

use of org.thymeleaf.templateengine.elementprocessors.dialect.PrecedenceDialect in project thymeleaf-tests by thymeleaf.

the class ElementProcessorsTest method testDialectPrecedenceTagBefore.

@Test
public void testDialectPrecedenceTagBefore() throws Exception {
    final TestExecutor executor = TestExecutorFactory.createTestExecutor();
    executor.setDialects(Arrays.asList(new IDialect[] { new StandardDialect(), new PrecedenceDialect(StandardDialect.PROCESSOR_PRECEDENCE - 1) }));
    executor.setThrottleStep(this.throttleStep);
    executor.execute("classpath:templateengine/elementprocessors/precedencetagbefore");
    Assert.assertTrue(executor.isAllOK());
}
Also used : TestExecutor(org.thymeleaf.testing.templateengine.engine.TestExecutor) PrecedenceDialect(org.thymeleaf.templateengine.elementprocessors.dialect.PrecedenceDialect) StandardDialect(org.thymeleaf.standard.StandardDialect) IDialect(org.thymeleaf.dialect.IDialect) Test(org.junit.Test)

Example 2 with PrecedenceDialect

use of org.thymeleaf.templateengine.elementprocessors.dialect.PrecedenceDialect in project thymeleaf-tests by thymeleaf.

the class ElementProcessorsTest method testDialectPrecedenceTagSame.

@Test
public void testDialectPrecedenceTagSame() throws Exception {
    final TestExecutor executor = TestExecutorFactory.createTestExecutor();
    executor.setDialects(Arrays.asList(new IDialect[] { new StandardDialect(), new PrecedenceDialect(StandardDialect.PROCESSOR_PRECEDENCE) }));
    executor.setThrottleStep(this.throttleStep);
    executor.execute("classpath:templateengine/elementprocessors/precedencetagsame");
    Assert.assertTrue(executor.isAllOK());
}
Also used : TestExecutor(org.thymeleaf.testing.templateengine.engine.TestExecutor) PrecedenceDialect(org.thymeleaf.templateengine.elementprocessors.dialect.PrecedenceDialect) StandardDialect(org.thymeleaf.standard.StandardDialect) IDialect(org.thymeleaf.dialect.IDialect) Test(org.junit.Test)

Example 3 with PrecedenceDialect

use of org.thymeleaf.templateengine.elementprocessors.dialect.PrecedenceDialect in project thymeleaf-tests by thymeleaf.

the class ElementProcessorsTest method testDialectPrecedenceModelAfter.

@Test
public void testDialectPrecedenceModelAfter() throws Exception {
    final TestExecutor executor = TestExecutorFactory.createTestExecutor();
    executor.setDialects(Arrays.asList(new IDialect[] { new StandardDialect(), new PrecedenceDialect(StandardDialect.PROCESSOR_PRECEDENCE + 1) }));
    executor.setThrottleStep(this.throttleStep);
    executor.execute("classpath:templateengine/elementprocessors/precedencemodelafter");
    Assert.assertTrue(executor.isAllOK());
}
Also used : TestExecutor(org.thymeleaf.testing.templateengine.engine.TestExecutor) PrecedenceDialect(org.thymeleaf.templateengine.elementprocessors.dialect.PrecedenceDialect) StandardDialect(org.thymeleaf.standard.StandardDialect) IDialect(org.thymeleaf.dialect.IDialect) Test(org.junit.Test)

Example 4 with PrecedenceDialect

use of org.thymeleaf.templateengine.elementprocessors.dialect.PrecedenceDialect in project thymeleaf-tests by thymeleaf.

the class ElementProcessorsTest method testDialectPrecedenceModelBefore.

@Test
public void testDialectPrecedenceModelBefore() throws Exception {
    final TestExecutor executor = TestExecutorFactory.createTestExecutor();
    executor.setDialects(Arrays.asList(new IDialect[] { new StandardDialect(), new PrecedenceDialect(StandardDialect.PROCESSOR_PRECEDENCE - 1) }));
    executor.setThrottleStep(this.throttleStep);
    executor.execute("classpath:templateengine/elementprocessors/precedencemodelbefore");
    Assert.assertTrue(executor.isAllOK());
}
Also used : TestExecutor(org.thymeleaf.testing.templateengine.engine.TestExecutor) PrecedenceDialect(org.thymeleaf.templateengine.elementprocessors.dialect.PrecedenceDialect) StandardDialect(org.thymeleaf.standard.StandardDialect) IDialect(org.thymeleaf.dialect.IDialect) Test(org.junit.Test)

Example 5 with PrecedenceDialect

use of org.thymeleaf.templateengine.elementprocessors.dialect.PrecedenceDialect in project thymeleaf-tests by thymeleaf.

the class ElementProcessorsTest method testDialectPrecedenceTagAfter.

@Test
public void testDialectPrecedenceTagAfter() throws Exception {
    final TestExecutor executor = TestExecutorFactory.createTestExecutor();
    executor.setDialects(Arrays.asList(new IDialect[] { new StandardDialect(), new PrecedenceDialect(StandardDialect.PROCESSOR_PRECEDENCE + 1) }));
    executor.setThrottleStep(this.throttleStep);
    executor.execute("classpath:templateengine/elementprocessors/precedencetagafter");
    Assert.assertTrue(executor.isAllOK());
}
Also used : TestExecutor(org.thymeleaf.testing.templateengine.engine.TestExecutor) PrecedenceDialect(org.thymeleaf.templateengine.elementprocessors.dialect.PrecedenceDialect) StandardDialect(org.thymeleaf.standard.StandardDialect) IDialect(org.thymeleaf.dialect.IDialect) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)6 IDialect (org.thymeleaf.dialect.IDialect)6 StandardDialect (org.thymeleaf.standard.StandardDialect)6 PrecedenceDialect (org.thymeleaf.templateengine.elementprocessors.dialect.PrecedenceDialect)6 TestExecutor (org.thymeleaf.testing.templateengine.engine.TestExecutor)6