Examples of RelationNotification


Examples of javax.management.relation.RelationNotification

      {
         notifications.add(n);
      }
      public RelationNotification check(int size)
      {
         RelationNotification result = null;
         assertEquals(size, notifications.size());
         Iterator iterator = notifications.iterator();
         while (iterator.hasNext())
         {
            RelationNotification rn = (RelationNotification) iterator.next();
            assertEquals(type, rn.getType());
            result = rn;
         }
         return result;
      }
View Full Code Here

Examples of javax.management.relation.RelationNotification

         RelationService rs = (RelationService) services.get(service);
         server.unregisterMBean(new ObjectName("x:relation=c,role=2,bean=1"));
         on = new ObjectName("test:type=support1");
         result = rs.hasRelation("id1").booleanValue();
         assertEquals(false, result);
         RelationNotification rn = listener.check(1);
         assertEquals(new ArrayList(), rn.getMBeansToUnregister());
         assertEquals(on, rn.getObjectName());
         assertEquals("id1", rn.getRelationId());
         assertEquals("relationTypeC", rn.getRelationTypeName());
      }
      finally
      {
         MBeanServerFactory.releaseMBeanServer(server);
      }
View Full Code Here

Examples of javax.management.relation.RelationNotification

         server.unregisterMBean(new ObjectName("x:relation=c,role=2,bean=1"));
         on = new ObjectName("test:type=support1");
         result = rs.hasRelation("id1").booleanValue();
         assertEquals(true, result);
         RelationNotification rn = listener.check(0);

         rs.purgeRelations();
         result = rs.hasRelation("id1").booleanValue();
         assertEquals(false, result);
         rn = listener.check(1);
         assertEquals(new ArrayList(), rn.getMBeansToUnregister());
         assertEquals(on, rn.getObjectName());
         assertEquals("id1", rn.getRelationId());
         assertEquals("relationTypeC", rn.getRelationTypeName());
      }
      finally
      {
         MBeanServerFactory.releaseMBeanServer(server);
      }
View Full Code Here

Examples of javax.management.relation.RelationNotification

         addRelation(server, service, support, "test:type=support1");
         server.addNotificationListener(service, listener, null, null);
         RelationService rs = (RelationService) services.get(service);
         rs.sendRelationCreationNotification("id1");
         on = new ObjectName("test:type=support1");
         RelationNotification rn = listener.check(1);
         assertEquals(new ArrayList(), rn.getMBeansToUnregister());
         assertEquals(new ArrayList(), rn.getNewRoleValue());
         assertEquals(on, rn.getObjectName());
         assertEquals(new ArrayList(), rn.getOldRoleValue());
         assertEquals("id1", rn.getRelationId());
         assertEquals("relationTypeC", rn.getRelationTypeName());
         assertEquals(null, rn.getRoleName());
      }
      finally
      {
         MBeanServerFactory.releaseMBeanServer(server);
      }
View Full Code Here

Examples of javax.management.relation.RelationNotification

         server.addNotificationListener(service, listener, null, null);
         RelationService rs = (RelationService) services.get(service);
         test.add(new ObjectName("test:type=test"));
         rs.sendRelationRemovalNotification("id1", test);
         on = new ObjectName("test:type=support1");
         RelationNotification rn = listener.check(1);
         assertEquals(test, rn.getMBeansToUnregister());
         assertEquals(new ArrayList(), rn.getNewRoleValue());
         assertEquals(on, rn.getObjectName());
         assertEquals(new ArrayList(), rn.getOldRoleValue());
         assertEquals("id1", rn.getRelationId());
         assertEquals("relationTypeC", rn.getRelationTypeName());
         assertEquals(null, rn.getRoleName());
      }
      finally
      {
         MBeanServerFactory.releaseMBeanServer(server);
      }
View Full Code Here

