use of com.liferay.ide.layouttpl.core.model.LayoutTplElement in project liferay-ide by liferay.
the class LayoutTplTestsBootstrap method testPortletColumnWeightInitialValueService.
@Test
public void testPortletColumnWeightInitialValueService() throws Exception {
final LayoutTplElement layoutTpl = LayoutTplElement.TYPE.instantiate();
layoutTpl.setBootstrapStyle(true);
final PortletLayoutElement row = layoutTpl.getPortletLayouts().insert();
final ElementList<PortletColumnElement> columns = row.getPortletColumns();
columns.insert();
columns.insert();
columns.insert();
columns.insert();
assertEquals(6, columns.get(0).getWeight().content().intValue());
assertEquals(3, columns.get(1).getWeight().content().intValue());
assertEquals(2, columns.get(2).getWeight().content().intValue());
assertEquals(1, columns.get(3).getWeight().content().intValue());
columns.get(0).setWeight(2);
columns.get(1).setWeight(2);
columns.get(2).setWeight(2);
columns.get(3).setWeight(2);
columns.insert();
assertEquals(4, columns.get(4).getWeight().content().intValue());
}
Aggregations