Package javax.naming

Examples of javax.naming.BinaryRefAddr


      throw namingException;
    }

    return new Reference(
        Ejb3Configuration.class.getName(),
        new BinaryRefAddr("object", serialized ),
        Ejb3ConfigurationObjectFactory.class.getName(),
        null
    );
  }
View Full Code Here


      throw namingException;
    }

    return new Reference(
        Ejb3Configuration.class.getName(),
        new BinaryRefAddr("object", serialized ),
        Ejb3ConfigurationObjectFactory.class.getName(),
        null
    );
  }
View Full Code Here

    }
    Assert.assertNull(addr);
  }

  public void testBinaryRefAddr_TooBigSize() {
    BinaryRefAddr addr = null;

    // Test too big size
    try {
      addr = new BinaryRefAddr("binary", new byte[] { 2, 3 }, 0, 3);
      fail("Should throw ArrayIndexOutOfBoundsException here.");
    } catch (ArrayIndexOutOfBoundsException e) {
    }
    Assert.assertNull(addr);
View Full Code Here

  }

  public void testGetType() {
    // Test empty type
    BinaryRefAddr addr = new BinaryRefAddr("", new byte[] { 1 });
    Assert.assertEquals("", addr.getType());

    // Other conditions are tested in testBinaryRefAddr_XXX
  }
View Full Code Here

    Random random = new Random(100);
    for (int i = 0; i < count; i++) {
      address0[i] = (byte) random.nextInt();
      address1[i] = address0[i];
    }
    BinaryRefAddr addr0 = new BinaryRefAddr(type, address0);
    BinaryRefAddr addr1 = new BinaryRefAddr(type, address1);
    assertTrue(addr0.equals(addr0));
    assertFalse(addr0.equals(null));
    assertTrue(addr1.equals(addr0));
    assertTrue(addr0.equals(addr1));
  }
View Full Code Here

    for (int i = 0; i < count; i++) {
      address0[i] = (byte) random.nextInt();
      address1[i] = address0[i];
    }

    BinaryRefAddr addr0 = new BinaryRefAddr(null, address0);
    BinaryRefAddr addr1 = new BinaryRefAddr(null, address1);
    try {
      addr0.equals(addr1);
      fail("Should throw NullPointerException.");
    } catch (NullPointerException e) {
    }
View Full Code Here

  }

  public void testtestEquals_refAddr() {
    String type = "Binary Type";
    byte[] address = { 1, 2, 3, 4 };
    BinaryRefAddr addr = new BinaryRefAddr(type, address);
    MyRefAddr addr2 = new MyRefAddr(type, address);

    assertFalse(addr.equals(addr2));
  }
View Full Code Here

    int hashCode = type.hashCode();
    for (byte element : address) {
      hashCode += element;
    }
    BinaryRefAddr addr = new BinaryRefAddr(type, address);
    assertEquals(hashCode, addr.hashCode());
  }
View Full Code Here

  }

  public void testHashcode_TypeNull() {
    byte[] address = { 1, 2, 3, };

    BinaryRefAddr addr = new BinaryRefAddr(null, address);
    try {
      addr.hashCode();
      fail("Should throw NullPointerException.");
    } catch (NullPointerException e) {
    }

  }
View Full Code Here

  }

  public void testGetContent_Simple() {
    String type = "Binary Address";
    byte[] address = { 1, 2, 3, 4, 5, 6 };
    BinaryRefAddr addr = new BinaryRefAddr(type, address);

    assertTrue(java.util.Arrays.equals(address, (byte[]) addr.getContent()));
  }
View Full Code Here

TOP

Related Classes of javax.naming.BinaryRefAddr

Copyright © 2018 www.massapicom. 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.