[portal-commits] JBoss Portal SVN: r8961 - in branches/UIServer: core/src/main/org/jboss/portal/test/core/presentation/model and 3 other directories.

portal-commits at lists.jboss.org portal-commits at lists.jboss.org
Thu Nov 15 16:29:53 EST 2007


Author: sohil.shah at jboss.com
Date: 2007-11-15 16:29:52 -0500 (Thu, 15 Nov 2007)
New Revision: 8961

Modified:
   branches/UIServer/core/src/main/org/jboss/portal/core/presentation/model/ModelLoaderImpl.java
   branches/UIServer/core/src/main/org/jboss/portal/test/core/presentation/model/UIModelTester.java
   branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model2/UIContainerImpl.java
   branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model2/UIContextImpl.java
   branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model2/UIObjectImpl.java
   branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model2/UIPageImpl.java
   branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model2/UIPortalImpl.java
   branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model2/UIWindowImpl.java
   branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model2/UIObject.java
   branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/test/model/MockModelLoaderImpl.java
   branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/test/model/UIModelTester.java
Log:
cleanup to make sure client to the UI model is implementation-agnostic

Modified: branches/UIServer/core/src/main/org/jboss/portal/core/presentation/model/ModelLoaderImpl.java
===================================================================
--- branches/UIServer/core/src/main/org/jboss/portal/core/presentation/model/ModelLoaderImpl.java	2007-11-15 21:14:22 UTC (rev 8960)
+++ branches/UIServer/core/src/main/org/jboss/portal/core/presentation/model/ModelLoaderImpl.java	2007-11-15 21:29:52 UTC (rev 8961)
@@ -30,9 +30,9 @@
 import java.util.ArrayList;
 
 import org.jboss.portal.presentation.model2.UIObject;
-import org.jboss.portal.presentation.impl.model2.UIPortalImpl;
-import org.jboss.portal.presentation.impl.model2.UIPageImpl;
-import org.jboss.portal.presentation.impl.model2.UIWindowImpl;
+import org.jboss.portal.presentation.model2.UIPortal;
+import org.jboss.portal.presentation.model2.UIPage;
+import org.jboss.portal.presentation.model2.UIWindow;
 import org.jboss.portal.presentation.model2.state.ModelLoader;
 import org.jboss.portal.presentation.model2.state.ObjectState;
 
@@ -138,15 +138,15 @@
       
       if(portalObject instanceof Portal)
       {
-         type = UIPortalImpl.class;
+         type = UIPortal.class;
       }
       else if(portalObject instanceof Page)
       {
-         type = UIPageImpl.class;
+         type = UIPage.class;
       }
       else if(portalObject instanceof Window)
       {
-         type = UIWindowImpl.class;
+         type = UIWindow.class;
       }
       
       return type;

Modified: branches/UIServer/core/src/main/org/jboss/portal/test/core/presentation/model/UIModelTester.java
===================================================================
--- branches/UIServer/core/src/main/org/jboss/portal/test/core/presentation/model/UIModelTester.java	2007-11-15 21:14:22 UTC (rev 8960)
+++ branches/UIServer/core/src/main/org/jboss/portal/test/core/presentation/model/UIModelTester.java	2007-11-15 21:29:52 UTC (rev 8961)
@@ -37,7 +37,7 @@
 import org.jboss.portal.core.model.content.ContentType;
 import org.jboss.portal.core.presentation.model.ModelLoaderImpl;
 import org.jboss.portal.presentation.model2.*;
