}
/** rights tests */
public void testHasRightIsInMethods() {
BGContextManager cm = BGContextManagerImpl.getInstance();
BusinessGroupManager bgm = BusinessGroupManagerImpl.getInstance();
Manager secm = ManagerFactory.getManager();
BGRightManager rm = BGRightManagerImpl.getInstance();
BGAreaManager am = BGAreaManagerImpl.getInstance();
// 1) context one: learning groups
BGContext c1 = cm.createAndAddBGContextToResource("c1name", course1, BusinessGroup.TYPE_LEARNINGROUP, id1, true);
// create groups without waitinglist
BusinessGroup g1 = bgm.createAndPersistBusinessGroup(BusinessGroup.TYPE_LEARNINGROUP, null, "g1", null, new Integer(0), new Integer(10), false, false, c1);
BusinessGroup g2 = bgm.createAndPersistBusinessGroup(BusinessGroup.TYPE_LEARNINGROUP, null, "g2", null, new Integer(0), new Integer(10), false, false, c1);
// members
secm.addIdentityToSecurityGroup(id1, g2.getOwnerGroup());
secm.addIdentityToSecurityGroup(id1, g1.getPartipiciantGroup());
secm.addIdentityToSecurityGroup(id2, g1.getPartipiciantGroup());
secm.addIdentityToSecurityGroup(id2, g2.getPartipiciantGroup());
secm.addIdentityToSecurityGroup(id3, g1.getOwnerGroup());
// areas
BGArea a1 = am.createAndPersistBGAreaIfNotExists("a1", "desca1",c1);
BGArea a2 = am.createAndPersistBGAreaIfNotExists("a2", null, c1);
BGArea a3 = am.createAndPersistBGAreaIfNotExists("a3", null, c1);
am.addBGToBGArea(g1, a1);
am.addBGToBGArea(g2, a1);
am.addBGToBGArea(g1, a2);
am.addBGToBGArea(g2, a3);
// 2) context two: right groups
BGContext c2 = cm.createAndAddBGContextToResource("c2name", course1, BusinessGroup.TYPE_RIGHTGROUP, id2, true);
// groups
BusinessGroup g3 = bgm.createAndPersistBusinessGroup(BusinessGroup.TYPE_RIGHTGROUP, null, "g3", null, null, null, null/* enableWaitinglist */, null/* enableAutoCloseRanks */, c2);
BusinessGroup g4 = bgm.createAndPersistBusinessGroup(BusinessGroup.TYPE_RIGHTGROUP, null, "g4", null, null, null, null/* enableWaitinglist */, null/* enableAutoCloseRanks */, c2);
// members
secm.addIdentityToSecurityGroup(id1, g3.getPartipiciantGroup());
secm.addIdentityToSecurityGroup(id1, g4.getPartipiciantGroup());
secm.addIdentityToSecurityGroup(id3, g4.getPartipiciantGroup());
// rights