Package org.apache.harmony.jndi.tests.javax.naming.util

Examples of org.apache.harmony.jndi.tests.javax.naming.util.Person


    assertNull(orderedAttribute.get(0));
  }

  public void testSet_ordered_OldValueNull() throws NamingException {
    orderedAttribute.add(null);
    Person person = Person.getInstance();

    assertNull(orderedAttribute.set(0, person));
    assertEquals(person, orderedAttribute.get(0));
  }
View Full Code Here


    } catch (IndexOutOfBoundsException e) {
    }
  }

  public void testSet_order_ExistValue() throws NamingException {
    Person person = Person.getInstance();
    orderedAttribute.add(person);
    assertEquals(person, orderedAttribute.set(0, person));
    assertEquals(person, orderedAttribute.get(0));
  }
View Full Code Here

    assertEquals(person, orderedAttribute.set(0, person));
    assertEquals(person, orderedAttribute.get(0));
  }

  public void testSet_unorder_ExistValue() {
    Person person = Person.getInstance();
    unorderedAttribute.add(person);
    try {
      unorderedAttribute.set(0, person);
      fail("Should throw IllegalStateException.");
    } catch (IllegalStateException e) {
View Full Code Here

  /**
   * test equals
   */
  public void testEquals() throws CloneNotSupportedException {
    String ID = "equals";
    Person person = Person.getInstance();
    Person personClone = (Person) person.clone();
    BasicAttribute attribute0 = new BasicAttribute(ID);
    attribute0.add(person);

    BasicAttribute attribute1 = new BasicAttribute(ID);
    attribute1.add(personClone);
View Full Code Here

  /**
   * test equals with different ordering setting
   */
  public void testNotEquals_ByOrderFlag() {
    String ID = "not equals";
    Person person = Person.getInstance();
    BasicAttribute attribute0 = new BasicAttribute(ID, person, false);
    BasicAttribute attribute1 = new BasicAttribute(ID, person, true);

    assertFalse(attribute0.equals(attribute1));
  }
View Full Code Here

  /**
   * test equals with different value
   */
  public void testNotEquals_ByValue() {
    String ID = "not equals";
    Person person0 = Person.getInstance();
    Person person1 = Person.getInstance();

    BasicAttribute attribute0 = new BasicAttribute(ID, person0);
    BasicAttribute attribute1 = new BasicAttribute(ID, person1);

    assertFalse(attribute0.equals(attribute1));
View Full Code Here

    for (int i = 0; i < numbers.length; i++) {
      numbers[i] = i * 10;
    }
    String id = "int-Array";
    BasicAttribute attribute = new BasicAttribute(id, numbers);
    Person person = Person.getInstance();
    attribute.add(person);
    int hashCode = id.hashCode() + person.hashCode();
    for (int element : numbers) {
      hashCode += element;
    }

    assertEquals(hashCode, attribute.hashCode());
View Full Code Here

TOP

Related Classes of org.apache.harmony.jndi.tests.javax.naming.util.Person

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.