Examples of BinaryRefAddr


Examples of javax.naming.BinaryRefAddr

    assertEquals(refAddr1, ref.get(1));
  }

  public void testAdd_ByIndexInsert() {
    String type = "Binary";
    BinaryRefAddr refAddr0 = new BinaryRefAddr(type, buffer);
    byte[] buffer1 = { 1, 2, 3, 4 };
    BinaryRefAddr refAddr1 = new BinaryRefAddr(type, buffer1);
    byte[] buffer2 = { 1, 2, 3, 4, 5 };
    BinaryRefAddr refAddr2 = new BinaryRefAddr(type, buffer2);

    ref.add(0, refAddr0);
    ref.add(1, refAddr1);
    ref.add(1, refAddr2);
View Full Code Here

Examples of javax.naming.BinaryRefAddr

    assertEquals(refAddr2, ref.get(1));
  }

  public void testAdd_ByIndexInvalidGreat() {
    String type = "Binary";
    BinaryRefAddr refAddr = new BinaryRefAddr(type, buffer);
    try {
      ref.add(1, refAddr);
      fail("This should throw a ArrayIndexOutOfBoundsException");
    } catch (ArrayIndexOutOfBoundsException e) {
    }
View Full Code Here

Examples of javax.naming.BinaryRefAddr

    }
  }

  public void testAdd_ByIndexInvalidLess() {
    String type = "Binary";
    BinaryRefAddr refAddr = new BinaryRefAddr(type, buffer);
    try {
      ref.add(-1, refAddr);
      fail("This should throw a ArrayIndexOutOfBoundsException");
    } catch (ArrayIndexOutOfBoundsException e) {
    }
View Full Code Here

Examples of javax.naming.BinaryRefAddr

    }
  }

  public void testGet_SimpleInvalidGreat() {
    String type = "Binary";
    BinaryRefAddr refAddr = new BinaryRefAddr(type, buffer);
    ref.add(refAddr);

    try {
      ref.get(ref.size());
      fail("This should throw a ArrayIndexOutOfBoundsException");
View Full Code Here

Examples of javax.naming.BinaryRefAddr

    }
  }

  public void testGet_SimpleInvalidLess() {
    String type = "Binary";
    BinaryRefAddr refAddr = new BinaryRefAddr(type, buffer);
    ref.add(refAddr);

    try {
      ref.get(-1);
      fail("This should throw a ArrayIndexOutOfBoundsException");
View Full Code Here

Examples of javax.naming.BinaryRefAddr

    byte[][] buffers = { { 1, 2, 3, 4 }, { 5, 6, 7, 8 }, };

    BinaryRefAddr[] refAddrs = new BinaryRefAddr[types.length];

    for (int i = 0; i < types.length; i++) {
      refAddrs[i] = new BinaryRefAddr(types[i], buffers[i]);
      ref.add(refAddrs[i]);
    }

    for (int i = 0; i < types.length; i++) {
      assertEquals(refAddrs[i], ref.get(types[i]));
View Full Code Here

Examples of javax.naming.BinaryRefAddr

    }
  }

  public void testGet_ByTypeNotExist() {
    String type = "Binary";
    BinaryRefAddr refAddr = new BinaryRefAddr(type, buffer);
    ref.add(refAddr);

    assertNull(ref.get("String"));
  }
View Full Code Here

Examples of javax.naming.BinaryRefAddr

    assertNull(ref.get("String"));
  }

  public void testGet_TypeNull() {
    String type = "Binary";
    BinaryRefAddr refAddr = new BinaryRefAddr(type, buffer);
    ref.add(refAddr);
    try {
      ref.get(null);
      fail("Should throw NullPointerException.");
    } catch (NullPointerException e) {
View Full Code Here

Examples of javax.naming.BinaryRefAddr

    }
  }

  public void testGetAll_Simple() {
    String type = "Binary";
    BinaryRefAddr refAddr = new BinaryRefAddr(type, buffer);
    ref.add(refAddr);

    Enumeration<?> allAddrs = ref.getAll();
    assertTrue(allAddrs.hasMoreElements());
    assertEquals(refAddr, allAddrs.nextElement());
View Full Code Here

Examples of javax.naming.BinaryRefAddr

    assertFalse(allAddrs.hasMoreElements());
  }

  public void testRemove_Simple() {
    String type = "Binary";
    BinaryRefAddr refAddr = new BinaryRefAddr(type, buffer);
    ref.add(refAddr);

    assertEquals(1, ref.size());

    assertEquals(ref.remove(0), refAddr);
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.