本文整理匯總了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));
}