Package javax.naming.directory

Examples of javax.naming.directory.AttributeModificationException


  public void testToString() {
    log.setMethod("testToString()");
    String str;

    AttributeModificationException ex = new AttributeModificationException(
        "sample message");
    str = ex.toString();
    assertTrue(str.indexOf("sample message") >= 0);
    assertFalse(str.indexOf("sample id") >= 0);
    assertFalse(str.indexOf("sample value") >= 0);

    ModificationItem items[] = new ModificationItem[] { new ModificationItem(
        DirContext.ADD_ATTRIBUTE, new BasicAttribute("sample id",
            "sample value")), };

    ex.setUnexecutedModifications(items);
    str = ex.toString();
    assertTrue(str.indexOf("sample message") >= 0);
    assertTrue(str.indexOf("sample id") >= 0);
    assertTrue(str.indexOf("sample value") >= 0);
  }
View Full Code Here


    assertTrue(str.indexOf("sample id") >= 0);
    assertTrue(str.indexOf("sample value") >= 0);
  }

  public void testGetUnexecutedModifications() {
    AttributeModificationException exception = new AttributeModificationException(
        "Test");
    assertNull(exception.getUnexecutedModifications());
  }
View Full Code Here

        "Test");
    assertNull(exception.getUnexecutedModifications());
  }

  public void testGetUnexecutedModifications2() {
    AttributeModificationException exception = new AttributeModificationException(
        null);
    assertNull(exception.getUnexecutedModifications());
  }
View Full Code Here

        null);
    assertNull(exception.getUnexecutedModifications());
  }

  public void testGetUnexecutedModifications3() {
    AttributeModificationException exception = new AttributeModificationException();
    assertNull(exception.getUnexecutedModifications());
  }
View Full Code Here

    AttributeModificationException exception = new AttributeModificationException();
    assertNull(exception.getUnexecutedModifications());
  }

  public void testSetRemainingName() throws InvalidNameException {
    AttributeModificationException ex1 = new AttributeModificationException(
        "Test 1");
    AttributeModificationException ex2 = new AttributeModificationException(
        "Test 2");
    Name name = new CompositeName("TestSetRemainingName");
    ex1.setRootCause(ex2);
    ex1.setRemainingName(name);
    boolean check = ex1.toString().indexOf(
View Full Code Here

        ex1.getRemainingName().toString() + "'") > 0;
    assertTrue(check);
  }

  public void testSetRemainingName2() throws InvalidNameException {
    AttributeModificationException ex1 = new AttributeModificationException(
        "Test 1");
    AttributeModificationException ex2 = new AttributeModificationException(
        "Test 2");
    Name name = new CompositeName("TestSetRemainingName2");
    ex1.setRemainingName(name);
    ex1.setRootCause(ex2);
    boolean check = ex1.toString().indexOf(
        "[Root exception is " + ex2.toString()) > 0;
    assertTrue(check);
  }
View Full Code Here

        "[Root exception is " + ex2.toString()) > 0;
    assertTrue(check);
  }

  public void testSetUnexecutedModifications() throws InvalidNameException {
    AttributeModificationException ex1 = new AttributeModificationException(
        "Test 1");
    AttributeModificationException ex2 = new AttributeModificationException(
        "Test 2");
    Name name = new CompositeName("TestSetUnexecutedModifications");
    ex1.setRemainingName(name);
    ex1.setRootCause(ex2);
    ModificationItem[] items = {
View Full Code Here

TOP

Related Classes of javax.naming.directory.AttributeModificationException

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.