Example usage for com.liferay.portal.model.impl LayoutTypeControllerImpl LayoutTypeControllerImpl

List of usage examples for com.liferay.portal.model.impl LayoutTypeControllerImpl LayoutTypeControllerImpl

Introduction

In this page you can find the example usage for com.liferay.portal.model.impl LayoutTypeControllerImpl LayoutTypeControllerImpl.

Prototype

public LayoutTypeControllerImpl(String type) 

Source Link

Usage

From source file:com.liferay.layout.service.test.LayoutImplTest.java

License:Open Source License

@Test
public void testIsTypeEmbeddedWithLayoutTypeController() throws Exception {
    Registry registry = RegistryUtil.getRegistry();

    LayoutTypeController layoutTypeController = new LayoutTypeControllerImpl(LayoutConstants.TYPE_EMBEDDED);

    for (String type : _TYPES) {
        if (type.equals(LayoutConstants.TYPE_EMBEDDED)) {
            continue;
        }//from   w ww .ja v  a 2 s  . c  o m

        _layout.setType(type);

        Map<String, Object> properties = new HashMap<>();

        properties.put("layout.type", type);

        ServiceRegistration<LayoutTypeController> serviceRegistration = registry
                .registerService(LayoutTypeController.class, layoutTypeController, properties);

        try {
            Assert.assertTrue(_layout.isTypeEmbedded());
        } finally {
            serviceRegistration.unregister();
        }
    }
}

From source file:com.liferay.layout.service.test.LayoutImplTest.java

License:Open Source License

@Test
public void testIsTypePanelWithLayoutTypeController() throws Exception {
    Registry registry = RegistryUtil.getRegistry();

    LayoutTypeController layoutTypeController = new LayoutTypeControllerImpl(LayoutConstants.TYPE_PANEL);

    for (String layoutTypeValue : _TYPES) {
        if (layoutTypeValue.equals(LayoutConstants.TYPE_PANEL)) {
            continue;
        }/*w ww  .j a  v a  2s  .  co  m*/

        _layout.setType(layoutTypeValue);

        Map<String, Object> properties = new HashMap<>();

        properties.put("layout.type", layoutTypeValue);

        ServiceRegistration<LayoutTypeController> serviceRegistration = registry
                .registerService(LayoutTypeController.class, layoutTypeController, properties);

        try {
            Assert.assertTrue(_layout.isTypePanel());
        } finally {
            serviceRegistration.unregister();
        }
    }
}

From source file:com.liferay.layout.service.test.LayoutImplTest.java

License:Open Source License

@Test
public void testIsTypePortletReturnsFalse() throws Exception {
    Registry registry = RegistryUtil.getRegistry();

    for (String type : _TYPES) {
        if (type.equals(LayoutConstants.TYPE_PORTLET)) {
            continue;
        }/* www .ja va 2s .c o  m*/

        LayoutTypeController layoutTypeController = new LayoutTypeControllerImpl(type);

        Map<String, Object> properties = new HashMap<>();

        properties.put("layout.type", type);

        ServiceRegistration<LayoutTypeController> serviceRegistration = registry
                .registerService(LayoutTypeController.class, layoutTypeController, properties);

        try {
            _layout.setType(type);

            Assert.assertFalse(_layout.isTypePortlet());
        } finally {
            serviceRegistration.unregister();
        }
    }
}

From source file:com.liferay.layout.service.test.LayoutImplTest.java

License:Open Source License

@Test
public void testIsTypePortletWithLayoutTypeController() throws Exception {
    Registry registry = RegistryUtil.getRegistry();

    LayoutTypeController layoutTypeController = new LayoutTypeControllerImpl(LayoutConstants.TYPE_PORTLET);

    for (String type : _TYPES) {
        if (type.equals(LayoutConstants.TYPE_PORTLET)) {
            continue;
        }//w  w  w  .  j  av a2s  .  co m

        _layout.setType(type);

        Map<String, Object> properties = new HashMap<>();

        properties.put("layout.type", type);

        ServiceRegistration<LayoutTypeController> serviceRegistration = registry
                .registerService(LayoutTypeController.class, layoutTypeController, properties);

        try {
            Assert.assertTrue(_layout.isTypePortlet());
        } finally {
            serviceRegistration.unregister();
        }
    }
}