Examples of javax.management.relation.RelationNotification

         server.addNotificationListener(service, listener, null, null);
         RelationService rs = (RelationService) services.get(service);
         test.add(new ObjectName("test:type=test"));
         rs.sendRoleUpdateNotification("id1", roleB1, test);
         on = new ObjectName("test:type=support1");
         RelationNotification rn = listener.check(1);
         assertEquals(new ArrayList(), rn.getMBeansToUnregister());
         assertEquals(roleB1.getRoleValue(), rn.getNewRoleValue());
         assertEquals(on, rn.getObjectName());
         assertEquals(test, rn.getOldRoleValue());
         assertEquals("id1", rn.getRelationId());
         assertEquals("relationTypeC", rn.getRelationTypeName());
         assertEquals("roleB1", rn.getRoleName());
      }
      finally
      {
         MBeanServerFactory.releaseMBeanServer(server);
      }
View Full Code Here

Examples of javax.management.relation.RelationNotification

         on = new ObjectName("test:type=support1");
         RoleList shouldBe = new RoleList();
         shouldBe.add(roleC1);
         shouldBe.add(roleCX2);
         compare(shouldBe, support.retrieveAllRoles());
         RelationNotification rn = listener.check(1);
         assertEquals(new ArrayList(), rn.getMBeansToUnregister());
         assertEquals(roleCX2.getRoleValue(), rn.getNewRoleValue());
         assertEquals(on, rn.getObjectName());
         assertEquals(roleC2.getRoleValue(), rn.getOldRoleValue());
         assertEquals("id1", rn.getRelationId());
         assertEquals("relationTypeC", rn.getRelationTypeName());
         assertEquals("roleC2", rn.getRoleName());
      }
      finally
      {
         MBeanServerFactory.releaseMBeanServer(server);
      }
View Full Code Here

Examples of javax.management.relation.RelationNotification

         }
         RoleList shouldBe = new RoleList();
         shouldBe.add(roleC1);
         shouldBe.add(roleCX2);
         compare(shouldBe, support.retrieveAllRoles());
         RelationNotification rn = listener.check(1);
         assertEquals(new ArrayList(), rn.getMBeansToUnregister());
         assertEquals(roleCX2.getRoleValue(), rn.getNewRoleValue());
         assertEquals(on, rn.getObjectName());
         assertEquals(roleC2.getRoleValue(), rn.getOldRoleValue());
         assertEquals("id1", rn.getRelationId());
         assertEquals("relationTypeC", rn.getRelationTypeName());
         assertEquals("roleC2", rn.getRoleName());
      }
      finally
      {
         MBeanServerFactory.releaseMBeanServer(server);
      }
View Full Code Here

Examples of javax.management.relation.RelationNotification

      {
         notifications.add(n);
      }
      public RelationNotification check(int size)
      {
         RelationNotification result = null;
         assertEquals(size, notifications.size());
         Iterator iterator = notifications.iterator();
         while (iterator.hasNext())
         {
            RelationNotification rn = (RelationNotification) iterator.next();
            assertEquals(type, rn.getType());
            result = rn;
         }
         return result;
      }
View Full Code Here

Examples of javax.management.relation.RelationNotification

  /**
   * Test Basic Creation
   */
  public void testBasicCreation()
  {
    RelationNotification rn = null;
    try
    {
      rn = new RelationNotification(RelationNotification.RELATION_BASIC_CREATION,
             new RelationService(true), 21, 23, "message", "relationId",
             "relationTypeName", null, null);
    }
    catch (Exception e)
    {
      fail(e.toString());
    }
    assertEquals(RelationNotification.RELATION_BASIC_CREATION, rn.getType());
    assertEquals(21, rn.getSequenceNumber());
    assertEquals(23, rn.getTimeStamp());
    assertEquals("message", rn.getMessage());
    assertEquals("relationId", rn.getRelationId());
    assertEquals("relationTypeName", rn.getRelationTypeName());
    assertEquals(null, rn.getObjectName());
    assertEquals(0, rn.getMBeansToUnregister().size());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.