Package javax.naming

Examples of javax.naming.CompoundName


        /**
         * @see NameParser#parse(String)
         */
        public Name parse(String name) throws NamingException {
            return new CompoundName(name, syntax);
        }
View Full Code Here


    private EnterpriseNamingContextNameParser() {
    }

    public Name parse(String name) throws NamingException {
        return new CompoundName(name, PARSER_PROPERTIES);
    }
View Full Code Here

        } catch (NamingException e) {
            // OK
        }
        assertEquals("Hello", envContext.lookup(new CompositeName("hello")));
        assertEquals("Hello", compContext.lookup(new CompositeName("env/hello")));
        assertEquals("Hello", envContext.lookup(new CompoundName("hello", syntax)));
        assertEquals("Hello", compContext.lookup(new CompoundName("env/hello", syntax)));

        assertEquals(envContext, envContext.lookup(""));
    }
View Full Code Here

     * @return A non-null parsed form of the name using the naming convention
     * of this parser.
     * @exception NamingException If a naming exception was encountered.
     */
    public Name parse(String name) throws NamingException {
        return new CompoundName(name, syntax);
    }
View Full Code Here

         * (non-Javadoc)
         * @see javax.naming.NameParser#parse(java.lang.String)
         */
        public Name parse(String name) throws NamingException
        {
            return new CompoundName(name, syntax);
        }
View Full Code Here

/**
* Returns a new empty CompoundName
*/
public static Name newCompoundName() throws InvalidNameException
{
    return new CompoundName("", props);
}
View Full Code Here

        private SimpleNameParser() {
        }

        @Override
        public Name parse(final String name) throws NamingException {
            return new CompoundName(name, PARSER_PROPERTIES);
        }
View Full Code Here

        } catch (NamingException e) {
            // OK
        }
        assertEquals("Hello", envContext.lookup(new CompositeName("hello")));
        assertEquals("Hello", compContext.lookup(new CompositeName("env/hello")));
        assertEquals("Hello", envContext.lookup(new CompoundName("hello", syntax)));
        assertEquals("Hello", compContext.lookup(new CompoundName("env/hello", syntax)));

        assertEquals(envContext, envContext.lookup(""));
    }
View Full Code Here

    }
  }

  public void testGetSuffix() throws InvalidNameException {
    log.setMethod("testGetSuffix()");
    CompoundName name;

    // has more than one elements
    name = new CompoundName("a/b/c", props);
    assertNameEquals(name.getSuffix(0), "a", "b", "c");
    assertNameEquals(name.getSuffix(1), "b", "c");
    assertNameEquals(name.getSuffix(2), "c");
    // assertNameEmpty(name.getSuffix(3)); // worth debate
    try {
      name.getPrefix(-1);
      fail();
    } catch (ArrayIndexOutOfBoundsException e) {
    }
    try {
      name.getPrefix(4);
      fail();
    } catch (ArrayIndexOutOfBoundsException e) {
    }

    // has no elements
    name = new CompoundName("", props);
    assertNameEmpty(name.getPrefix(0));
    try {
      name.getPrefix(-1);
      fail();
    } catch (ArrayIndexOutOfBoundsException e) {
    }
    try {
      name.getPrefix(1);
      fail();
    } catch (ArrayIndexOutOfBoundsException e) {
    }
  }
View Full Code Here

    }
  }

  public void testAddAll() throws InvalidNameException {
    log.setMethod("testAddAll()");
    CompoundName name;

    name = new CompoundName("", props);
    assertNameEmpty(name);
    name.addAll(new CompoundName("a", props));
    assertNameEquals(name, "a");
    name.addAll(new CompoundName("b/c", props));
    assertNameEquals(name, "a", "b", "c");
  }
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.