use of org.thymeleaf.dialect.IProcessorDialect in project thymeleaf-tests by thymeleaf.
the class ElementProcessorIteratorTest method testProcessorIteration02.
@Test
public void testProcessorIteration02() {
final IProcessorDialect dialect = ProcessorAggregationTestDialect.buildHTMLDialect("standard", "th", "N-ELEMENT-10-null-src,N-ELEMENT-5-null-src,N-ELEMENT-15-null-one");
final TagObtentionTemplateHandler handler = computeHtmlTag("<a th:src='hello'>", dialect);
final ElementProcessorIterator iterator = handler.iter;
final OpenElementTag tag = handler.tag;
Assert.assertEquals("N-ELEMENT-5-null-{th:src,data-th-src}", iterator.next(tag).toString());
tag.getAttributes().setAttribute("th:one", "somevalue");
Assert.assertEquals("N-ELEMENT-10-null-{th:src,data-th-src}", iterator.next(tag).toString());
Assert.assertEquals("N-ELEMENT-15-null-{th:one,data-th-one}", iterator.next(tag).toString());
Assert.assertNull(iterator.next(tag));
}
use of org.thymeleaf.dialect.IProcessorDialect in project thymeleaf-tests by thymeleaf.
the class ElementProcessorIteratorTest method testProcessorIteration04.
@Test
public void testProcessorIteration04() {
final IProcessorDialect dialect = ProcessorAggregationTestDialect.buildHTMLDialect("standard", "th", "N-ELEMENT-10-null-src,N-ELEMENT-5-null-src,N-ELEMENT-2-null-one");
final TagObtentionTemplateHandler handler = computeHtmlTag("<a th:src='hello'>", dialect);
final ElementProcessorIterator iterator = handler.iter;
final OpenElementTag tag = handler.tag;
Assert.assertEquals("N-ELEMENT-5-null-{th:src,data-th-src}", iterator.next(tag).toString());
tag.getAttributes().setAttribute("th:one", "somevalue");
Assert.assertEquals("N-ELEMENT-2-null-{th:one,data-th-one}", iterator.next(tag).toString());
Assert.assertEquals("N-ELEMENT-10-null-{th:src,data-th-src}", iterator.next(tag).toString());
Assert.assertNull(iterator.next(tag));
}
use of org.thymeleaf.dialect.IProcessorDialect in project thymeleaf-tests by thymeleaf.
the class ElementProcessorIteratorTest method testProcessorIteration08.
@Test
public void testProcessorIteration08() {
final IProcessorDialect dialect = ProcessorAggregationTestDialect.buildHTMLDialect("standard", "th", "N-ELEMENT-10-null-src,N-ELEMENT-5-null-src,N-ELEMENT-2-null-one");
final TagObtentionTemplateHandler handler = computeHtmlTag("<a th:src='hello'>", dialect);
final ElementProcessorIterator iterator = handler.iter;
final OpenElementTag tag = handler.tag;
Assert.assertEquals("N-ELEMENT-5-null-{th:src,data-th-src}", iterator.next(tag).toString());
tag.getAttributes().setAttribute("th:one", "somevalue");
tag.getAttributes().removeAttribute("data-th-src");
Assert.assertEquals("N-ELEMENT-2-null-{th:one,data-th-one}", iterator.next(tag).toString());
Assert.assertNull(iterator.next(tag));
}
use of org.thymeleaf.dialect.IProcessorDialect in project thymeleaf-tests by thymeleaf.
the class ElementProcessorIteratorTest method testProcessorIteration09.
@Test
public void testProcessorIteration09() {
final IProcessorDialect dialect = ProcessorAggregationTestDialect.buildHTMLDialect("standard", "th", "N-ELEMENT-10-null-src,N-ELEMENT-5-null-src,N-ELEMENT-2-null-one");
final TagObtentionTemplateHandler handler = computeHtmlTag("<a th:src='hello'>", dialect);
final ElementProcessorIterator iterator = handler.iter;
final OpenElementTag tag = handler.tag;
Assert.assertEquals("N-ELEMENT-5-null-{th:src,data-th-src}", iterator.next(tag).toString());
tag.getAttributes().setAttribute("th:one", "somevalue");
Assert.assertEquals("N-ELEMENT-2-null-{th:one,data-th-one}", iterator.next(tag).toString());
tag.getAttributes().removeAttribute("th:src");
Assert.assertNull(iterator.next(tag));
}
use of org.thymeleaf.dialect.IProcessorDialect in project thymeleaf-tests by thymeleaf.
the class ElementProcessorIteratorTest method testProcessorIteration01.
@Test
public void testProcessorIteration01() {
final IProcessorDialect dialect = ProcessorAggregationTestDialect.buildHTMLDialect("standard", "th", "N-ELEMENT-10-null-src,N-ELEMENT-5-null-src");
final TagObtentionTemplateHandler handler = computeHtmlTag("<a th:src='hello'>", dialect);
final ElementProcessorIterator iterator = handler.iter;
final OpenElementTag tag = handler.tag;
Assert.assertEquals("N-ELEMENT-5-null-{th:src,data-th-src}", iterator.next(handler.tag).toString());
Assert.assertEquals("N-ELEMENT-10-null-{th:src,data-th-src}", iterator.next(handler.tag).toString());
Assert.assertNull(iterator.next(tag));
}
Aggregations