Search in sources :

Example 1 with WebProcessingContextBuilder

use of org.thymeleaf.testing.templateengine.context.web.WebProcessingContextBuilder in project thymeleaf-tests by thymeleaf.

the class ContextTest method testContextVarTest.

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

Example 2 with WebProcessingContextBuilder

use of org.thymeleaf.testing.templateengine.context.web.WebProcessingContextBuilder in project thymeleaf-tests by thymeleaf.

the class ContextTest method testContextBase.

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

Aggregations

Test (org.junit.Test)2 IDialect (org.thymeleaf.dialect.IDialect)2 StandardDialect (org.thymeleaf.standard.StandardDialect)2 WebProcessingContextBuilder (org.thymeleaf.testing.templateengine.context.web.WebProcessingContextBuilder)2 TestExecutor (org.thymeleaf.testing.templateengine.engine.TestExecutor)2 ContextDialect (org.thymeleaf.templateengine.context.dialect.ContextDialect)1 ContextVarTestDialect (org.thymeleaf.templateengine.context.dialect.ContextVarTestDialect)1