Skip to content
This repository has been archived by the owner on Apr 8, 2019. It is now read-only.

Commit

Permalink
Fix switchLayout test failure with Mongo
Browse files Browse the repository at this point in the history
  • Loading branch information
nttuyen committed Oct 28, 2013
1 parent 64de1c4 commit f3f6d0e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Expand Up @@ -294,7 +294,7 @@ public NodeData<ElementState>[] moveNode(String targetId, String fromId, String
toChildren.add(index, targetId);
nodes.put(targetId, target = target.withParent(toId));
nodes.put(fromId, from = from.withChildren(fromChildren));
nodes.put(toId, to = to.withChildren(fromChildren));
nodes.put(toId, to = to.withChildren(toChildren));
}
return new NodeData[]{target,from,to};
}
Expand Down
Expand Up @@ -39,6 +39,7 @@
import org.gatein.portal.mop.customization.CustomizationService;
import org.gatein.portal.mop.hierarchy.NodeContext;
import org.gatein.portal.mop.hierarchy.NodeData;
import org.gatein.portal.mop.hierarchy.NodeStore;
import org.gatein.portal.mop.layout.Element;
import org.gatein.portal.mop.layout.ElementState;
import org.gatein.portal.mop.layout.LayoutService;
Expand Down Expand Up @@ -173,9 +174,13 @@ public void testPage() {
public void testSwitchLayout() {
PageData page = createPage(createSite(SiteType.PORTAL, "test_layout_page"), "page", new PageState.Builder().build());
NodeData<ElementState>[] containers = createElements(page, Element.container(), Element.container(), Element.container());
createElements(context.getLayoutStore().begin(page.layoutId, true), containers[0], FOO_PORTLET);
createElements(context.getLayoutStore().begin(page.layoutId, true), containers[1], BAR_PORTLET);
createElements(context.getLayoutStore().begin(page.layoutId, true), containers[2], FOO_PORTLET);

//Create portlet 1 on container 1
NodeStore<ElementState> store = context.getLayoutStore().begin(page.layoutId, true);
createElements(store, containers[0], FOO_PORTLET);
createElements(store, containers[1], BAR_PORTLET);
createElements(store, containers[2], FOO_PORTLET);
context.getLayoutStore().end(store);

String layoutId = page.layoutId;

Expand Down

0 comments on commit f3f6d0e

Please sign in to comment.