本文整理汇总了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);
}
示例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;
}
示例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));
}