本文整理汇总了Java中javax.naming.CannotProceedException.setAltNameCtx方法的典型用法代码示例。如果您正苦于以下问题:Java CannotProceedException.setAltNameCtx方法的具体用法?Java CannotProceedException.setAltNameCtx怎么用?Java CannotProceedException.setAltNameCtx使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.naming.CannotProceedException
的用法示例。
在下文中一共展示了CannotProceedException.setAltNameCtx方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testGetContinuationContext_OBJ_name_context_badnameh
import javax.naming.CannotProceedException; //导入方法依赖的package包/类
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);
}
}
示例2: testGetContinuationContext_OBJ_name_context_wrongh
import javax.naming.CannotProceedException; //导入方法依赖的package包/类
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);
}
}
示例3: testGetContinuationContext_null_name_context_h
import javax.naming.CannotProceedException; //导入方法依赖的package包/类
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);
}
}
示例4: testGetContinuationContext_OBJ_name_context_null
import javax.naming.CannotProceedException; //导入方法依赖的package包/类
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);
}
}
示例5: testConstructorAndGetterSetter
import javax.naming.CannotProceedException; //导入方法依赖的package包/类
public void testConstructorAndGetterSetter() throws InvalidNameException {
log.setMethod("testConstructorAndGetterSetter()");
CannotProceedException cpe = new CannotProceedException();
Name altName = new CompositeName("1");
Context altContext = null;
Hashtable<?, ?> h = new Hashtable<Object, Object>();
Name newName = new CompositeName("2");
cpe.setAltName(altName);
assertEquals(altName, cpe.getAltName());
cpe.setAltNameCtx(altContext);
assertEquals(altContext, cpe.getAltNameCtx());
cpe.setEnvironment(h);
assertEquals(h, cpe.getEnvironment());
cpe.setRemainingNewName(newName);
assertEquals(newName, cpe.getRemainingNewName());
}
示例6: testGetContinuationContext_OBJ_name_context_h
import javax.naming.CannotProceedException; //导入方法依赖的package包/类
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);
}
示例7: testGetContinuationContext_OBJ_null_ctx_h
import javax.naming.CannotProceedException; //导入方法依赖的package包/类
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);
}