@Test
public void testOnePageThreeRows() throws Exception {

	// Dynamic data mapping form
	DDMForm ddmForm = DDMFormTestUtil.createDDMForm(
		"Field1", "Field2", "Field3", "Field4", "Field5");
	// Dynamic data mapping form layout
	DDMFormLayout ddmFormLayout = new DDMFormLayout();
	DDMFormLayoutPage ddmFormLayoutPage = createDDMFormLayoutPage(
		"Page 1", "Page 1 Description");
	DDMFormLayoutRow ddmFormLayoutRow1 = new DDMFormLayoutRow();
	ddmFormLayoutRow1.setDDMFormLayoutColumns(
		createDDMFormLayoutColumns("Field1", "Field2"));
	ddmFormLayoutPage.addDDMFormLayoutRow(ddmFormLayoutRow1);
	DDMFormLayoutRow ddmFormLayoutRow2 = new DDMFormLayoutRow();
	ddmFormLayoutRow2.setDDMFormLayoutColumns(
		createDDMFormLayoutColumns("Field3"));
	ddmFormLayoutPage.addDDMFormLayoutRow(ddmFormLayoutRow2);
	DDMFormLayoutRow ddmFormLayoutRow3 = new DDMFormLayoutRow();
	ddmFormLayoutRow3.addDDMFormLayoutColumn(
		new DDMFormLayoutColumn(12, "Field4", "Field5"));
	ddmFormLayoutPage.addDDMFormLayoutRow(ddmFormLayoutRow3);
	ddmFormLayout.addDDMFormLayoutPage(ddmFormLayoutPage);
	// Template context
	DDMFormPagesTemplateContextFactory ddmFormPagesTemplateContextFactory =
		createDDMFormPagesTemplateContextFactory(
			ddmForm, ddmFormLayout, null, false, true, false);
	List<Object> pages = ddmFormPagesTemplateContextFactory.create();
	Assert.assertEquals(pages.toString(), 1, pages.size());
	Map<String, Object> page1 = (Map<String, Object>)pages.get(0);
	Assert.assertEquals("Page 1", page1.get("title"));
	Assert.assertEquals("Page 1 Description", page1.get("description"));
	List<Object> rows = (List<Object>)page1.get("rows");
	Assert.assertEquals(rows.toString(), 3, rows.size());
	Map<String, Object> row1 = (Map<String, Object>)rows.get(0);
	List<Object> columnsRow1 = (List<Object>)row1.get("columns");
	Assert.assertEquals(columnsRow1.toString(), 2, columnsRow1.size());
	assertColumnSize(6, (Map<String, Object>)columnsRow1.get(0));
	assertColumnSize(6, (Map<String, Object>)columnsRow1.get(1));
	Map<String, Object> row2 = (Map<String, Object>)rows.get(1);
	List<Object> columnsRow2 = (List<Object>)row2.get("columns");
	Assert.assertEquals(columnsRow2.toString(), 1, columnsRow2.size());
	assertColumnSize(12, (Map<String, Object>)columnsRow2.get(0));
	Map<String, Object> row3 = (Map<String, Object>)rows.get(2);
	List<Object> columnsRow3 = (List<Object>)row3.get("columns");
	Assert.assertEquals(columnsRow3.toString(), 1, columnsRow3.size());
	assertColumnSize(12, (Map<String, Object>)columnsRow3.get(0));
}