Package javax.naming

Examples of javax.naming.CompoundName


  public void testConstructor_Null_String() throws InvalidNameException {
    log.setMethod("testConstructor_Null_String()");

    try {
      new CompoundName((String) null, props);
      fail("should be null pointer exception");
    } catch (NullPointerException e) {
    }
  }
View Full Code Here


  public void testConstructor_Null_Props() throws InvalidNameException {
    log.setMethod("testConstructor_Null_Props()");

    try {
      new CompoundName("abc", null);
      fail("should be null pointer exception");
    } catch (NullPointerException e) {
    }
  }
View Full Code Here

    log.setMethod("testConstructor_WithProps_D_NotFlat()");
    props.clear();
    props.put("jndi.syntax.direction", "left_to_right");

    try {
      new CompoundName("a/b/c", props);
      fail("has direction but no separator, should throw IllegalArgumentException");
    } catch (IllegalArgumentException e) {
    }
  }
View Full Code Here

    }
  }

  public void testConstructor_WithProps_D_Flat() throws InvalidNameException {
    log.setMethod("testConstructor_WithProps_D_Flat()");
    CompoundName name;
    props.clear();
    props.put("jndi.syntax.direction", "flat");

    name = new CompoundName("a/b/c", props);
    assertNameEquals(name, "a/b/c");
  }
View Full Code Here

    assertNameEquals(name, "a/b/c");
  }

  public void testConstructor_WithProps_DS() throws InvalidNameException {
    log.setMethod("testConstructor_WithProps_DS()");
    CompoundName name;
    props.clear();
    props.put("jndi.syntax.direction", "left_to_right");
    props.put("jndi.syntax.separator", "/");

    name = new CompoundName("a\\/b/c", props);
    assertNameEquals(name, "a\\", "b", "c");

    name = new CompoundName("'a/a'/b/c", props);
    assertNameEquals(name, "'a", "a'", "b", "c");

    name = new CompoundName("\"a/a\"/b/c", props);
    assertNameEquals(name, "\"a", "a\"", "b", "c");

    name = new CompoundName("<a/a>/b/c", props);
    assertNameEquals(name, "<a", "a>", "b", "c");

    name = new CompoundName("a/b/c", props);
    assertFalse(name.equals(new CompoundName("A/B/C", props)));
    assertFalse(name.equals(new CompoundName(" a / b / c ", props)));
  }
View Full Code Here

    log.setMethod("testConstructor_WithProps_DS2()");
    props.clear();
    props.put("jndi.syntax.direction", "left_to_right");
    props.put("jndi.syntax.separator2", "/");
    try {
      new CompoundName("a/b/c", props);
      fail("IllegalArgumentException expected");
    } catch (IllegalArgumentException e) {
    }
  }
View Full Code Here

    }
  }

  public void testConstructor_WithProps_DSS2() throws InvalidNameException {
    log.setMethod("testConstructor_WithProps_DSS2()");
    CompoundName name;
    props.clear();
    props.put("jndi.syntax.direction", "left_to_right");
    props.put("jndi.syntax.separator", "/");
    props.put("jndi.syntax.separator2", ":");
    name = new CompoundName("a:b/c:d", props);
    assertNameEquals(name, "a", "b", "c", "d");
    assertEquals("a/b/c/d", name.toString());
  }
View Full Code Here

    assertEquals("a/b/c/d", name.toString());
  }

  public void testConstructor_WithProps_DSS2E() throws InvalidNameException {
    log.setMethod("testConstructor_WithProps_DSS2E()");
    CompoundName name;
    props.clear();
    props.put("jndi.syntax.direction", "left_to_right");
    props.put("jndi.syntax.separator", "/");
    props.put("jndi.syntax.separator2", ":");
    props.put("jndi.syntax.escape", "\\");

    name = new CompoundName("a\\:b\\/c:d", props);
    assertNameEquals(name, "a:b/c", "d");
    assertEquals("a\\:b\\/c/d", name.toString());
  }
View Full Code Here

    assertEquals("a\\:b\\/c/d", name.toString());
  }

  public void testConstructor_WithProps_DSE() throws InvalidNameException {
    log.setMethod("testConstructor_WithProps_DSE()");
    CompoundName name;
    props.clear();
    props.put("jndi.syntax.direction", "left_to_right");
    props.put("jndi.syntax.separator", "/");
    props.put("jndi.syntax.escape", "\\");

    name = new CompoundName("a\\/a/b/c", props);
    assertNameEquals(name, "a/a", "b", "c");

    name = new CompoundName("a\\/a/\\b/c", props);
    assertNameEquals(name, "a/a", "\\b", "c");

    name = new CompoundName("\\'a/b/c", props);
    assertNameEquals(name, "\\'a", "b", "c");
  }
View Full Code Here

    assertNameEquals(name, "\\'a", "b", "c");
  }

  public void testConstructor_WithProps_DSEQ_Bq() throws InvalidNameException {
    log.setMethod("testConstructor_WithProps_DSEQ_Bq()");
    CompoundName name;
    props.clear();
    props.put("jndi.syntax.direction", "left_to_right");
    props.put("jndi.syntax.separator", "/");
    props.put("jndi.syntax.escape", "\\");
    props.put("jndi.syntax.beginquote", "'");

    name = new CompoundName("'a/a'/b/c", props);
    assertNameEquals(name, "a/a", "b", "c");

    name = new CompoundName("a'a/a'a/b/c", props);
    assertNameEquals(name, "a'a", "a'a", "b", "c");

    name = new CompoundName("\\'a/b/c", props);
    assertNameEquals(name, "'a", "b", "c");

    assertInvalidName("'a/a'a/b/c", props);
  }
View Full Code Here

TOP

Related Classes of javax.naming.CompoundName

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.