Examples of CompoundName


Examples of javax.naming.CompoundName

            syntax.put("jndi.syntax.ignorecase", "false");
        }

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

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

Examples of javax.naming.CompoundName

    private EnterpriseNamingContextNameParser() {
    }

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

Examples of javax.naming.CompoundName

        } 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

Examples of javax.naming.CompoundName

     * @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

Examples of javax.naming.CompoundName

         * (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

Examples of javax.naming.CompoundName

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

Examples of javax.naming.CompoundName

        private SimpleNameParser() {
        }

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

Examples of javax.naming.CompoundName

        } 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

Examples of javax.naming.CompoundName

    }
  }

  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
TOP
Copyright © 2018 www.massapi.com. 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.