use of com.enonic.xp.region.LayoutDescriptor in project xp by enonic.
the class DescriptorsTest method layoutDescriptor.
@Test
public void layoutDescriptor() {
final Form layoutForm = Form.create().addFormItem(Input.create().name("columns").label("columns").inputType(InputTypeName.DOUBLE).build()).build();
final LayoutDescriptor layoutDescriptor = LayoutDescriptor.create().displayName("Fancy layout").config(layoutForm).regions(RegionDescriptors.create().build()).key(DescriptorKey.from("module:fancy-layout")).build();
final LayoutDescriptor copy = LayoutDescriptor.copyOf(layoutDescriptor).build();
assertEquals("Fancy layout", layoutDescriptor.getDisplayName());
assertEquals(layoutForm, layoutDescriptor.getConfig());
assertEquals(layoutDescriptor.getComponentPath(), copy.getComponentPath());
assertEquals(layoutDescriptor.getRegions(), copy.getRegions());
}
use of com.enonic.xp.region.LayoutDescriptor in project xp by enonic.
the class LayoutDescriptorServiceTest method testGetByKey.
@Test
public void testGetByKey() throws Exception {
final DescriptorKey key = DescriptorKey.from("myapp1:mylayout");
final LayoutDescriptor descriptor = this.service.getByKey(key);
assertNotNull(descriptor);
assertTrue(Instant.now().isAfter(descriptor.getModifiedTime()));
}
Aggregations