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


Java OpenmrsClassLoader类代码示例

本文整理汇总了Java中org.openmrs.util.OpenmrsClassLoader的典型用法代码示例。如果您正苦于以下问题:Java OpenmrsClassLoader类的具体用法?Java OpenmrsClassLoader怎么用?Java OpenmrsClassLoader使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OpenmrsClassLoader类属于org.openmrs.util包,在下文中一共展示了OpenmrsClassLoader类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import org.openmrs.util.OpenmrsClassLoader; //导入依赖的package包/类
/**
 * Overriding the init(ServletConfig) method to save the dwr servlet to the ModuleWebUtil class
 */
public void init(ServletConfig config) throws ServletException {
	Thread.currentThread().setContextClassLoader(OpenmrsClassLoader.getInstance());
	
	DwrServletConfig conf =  new DwrServletConfig(config.getServletName(), config.getServletContext());
	conf.setInitParameter("debug", "false");
	conf.setInitParameter("crossDomainSessionSecurity", "false");
	conf.setInitParameter("config-modules", "/WEB-INF/dwr-modules.xml");
	
	super.init(conf);
}
 
开发者ID:openmrs,项目名称:openmrs-module-legacyui,代码行数:14,代码来源:OpenmrsDWRServlet.java

示例2: getProcess

import org.openmrs.util.OpenmrsClassLoader; //导入依赖的package包/类
/**
 * Used to get the configuration objects
 * @return
 */
public Process getProcess() {

	Process process = null;
	try {
		Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
		process  = (Process) jaxbUnmarshaller.unmarshal(OpenmrsClassLoader.getInstance().getResourceAsStream("process.xml"));

	} catch (JAXBException e) {
		e.printStackTrace();
	}
	return process;
}
 
开发者ID:openmrs,项目名称:openmrs-module-dataimporttool,代码行数:17,代码来源:ProcessReader.java

示例3: testUploadofNotaZipArchieve

import org.openmrs.util.OpenmrsClassLoader; //导入依赖的package包/类
/**
 * Test of upload method, of class AddAppController.
 */
@Test
public void testUploadofNotaZipArchieve() throws Exception {
	HttpServletRequest request = new MockHttpServletRequest(new MockServletContext(), "POST", "/module/owa/addApp.htm");
	URL url = OpenmrsClassLoader.getInstance().getResource("testing");
	MockMultipartFile multifile = new MockMultipartFile("testFile", "testing", null, new FileInputStream(url.getFile()));
	AddAppController controller = (AddAppController) applicationContext.getBean("addAppController");
	controller.upload(multifile, request);
	Assert.assertEquals("owa.not_a_zip", request.getSession().getAttribute(WebConstants.OPENMRS_ERROR_ATTR));
}
 
开发者ID:openmrs,项目名称:openmrs-module-owa,代码行数:13,代码来源:AddAppControllerTest.java


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