-import org.jboss.portal.presentation.impl.model2.*;
+import org.jboss.portal.presentation.impl.model2.UIContextImpl;
 
 /**
  * @author <a href="mailto:sshah at redhat.com">Sohil Shah</a>
@@ -91,14 +91,13 @@
       
       //Setup rootChildrenInfo
       Map rootChildrenInfo = new HashMap();
-      rootChildrenInfo.put("defaultPortal", UIPortalImpl.class);      
+      rootChildrenInfo.put("defaultPortal", UIPortal.class);      
       
       UIContext objectTree = this.uiContext.initUIObjectTree(rootChildrenInfo);
-      UIObject defaultPortal = objectTree.getChildren(UIPortalImpl.class).get(0);      
+      UIPortal defaultPortal = objectTree.getChildren(UIPortal.class).get(0);      
       
       assertEquals(defaultPortal.getName(), "defaultPortal");
       assertEquals(defaultPortal.getId(), "/defaultPortal");
-      assertTrue(defaultPortal instanceof UIPortal);
       
       List<UIObject> lazyLoadedChildren = defaultPortal.getChildren();
       

Modified: branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model2/UIContainerImpl.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model2/UIContainerImpl.java	2007-11-15 21:14:22 UTC (rev 8960)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model2/UIContainerImpl.java	2007-11-15 21:29:52 UTC (rev 8961)
@@ -23,6 +23,8 @@
 package org.jboss.portal.presentation.impl.model2;
 
 import org.jboss.portal.presentation.model2.UIContainer;
+import org.jboss.portal.presentation.model2.UIObject;
+import org.jboss.portal.presentation.model2.UIWindow;
 
 /**
  * @author <a href="mailto:sshah at redhat.com">Sohil Shah</a>
@@ -30,5 +32,21 @@
  */
 public class UIContainerImpl extends UIObjectImpl implements UIContainer
 {
-
+   /**
+    * 
+    * @param <T>
+    * @param type
+    * @return
+    */
+   protected <T extends UIObject> boolean isAllowedAsChild(Class<T> type)
+   {
+      boolean isAllowedAsChild = false;
+      
+      if(type == UIWindow.class)
+      {
+         isAllowedAsChild = true;
+      }
+      
+      return isAllowedAsChild;
+   }
 }

Modified: branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model2/UIContextImpl.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model2/UIContextImpl.java	2007-11-15 21:14:22 UTC (rev 8960)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model2/UIContextImpl.java	2007-11-15 21:29:52 UTC (rev 8961)
@@ -26,6 +26,7 @@
 import java.util.Iterator;
 import org.jboss.portal.presentation.model2.UIContext;
 import org.jboss.portal.presentation.model2.UIObject;
+import org.jboss.portal.presentation.model2.UIPortal;
 import org.jboss.portal.presentation.model2.state.ModelLoader;
 import org.jboss.portal.presentation.model2.state.ObjectState;
 
@@ -60,19 +61,15 @@
          //Fetch the state of the UIObject in question
          ObjectState objectState = this.modelLoader.loadState(id);
          
-         uiObject = type.newInstance();
+         uiObject = this.getImplementationClass(type).newInstance();
          ((UIObjectImpl)uiObject).setState(this,objectState, true);
          
          return uiObject;
       }
-      catch(InstantiationException ie)
+      catch(Exception e)
       {
-         throw new RuntimeException(ie);
-      }
-      catch(IllegalAccessException iae)
-      {
-         throw new RuntimeException(iae);
-      }
+         throw new RuntimeException(e);
+      }      
    }
    
    /**
@@ -113,4 +110,22 @@
    {
       this.modelLoader = modelLoader;
    }
+   
+   /**
+    * 
+    * @param <T>
+    * @param type
+    * @return
+    */
+   protected <T extends UIObject> boolean isAllowedAsChild(Class<T> type)
+   {
+      boolean isAllowedAsChild = false;
+      
+      if(type == UIPortal.class)
+      {
+         isAllowedAsChild = true;
+      }
+      
+      return isAllowedAsChild;
+   }
 }

Modified: branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model2/UIObjectImpl.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model2/UIObjectImpl.java	2007-11-15 21:14:22 UTC (rev 8960)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model2/UIObjectImpl.java	2007-11-15 21:29:52 UTC (rev 8961)
@@ -28,6 +28,11 @@
 
 import org.jboss.portal.presentation.model2.UIObject;
 import org.jboss.portal.presentation.model2.UIContext;
+import org.jboss.portal.presentation.model2.UIPortal;
+import org.jboss.portal.presentation.model2.UIContainer;
+import org.jboss.portal.presentation.model2.UIWindow;
+import org.jboss.portal.presentation.model2.UIPage;
+
 import org.jboss.portal.presentation.model2.state.ObjectState;
 
 /**
@@ -131,58 +136,90 @@
    /**
     * 
     */
