Skip to content

Instantly share code, notes, and snippets.

@vstorm83
Created June 20, 2011 10:51
Show Gist options
  • Save vstorm83/1035434 to your computer and use it in GitHub Desktop.
Save vstorm83/1035434 to your computer and use it in GitHub Desktop.
TestNavigationServiceRebase - testConsistentStateAfterRebase
public void testConsistentStateAfterRebase() throws Exception
{
MOPService mop = mgr.getPOMService();
Site portal = mop.getModel().getWorkspace().addSite(ObjectType.PORTAL_SITE, "consistent_state_after_rebase");
Navigation def = portal.getRootNavigation().addChild("default");
def.addChild("a");
//
sync(true);
//
NavigationContext navigation = service.loadNavigation(SiteKey.portal("consistent_state_after_rebase"));
Node root = service.loadNode(Node.MODEL, navigation, Scope.ALL, null).node;
NodeState state = new NodeState.Builder().capture();
root.getChild("a").setState(state);
assertSame(state, root.getChild("a").getState());
//
sync(true);
//
service.rebaseNode(root.context, null, null);
assertSame(state, root.getChild("a").getState());
}
@vietj
Copy link

vietj commented Jun 20, 2011

Actually the only raison this fails is the usage of assertSame instead of assertEquals and in that situation it works. So this seems valid to me, I think something is missing in the unit test istelf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment