Example usage for com.liferay.portal.kernel.model LayoutPrototype getGroup

List of usage examples for com.liferay.portal.kernel.model LayoutPrototype getGroup

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.model LayoutPrototype getGroup.

Prototype

public Group getGroup() throws com.liferay.portal.kernel.exception.PortalException;

Source Link

Usage

From source file:com.liferay.exportimport.test.LayoutExportImportTest.java

License:Open Source License

@Test
public void testExportImportLayoutPrototypeInvalidLARType() throws Exception {

    // Import a layout prototype to a layout set

    LayoutPrototype layoutPrototype = LayoutTestUtil.addLayoutPrototype(RandomTestUtil.randomString());

    group = layoutPrototype.getGroup();

    importedGroup = GroupTestUtil.addGroup();

    long[] layoutIds = new long[0];

    try {//from   w ww .  j  a  va2  s. c o  m
        exportImportLayouts(layoutIds, getImportParameterMap());

        Assert.fail();
    } catch (LARTypeException larte) {
    }

    // Import a layout prototype to a layout set pototype

    LayoutSetPrototype layoutSetPrototype = LayoutTestUtil.addLayoutSetPrototype(RandomTestUtil.randomString());

    importedGroup = layoutSetPrototype.getGroup();

    try {
        exportImportLayouts(layoutIds, getImportParameterMap());

        Assert.fail();
    } catch (LARTypeException larte) {
    } finally {
        LayoutSetPrototypeLocalServiceUtil.deleteLayoutSetPrototype(layoutSetPrototype);

        importedGroup = null;
    }
}

From source file:com.liferay.exportimport.test.LayoutExportImportTest.java

License:Open Source License

@Test
public void testExportImportLayoutSetInvalidLARType() throws Exception {

    // Import a layout set to a layout prototype

    LayoutPrototype layoutPrototype = LayoutTestUtil.addLayoutPrototype(RandomTestUtil.randomString());

    importedGroup = layoutPrototype.getGroup();

    long[] layoutIds = new long[0];

    try {/*www. j  a va  2 s .c  om*/
        exportImportLayouts(layoutIds, getImportParameterMap());

        Assert.fail();
    } catch (LARTypeException larte) {
    }

    // Import a layout set to a layout set prototype

    LayoutSetPrototype layoutSetPrototype = LayoutTestUtil.addLayoutSetPrototype(RandomTestUtil.randomString());

    importedGroup = layoutSetPrototype.getGroup();

    try {
        exportImportLayouts(layoutIds, getImportParameterMap());

        Assert.fail();
    } catch (LARTypeException larte) {
    } finally {
        LayoutSetPrototypeLocalServiceUtil.deleteLayoutSetPrototype(layoutSetPrototype);

        importedGroup = null;
    }
}

From source file:com.liferay.exportimport.test.LayoutExportImportTest.java

License:Open Source License

@Test
public void testExportImportLayoutSetPrototypeInvalidLARType() throws Exception {

    // Import a layout set prototype to a layout set

    LayoutSetPrototype layoutSetPrototype = LayoutTestUtil.addLayoutSetPrototype(RandomTestUtil.randomString());

    try {/*from ww w  . j  av  a 2s  .  c  o  m*/
        group = layoutSetPrototype.getGroup();
        importedGroup = GroupTestUtil.addGroup();

        long[] layoutIds = new long[0];

        try {
            exportImportLayouts(layoutIds, getImportParameterMap());

            Assert.fail();
        } catch (LARTypeException larte) {
        }

        // Import a layout set prototype to a layout prototyope

        LayoutPrototype layoutPrototype = LayoutTestUtil.addLayoutPrototype(RandomTestUtil.randomString());

        importedGroup = layoutPrototype.getGroup();

        try {
            exportImportLayouts(layoutIds, getImportParameterMap());

            Assert.fail();
        } catch (LARTypeException larte) {
        }
    } finally {
        LayoutSetPrototypeLocalServiceUtil.deleteLayoutSetPrototype(layoutSetPrototype);

        group = null;
    }
}