bf = (BaseFragmentElement)root.getFragments().get(1);
assertTrue(bf instanceof FragmentReference);
fr = (FragmentReference)bf;
assertTrue(fr.getRefId().equals("test002"));
FragmentDefinition fragmentdefinition = pageManager.newFragmentDefinition("/test002.fpsml");
fragmentdefinition.setTitle("Created Fragment Definition");
rootFragmentElement = fragmentdefinition.getRootFragment();
assertTrue(rootFragmentElement instanceof Fragment);
root = (Fragment)rootFragmentElement;
root.setName("TestPortlet");
root.setId("test002");
try
{
pageManager.updateFragmentDefinition(fragmentdefinition);
}
catch (Exception e)
{
String errmsg = "Exception in fragment definition update: " + e.toString();
e.printStackTrace();
System.err.println(errmsg);
assertNotNull(errmsg, null);
}
fragmentdefinition = pageManager.getFragmentDefinition("/test002.fpsml");
assertNotNull(fragmentdefinition);
assertTrue(fragmentdefinition.getId().equals("/test002.fpsml"));
assertEquals("Created Fragment Definition", fragmentdefinition.getTitle());
assertNotNull(fragmentdefinition.getRootFragment());
rootFragmentElement = fragmentdefinition.getRootFragment();
assertTrue(rootFragmentElement instanceof Fragment);
root = (Fragment)rootFragmentElement;
assertTrue(root.getId().equals("test002"));
assertTrue(root.getName().equals("TestPortlet"));
assertTrue(root.getType().equals(Fragment.PORTLET));