-   public <T extends UIObject> List<UIObject> getChildren(Class<T> type)
+   public <T extends UIObject> List<T> getChildren(Class<T> type)
    {
-      List<UIObject> filteredList = new ArrayList<UIObject>();
-      
-      //Making sure all children are fully loaded
-      List<UIObject> allChildren = this.getChildren();
-      
-      if(allChildren != null)
+      try
       {
-         for(int i=0; i<allChildren.size(); i++)
+         List<T> filteredList = new ArrayList<T>();
+         
+         //Making sure all children are fully loaded
+         List<UIObject> allChildren = this.getChildren();
+         
+         Class<T> implementationClass = this.getImplementationClass(type);
+         if(allChildren != null)
          {
-            UIObject child = allChildren.get(i);
-            if(type == child.getClass())
+            for(int i=0; i<allChildren.size(); i++)
             {
-               filteredList.add(child);
+               UIObject child = allChildren.get(i);
+               if(implementationClass == child.getClass())
+               {
+                  filteredList.add((T)child);
+               }
             }
          }
+         return filteredList;
       }
-      return filteredList;
+      catch(Exception e)
+      {
+         throw new RuntimeException(e);
+      }
    }
 
-   protected Class<? extends UIObjectImpl> getImplementationType(Class<? extends UIObject> type)
+   /**
+    * 
+    * @param type
+    * @return
+    */
+   protected <T extends UIObject> Class<T> getImplementationClass(Class<T> type) throws Exception
    {
-      return null;
+      Class<T> uiobjectClass = null;
+      
+      if(type == UIContext.class)
+      {
+         uiobjectClass = (Class<T>)UIContextImpl.class;
+      }
+      else if(type == UIPortal.class)
+      {
+         uiobjectClass = (Class<T>)UIPortalImpl.class;
+      }      
+      else if(type == UIPage.class)
+      {
+         uiobjectClass = (Class<T>)UIPageImpl.class;
+      }
+      else if(type == UIContainer.class)
+      {
+         uiobjectClass = (Class<T>)UIContainerImpl.class;
+      }
+      else if(type == UIWindow.class)
+      {
+         uiobjectClass = (Class<T>)UIWindowImpl.class;
+      }
+            
+      return uiobjectClass;
    }
+   
+   /**
+    * 
+    * @param <T>
+    * @param type
+    * @return
+    */
+   protected abstract <T extends UIObject> boolean isAllowedAsChild(Class<T> type);
 
-   protected abstract boolean isChildTypeAccepted(Class<? extends UIObject> type);
    
    /**
     * 
     */
    public <T extends UIObject> T createChild(String name, Class<T> type) throws IllegalArgumentException
    {
-      if (!isChildTypeAccepted(type))
+      if(!this.isAllowedAsChild(type))
       {
-         throw new IllegalArgumentException("Blah");
+         throw new IllegalArgumentException(type.getName()+" cannot be added as a child to this parent");
       }
-
-      //
-      Class<? extends UIObjectImpl> implType = getImplementationType(type);
-
       try
       {
-         T child = null;
+         T child = this.getImplementationClass(type).newInstance();         
          
-         if(type == UIContextImpl.class)
-         {
-            throw new IllegalArgumentException("UIContext must be the root of the UIObject tree. It should not be added to any UIObject as a child");
-         }
-         
-         child = type.newInstance();
-         
          //Name
          ((UIObjectImpl)child).name = name;
          
@@ -196,16 +233,13 @@
          ((UIObjectImpl)child).state = this.getUIContext().getModelLoader().loadState(((UIObjectImpl)child).id); 
          
          this.children.add(child);
+         
          return child;
       }
-      catch(InstantiationException ie)
+      catch(Exception e)
       {
-         throw new RuntimeException(ie);
-      }
-      catch(IllegalAccessException iae)
-      {
-         throw new RuntimeException(iae);
-      }
+         throw new RuntimeException(e);
+      }      
    }
 
    /**

Modified: branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model2/UIPageImpl.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model2/UIPageImpl.java	2007-11-15 21:14:22 UTC (rev 8960)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model2/UIPageImpl.java	2007-11-15 21:29:52 UTC (rev 8961)
@@ -22,12 +22,36 @@
  ******************************************************************************/
 package org.jboss.portal.presentation.impl.model2;
 
+import org.jboss.portal.presentation.model2.UIObject;
+import org.jboss.portal.presentation.model2.UIContainer;
 import org.jboss.portal.presentation.model2.UIPage;
+import org.jboss.portal.presentation.model2.UIWindow;
 
 /**
  * @author <a href="mailto:sshah at redhat.com">Sohil Shah</a>
  *
  */
 public class UIPageImpl extends UIObjectImpl implements UIPage
-{   
+{ 
+   /**
+    * 
+    * @param <T>
+    * @param type
+    * @return
+    */
+   protected <T extends UIObject> boolean isAllowedAsChild(Class<T> type)
+   {
+      boolean isAllowedAsChild = false;
+      
+      if(
+           type == UIPage.class ||
+           type == UIContainer.class ||           
+           type == UIWindow.class
+      )
+      {
+         isAllowedAsChild = true;
+      }
+      
+      return isAllowedAsChild;
+   }
 }

Modified: branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model2/UIPortalImpl.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model2/UIPortalImpl.java	2007-11-15 21:14:22 UTC (rev 8960)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model2/UIPortalImpl.java	2007-11-15 21:29:52 UTC (rev 8961)
@@ -22,7 +22,9 @@
  ******************************************************************************/
 package org.jboss.portal.presentation.impl.model2;
 
+import org.jboss.portal.presentation.model2.UIObject;
 import org.jboss.portal.presentation.model2.UIPortal;
+import org.jboss.portal.presentation.model2.UIPage;
 
 /**
  * @author <a href="mailto:sshah at redhat.com">Sohil Shah</a>
@@ -30,5 +32,23 @@
  */
 public class UIPortalImpl extends UIObjectImpl implements UIPortal
 {
-
+   /**
+    * 
+    * @param <T>
+    * @param type
+    * @return
+    */
+   protected <T extends UIObject> boolean isAllowedAsChild(Class<T> type)
+   {
+      boolean isAllowedAsChild = false;
+      
+      if(
+            type == UIPage.class
+      )
+      {
+         isAllowedAsChild = true;
+      }
+      
+      return isAllowedAsChild;
+   }
 }

Modified: branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model2/UIWindowImpl.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model2/UIWindowImpl.java	2007-11-15 21:14:22 UTC (rev 8960)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model2/UIWindowImpl.java	2007-11-15 21:29:52 UTC (rev 8961)
@@ -24,6 +24,7 @@
 
 import org.jboss.portal.Mode;
 import org.jboss.portal.WindowState;
+import org.jboss.portal.presentation.model2.UIObject;
 import org.jboss.portal.presentation.model2.UIWindow;
 
 /**
@@ -94,4 +95,15 @@
    {
       this.windowState = windowState;
    }
+   
+   /**
+    * 
+    * @param <T>
+    * @param type
+    * @return
+    */
+   protected <T extends UIObject> boolean isAllowedAsChild(Class<T> type)
+   {
+      return false;
+   }
 }

Modified: branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model2/UIObject.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model2/UIObject.java	2007-11-15 21:14:22 UTC (rev 8960)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model2/UIObject.java	2007-11-15 21:29:52 UTC (rev 8961)
@@ -56,7 +56,7 @@
     * @return the newly created child
     * @throws IllegalArgumentException if the name is null, already exists or this kind of object does not accept children of the specified type
     */
-   public <T extends UIObject>T createChild(String name, Class<T> type) throws IllegalArgumentException;
+   public <T extends UIObject> T createChild(String name, Class<T> type) throws IllegalArgumentException;
 
    /**
     * 
@@ -76,5 +76,5 @@
     * @param type
     * @return
     */
