01: package csdl.jblanket;
02:
03: import csdl.jblanket.methodset.MethodSet;
04: import csdl.jblanket.modifier.MethodCollector;
05: import csdl.jblanket.util.MethodCategories;
06:
07: import java.io.File;
08: import java.io.IOException;
09:
10: /**
11: * Provides description for two main classes in the system: Modifier and JBlanketReport.
12: *
13: * @author Joy M. Agustin
14: * @version $Id: JBlanket.java,v 1.3 2005/02/21 20:28:42 timshadel Exp $
15: */
16: public abstract class JBlanket {
17:
18: /** Describes if JBlanket should execute in verbose mode */
19: protected boolean verbose = false;
20:
21: /** Describes if one-line methods should be excluded from the coverage measurement */
22: protected boolean excludeOneLineMethods = false;
23: /** Describes if constructors should be excluded from the coverage measurement */
24: protected boolean excludeConstructors = false;
25: /** Describes if a file should be used to exclude methods from the coverage measurement */
26: protected boolean excludeIndividualMethods = false;
27:
28: /** Output directory for JBlanket */
29: protected static String jblanketDir;
30:
31: /** Container for all methods */
32: protected MethodSet totalSet;
33: /** Container for one-line methods */
34: protected MethodSet oneLineSet;
35: /** Container for constructors */
36: protected MethodSet constructorSet;
37: /** Container for untestable methods */
38: protected MethodSet untestableSet;
39:
40: /** Container for all method categories */
41: protected MethodCategories categories;
42:
43: /**
44: * Constructs a new JBlanket instance. Sets <code>jblanketDir</code> from the system property.
45: * If it does not exist, the JBlanket output directory is created
46: * (see MethodCollector.getJBlanketDir method).
47: */
48: public JBlanket() {
49: // add paths to files so they all end up in the same place
50: JBlanket.jblanketDir = MethodCollector.getJBlanketDir();
51: this .categories = MethodCategories.getInstance();
52:
53: }
54:
55: /**
56: * Stores all the method information from <code>methodSet</code> to file <code>fileName</code>.
57: *
58: * @param methodSet the collection of method information to store.
59: * @param file the output file.
60: * @throws IOException if cannot write to <code>fileName</code>.
61: */
62: protected abstract void storeMethods(MethodSet methodSet, File file)
63: throws IOException;
64: }
|