Package javax.naming

Examples of javax.naming.CannotProceedException


     * @param resolvedObject the resolved object
     * @param remainingName the remaining name
     * @return the exception
     */
    public static CannotProceedException cannotProceedException(final Object resolvedObject, final Name remainingName) {
        final CannotProceedException cpe = new CannotProceedException();
        cpe.setResolvedObj(resolvedObject);
        cpe.setRemainingName(remainingName);
        return cpe;
    }
View Full Code Here


            }
        }
    }

    private static CannotProceedException cannotProceedException(final Object resolvedObject, final Name remainingName) {
        final CannotProceedException cpe = new CannotProceedException();
        cpe.setResolvedObj(resolvedObject);
        cpe.setRemainingName(remainingName);
        return cpe;
    }
View Full Code Here

  public void testGetContinuationContext_MockContext_null_null_null()
      throws NamingException {
    log
        .setMethod("testGetContinuationContext_MockContext_null_null_null()");
    CannotProceedException cpe = new CannotProceedException();
    Object resolvedObj = new MockContext(new Hashtable<String, Object>());
    cpe.setResolvedObj(resolvedObj);
    Context r = NamingManager.getContinuationContext(cpe);
    assertSame(resolvedObj, r);
    assertSame(cpe, cpe.getEnvironment().get(NamingManager.CPE));
  }
View Full Code Here

  }

  public void testGetContinuationContext_OBJ_name_context_h()
      throws NamingException {
    log.setMethod("testGetContinuationContext_OBJ_name_context_h()");
    CannotProceedException cpe = new CannotProceedException();
    cpe.setResolvedObj("resolved object");
    cpe.setAltName(new CompositeName("abc/abc"));
    cpe.setAltNameCtx(new MockContext(new Hashtable<String, Object>()));
    Hashtable<String, String> h = new Hashtable<String, String>();
    h
        .put(Context.OBJECT_FACTORIES,
            "org.apache.harmony.jndi.tests.javax.naming.spi.NamingManagerTest$MockContextObjectFactory");
    cpe.setEnvironment(h);
    Context r = NamingManager.getContinuationContext(cpe);
    assertTrue(r instanceof MockContext);
  }
View Full Code Here

  }

  public void testGetContinuationContext_OBJ_name_context_badnameh()
      throws NamingException {
    log.setMethod("testGetContinuationContext_OBJ_name_context_badnameh()");
    CannotProceedException cpe = new CannotProceedException();
    Object obj = "resolved object";
    cpe.setResolvedObj(obj);
    CompositeName altName = new CompositeName("abc/abc");
    cpe.setAltName(altName);
    MockContext context = new MockContext(new Hashtable<String, Object>());
    cpe.setAltNameCtx(context);
    Hashtable<String, String> h = new Hashtable<String, String>();
    h.put(Context.OBJECT_FACTORIES, "bad name:asdfa");
    cpe.setEnvironment(h);
    try {
      NamingManager.getContinuationContext(cpe);
      fail();
    } catch (CannotProceedException e) {
      assertCPE(cpe, altName, context, h, e, obj);
View Full Code Here

  }

  public void testGetContinuationContext_OBJ_name_context_wrongh()
      throws NamingException {
    log.setMethod("testGetContinuationContext_OBJ_name_context_wrongh()");
    CannotProceedException cpe = new CannotProceedException();
    Object obj = "resolved object";
    cpe.setResolvedObj(obj);

    CompositeName altName = new CompositeName("abc/abc");
    cpe.setAltName(altName);
    MockContext context = new MockContext(new Hashtable<String, Object>());
    cpe.setAltNameCtx(context);
    Hashtable<String, String> h = new Hashtable<String, String>();
    h
        .put(Context.OBJECT_FACTORIES,
            "org.apache.harmony.jndi.tests.javax.naming.spi.NamingManagerTest$MockObjectFactory");
    cpe.setEnvironment(h);
    try {
      NamingManager.getContinuationContext(cpe);
      fail();
    } catch (CannotProceedException e) {
      assertCPE(cpe, altName, context, h, e, obj);
View Full Code Here

  }

  public void testGetContinuationContext_null_name_context_h()
      throws NamingException {
    log.setMethod("testGetContinuationContext_null_name_context_h()");
    CannotProceedException cpe = new CannotProceedException();
    CompositeName altName = new CompositeName("abc/abc");
    cpe.setAltName(altName);
    MockContext context = new MockContext(new Hashtable<String, Object>());
    cpe.setAltNameCtx(context);
    Hashtable<String, String> h = new Hashtable<String, String>();
    h.put(Context.OBJECT_FACTORIES,"org.apache.harmony.jndi.tests.javax.naming.spi.NamingManagerTest$MockContextObjectFactory");
        cpe.setEnvironment(h);
    try {
        NamingManager.getContinuationContext(cpe);
      fail();
    } catch (CannotProceedException e) {
      assertCPE(cpe, altName, context, h, e, null);
View Full Code Here

  }

  public void testGetContinuationContext_OBJ_null_ctx_h()
      throws NamingException {
    log.setMethod("testGetContinuationContext_OBJ_null_ctx_h()");
    CannotProceedException cpe = new CannotProceedException();
    cpe.setResolvedObj("resolved object");
    cpe.setAltNameCtx(new MockContext(new Hashtable<String, Object>()));
    Hashtable<String, String> h = new Hashtable<String, String>();
    h
        .put(Context.OBJECT_FACTORIES,
            "org.apache.harmony.jndi.tests.javax.naming.spi.NamingManagerTest$MockContextObjectFactory");
    cpe.setEnvironment(h);
    Context r = NamingManager.getContinuationContext(cpe);
    assertTrue(r instanceof MockContext);
  }
View Full Code Here

  }

  public void testGetContinuationContext_OBJ_name_null_h()
      throws NamingException {
    log.setMethod("testGetContinuationContext_OBJ_name_null_h()");
    CannotProceedException cpe = new CannotProceedException();
    cpe.setResolvedObj("resolved object");
    cpe.setAltName(new CompositeName("abc/abc"));
    Hashtable<String, String> h = new Hashtable<String, String>();
    h
        .put(Context.OBJECT_FACTORIES,
            "org.apache.harmony.jndi.tests.javax.naming.spi.NamingManagerTest$MockContextObjectFactory");
    cpe.setEnvironment(h);
    Context r = NamingManager.getContinuationContext(cpe);
    assertTrue(r instanceof MockContext);
  }
View Full Code Here

  }

  public void testGetContinuationContext_OBJ_name_context_null()
      throws NamingException {
    log.setMethod("testGetContinuationContext_OBJ_name_context_null()");
    CannotProceedException cpe = new CannotProceedException();
    Object obj = "resolved object";
    cpe.setResolvedObj(obj);
    CompositeName altName = new CompositeName("abc/abc");
    cpe.setAltName(altName);
    MockContext context = new MockContext(new Hashtable<String, Object>());
    cpe.setAltNameCtx(context);
    try {
      NamingManager.getContinuationContext(cpe);
      fail();
    } catch (CannotProceedException e) {
      assertCPE(cpe, altName, context, null, e, obj);
View Full Code Here

TOP

Related Classes of javax.naming.CannotProceedException

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.