| 1 |  |  | 
            
  
    | 2 |  |  | 
            
  
    | 3 |  |  | 
            
  
    | 4 |  |  | 
            
  
    | 5 |  |  | 
            
  
    | 6 |  |  | 
            
  
    | 7 |  |  | 
            
  
    | 8 |  |  | 
            
  
    | 9 |  |  | 
            
  
    | 10 |  |  | 
            
  
    | 11 |  |  | 
            
  
    | 12 |  |  | 
            
  
    | 13 |  |  | 
            
  
    | 14 |  |  | 
            
  
    | 15 |  |  | 
            
  
    | 16 |  |  | 
            
  
    | 17 |  | package org.kuali.rice.test; | 
            
  
    | 18 |  |  | 
            
  
    | 19 |  | import org.apache.commons.lang.StringUtils; | 
            
  
    | 20 |  | import org.apache.log4j.Logger; | 
            
  
    | 21 |  | import org.apache.log4j.PropertyConfigurator; | 
            
  
    | 22 |  | import org.junit.After; | 
            
  
    | 23 |  | import org.junit.Before; | 
            
  
    | 24 |  | import org.kuali.rice.core.api.config.property.Config; | 
            
  
    | 25 |  | import org.kuali.rice.core.api.config.property.ConfigContext; | 
            
  
    | 26 |  | import org.kuali.rice.core.api.lifecycle.BaseLifecycle; | 
            
  
    | 27 |  | import org.kuali.rice.core.api.lifecycle.Lifecycle; | 
            
  
    | 28 |  | import org.kuali.rice.core.impl.config.property.JAXBConfigImpl; | 
            
  
    | 29 |  | import org.kuali.rice.core.api.lifecycle.BaseLifecycle; | 
            
  
    | 30 |  | import org.kuali.rice.core.api.lifecycle.Lifecycle; | 
            
  
    | 31 |  | import org.kuali.rice.core.impl.resourceloader.SpringResourceLoader; | 
            
  
    | 32 |  | import org.kuali.rice.test.data.PerSuiteUnitTestData; | 
            
  
    | 33 |  | import org.kuali.rice.test.lifecycles.PerSuiteDataLoaderLifecycle; | 
            
  
    | 34 |  | import org.springframework.core.io.FileSystemResourceLoader; | 
            
  
    | 35 |  | import org.springframework.core.io.Resource; | 
            
  
    | 36 |  | import org.springframework.core.io.ResourceLoader; | 
            
  
    | 37 |  |  | 
            
  
    | 38 |  | import javax.xml.namespace.QName; | 
            
  
    | 39 |  | import java.io.File; | 
            
  
    | 40 |  | import java.io.IOException; | 
            
  
    | 41 |  | import java.util.ArrayList; | 
            
  
    | 42 |  | import java.util.Collections; | 
            
  
    | 43 |  | import java.util.HashSet; | 
            
  
    | 44 |  | import java.util.LinkedList; | 
            
  
    | 45 |  | import java.util.List; | 
            
  
    | 46 |  | import java.util.Properties; | 
            
  
    | 47 |  | import java.util.Set; | 
            
  
    | 48 |  |  | 
            
  
    | 49 |  | import static org.junit.Assert.assertNotNull; | 
            
  
    | 50 |  | import static org.junit.Assert.fail; | 
            
  
    | 51 |  |  | 
            
  
    | 52 |  |  | 
            
  
    | 53 |  |  | 
            
  
    | 54 |  |  | 
            
  
    | 55 |  |  | 
            
  
    | 56 |  |  | 
            
  
    | 57 |  |  | 
            
  
    | 58 |  |  | 
            
  
    | 59 |  | @author | 
            
  
    | 60 |  | @since | 
            
  
    | 61 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 178 (178) | Complexity: 48 | Complexity Density: 0.4 |  | 
  
  
    | 62 |  | public abstract class RiceTestCase extends BaseRiceTestCase { | 
            
  
    | 63 |  |  | 
            
  
    | 64 |  | private static final Logger LOG = Logger.getLogger(RiceTestCase.class); | 
            
  
    | 65 |  |  | 
            
  
    | 66 |  | private static final String ALT_LOG4J_CONFIG_LOCATION_PROP = "alt.log4j.config.location"; | 
            
  
    | 67 |  | private static final String DEFAULT_LOG4J_CONFIG = "classpath:rice-testharness-default-log4j.properties"; | 
            
  
    | 68 |  | protected static final String DEFAULT_TEST_HARNESS_SPRING_BEANS = "classpath:TestHarnessSpringBeans.xml"; | 
            
  
    | 69 |  | protected static boolean SUITE_LIFE_CYCLES_RAN = false; | 
            
  
    | 70 |  | protected static boolean SUITE_LIFE_CYCLES_FAILED = false; | 
            
  
    | 71 |  | protected static String failedSuiteTestName; | 
            
  
    | 72 |  |  | 
            
  
    | 73 |  | protected List<Lifecycle> perTestLifeCycles = new LinkedList<Lifecycle>(); | 
            
  
    | 74 |  |  | 
            
  
    | 75 |  | protected List<Lifecycle> suiteLifeCycles = new LinkedList<Lifecycle>(); | 
            
  
    | 76 |  |  | 
            
  
    | 77 |  | private static Set<String> perSuiteDataLoaderLifecycleNamesRun = new HashSet<String>(); | 
            
  
    | 78 |  |  | 
            
  
    | 79 |  | private List<String> reports = new ArrayList<String>(); | 
            
  
    | 80 |  |  | 
            
  
    | 81 |  | private SpringResourceLoader testHarnessSpringResourceLoader; | 
            
  
    | 82 |  | private boolean clearTables = true; | 
            
  
    | 83 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 9 (9) | Complexity: 2 | Complexity Density: 0.22 |  | 
  
  
    | 84 | 0 |  @Override... | 
            
  
    | 85 |  | @Before | 
            
  
    | 86 |  | public void setUp() throws Exception { | 
            
  
    | 87 | 0 | try { | 
            
  
    | 88 | 0 | configureLogging(); | 
            
  
    | 89 | 0 | logBeforeRun(); | 
            
  
    | 90 |  |  | 
            
  
    | 91 | 0 | final long initTime = System.currentTimeMillis(); | 
            
  
    | 92 |  |  | 
            
  
    | 93 | 0 | setUpInternal(); | 
            
  
    | 94 |  |  | 
            
  
    | 95 | 0 | report("Time to start all Lifecycles: " + (System.currentTimeMillis() - initTime)); | 
            
  
    | 96 |  | } catch (Throwable e) { | 
            
  
    | 97 | 0 | e.printStackTrace(); | 
            
  
    | 98 | 0 | tearDown(); | 
            
  
    | 99 | 0 | throw new RuntimeException(e); | 
            
  
    | 100 |  | } | 
            
  
    | 101 |  | } | 
            
  
    | 102 |  |  | 
            
  
    | 103 |  |  | 
            
  
    | 104 |  |  | 
            
  
    | 105 |  |  | 
            
  
    | 106 |  |  | 
            
  
    | 107 |  |  | 
            
  
    | 108 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 24 (24) | Complexity: 4 | Complexity Density: 0.2 |  | 
  
  
    | 109 | 0 |  protected void setUpInternal() throws Exception {... | 
            
  
    | 110 | 0 | assertNotNull(getModuleName()); | 
            
  
    | 111 | 0 | setModuleName(getModuleName()); | 
            
  
    | 112 | 0 | setBaseDirSystemProperty(getModuleName()); | 
            
  
    | 113 |  |  | 
            
  
    | 114 | 0 | this.perTestLifeCycles = getPerTestLifecycles(); | 
            
  
    | 115 | 0 | this.suiteLifeCycles = getSuiteLifecycles(); | 
            
  
    | 116 |  |  | 
            
  
    | 117 | 0 | if (SUITE_LIFE_CYCLES_FAILED) { | 
            
  
    | 118 | 0 | fail("Suite Lifecycles startup failed on test " + failedSuiteTestName + "!!!  Please see logs for details."); | 
            
  
    | 119 |  | } | 
            
  
    | 120 | 0 | if (!SUITE_LIFE_CYCLES_RAN) { | 
            
  
    | 121 | 0 | try { | 
            
  
    | 122 | 0 | startLifecycles(this.suiteLifeCycles); | 
            
  
    | 123 | 0 | SUITE_LIFE_CYCLES_RAN = true; | 
            
  
    | 124 |  | } catch (Throwable e) { | 
            
  
    | 125 | 0 | e.printStackTrace(); | 
            
  
    | 126 | 0 | SUITE_LIFE_CYCLES_RAN = false; | 
            
  
    | 127 | 0 | SUITE_LIFE_CYCLES_FAILED = true; | 
            
  
    | 128 | 0 | failedSuiteTestName = getFullTestName(); | 
            
  
    | 129 | 0 | tearDown(); | 
            
  
    | 130 | 0 | stopLifecycles(this.suiteLifeCycles); | 
            
  
    | 131 | 0 | throw new RuntimeException(e); | 
            
  
    | 132 |  | } | 
            
  
    | 133 |  | } | 
            
  
    | 134 |  |  | 
            
  
    | 135 | 0 | startSuiteDataLoaderLifecycles(); | 
            
  
    | 136 |  |  | 
            
  
    | 137 | 0 | startLifecycles(this.perTestLifeCycles); | 
            
  
    | 138 |  |  | 
            
  
    | 139 |  | } | 
            
  
    | 140 |  |  | 
            
  
    | 141 |  |  | 
            
  
    | 142 |  |  | 
            
  
    | 143 |  |  | 
            
  
    | 144 |  |  | 
            
  
    | 145 |  |  | 
            
  
    | 146 |  | @throws | 
            
  
    | 147 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 4 (4) | Complexity: 1 | Complexity Density: 0.25 |  | 
  
  
    | 148 | 0 |  protected void startSuiteDataLoaderLifecycles() throws Exception {... | 
            
  
    | 149 | 0 | List<Class> classes = TestUtilities.getHierarchyClassesToHandle(getClass(), new Class[] { PerSuiteUnitTestData.class }, perSuiteDataLoaderLifecycleNamesRun); | 
            
  
    | 150 | 0 | for (Class c: classes) { | 
            
  
    | 151 | 0 | new PerSuiteDataLoaderLifecycle(c).start(); | 
            
  
    | 152 | 0 | perSuiteDataLoaderLifecycleNamesRun.add(c.getName()); | 
            
  
    | 153 |  | } | 
            
  
    | 154 |  | } | 
            
  
    | 155 |  |  | 
            
  
    | 156 |  |  | 
            
  
    | 157 |  |  | 
            
  
    | 158 |  |  | 
            
  
    | 159 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 7 (7) | Complexity: 3 | Complexity Density: 1 |  | 
  
  
    | 160 | 0 |  protected void setBaseDirSystemProperty(String moduleBaseDir) {... | 
            
  
    | 161 | 0 | if (System.getProperty("basedir") == null) { | 
            
  
    | 162 | 0 | final String userDir = System.getProperty("user.dir"); | 
            
  
    | 163 |  |  | 
            
  
    | 164 | 0 | System.setProperty("basedir", userDir + ((userDir.endsWith(File.separator + "test" + File.separator + moduleBaseDir)) ? "" : File.separator + "test" + File.separator + moduleBaseDir)); | 
            
  
    | 165 |  | } | 
            
  
    | 166 |  | } | 
            
  
    | 167 |  |  | 
            
  
    | 168 |  |  | 
            
  
    | 169 |  |  | 
            
  
    | 170 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 1 (1) | Complexity: 1 | Complexity Density: 1 |  | 
  
  
    | 171 | 0 |  protected String getBaseDir() {... | 
            
  
    | 172 | 0 | return System.getProperty("basedir"); | 
            
  
    | 173 |  | } | 
            
  
    | 174 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 4 (4) | Complexity: 2 | Complexity Density: 1 |  | 
  
  
    | 175 | 0 |  protected void setModuleName(String moduleName) {... | 
            
  
    | 176 | 0 | if (System.getProperty("module.name") == null) { | 
            
  
    | 177 | 0 | System.setProperty("module.name", moduleName); | 
            
  
    | 178 |  | } | 
            
  
    | 179 |  | } | 
            
  
    | 180 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 3 (3) | Complexity: 1 | Complexity Density: 0.33 |  | 
  
  
    | 181 | 0 |  @Override... | 
            
  
    | 182 |  | @After | 
            
  
    | 183 |  | public void tearDown() throws Exception { | 
            
  
    | 184 |  |  | 
            
  
    | 185 | 0 | ThreadMonitor.tearDown(60000); | 
            
  
    | 186 | 0 | stopLifecycles(this.perTestLifeCycles); | 
            
  
    | 187 | 0 | logAfterRun(); | 
            
  
    | 188 |  | } | 
            
  
    | 189 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 4 (4) | Complexity: 1 | Complexity Density: 0.25 |  | 
  
  
    | 190 | 0 |  protected void logBeforeRun() {... | 
            
  
    | 191 | 0 | LOG.info("##############################################################"); | 
            
  
    | 192 | 0 | LOG.info("# Starting test " + getFullTestName() + "..."); | 
            
  
    | 193 | 0 | LOG.info("# " + dumpMemory()); | 
            
  
    | 194 | 0 | LOG.info("##############################################################"); | 
            
  
    | 195 |  | } | 
            
  
    | 196 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 6 (6) | Complexity: 1 | Complexity Density: 0.17 |  | 
  
  
    | 197 | 0 |  protected void logAfterRun() {... | 
            
  
    | 198 | 0 | LOG.info("##############################################################"); | 
            
  
    | 199 | 0 | LOG.info("# ...finished test " + getFullTestName()); | 
            
  
    | 200 | 0 | LOG.info("# " + dumpMemory()); | 
            
  
    | 201 | 0 | for (final String report : this.reports) { | 
            
  
    | 202 | 0 | LOG.info("# " + report); | 
            
  
    | 203 |  | } | 
            
  
    | 204 | 0 | LOG.info("##############################################################\n\n\n"); | 
            
  
    | 205 |  | } | 
            
  
    | 206 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 1 (1) | Complexity: 1 | Complexity Density: 1 |  | 
  
  
    | 207 | 0 |  protected String getFullTestName() {... | 
            
  
    | 208 | 0 | return getClass().getSimpleName() + "." + getName(); | 
            
  
    | 209 |  | } | 
            
  
    | 210 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 17 (17) | Complexity: 4 | Complexity Density: 0.31 |  | 
  
  
    | 211 | 0 |  protected void configureLogging() throws IOException {... | 
            
  
    | 212 | 0 | ResourceLoader resourceLoader = new FileSystemResourceLoader(); | 
            
  
    | 213 | 0 | String altLog4jConfigLocation = System.getProperty(ALT_LOG4J_CONFIG_LOCATION_PROP); | 
            
  
    | 214 | 0 | Resource log4jConfigResource = null; | 
            
  
    | 215 | 0 | if (!StringUtils.isEmpty(altLog4jConfigLocation)) { | 
            
  
    | 216 | 0 | log4jConfigResource = resourceLoader.getResource(altLog4jConfigLocation); | 
            
  
    | 217 |  | } | 
            
  
    | 218 | 0 | if (log4jConfigResource == null || !log4jConfigResource.exists()) { | 
            
  
    | 219 | 0 | System.out.println("Alternate Log4j config resource does not exist! " + altLog4jConfigLocation); | 
            
  
    | 220 | 0 | System.out.println("Using default log4j configuration: " + DEFAULT_LOG4J_CONFIG); | 
            
  
    | 221 | 0 | log4jConfigResource = resourceLoader.getResource(DEFAULT_LOG4J_CONFIG); | 
            
  
    | 222 |  | } else { | 
            
  
    | 223 | 0 | System.out.println("Using alternate log4j configuration at: " + altLog4jConfigLocation); | 
            
  
    | 224 |  | } | 
            
  
    | 225 | 0 | Properties p = new Properties(); | 
            
  
    | 226 | 0 | p.load(log4jConfigResource.getInputStream()); | 
            
  
    | 227 | 0 | PropertyConfigurator.configure(p); | 
            
  
    | 228 |  | } | 
            
  
    | 229 |  |  | 
            
  
    | 230 |  |  | 
            
  
    | 231 |  |  | 
            
  
    | 232 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 2 (2) | Complexity: 1 | Complexity Density: 0.5 |  | 
  
  
    | 233 | 0 |  protected void startLifecycles(List<Lifecycle> lifecycles) throws Exception {... | 
            
  
    | 234 | 0 | for (Lifecycle lifecycle : lifecycles) { | 
            
  
    | 235 | 0 | lifecycle.start(); | 
            
  
    | 236 |  | } | 
            
  
    | 237 |  | } | 
            
  
    | 238 |  |  | 
            
  
    | 239 |  |  | 
            
  
    | 240 |  |  | 
            
  
    | 241 |  |  | 
            
  
    | 242 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 15 (15) | Complexity: 5 | Complexity Density: 0.56 |  | 
  
  
    | 243 | 0 |  protected void stopLifecycles(List<Lifecycle> lifecycles) throws Exception {... | 
            
  
    | 244 | 0 | int lifecyclesSize = lifecycles.size() - 1; | 
            
  
    | 245 | 0 | for (int i = lifecyclesSize; i >= 0; i--) { | 
            
  
    | 246 | 0 | try { | 
            
  
    | 247 | 0 | if (lifecycles.get(i) == null) { | 
            
  
    | 248 | 0 | LOG.warn("Attempted to stop a null lifecycle"); | 
            
  
    | 249 |  | } else { | 
            
  
    | 250 | 0 | if (lifecycles.get(i).isStarted()) { | 
            
  
    | 251 | 0 | LOG.warn("Attempting to stop a lifecycle " + lifecycles.get(i).getClass()); | 
            
  
    | 252 | 0 | lifecycles.get(i).stop(); | 
            
  
    | 253 |  | } | 
            
  
    | 254 |  | } | 
            
  
    | 255 |  | } catch (Exception e) { | 
            
  
    | 256 | 0 | LOG.error("Failed to shutdown one of the lifecycles!", e); | 
            
  
    | 257 |  | } | 
            
  
    | 258 |  | } | 
            
  
    | 259 |  | } | 
            
  
    | 260 |  |  | 
            
  
    | 261 |  |  | 
            
  
    | 262 |  |  | 
            
  
    | 263 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 15 (15) | Complexity: 3 | Complexity Density: 0.27 |  | 
  
  
    | 264 | 0 |  protected List<Lifecycle> getSuiteLifecycles() {... | 
            
  
    | 265 | 0 | List<Lifecycle> lifecycles = new LinkedList<Lifecycle>(); | 
            
  
    | 266 |  |  | 
            
  
    | 267 |  |  | 
            
  
    | 268 |  |  | 
            
  
    | 269 |  |  | 
            
  
    | 270 | 0 | lifecycles.add(new BaseLifecycle() { | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 3 (3) | Complexity: 1 | Complexity Density: 0.33 |  | 
  
  
    | 271 | 0 |  @Override... | 
            
  
    | 272 |  | public void start() throws Exception { | 
            
  
    | 273 | 0 | Config config = getTestHarnessConfig(); | 
            
  
    | 274 | 0 | ConfigContext.init(config); | 
            
  
    | 275 | 0 | super.start(); | 
            
  
    | 276 |  | } | 
            
  
    | 277 |  | }); | 
            
  
    | 278 |  |  | 
            
  
    | 279 |  |  | 
            
  
    | 280 |  |  | 
            
  
    | 281 |  |  | 
            
  
    | 282 | 0 | lifecycles.add(getTestHarnessSpringResourceLoader()); | 
            
  
    | 283 |  |  | 
            
  
    | 284 |  |  | 
            
  
    | 285 |  |  | 
            
  
    | 286 |  |  | 
            
  
    | 287 |  |  | 
            
  
    | 288 | 0 | lifecycles.add(new BaseLifecycle() { | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 2 (2) | Complexity: 1 | Complexity Density: 0.5 |  | 
  
  
    | 289 | 0 |  @Override... | 
            
  
    | 290 |  | public void start() throws Exception { | 
            
  
    | 291 | 0 | TestHarnessServiceLocator.setContext(getTestHarnessSpringResourceLoader().getContext()); | 
            
  
    | 292 | 0 | super.start(); | 
            
  
    | 293 |  | } | 
            
  
    | 294 |  | }); | 
            
  
    | 295 |  |  | 
            
  
    | 296 |  |  | 
            
  
    | 297 |  |  | 
            
  
    | 298 |  |  | 
            
  
    | 299 | 0 | if (clearTables) { | 
            
  
    | 300 | 0 | lifecycles.add(new ClearDatabaseLifecycle()); | 
            
  
    | 301 |  | } | 
            
  
    | 302 |  |  | 
            
  
    | 303 |  |  | 
            
  
    | 304 |  |  | 
            
  
    | 305 |  |  | 
            
  
    | 306 | 0 | lifecycles.add(new BaseLifecycle() { | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 2 (2) | Complexity: 1 | Complexity Density: 0.5 |  | 
  
  
    | 307 | 0 |  @Override... | 
            
  
    | 308 |  | public void start() throws Exception { | 
            
  
    | 309 | 0 | loadSuiteTestData(); | 
            
  
    | 310 | 0 | super.start(); | 
            
  
    | 311 |  | } | 
            
  
    | 312 |  | }); | 
            
  
    | 313 |  |  | 
            
  
    | 314 | 0 | Lifecycle loadApplicationLifecycle = getLoadApplicationLifecycle(); | 
            
  
    | 315 | 0 | if (loadApplicationLifecycle != null) { | 
            
  
    | 316 | 0 | lifecycles.add(loadApplicationLifecycle); | 
            
  
    | 317 |  | } | 
            
  
    | 318 | 0 | return lifecycles; | 
            
  
    | 319 |  | } | 
            
  
    | 320 |  |  | 
            
  
    | 321 |  |  | 
            
  
    | 322 |  |  | 
            
  
    | 323 |  |  | 
            
  
    | 324 |  |  | 
            
  
    | 325 |  |  | 
            
  
    | 326 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 1 (1) | Complexity: 1 | Complexity Density: 1 |  | 
  
  
    | 327 | 0 |  protected Lifecycle getLoadApplicationLifecycle() {... | 
            
  
    | 328 |  |  | 
            
  
    | 329 | 0 | return null; | 
            
  
    | 330 |  | } | 
            
  
    | 331 |  |  | 
            
  
    | 332 |  |  | 
            
  
    | 333 |  | @return | 
            
  
    | 334 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 4 (4) | Complexity: 1 | Complexity Density: 0.25 |  | 
  
  
    | 335 | 0 |  protected List<Lifecycle> getPerTestLifecycles() {... | 
            
  
    | 336 | 0 | List<Lifecycle> lifecycles = new LinkedList<Lifecycle>(); | 
            
  
    | 337 | 0 | lifecycles.add(getPerTestDataLoaderLifecycle()); | 
            
  
    | 338 | 0 | lifecycles.add(new BaseLifecycle() { | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 2 (2) | Complexity: 1 | Complexity Density: 0.5 |  | 
  
  
    | 339 | 0 |  @Override... | 
            
  
    | 340 |  | public void start() throws Exception { | 
            
  
    | 341 | 0 | loadPerTestData(); | 
            
  
    | 342 | 0 | super.start(); | 
            
  
    | 343 |  | } | 
            
  
    | 344 |  | }); | 
            
  
    | 345 | 0 | return lifecycles; | 
            
  
    | 346 |  | } | 
            
  
    | 347 |  |  | 
            
  
    | 348 |  |  | 
            
  
    | 349 |  |  | 
            
  
    | 350 |  |  | 
               
        |  |  | 
           
           |  | - | Uncovered Elements: 0 (0) | Complexity: 1 | Complexity Density: - |  | 
  
  
    | 351 | 0 |  protected void loadSuiteTestData() throws Exception {... | 
            
  
    | 352 |  |  | 
            
  
    | 353 |  | } | 
            
  
    | 354 |  |  | 
            
  
    | 355 |  |  | 
            
  
    | 356 |  |  | 
            
  
    | 357 |  |  | 
               
        |  |  | 
           
           |  | - | Uncovered Elements: 0 (0) | Complexity: 1 | Complexity Density: - |  | 
  
  
    | 358 | 0 |  protected void loadPerTestData() throws Exception {... | 
            
  
    | 359 |  |  | 
            
  
    | 360 |  | } | 
            
  
    | 361 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 1 (1) | Complexity: 1 | Complexity Density: 1 |  | 
  
  
    | 362 | 0 |  protected void report(final String report) {... | 
            
  
    | 363 | 0 | this.reports.add(report); | 
            
  
    | 364 |  | } | 
            
  
    | 365 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 4 (4) | Complexity: 1 | Complexity Density: 0.25 |  | 
  
  
    | 366 | 0 |  protected String dumpMemory() {... | 
            
  
    | 367 | 0 | final long total = Runtime.getRuntime().totalMemory(); | 
            
  
    | 368 | 0 | final long free = Runtime.getRuntime().freeMemory(); | 
            
  
    | 369 | 0 | final long max = Runtime.getRuntime().maxMemory(); | 
            
  
    | 370 | 0 | return "[Memory] max: " + max + ", total: " + total + ", free: " + free; | 
            
  
    | 371 |  | } | 
            
  
    | 372 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 5 (5) | Complexity: 2 | Complexity Density: 0.67 |  | 
  
  
    | 373 | 0 |  public SpringResourceLoader getTestHarnessSpringResourceLoader() {... | 
            
  
    | 374 | 0 | if (testHarnessSpringResourceLoader == null) { | 
            
  
    | 375 | 0 | testHarnessSpringResourceLoader = new SpringResourceLoader(new QName("TestHarnessSpringContext"), getTestHarnessSpringBeansLocation(), null); | 
            
  
    | 376 |  | } | 
            
  
    | 377 | 0 | return testHarnessSpringResourceLoader; | 
            
  
    | 378 |  | } | 
            
  
    | 379 |  |  | 
            
  
    | 380 |  |  | 
            
  
    | 381 |  |  | 
            
  
    | 382 |  |  | 
            
  
    | 383 |  | @return | 
            
  
    | 384 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 1 (1) | Complexity: 1 | Complexity Density: 1 |  | 
  
  
    | 385 | 0 |  protected List<String> getTestHarnessSpringBeansLocation() {... | 
            
  
    | 386 | 0 | return Collections.singletonList( DEFAULT_TEST_HARNESS_SPRING_BEANS ); | 
            
  
    | 387 |  | } | 
            
  
    | 388 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 3 (3) | Complexity: 1 | Complexity Density: 0.33 |  | 
  
  
    | 389 | 0 |  protected Config getTestHarnessConfig() throws Exception {... | 
            
  
    | 390 | 0 | Config config = new JAXBConfigImpl(getConfigLocations(), System.getProperties()); | 
            
  
    | 391 | 0 | config.parseConfig(); | 
            
  
    | 392 | 0 | return config; | 
            
  
    | 393 |  | } | 
            
  
    | 394 |  |  | 
            
  
    | 395 |  |  | 
            
  
    | 396 |  |  | 
            
  
    | 397 |  |  | 
            
  
    | 398 |  | @return | 
            
  
    | 399 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 4 (4) | Complexity: 1 | Complexity Density: 0.25 |  | 
  
  
    | 400 | 0 |  protected List<String> getConfigLocations() {... | 
            
  
    | 401 | 0 | List<String> configLocations = new ArrayList<String>(); | 
            
  
    | 402 | 0 | configLocations.add(getRiceMasterDefaultConfigFile()); | 
            
  
    | 403 | 0 | configLocations.add(getModuleTestConfigLocation()); | 
            
  
    | 404 | 0 | return configLocations; | 
            
  
    | 405 |  | } | 
            
  
    | 406 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 1 (1) | Complexity: 1 | Complexity Density: 1 |  | 
  
  
    | 407 | 0 |  protected String getModuleTestConfigLocation() {... | 
            
  
    | 408 | 0 | return "classpath:META-INF/" + getModuleName().toLowerCase() + "-test-config.xml"; | 
            
  
    | 409 |  | } | 
            
  
    | 410 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 1 (1) | Complexity: 1 | Complexity Density: 1 |  | 
  
  
    | 411 | 0 |  protected String getRiceMasterDefaultConfigFile() {... | 
            
  
    | 412 | 0 | return "classpath:META-INF/test-config-defaults.xml"; | 
            
  
    | 413 |  | } | 
            
  
    | 414 |  |  | 
            
  
    | 415 |  |  | 
            
  
    | 416 |  |  | 
            
  
    | 417 |  |  | 
            
  
    | 418 |  | @return | 
            
  
    | 419 |  |  | 
            
  
    | 420 |  | protected abstract String getModuleName(); | 
            
  
    | 421 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 1 (1) | Complexity: 1 | Complexity Density: 1 |  | 
  
  
    | 422 | 0 |  protected void setClearTables(boolean clearTables) {... | 
            
  
    | 423 | 0 | this.clearTables = clearTables; | 
            
  
    | 424 |  | } | 
            
  
    | 425 |  |  | 
            
  
    | 426 |  | } |