-   public <T extends UIObject> List<UIObject> getChildren(Class<T> type);   
+   public <T extends UIObject> List<T> getChildren(Class<T> type);   
 }

Modified: branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/test/model/MockModelLoaderImpl.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/test/model/MockModelLoaderImpl.java	2007-11-15 21:14:22 UTC (rev 8960)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/test/model/MockModelLoaderImpl.java	2007-11-15 21:29:52 UTC (rev 8961)
@@ -25,7 +25,7 @@
 import java.util.List;
 import java.util.ArrayList;
 
-import org.jboss.portal.presentation.impl.model2.UIPortalImpl;
+import org.jboss.portal.presentation.model2.UIPortal;
 import org.jboss.portal.presentation.model2.state.ModelLoader;
 import org.jboss.portal.presentation.model2.state.ObjectState;
 
@@ -57,7 +57,7 @@
       }
       
       
-      state = new ObjectState(UIPortalImpl.class,
+      state = new ObjectState(UIPortal.class,
       name, 
       null, //properties
       parentId, 

Modified: branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/test/model/UIModelTester.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/test/model/UIModelTester.java	2007-11-15 21:14:22 UTC (rev 8960)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/test/model/UIModelTester.java	2007-11-15 21:29:52 UTC (rev 8961)
@@ -30,7 +30,7 @@
 import java.util.HashMap;
 
 import org.jboss.portal.presentation.model2.*;
-import org.jboss.portal.presentation.impl.model2.*;
+import org.jboss.portal.presentation.impl.model2.UIContextImpl;
 
 /**
  * @author <a href="mailto:sshah at redhat.com">Sohil Shah</a>
@@ -67,39 +67,33 @@
       //Adding a UIContext...this should result in an IllegalArgumentException
       try
       {
-         this.uiContext.createChild("duplicateRoot", UIContextImpl.class);
+         this.uiContext.createChild("duplicateRoot", UIContext.class);
       }
       catch(Exception e)
       {
          this.assertEquals(e.getClass(), IllegalArgumentException.class);
       }
       
-      //Add a UIPage to the UIContext
-      this.uiContext.createChild("defaultPortal", UIPortalImpl.class);
-      
       //Assert the state of UIPortal added to the UIObject tree
-      UIObject portal = this.uiContext.getChildren(UIPortalImpl.class).get(0);
+      UIPortal portal = this.uiContext.createChild("defaultPortal", UIPortal.class);
       assertEquals(portal.getName(), "defaultPortal");
       assertEquals(portal.getId(), "/defaultPortal");
       assertTrue(portal.getParent() instanceof UIContext);
       
       //Add a UIPage to the UIPortal
-      portal.createChild("defaultPage", UIPageImpl.class);
-      UIObject page = portal.getChildren(UIPageImpl.class).get(0);
+      UIPage page = portal.createChild("defaultPage", UIPage.class);      
       assertEquals(page.getName(), "defaultPage");
       assertEquals(page.getId(), "/defaultPortal/defaultPage");
       assertTrue(page.getParent() instanceof UIPortal);
       
       //Add a UIPage to the UIContainer
-      page.createChild("defaultContainer", UIContainerImpl.class);
-      UIObject container = page.getChildren(UIContainerImpl.class).get(0);
+      UIContainer container = page.createChild("defaultContainer", UIContainer.class);      
       assertEquals(container.getName(), "defaultContainer");
       assertEquals(container.getId(), "/defaultPortal/defaultPage/defaultContainer");
       assertTrue(container.getParent() instanceof UIPage);
       
       //Add a UIWindow to UIPage
-      container.createChild("defaultWindow", UIWindowImpl.class);
-      UIObject window = container.getChildren(UIWindowImpl.class).get(0);
+      UIWindow window = container.createChild("defaultWindow", UIWindow.class);      
       assertEquals(window.getName(), "defaultWindow");
       assertEquals(window.getId(), "/defaultPortal/defaultPage/defaultContainer/defaultWindow");
       assertTrue(window.getParent() instanceof UIContainer);
@@ -110,24 +104,18 @@
     * @throws Exception
     */
    public void testDestroyChild() throws Exception
-   {
-      //Add a UIPage to the UIContext
-      this.uiContext.createChild("defaultPortal", UIPortalImpl.class);
-      
+   {      
       //Assert the state of UIPortal added to the UIObject tree
-      UIObject portal = this.uiContext.getChildren(UIPortalImpl.class).get(0);      
+      UIPortal portal = this.uiContext.createChild("defaultPortal", UIPortal.class);      
       
       //Add a UIPage to the UIPortal
-      portal.createChild("defaultPage", UIPageImpl.class);
-      UIObject page = portal.getChildren(UIPageImpl.class).get(0);
+      UIPage page = portal.createChild("defaultPage", UIPage.class);      
       
       //Add a UIPage to the UIContainer
-      page.createChild("defaultContainer", UIContainerImpl.class);
-      UIObject container = page.getChildren(UIContainerImpl.class).get(0);
+      UIContainer container = page.createChild("defaultContainer", UIContainer.class);      
             
       //Add a UIWindow to UIPage
-      container.createChild("defaultWindow", UIWindowImpl.class);
-      UIObject window = container.getChildren(UIWindowImpl.class).get(0); 
+      UIWindow window = container.createChild("defaultWindow", UIWindow.class);       
       
       //Destroy the container. When this is done, both container and window must be destroyed from the UIObject tree
       page.destroyChild(container.getName());
@@ -143,12 +131,12 @@
    {
       //Setup rootChildrenInfo
       Map rootChildrenInfo = new HashMap();
-      rootChildrenInfo.put("defaultPortal", UIPortalImpl.class);
-      rootChildrenInfo.put("someOtherPortal", UIPortalImpl.class);
+      rootChildrenInfo.put("defaultPortal", UIPortal.class);
+      rootChildrenInfo.put("someOtherPortal", UIPortal.class);
       
       UIContext objectTree = this.uiContext.initUIObjectTree(rootChildrenInfo);
-      UIObject defaultPortal = objectTree.getChildren(UIPortalImpl.class).get(0);
-      UIObject someOtherPortal = objectTree.getChildren(UIPortalImpl.class).get(1);
+      UIPortal defaultPortal = objectTree.getChildren(UIPortal.class).get(0);
+      UIPortal someOtherPortal = objectTree.getChildren(UIPortal.class).get(1);
       
       assertEquals(defaultPortal.getName(), "defaultPortal");
       assertEquals(defaultPortal.getId(), "/defaultPortal");
@@ -164,12 +152,12 @@
    {
       //Setup rootChildrenInfo
       Map rootChildrenInfo = new HashMap();
-      rootChildrenInfo.put("defaultPortal", UIPortalImpl.class);
+      rootChildrenInfo.put("defaultPortal", UIPortal.class);
       
       UIContext objectTree = this.uiContext.initUIObjectTree(rootChildrenInfo);
       
-      UIObject uiObject = objectTree.getObject("/defaultPortal/defaultPage", UIPortalImpl.class);
-      UIObject parent = uiObject.getParent();
+      UIPortal portal = objectTree.getObject("/defaultPortal/defaultPage", UIPortal.class);
+      UIObject parent = portal.getParent();
       
       assertEquals(parent.getName(), "defaultPortal");
       assertEquals(parent.getId(), "/defaultPortal");
@@ -182,10 +170,10 @@
    public void testLazyLoading() throws Exception
    {
       Map rootChildrenInfo = new HashMap();
-      rootChildrenInfo.put("testingLazyLoading", UIPortalImpl.class);
+      rootChildrenInfo.put("testingLazyLoading", UIPortal.class);
       
       UIContext objectTree = this.uiContext.initUIObjectTree(rootChildrenInfo);
-      UIObject defaultPortal = objectTree.getChildren(UIPortalImpl.class).get(0);
+      UIPortal defaultPortal = objectTree.getChildren(UIPortal.class).get(0);
       List<UIObject> lazyLoadedChildren = defaultPortal.getChildren();
       
       assertTrue((lazyLoadedChildren != null && lazyLoadedChildren.size()>0));




More information about the portal-commits mailing list