Examples of RelationNotification


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

Examples of javax.management.relation.RelationNotification

  /**
   * Test Basic Removal
   */
  public void testBasicRemoval()
  {
    RelationNotification rn = null;
    ObjectName objectName = null;
    ArrayList unregs = new ArrayList();
    try
    {
      rn = new RelationNotification(RelationNotification.RELATION_BASIC_REMOVAL,
             new RelationService(true), 21, 23, "message", "relationId",
             "relationTypeName", null, unregs);
    }
    catch (Exception e)
    {
      fail(e.toString());
    }
    assertEquals(RelationNotification.RELATION_BASIC_REMOVAL, 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(unregs, rn.getMBeansToUnregister());
  }
View Full Code Here

Examples of javax.management.relation.RelationNotification

  /**
   * Test MBean Creation
   */
  public void testMBeanCreation()
  {
    RelationNotification rn = null;
    ObjectName objectName = null;
    try
    {
      objectName = new ObjectName(":a=a");
      rn = new RelationNotification(RelationNotification.RELATION_MBEAN_CREATION,
             new RelationService(true), 21, 23, "message", "relationId",
             "relationTypeName", objectName, null);
    }
    catch (Exception e)
    {
      fail(e.toString());
    }
    assertEquals(RelationNotification.RELATION_MBEAN_CREATION, rn.getType());
    assertEquals(21, rn.getSequenceNumber());
    assertEquals(23, rn.getTimeStamp());
    assertEquals("message", rn.getMessage());
    assertEquals("relationId", rn.getRelationId());
    assertEquals("relationTypeName", rn.getRelationTypeName());
    assertEquals(objectName, rn.getObjectName());
    assertEquals(0, rn.getMBeansToUnregister().size());
  }
View Full Code Here

Examples of javax.management.relation.RelationNotification

  /**
   * Test MBean Removal
   */
  public void testMBeanRemoval()
  {
    RelationNotification rn = null;
    ObjectName objectName = null;
    ArrayList unregs = new ArrayList();
    try
    {
      objectName = new ObjectName(":a=a");
      rn = new RelationNotification(RelationNotification.RELATION_MBEAN_REMOVAL,
             new RelationService(true), 21, 23, "message", "relationId",
             "relationTypeName", objectName, unregs);
    }
    catch (Exception e)
    {
      fail(e.toString());
    }
    assertEquals(RelationNotification.RELATION_MBEAN_REMOVAL, rn.getType());
    assertEquals(21, rn.getSequenceNumber());
    assertEquals(23, rn.getTimeStamp());
    assertEquals("message", rn.getMessage());
    assertEquals("relationId", rn.getRelationId());
    assertEquals("relationTypeName", rn.getRelationTypeName());
    assertEquals(objectName, rn.getObjectName());
    assertEquals(unregs, rn.getMBeansToUnregister());
  }
View Full Code Here

Examples of javax.management.relation.RelationNotification

  /**
   * Test Basic Update
   */
  public void testBasicUpdate()
  {
    RelationNotification rn = null;
    ArrayList newRoles = new ArrayList();
    ArrayList oldRoles = new ArrayList();
    try
    {
      rn = new RelationNotification(RelationNotification.RELATION_BASIC_UPDATE,
             new RelationService(true), 21, 23, "message", "relationId",
             "relationTypeName", null, "roleName", newRoles, oldRoles);
    }
    catch (Exception e)
    {
      fail(e.toString());
    }
    assertEquals(RelationNotification.RELATION_BASIC_UPDATE, 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("roleName", rn.getRoleName());
    assertEquals(0, rn.getNewRoleValue().size());
    assertEquals(0, rn.getOldRoleValue().size());
  }
View Full Code Here

Examples of javax.management.relation.RelationNotification

  /**
   * Test MBean Update
   */
  public void testMBeanUpdate()
  {
    RelationNotification rn = null;
    ObjectName objectName = null;
    ArrayList newRoles = new ArrayList();
    ArrayList oldRoles = new ArrayList();
    try
    {
      objectName = new ObjectName(":a=a");
      rn = new RelationNotification(RelationNotification.RELATION_MBEAN_UPDATE,
             new RelationService(true), 21, 23, "message", "relationId",
             "relationTypeName", objectName, "roleName", newRoles, oldRoles);
    }
    catch (Exception e)
    {
      fail(e.toString());
    }
    assertEquals(RelationNotification.RELATION_MBEAN_UPDATE, rn.getType());
    assertEquals(21, rn.getSequenceNumber());
    assertEquals(23, rn.getTimeStamp());
    assertEquals("message", rn.getMessage());
    assertEquals("relationId", rn.getRelationId());
    assertEquals("relationTypeName", rn.getRelationTypeName());
    assertEquals(objectName, rn.getObjectName());
    assertEquals("roleName", rn.getRoleName());
    assertEquals(0, rn.getNewRoleValue().size());
    assertEquals(0, rn.getOldRoleValue().size());
  }
View Full Code Here

Examples of javax.management.relation.RelationNotification

  /**
   * Test Creation/Removal Error Handling
   */
  public void testCreationRemovalErrors()
  {
    RelationNotification rn = null;
    ObjectName objectName = null;
    try
    {
      objectName = new ObjectName(":a=a");
    }
    catch (Exception e)
    {
      fail(e.toString());
    }
    ArrayList unregs = new ArrayList();

    boolean caught = false;
    try
    {
      rn = new RelationNotification("blah",
             new RelationService(true), 21, 23, "message", "relationId",
             "relationTypeName", objectName, unregs);
    }
    catch (IllegalArgumentException e)
    {
      caught = true;
    }
    catch (Exception e)
    {
      fail(e.toString());
    }
    if (caught == false)
      fail("Creation/Removal accepts an invalid type");

    caught = false;
    try
    {
      rn = new RelationNotification(RelationNotification.RELATION_BASIC_UPDATE,
             new RelationService(true), 21, 23, "message", "relationId",
             "relationTypeName", objectName, unregs);
    }
    catch (IllegalArgumentException e)
    {
      caught = true;
    }
    catch (Exception e)
    {
      fail(e.toString());
    }
    if (caught == false)
      fail("Creation/Removal accepts basic update");

    caught = false;
    try
    {
      rn = new RelationNotification(RelationNotification.RELATION_MBEAN_UPDATE,
             new RelationService(true), 21, 23, "message", "relationId",
             "relationTypeName", objectName, unregs);
    }
    catch (IllegalArgumentException e)
    {
      caught = true;
    }
    catch (Exception e)
    {
      fail(e.toString());
    }
    if (caught == false)
      fail("Creation/Removal accepts mean update");

    caught = false;
    try
    {
      rn = new RelationNotification(RelationNotification.RELATION_BASIC_CREATION,
             null, 21, 23, "message", "relationId",
             "relationTypeName", objectName, unregs);
    }
    catch (IllegalArgumentException e)
    {
      caught = true;
    }
    catch (Exception e)
    {
      fail(e.toString());
    }
    if (caught == false)
      fail("Creation/Removal accepts null source");

    caught = false;
    try
    {
      rn = new RelationNotification(RelationNotification.RELATION_BASIC_CREATION,
             new RelationService(true), 21, 23, "message", null,
             "relationTypeName", objectName, unregs);
    }
    catch (IllegalArgumentException e)
    {
      caught = true;
    }
    catch (Exception e)
    {
      fail(e.toString());
    }
    if (caught == false)
      fail("Creation/Removal accepts null relation id");

    caught = false;
    try
    {
      rn = new RelationNotification(RelationNotification.RELATION_BASIC_CREATION,
             new RelationService(true), 21, 23, "message", "relation id",
             null, objectName, unregs);
    }
    catch (IllegalArgumentException e)
    {
View Full Code Here

Examples of javax.management.relation.RelationNotification

  /**
   * Test Creation/Removal Error Handling
   */
  public void testCreationRemovalErrors2()
  {
    RelationNotification rn = null;
    ObjectName objectName = null;
    try
    {
      objectName = new ObjectName(":a=a");
    }
    catch (Exception e)
    {
      fail(e.toString());
    }
    ArrayList unregs = new ArrayList();

    boolean caught = false;
    try
    {
      rn = new RelationNotification(null,
             new RelationService(true), 21, 23, "message", "relationId",
             "relationTypeName", objectName, unregs);
    }
    catch (NullPointerException e)
    {
View Full Code Here

Examples of javax.management.relation.RelationNotification

  /**
   * Test Update Error Handling
   */
  public void testUpdateErrors()
  {
    RelationNotification rn = null;
    ObjectName objectName = null;
    try
    {
      objectName = new ObjectName(":a=a");
    }
    catch (Exception e)
    {
      fail(e.toString());
    }
    ArrayList newRoles = new ArrayList();
    ArrayList oldRoles = new ArrayList();

    boolean caught = false;
    try
    {
      rn = new RelationNotification("blah",
             new RelationService(true), 21, 23, "message", "relationId",
             "relationTypeName", objectName, "roleInfo", newRoles, oldRoles);
    }
    catch (IllegalArgumentException e)
    {
      caught = true;
    }
    catch (Exception e)
    {
      fail(e.toString());
    }
    if (caught == false)
      fail("Update accepts an invalid type");

    caught = false;
    try
    {
      rn = new RelationNotification(RelationNotification.RELATION_BASIC_CREATION,
             new RelationService(true), 21, 23, "message", "relationId",
             "relationTypeName", objectName, "roleInfo", newRoles, oldRoles);
    }
    catch (IllegalArgumentException e)
    {
      caught = true;
    }
    catch (Exception e)
    {
      fail(e.toString());
    }
    if (caught == false)
      fail("Update accepts basic create");

    caught = false;
    try
    {
      rn = new RelationNotification(RelationNotification.RELATION_MBEAN_CREATION,
             new RelationService(true), 21, 23, "message", "relationId",
             "relationTypeName", objectName, "roleInfo", newRoles, oldRoles);
    }
    catch (IllegalArgumentException e)
    {
      caught = true;
    }
    catch (Exception e)
    {
      fail(e.toString());
    }
    if (caught == false)
      fail("Creation/Removal accepts mean create");

    caught = false;
    try
    {
      rn = new RelationNotification(RelationNotification.RELATION_BASIC_REMOVAL,
             new RelationService(true), 21, 23, "message", "relationId",
             "relationTypeName", objectName, "roleInfo", newRoles, oldRoles);
    }
    catch (IllegalArgumentException e)
    {
      caught = true;
    }
    catch (Exception e)
    {
      fail(e.toString());
    }
    if (caught == false)
      fail("Update accepts basic remove");

    caught = false;
    try
    {
      rn = new RelationNotification(RelationNotification.RELATION_MBEAN_REMOVAL,
             new RelationService(true), 21, 23, "message", "relationId",
             "relationTypeName", objectName, "roleInfo", newRoles, oldRoles);
    }
    catch (IllegalArgumentException e)
    {
      caught = true;
    }
    catch (Exception e)
    {
      fail(e.toString());
    }
    if (caught == false)
      fail("Update accepts mean remove");

    caught = false;
    try
    {
      rn = new RelationNotification(RelationNotification.RELATION_BASIC_UPDATE,
             null, 21, 23, "message", "relationId",
             "relationTypeName", objectName, "roleInfo", newRoles, oldRoles);
    }
    catch (IllegalArgumentException e)
    {
      caught = true;
    }
    catch (Exception e)
    {
      fail(e.toString());
    }
    if (caught == false)
      fail("Update accepts null source");

    caught = false;
    try
    {
      rn = new RelationNotification(RelationNotification.RELATION_BASIC_UPDATE,
             new RelationService(true), 21, 23, "message", null,
             "relationTypeName", objectName, "roleInfo", newRoles, oldRoles);
    }
    catch (IllegalArgumentException e)
    {
      caught = true;
    }
    catch (Exception e)
    {
      fail(e.toString());
    }
    if (caught == false)
      fail("Update accepts null relation id");

    caught = false;
    try
    {
      rn = new RelationNotification(RelationNotification.RELATION_BASIC_UPDATE,
             new RelationService(true), 21, 23, "message", "relation id",
             null, objectName, "roleInfo", newRoles, oldRoles);
    }
    catch (IllegalArgumentException e)
    {
      caught = true;
    }
    catch (Exception e)
    {
      fail(e.toString());
    }
    if (caught == false)
      fail("Update accepts null relation type name");

    caught = false;
    try
    {
      rn = new RelationNotification(RelationNotification.RELATION_BASIC_UPDATE,
             new RelationService(true), 21, 23, "message", "relation id",
             null, objectName, null, newRoles, oldRoles);
    }
    catch (IllegalArgumentException e)
    {
      caught = true;
    }
    catch (Exception e)
    {
      fail(e.toString());
    }
    if (caught == false)
      fail("Update accepts null role info");

    caught = false;
    try
    {
      rn = new RelationNotification(RelationNotification.RELATION_BASIC_UPDATE,
             new RelationService(true), 21, 23, "message", "relation id",
             "relationTypeName", objectName, "roleInfo", null, oldRoles);
    }
    catch (IllegalArgumentException e)
    {
      caught = true;
    }
    catch (Exception e)
    {
      fail(e.toString());
    }
    if (caught == false)
      fail("Creation/Removal accepts null new role value");

    caught = false;
    try
    {
      rn = new RelationNotification(RelationNotification.RELATION_BASIC_UPDATE,
             new RelationService(true), 21, 23, "message", "relation id",
             "relationTypeName", objectName, "roleInfo", newRoles, null);
    }
    catch (IllegalArgumentException e)
    {
View Full Code Here

Examples of javax.management.relation.RelationNotification

  /**
   * Test Update Error Handling
   */
  public void testUpdateErrors2()
  {
    RelationNotification rn = null;
    ObjectName objectName = null;
    try
    {
      objectName = new ObjectName(":a=a");
    }
    catch (Exception e)
    {
      fail(e.toString());
    }
    ArrayList newRoles = new ArrayList();
    ArrayList oldRoles = new ArrayList();

    boolean caught = false;
    try
    {
      rn = new RelationNotification(null,
             new RelationService(true), 21, 23, "message", "relationId",
             "relationTypeName", objectName, "roleInfo", newRoles, oldRoles);
    }
    catch (NullPointerException e)
    {
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.