ch.elca.el4j.coberturaruntime
Class CoberturaRuntimeControllerImpl

java.lang.Object
  extended by ch.elca.el4j.coberturaruntime.CoberturaRuntimeControllerImpl
All Implemented Interfaces:
CoberturaRuntimeController

public class CoberturaRuntimeControllerImpl
extends Object
implements CoberturaRuntimeController

Bean to control the cobertura runtime behavior.

Author:
Martin Zeltner (MZE)
File-location:
CoberturaRuntimeControllerImpl
Last check-in date:
2009-12-01 10:59:54 +0100 (Di, 01. Dez 2009) by jonasha for revision 4010

Field Summary
static String COBERTURA_RUNTIME_DATA_DIRECTORY
          Property key for the cobertura data directory.
static String COBERTURA_RUNTIME_DATA_FILENAME
          Property key for the cobertura data filename.
static String COBERTURA_RUNTIME_KEEP_REPORTS
          Property key for the cobertura keep reports flag.
static String COBERTURA_RUNTIME_SRC_COL_DIR_NAME
          Property key for the cobertura data directory.
protected  File m_coberturaCollectedSourcesDirectory
          Is the directory where the collected sources are.
protected  File m_coberturaDataDirectory
          Is the cobertura data directory where all info will be saved.
protected  String m_coberturaDataFilename
          Is the cobertura data filename.
protected  boolean m_isOfflineMode
          If false the controller is running in online mode.
protected  boolean m_keepReports
          If true every report will have its own directory.
 
Constructor Summary
CoberturaRuntimeControllerImpl()
          Constructor to init the cobertura data directory in online mode.
CoberturaRuntimeControllerImpl(boolean offlineMode)
          Constructor to init the cobertura data directory.
 
Method Summary
 void flushRecords()
          Flushes the made records to the given data file.
 String generateReport()
          Generates the cobertura report of the current state.
 String getDataFilePath()
          
 boolean isRecording()
          
protected  void setGlobalCoverageDataAndDataFile(net.sourceforge.cobertura.coveragedata.ProjectData coverageData, File coberturaDataFile)
          Sets the global coverage data and the data file via reflection, due this point is really poorly made in cobertura.
 boolean startRecording()
          Starts recording of cobertura.
 boolean stopRecording()
          Stops recording of cobertura.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COBERTURA_RUNTIME_DATA_DIRECTORY

public static final String COBERTURA_RUNTIME_DATA_DIRECTORY
Property key for the cobertura data directory.

See Also:
Constant Field Values

COBERTURA_RUNTIME_DATA_FILENAME

public static final String COBERTURA_RUNTIME_DATA_FILENAME
Property key for the cobertura data filename.

See Also:
Constant Field Values

COBERTURA_RUNTIME_SRC_COL_DIR_NAME

public static final String COBERTURA_RUNTIME_SRC_COL_DIR_NAME
Property key for the cobertura data directory.

See Also:
Constant Field Values

COBERTURA_RUNTIME_KEEP_REPORTS

public static final String COBERTURA_RUNTIME_KEEP_REPORTS
Property key for the cobertura keep reports flag.

See Also:
Constant Field Values

m_coberturaDataDirectory

protected final File m_coberturaDataDirectory
Is the cobertura data directory where all info will be saved.


m_coberturaDataFilename

protected final String m_coberturaDataFilename
Is the cobertura data filename.


m_coberturaCollectedSourcesDirectory

protected final File m_coberturaCollectedSourcesDirectory
Is the directory where the collected sources are.


m_keepReports

protected final boolean m_keepReports
If true every report will have its own directory.


m_isOfflineMode

protected final boolean m_isOfflineMode
If false the controller is running in online mode.

Constructor Detail

CoberturaRuntimeControllerImpl

public CoberturaRuntimeControllerImpl()
Constructor to init the cobertura data directory in online mode.


CoberturaRuntimeControllerImpl

public CoberturaRuntimeControllerImpl(boolean offlineMode)
Constructor to init the cobertura data directory.

Parameters:
offlineMode - true if no app is running.
Method Detail

startRecording

public boolean startRecording()
Starts recording of cobertura.

Specified by:
startRecording in interface CoberturaRuntimeController
Returns:
Returns true if the recording could be started and cobertura was not already running.

stopRecording

public boolean stopRecording()
Stops recording of cobertura.

Specified by:
stopRecording in interface CoberturaRuntimeController
Returns:
Returns true if the recording could be stopped and cobertura was not already stopped.

setGlobalCoverageDataAndDataFile

protected void setGlobalCoverageDataAndDataFile(net.sourceforge.cobertura.coveragedata.ProjectData coverageData,
                                                File coberturaDataFile)
Sets the global coverage data and the data file via reflection, due this point is really poorly made in cobertura.

Parameters:
coverageData - Is the loaded cobertura data.
coberturaDataFile - Is the file reference of the cobertura data.

isRecording

public boolean isRecording()

Specified by:
isRecording in interface CoberturaRuntimeController
Returns:
Returns true if cobertura is currently recording.

flushRecords

public void flushRecords()
Flushes the made records to the given data file.

Specified by:
flushRecords in interface CoberturaRuntimeController

getDataFilePath

public String getDataFilePath()

Specified by:
getDataFilePath in interface CoberturaRuntimeController
Returns:
Returns the path to the cobertura data file.

generateReport

public String generateReport()
Generates the cobertura report of the current state.

Specified by:
generateReport in interface CoberturaRuntimeController
Returns:
Returns the directory path of the generated report.


Copyright © 2005-2011 ELCA. All Rights Reserved.