Package org.jasig.portal.portlet.om

Examples of org.jasig.portal.portlet.om.IPortletDefinitionId


    }
   
    //interim with no prefs & in db - delete db version
    @Test
    public void testInterimNoPrefsAlreadyPersistent() throws Throwable {
        final IPortletDefinitionId portDefId1 = this.createDefaultPorltetDefinition();
        final String nodeId = "u1l1n1";
       
        //Mock setup
        final MockHttpServletRequest request = new MockHttpServletRequest();
       
        when(portalRequestUtils.getOriginalPortalRequest(request)).thenReturn(request);
        when(portalRequestUtils.getOriginalPortletOrPortalRequest(request)).thenReturn(request);
       
        when(userInstanceManager.getUserInstance(request)).thenReturn(userInstance);
        when(userInstance.getPreferencesManager()).thenReturn(preferencesManager);
        when(userInstance.getPerson()).thenReturn(person);
        when(preferencesManager.getUserLayoutManager()).thenReturn(userLayoutManager);
       
        when(userLayoutManager.getNode(nodeId)).thenReturn(node);
        when(node.getType()).thenReturn(LayoutNodeType.PORTLET);
        when(node.getChannelPublishId()).thenReturn(portDefId1.getStringId());

        final IPortletEntityId portletEntityId = this.execute(new Callable<IPortletEntityId>() {
            @Override
            public IPortletEntityId call() throws Exception {
                //T1 - Create the entity
View Full Code Here


    }
   
    //interim with prefs & in db - get db version & update
    @Test
    public void testInterimAddingPrefsAlreadyPersistent() throws Throwable {
        final IPortletDefinitionId portDefId1 = this.createDefaultPorltetDefinition();
        final String nodeId = "u1l1n1";
       
        //Mock setup
        final MockHttpServletRequest request = new MockHttpServletRequest();
       
        when(portalRequestUtils.getOriginalPortalRequest(request)).thenReturn(request);
        when(portalRequestUtils.getOriginalPortletOrPortalRequest(request)).thenReturn(request);
       
        when(userInstanceManager.getUserInstance(request)).thenReturn(userInstance);
        when(userInstance.getPreferencesManager()).thenReturn(preferencesManager);
        when(userInstance.getPerson()).thenReturn(person);
        when(preferencesManager.getUserLayoutManager()).thenReturn(userLayoutManager);
       
        when(userLayoutManager.getNode(nodeId)).thenReturn(node);
        when(node.getType()).thenReturn(LayoutNodeType.PORTLET);
        when(node.getChannelPublishId()).thenReturn(portDefId1.getStringId());

        /*
         * T1 - create ientity
         * T2 - get ientity
         * T2 - add pref and store ientity converting it to pentity
View Full Code Here

    }
   
    //persistent with no prefs & in db - delete & create interim
    @Test
    public void testPersistentRemovePrefs() throws Exception {
        final IPortletDefinitionId portletDefId = this.createDefaultPorltetDefinition();
        final String nodeId = "u1l1n1";
       
        //Mock setup
        final MockHttpServletRequest request = new MockHttpServletRequest();
       
        when(portalRequestUtils.getOriginalPortalRequest(request)).thenReturn(request);
        when(portalRequestUtils.getOriginalPortletOrPortalRequest(request)).thenReturn(request);
       
        when(userInstanceManager.getUserInstance(request)).thenReturn(userInstance);
        when(userInstance.getPreferencesManager()).thenReturn(preferencesManager);
        when(userInstance.getPerson()).thenReturn(person);
        when(preferencesManager.getUserLayoutManager()).thenReturn(userLayoutManager);
       
        when(userLayoutManager.getNode(nodeId)).thenReturn(node);
        when(node.getType()).thenReturn(LayoutNodeType.PORTLET);
        when(node.getChannelPublishId()).thenReturn(portletDefId.getStringId());


        final IPortletEntityId portletEntityId = this.execute(new Callable<IPortletEntityId>() {
            @Override
            public IPortletEntityId call() throws Exception {
View Full Code Here

    }

    //persistent with prefs & in db - update
    @Test
    public void testPersistentUpdatingPrefs() throws Exception {
        final IPortletDefinitionId portletDefId = this.createDefaultPorltetDefinition();
        final String nodeId = "u1l1n1";
       
        //Mock setup
        final MockHttpServletRequest request = new MockHttpServletRequest();
       
        when(portalRequestUtils.getOriginalPortalRequest(request)).thenReturn(request);
        when(portalRequestUtils.getOriginalPortletOrPortalRequest(request)).thenReturn(request);
       
        when(userInstanceManager.getUserInstance(request)).thenReturn(userInstance);
        when(userInstance.getPreferencesManager()).thenReturn(preferencesManager);
        when(userInstance.getPerson()).thenReturn(person);
        when(preferencesManager.getUserLayoutManager()).thenReturn(userLayoutManager);
       
        when(userLayoutManager.getNode(nodeId)).thenReturn(node);
        when(node.getType()).thenReturn(LayoutNodeType.PORTLET);
        when(node.getChannelPublishId()).thenReturn(portletDefId.getStringId());


        final IPortletEntityId portletEntityId = this.execute(new Callable<IPortletEntityId>() {
            @Override
            public IPortletEntityId call() throws Exception {
View Full Code Here

    }

    //interim with no prefs & not in db - noop
    @Test
    public void testInterimNoPrefs() throws Exception {
        final IPortletDefinitionId portletDefId = this.createDefaultPorltetDefinition();
        final String nodeId = "u1l1n1";
       
        //Mock setup
        final MockHttpServletRequest request = new MockHttpServletRequest();
       
        when(portalRequestUtils.getOriginalPortalRequest(request)).thenReturn(request);
        when(portalRequestUtils.getOriginalPortletOrPortalRequest(request)).thenReturn(request);
       
        when(userInstanceManager.getUserInstance(request)).thenReturn(userInstance);
        when(userInstance.getPreferencesManager()).thenReturn(preferencesManager);
        when(userInstance.getPerson()).thenReturn(person);
        when(preferencesManager.getUserLayoutManager()).thenReturn(userLayoutManager);
       
        when(userLayoutManager.getNode(nodeId)).thenReturn(node);
        when(node.getType()).thenReturn(LayoutNodeType.PORTLET);
        when(node.getChannelPublishId()).thenReturn(portletDefId.getStringId());


        final IPortletEntityId portletEntityId = this.execute(new Callable<IPortletEntityId>() {
            @Override
            public IPortletEntityId call() throws Exception {
View Full Code Here

    }

    //interim with prefs & not in db - create new & update, delete interim
    @Test
    public void testInterimAddingPrefs() throws Exception {
        final IPortletDefinitionId portletDefId = this.createDefaultPorltetDefinition();
        final String nodeId = "u1l1n1";
       
        //Mock setup
        final MockHttpServletRequest request = new MockHttpServletRequest();
       
        when(portalRequestUtils.getOriginalPortalRequest(request)).thenReturn(request);
        when(portalRequestUtils.getOriginalPortletOrPortalRequest(request)).thenReturn(request);
       
        when(userInstanceManager.getUserInstance(request)).thenReturn(userInstance);
        when(userInstance.getPreferencesManager()).thenReturn(preferencesManager);
        when(userInstance.getPerson()).thenReturn(person);
        when(preferencesManager.getUserLayoutManager()).thenReturn(userLayoutManager);
       
        when(userLayoutManager.getNode(nodeId)).thenReturn(node);
        when(node.getType()).thenReturn(LayoutNodeType.PORTLET);
        when(node.getChannelPublishId()).thenReturn(portletDefId.getStringId());


        final IPortletEntityId portletEntityId = this.execute(new Callable<IPortletEntityId>() {
            @Override
            public IPortletEntityId call() throws Exception {
View Full Code Here

    IPortletWindow portletWindow = mock(IPortletWindow.class);
    IPortletEntity portletEntity = mock(IPortletEntity.class);
    when(portletWindow.getPortletEntity()).thenReturn(portletEntity);
    IPortletDefinition portletDefinition = mock(IPortletDefinition.class);
    when(portletEntity.getPortletDefinition()).thenReturn(portletDefinition);
    IPortletDefinitionId portletDefinitionId = mock(IPortletDefinitionId.class);
    when(portletDefinition.getPortletDefinitionId()).thenReturn(portletDefinitionId);
   
    IPersonAttributeDao personAttributeDao = mock(IPersonAttributeDao.class);
    when(personAttributeDao.getPerson("username")).thenReturn(personAttributes);
 
View Full Code Here

    @Test
    public void testNoopOperations() throws Exception {
        execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                final IPortletDefinitionId portletDefinitionId = PortletDefinitionIdImpl.create(1);
                final IPortletDefinition nullPortDef1 = jpaPortletDefinitionDao.getPortletDefinition(portletDefinitionId);
                assertNull(nullPortDef1);
               
                final IPortletEntity nullPortEnt1 = jpaPortletEntityDao.getPortletEntity("chanSub1", 1);
                assertNull(nullPortEnt1);
View Full Code Here

        });
    }

    @Test
    public void testAllDefinitionDaoMethods() throws Exception {
        final IPortletDefinitionId portletDefinitionId = execute(new Callable<IPortletDefinitionId>() {
            @Override
            public IPortletDefinitionId call() {
                final IPortletType channelType = jpaChannelTypeDao.createPortletType("BaseType", "foobar");
               
                //Create a definition
View Full Code Here

        });
    }
   
    @Test
    public void testAllEntityDaoMethods() throws Exception {
        final IPortletDefinitionId portletDefinitionId = execute(new Callable<IPortletDefinitionId>() {
            @Override
            public IPortletDefinitionId call() throws Exception {

                final IPortletType channelType = jpaChannelTypeDao.createPortletType("BaseType", "foobar");
               
View Full Code Here

TOP

Related Classes of org.jasig.portal.portlet.om.IPortletDefinitionId

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.