@After public void revertRuntimeProperties() { if (initialRuntimeProperties != null) { Context.setRuntimeProperties(initialRuntimeProperties); initialRuntimeProperties = null; } }
properties.put("connection.username", username); properties.put("connection.password", password); setRuntimeProperties(properties);
/** * Basic constructor for the super class to all openmrs api unit tests. This constructor sets up * the classloader and the properties file so that by the type spring gets around to finally * starting, the openmrs runtime properties are already in place A static load count is kept to * count the number of times this class has been loaded. * * @see #getLoadCount() */ public BaseContextSensitiveTest() { Thread.currentThread().setContextClassLoader(OpenmrsClassLoader.getInstance()); Properties props = getRuntimeProperties(); if (log.isDebugEnabled()) log.debug("props: " + props); Context.setRuntimeProperties(props); loadCount++; instance = this; }
Context.setRuntimeProperties(props);
properties.putAll(runtimeProperties); runtimeProperties = properties; Context.setRuntimeProperties(runtimeProperties);