Package org.apache.harmony.jndi.tests.javax.naming.spi.mock

Examples of org.apache.harmony.jndi.tests.javax.naming.spi.mock.MockContext


    public void testGetStateToBind_f1ReturnNull() throws NamingException {
       
        Object o = "object";
        Name n = new CompositeName();
        Context c = new MockContext(new Hashtable<String, String>()); // no state factory
        Hashtable<Object, Object> h = new Hashtable<Object, Object>();
        Attributes a = null;
        h.put(Context.STATE_FACTORIES,
                "org.apache.harmony.jndi.tests.javax.naming.spi.mock.MockDirStateFactory");
        NamingManagerTest.indicateReturnNull(h);
View Full Code Here


    public void testGetStateToBind_f1NamingException() {
       
        Object o = "object";
        Name n = new CompositeName();
        Context c = new MockContext(new Hashtable<String, String>()); // no state factory
        Hashtable<String, String> h = new Hashtable<String, String>();
        Attributes a = null;
        h.put(Context.STATE_FACTORIES,
                "org.apache.harmony.jndi.tests.javax.naming.spi.mock.MockDirStateFactory");
        NamingManagerTest.indicateNamingException(h);
View Full Code Here

    public void testGetStateToBind_f1RuntimeException() {
       
        Object o = "object";
        Name n = new CompositeName();
        Context c = new MockContext(new Hashtable<String, String>()); // no state factory
        Hashtable<Object, Object> h = new Hashtable<Object, Object>();
        Attributes a = null;
        h.put(Context.STATE_FACTORIES,
                "org.apache.harmony.jndi.tests.javax.naming.spi.mock.MockDirStateFactory");
        NamingManagerTest.indicateRuntimeException(h);
View Full Code Here

      throws NamingException {
    log.setMethod("myTestGetInitialContext_HasBuilder_Normal");

    Context context = NamingManager.getInitialContext(null);
    assertTrue(context instanceof MockContext);
    assertEquals(context, new MockContext(null));

    Hashtable<Object, Object> env = new Hashtable<Object, Object>();
    env.put(Context.INITIAL_CONTEXT_FACTORY,
        "dazzle.jndi.testing.spi.DazzleContextFactory");
    context = NamingManager.getInitialContext(env);
    assertTrue(context instanceof MockContext);
    assertEquals(context, new MockContext(env));
  }
View Full Code Here

TOP

Related Classes of org.apache.harmony.jndi.tests.javax.naming.spi.mock.MockContext

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.