public void run() { ProjectData.saveGlobalProjectData(); }
public void run() { ProjectData.saveGlobalProjectData(); } }
public void run() { ProjectData.saveGlobalProjectData(); }
private static void initialize() { // Hack for Tomcat - by saving project data right now we force loading // of classes involved in this process (like ObjectOutputStream) // so that it won't be necessary to load them on JVM shutdown if (System.getProperty("catalina.home") != null) { saveGlobalProjectData(); // Force the class loader to load some classes that are // required by our JVM shutdown hook. // TODO: Use ClassLoader.loadClass("whatever"); instead ClassData.class.toString(); CoverageData.class.toString(); CoverageDataContainer.class.toString(); FileLocker.class.toString(); HasBeenInstrumented.class.toString(); LineData.class.toString(); PackageData.class.toString(); SourceFileData.class.toString(); } // Add a hook to save the data when the JVM exits saveTimer = new SaveTimer(); Runtime.getRuntime().addShutdownHook(new Thread(saveTimer)); // Possibly also save the coverage data every x seconds? //Timer timer = new Timer(true); //timer.schedule(saveTimer, 100); }
private static void initialize() { // Hack for Tomcat - by saving project data right now we force loading // of classes involved in this process (like ObjectOutputStream) // so that it won't be necessary to load them on JVM shutdown if (System.getProperty("catalina.home") != null) { saveGlobalProjectData(); // Force the class loader to load some classes that are // required by our JVM shutdown hook. // TODO: Use ClassLoader.loadClass("whatever"); instead ClassData.class.toString(); CoverageData.class.toString(); CoverageDataContainer.class.toString(); FileLocker.class.toString(); LineData.class.toString(); PackageData.class.toString(); SourceFileData.class.toString(); } // Add a hook to save the data when the JVM exits shutdownHook = new Thread(new SaveTimer()); Runtime.getRuntime().addShutdownHook(shutdownHook); // Possibly also save the coverage data every x seconds? //Timer timer = new Timer(true); //timer.schedule(saveTimer, 100); }
public static void saveGlobalProjectDataWithTomcatInits() { // Hack for Tomcat - by saving project data right now we force loading // of classes involved in this process (like ObjectOutputStream) // so that it won't be necessary to load them on JVM shutdown if (System.getProperty("catalina.home") != null) { ProjectData.saveGlobalProjectData(); // Force the class loader to load some classes that are // required by our JVM shutdown hook. // TODO: Use ClassLoader.loadClass("whatever"); instead ClassData.class.toString(); CoverageData.class.toString(); CoverageDataContainer.class.toString(); FileLocker.class.toString(); LineData.class.toString(); PackageData.class.toString(); SourceFileData.class.toString(); } // Add a hook to save the data when the JVM exits Runtime.getRuntime().addShutdownHook(new Thread(new SaveTimer())); // Possibly also save the coverage data every x seconds? //Timer timer = new Timer(true); //timer.schedule(saveTimer, 100); } }
private static void initialize() { // Hack for Tomcat - by saving project data right now we force loading // of classes involved in this process (like ObjectOutputStream) // so that it won't be necessary to load them on JVM shutdown if (System.getProperty("catalina.home") != null) { saveGlobalProjectData(); // Force the class loader to load some classes that are // required by our JVM shutdown hook. // TODO: Use ClassLoader.loadClass("whatever"); instead ClassData.class.toString(); CoverageData.class.toString(); CoverageDataContainer.class.toString(); FileLocker.class.toString(); LineData.class.toString(); PackageData.class.toString(); SourceFileData.class.toString(); } // Add a hook to save the data when the JVM exits shutdownHook = new Thread(new SaveTimer()); Runtime.getRuntime().addShutdownHook(shutdownHook); // Possibly also save the coverage data every x seconds? //Timer timer = new Timer(true); //timer.schedule(saveTimer, 100); }
void rollCobertura() { String cobFileName = coverageFileName(); if (cobFileName == null) { throw new RuntimeException("Cobertura data file is not defined; use System property " + COB_FILE_PROP + " or a cobertura.properties file in the classpath." ); } try { ProjectData.saveGlobalProjectData(); File cser = new File(cobFileName); if (!cser.exists()) { throw new RuntimeException("No cobertura file at " + cobFileName); } db = new PropDb(); db.read(cser.getParentFile()); copyFileToPerPackageArchive(cser); int count = 0; if (db.getCount() != null) { count = db.getCount(); } db.setCount(count + 1); db.setPackageName(currentPackage); db.write(cser.getParentFile()); } catch (Throwable t) { throw new RuntimeException("Failed to roll cobertura file: " + t, t); } }