Package javax.naming

Examples of javax.naming.CompoundName


  }

  public void testConstructor_WithProps_DSEQ_BqEq()
      throws InvalidNameException {
    log.setMethod("testConstructor_WithProps_DSEQ_BqEq()");
    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", "<");
    props.put("jndi.syntax.endquote", ">");

    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/a>/b/c", props);
    assertNameEquals(name, "<a", "a>", "b", "c");

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

    assertInvalidName("<a/a>a/b/c", props);

    name = new CompoundName("<a\\>a>", props);
    assertNameEquals(name, "a>a");
    assertEquals("a>a", name.toString());

    name = new CompoundName("<a\\<a>", props);
    assertNameEquals(name, "a\\<a");
    assertEquals(new CompoundName(name.toString(), props), name);
    assertEquals("a\\\\<a", name.toString());

    name = new CompoundName("<a\\/a>", props);
    assertNameEquals(name, "a\\/a");
    assertEquals("<a\\/a>", name.toString());
  }
View Full Code Here


    assertEquals("<a\\/a>", name.toString());
  }

  public void testConstructor_WithProps_DSEQ_Eq() throws InvalidNameException {
    log.setMethod("testConstructor_WithProps_DSEQ_Eq()");
    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.endquote", ">");

    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");
    assertEquals(">a/a>/b/c", name.toString());
  }
View Full Code Here

  }

  public void testConstructor_WithProps_DSEQ_Bq2()
      throws InvalidNameException {
    log.setMethod("testConstructor_WithProps_DSEQ_Bq2()");
    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.beginquote2", "'");

    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

  }

  public void testConstructor_WithProps_DSEQ_Bq2Eq2()
      throws InvalidNameException {
    log.setMethod("testConstructor_WithProps_DSEQ_Bq2Eq2()");
    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.beginquote2", "<");
    props.put("jndi.syntax.endquote2", ">");

    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/a>/b/c", props);
    assertNameEquals(name, "<a", "a>", "b", "c");

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

    assertInvalidName("<a/a>a/b/c", props);

    name = new CompoundName("<a\\>a>", props);
    assertNameEquals(name, "a>a");
    assertEquals("a>a", name.toString());

    name = new CompoundName("<a\\<a>", props);
    assertNameEquals(name, "a\\<a");
    assertEquals(new CompoundName(name.toString(), props), name);
    assertEquals("a\\\\<a", name.toString());

    name = new CompoundName("<a\\/a>", props);
    assertNameEquals(name, "a\\/a");
    assertEquals(new CompoundName(name.toString(), props), name);
    assertEquals("<a\\/a>", name.toString());
  }
View Full Code Here

  }

  public void testConstructor_WithProps_DSEQ_Eq2()
      throws InvalidNameException {
    log.setMethod("testConstructor_WithProps_DSEQ_Eq2()");
    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.endquote2", ">");

    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");
    assertEquals(new CompoundName(name.toString(), props), name);
  }
View Full Code Here

  }

  public void testConstructor_WithProps_DSEQ_DefaultIgnoreCase()
      throws InvalidNameException {
    log.setMethod("testConstructor_WithProps_DSEQ_DefaultIgnoreCase()");
    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", "<");
    props.put("jndi.syntax.endquote", ">");
    props.put("jndi.syntax.beginquote2", "'");
    props.put("jndi.syntax.endquote2", "'");

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

  }

  public void testConstructor_WithProps_DSEQ_DefaultTrimBlanks()
      throws InvalidNameException {
    log.setMethod("testConstructor_WithProps_DSEQ_DefaultTrimBlanks()");
    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", "<");
    props.put("jndi.syntax.endquote", ">");
    props.put("jndi.syntax.beginquote2", "'");
    props.put("jndi.syntax.endquote2", "'");

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

    assertFalse(name.equals(new CompoundName(" a / b / c ", props)));
  }

  public void testConstructor_WithProps_DSEQAv() throws InvalidNameException {
    log.setMethod("testConstructor_WithProps_DSEQAv()");
    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", "<");
    props.put("jndi.syntax.endquote", ">");
    props.put("jndi.syntax.beginquote2", "'");
    props.put("jndi.syntax.endquote2", "'");
    props.put("jndi.syntax.separator.ava", ",");

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

    assertNameEquals(name, "a", ",");
  }

  public void testConstructor_WithProps_DSEQTv() throws InvalidNameException {
    log.setMethod("testConstructor_WithProps_DSEQTv()");
    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", "<");
    props.put("jndi.syntax.endquote", ">");
    props.put("jndi.syntax.beginquote2", "'");
    props.put("jndi.syntax.endquote2", "'");
    props.put("jndi.syntax.separator.typeval", "=");

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

  }

  public void testConstructor_WithProps_DSEQAvTv()
      throws InvalidNameException {
    log.setMethod("testConstructor_WithProps_DSEQAvTv()");
    CompoundName name, name2;
    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", "<");
    props.put("jndi.syntax.endquote", ">");
    props.put("jndi.syntax.beginquote2", "'");
    props.put("jndi.syntax.endquote2", "'");
    props.put("jndi.syntax.separator.ava", ",");
    props.put("jndi.syntax.separator.typeval", "=");

    name = new CompoundName("a='b'/c", props);
    assertNameEquals(name, "a='b'", "c");
    assertInvalidName("a='b',/c", props);
    assertInvalidName("a='b',c/d", props);
    assertInvalidName("a='b',c=d/e", props);
    name = new CompoundName("a=<b/b>/abc", props);
    assertNameEquals(name, "a=<b/b>", "abc");
    name = new CompoundName("a=b='c'/d", props);
    assertNameEquals(name, "a=b='c'", "d");
    assertInvalidName("CN=<Ima Random>, O=HMY, C=UK", props);
    assertInvalidName("CN=<Ima Random, O=HMY, C=UK", props);
    name = new CompoundName("CN=<Ima Random>/O=HMY/C=UK", props);
    assertNameEquals(name, "CN=<Ima Random>", "O=HMY", "C=UK");
    assertInvalidName("CN=<Ima Random/O=HMY/C=UK", props);
    name = new CompoundName("a=b'b',c='d'/abc'", props);
    assertNameEquals(name, "a=b'b',c='d'", "abc'");
    assertInvalidName("a='b\\',c='d'/abc", props);
    assertInvalidName("a='b',/abc", props);
    assertInvalidName("a='b',abc/abc", props);
    assertInvalidName("'<a>'=b,c=d/abc", props);
    assertInvalidName("'a=b,c=d/abc", props);
    name = new CompoundName("a=,c=d/abc", props);
    assertNameEquals(name, "a=,c=d", "abc");
    name = new CompoundName("=b,c=d/abc", props);
    assertNameEquals(name, "=b,c=d", "abc");
    assertInvalidName("''=b,c=d/abc", props);
    assertInvalidName("a='b\\,b',c=d/abc", props);
    assertInvalidName("a\\=a='b',c=d/abc", props);
    name = new CompoundName(",,/,,", props);
    assertNameEquals(name, ",,", ",,");
    name = new CompoundName("a=/bc", props);
    assertNameEquals(name, "a=", "bc");
    name = new CompoundName("=b/bc", props);
    assertNameEquals(name, "=b", "bc");
    name = new CompoundName("=/bc", props);
    assertNameEquals(name, "=", "bc");

    // Does escape work for typeval?
    name = new CompoundName("a\\='b/c'/d", props);
    assertEquals("<a\\='b/c'>/d", name.toString());
    assertNameEquals(name, "a\\='b/c'", "d");

    name = new CompoundName("a=b, c=d/a=b, c=d", props);
    name2 = new CompoundName("a=b,c=d/a=b,c=d", props);
    assertFalse(name.equals(name2));
    props.put("jndi.syntax.trimblanks", "true");
    name = new CompoundName("a=b, c=d/a=b, c=d", props);
    name2 = new CompoundName("a=b,c=d/a=b,c=d", props);
    assertFalse(name.equals(name2));

    name = new CompoundName("a=b,c=d/a=b,c=d", props);
    name2 = new CompoundName("A=B,C=D/A=B,C=D", props);
    assertFalse(name.equals(name2));
    props.put("jndi.syntax.ignorecase", "true");
    name = new CompoundName("a=b,c=d/a=b,c=d", props);
    name2 = new CompoundName("A=B,C=D/A=B,C=D", props);
    assertTrue(name.equals(name2));

  }
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.