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

  }

  public void testConstructor_ByRefAddr() {
    String className = "java.util.Hashtable";
    String type = "Binary";
    RefAddr refAddr = new BinaryRefAddr(type, buffer);
    Reference reference = new Reference(className, refAddr);

    assertEquals(className, reference.getClassName());
    assertEquals(refAddr, reference.get(0));
    assertNull(reference.getFactoryClassName());
View Full Code Here

    String className = "java.util.Hashtable";
    String factoryName = "factory name";
    String factoryLocation = "file:///home/";

    String type = "Binary";
    RefAddr refAddr = new BinaryRefAddr(type, buffer);

    Reference reference = new Reference(className, refAddr, factoryName,
        factoryLocation);

    assertEquals(className, reference.getClassName());
View Full Code Here

    assertEquals(1, reference.size());
  }

  public void testAdd_Simple() {
    String type = "Binary";
    BinaryRefAddr refAddr0 = new BinaryRefAddr(type, buffer);
    byte[] buffer1 = { 1, 2, 3, 4 };
    BinaryRefAddr refAddr1 = new BinaryRefAddr(type, buffer1);
    ref.add(refAddr0);
    ref.add(refAddr1);

    assertEquals(2, ref.size());
    assertEquals(refAddr0, ref.get(0));
View Full Code Here

    assertNull(ref.get(0));
  }

  public void testAdd_ByIndex() {
    String type = "Binary";
    BinaryRefAddr refAddr0 = new BinaryRefAddr(type, buffer);
    byte[] buffer1 = { 1, 2, 3, 4 };
    BinaryRefAddr refAddr1 = new BinaryRefAddr(type, buffer1);
    ref.add(0, refAddr0);
    ref.add(1, refAddr1);

    assertEquals(2, ref.size());
    assertEquals(refAddr0, ref.get(0));
View Full Code Here

    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

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

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

        }
    }

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

        }
  }

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

    try {
      ref.get(ref.size());
      fail("should throw ArrayIndexOutOfBoundsException");
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.