当前位置: 首页>>代码示例>>Java>>正文


Java CannotProceedException.setAltNameCtx方法代码示例

本文整理汇总了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);
	}
}
 
开发者ID:shannah,项目名称:cn1,代码行数:21,代码来源:NamingManagerTest.java

示例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);
	}
}
 
开发者ID:shannah,项目名称:cn1,代码行数:24,代码来源:NamingManagerTest.java

示例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);
	}
}
 
开发者ID:shannah,项目名称:cn1,代码行数:19,代码来源:NamingManagerTest.java

示例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);
	}
}
 
开发者ID:shannah,项目名称:cn1,代码行数:18,代码来源:NamingManagerTest.java

示例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());
}
 
开发者ID:shannah,项目名称:cn1,代码行数:22,代码来源:CannotProceedExceptionTest.java

示例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);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:16,代码来源:NamingManagerTest.java

示例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);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:15,代码来源:NamingManagerTest.java


注:本文中的javax.naming.CannotProceedException.setAltNameCtx方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。