public void TestAddRelationFailureInvalidRelationService() { RelationSupport relation = new RelationSupport("REL1", ":type=RelationService2", "Parenthood", new Role("Parent", new ObjectName(":type=Parent")), new Role("Child", new ObjectName(":type=Child,id=1"), new ObjectName(":type=Child,id=2"))); _server.RegisterMBean(relation, ":type=Parenthood,id=1"); _relationService.AddRelation(":type=Parenthood,id=1"); }
public void TestAddRelationSuccess() { RelationSupport relation = new RelationSupport("REL1", ":type=RelationService", "Parenthood", new Role("Parent", new ObjectName(":type=Parent")), new Role("Child", new ObjectName(":type=Child,id=1"), new ObjectName(":type=Child,id=2"))); _server.RegisterMBean(relation, ":type=Parenthood,id=1"); _relationService.AddRelation(":type=Parenthood,id=1"); Assert.IsTrue(_relationService.HasRelation("REL1")); Assert.AreEqual("REL1", _relationService.IsRelation(":type=Parenthood,id=1")); Assert.AreEqual(new ObjectName(":type=Parenthood,id=1"), _relationService.IsRelationMBean("REL1")); }
public void TestAddRelationFailuereInvalidId() { RelationSupport relation = new RelationSupport("REL1", ":type=RelationService", "Parenthood", new Role("Parent", new ObjectName(":type=Parent")), new Role("Child", new ObjectName(":type=Child,id=1"), new ObjectName(":type=Child,id=2"))); _server.RegisterMBean(relation, ":type=Parenthood,id=1"); _relationService.AddRelation(":type=Parenthood,id=1"); RelationSupport relation2 = new RelationSupport("REL1", ":type=RelationService", "Parenthood2", new Role("Parent", new ObjectName(":type=Parent")), new Role("Child", new ObjectName(":type=Child,id=1"), new ObjectName(":type=Child,id=2"))); _server.RegisterMBean(relation, ":type=Parenthood,id=2"); _relationService.AddRelation(":type=Parenthood,id=2"); }
public void TestAddRelationSuccess() { RelationSupport relation = new RelationSupport("REL1", ":type=RelationService", "Parenthood", new Role("Parent", new ObjectName(":type=Parent")), new Role("Child", new ObjectName(":type=Child,id=1"), new ObjectName(":type=Child,id=2"))); _server.RegisterMBean(relation, ":type=Parenthood,id=1"); _relationService.AddRelation(":type=Parenthood,id=1"); Assert.IsTrue(_relationService.HasRelation("REL1")); Assert.AreEqual("REL1", _relationService.IsRelation(":type=Parenthood,id=1")); Assert.AreEqual(new ObjectName(":type=Parenthood,id=1"), _relationService.IsRelationMBean("REL1")); }