EMMA Coverage Report (generated Sat Jun 02 16:47:50 EDT 2012)
[all classes][net.sf.madmap]

COVERAGE SUMMARY FOR SOURCE FILE [MadmapMain.java]

nameclass, %method, %block, %line, %
MadmapMain.java100% (1/1)70%  (14/20)23%  (73/315)29%  (29/101)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class MadmapMain100% (1/1)70%  (14/20)23%  (73/315)29%  (29/101)
MadmapMain (): void 0%   (0/1)0%   (0/3)0%   (0/1)
guiNotify (): void 0%   (0/1)0%   (0/15)0%   (0/4)
main (String []): void 0%   (0/1)0%   (0/187)0%   (0/56)
runAnalysis (): boolean 0%   (0/1)0%   (0/2)0%   (0/1)
usage (): void 0%   (0/1)0%   (0/6)0%   (0/2)
waitForGui (): void 0%   (0/1)0%   (0/29)0%   (0/8)
<static initializer> 100% (1/1)100% (45/45)100% (16/16)
appContext (): ApplicationContext 100% (1/1)100% (2/2)100% (1/1)
concurrency (): int 100% (1/1)100% (2/2)100% (1/1)
getSaveMemberNames (): boolean 100% (1/1)100% (2/2)100% (1/1)
jdk14_compatible (): boolean 100% (1/1)100% (2/2)100% (1/1)
noGUI (): boolean 100% (1/1)100% (2/2)100% (1/1)
printFinalizers (): boolean 100% (1/1)100% (2/2)100% (1/1)
runDump (): boolean 100% (1/1)100% (2/2)100% (1/1)
runRecursiveChildrenSize (): boolean 100% (1/1)100% (2/2)100% (1/1)
runSystemGC (): boolean 100% (1/1)100% (2/2)100% (1/1)
setSaveMemberNames (boolean): void 100% (1/1)100% (3/3)100% (1/1)
setVerbose (boolean): void 100% (1/1)100% (3/3)100% (1/1)
testFeature (): boolean 100% (1/1)100% (2/2)100% (1/1)
verbose (): boolean 100% (1/1)100% (2/2)100% (1/1)

1/**
2 * 
3 */
4package net.sf.madmap;
5 
6import java.lang.management.ManagementFactory;
7 
8import javax.management.MBeanServer;
9import javax.management.ObjectName;
10import javax.swing.JOptionPane;
11import org.springframework.context.*;
12import org.springframework.context.support.*;
13/**
14 * MadmapMain is the main class of the application, it launches the primordial
15 * window or starts execution if running cmd-line only.
16 * 
17 * @author ecaspole
18 *
19 */
20public class MadmapMain {
21 
22        static boolean _runDumpPhase     = false;
23        static boolean _runAnalysisPhase = true;
24        static int     _concurrency      = Runtime.getRuntime().availableProcessors();  // 1;
25        static int     _running          = 0;
26        static boolean _verbose          = false;
27        static boolean _saveMemberNames  = true;
28        static boolean _printFinalizers   = true;
29        static boolean _do_recursive_children_size   = false;
30        static boolean _do_gc             = false;
31        static boolean  _jdk14_compatible = true;
32        static boolean  _nogui            = false;
33        static boolean  _testFeature      = false;
34        
35        static ApplicationContext  _appContext      = new ClassPathXmlApplicationContext("madmapContext.xml");
36        
37        public static ApplicationContext appContext()           { return _appContext; }
38        static ILogger        _logger = (ILogger)(MadmapMain.appContext()).getBean("logger");
39  static IResources        _resources = (IResources)(MadmapMain.appContext()).getBean("resources");
40 
41        static Object   _guiLock    = new Object();
42 
43        public static void guiNotify() {
44                synchronized( _guiLock ) {
45                        _guiLock.notify();
46                }
47        }
48 
49  public static boolean runDump()           { return _runDumpPhase; }
50  public static boolean runAnalysis()       { return _runAnalysisPhase; }
51  public static boolean runSystemGC()       { return _do_gc; }
52  public static boolean runRecursiveChildrenSize()       { return _do_recursive_children_size; }
53  public static void    setVerbose(boolean newVal)           {  _verbose = newVal; }
54  public static boolean verbose()           { return _verbose; }
55  public static void    setSaveMemberNames(boolean newVal)           {  _saveMemberNames = newVal; }
56  public static boolean getSaveMemberNames()           { return _saveMemberNames; }
57 
58  public static boolean printFinalizers()   { return _printFinalizers; }
59  public static boolean noGUI()             { return _nogui; }
60  public static boolean testFeature()      { return _testFeature; }
61  public static boolean jdk14_compatible()  { return _jdk14_compatible; }
62  public static int     concurrency()       { return _concurrency; }
63        
64        public static void waitForGui() {
65                try {
66                        synchronized( _guiLock ) {
67                                _guiLock.wait();
68                        }
69                } catch( InterruptedException ie ) {
70                        System. out. println ( "Error opening file : Caught " + ie );
71                        ie.printStackTrace();
72                }
73        }
74 
75  public static void usage() {    
76    System.out.println(_resources.getString("usageStrs"));
77  }
78 
79        /**
80         * @param args
81         */
82        public static void main( String argv[] )
83        {
84                String  name        = null;
85                String  arg;
86                boolean seenFile    = false;
87                boolean firstTime   = true;
88 
89                try {
90                        for ( int i = 0; i < argv.length; i++ ) {
91                                if ( argv[ i ].equals( "-d" ) ) {
92                                        _runDumpPhase = true;
93                                } else if ( argv[ i ].equals( "-a" ) ) {
94                                        _runAnalysisPhase = true;
95                                } else if ( argv[ i ].equals( "-c" ) ) {
96                                        _do_gc = true;
97                                } else if ( argv[ i ].equals( "-f" ) ) {
98                                        _printFinalizers = true;
99                                } else if ( argv[ i ].equals( "-h" ) ) {
100                                        usage();
101                                        return;
102                                } else if ( argv[ i ].equals( "-n" ) ) {
103                                        _nogui = true;
104                                } else if ( argv[ i ].equals( "-m" ) ) {
105                                        _saveMemberNames = false;
106                                } else if ( argv[ i ].equals( "-r" ) ) {
107                                        _do_recursive_children_size = true;
108                                } else if ( argv[ i ].equals( "-u" ) ) {
109                                        _concurrency = 1;
110                                } else if ( argv[ i ].equals( "-x" ) ) {
111                                        _testFeature = true;
112 
113                                } else if ( argv[ i ].equals( "-v" ) ) {
114                                        _verbose = true;
115                                        //} else if ( argv[ i ].equals( "-y" ) ) {
116                                        //  _jdk14_compatible = true;
117                                } else {
118                                        if (argv[ i ].startsWith("-") == false) {
119                                                if ( seenFile == false ) {
120                                                        name = argv[ i ];
121                                                        seenFile = true;
122                                                } else {
123                                                        System.out.println( "Unknown:" + argv[ i ] );
124                                                        usage();
125                                                        return;
126                                                }
127                                        }
128                                }
129                        }
130                } catch (ArrayIndexOutOfBoundsException e) { // argv is empty
131                        System.out.println("Must specify an argument");
132                        usage();
133                        return;
134                }
135 
136                usage();
137 
138                if ( _nogui ) {
139                        try {
140                                Madmap        app = new Madmap( name );
141                                app.init();
142                        } catch (OutOfMemoryError e) { 
143                                System.out.println("OutOfMemoryError in main thread. Relaunch Madmap with larger heap size.");
144                                e.printStackTrace();
145                                System.exit(-1);
146                        } catch (Exception e) { 
147                                System.out.println("Exception in main: " + e);
148                                e.printStackTrace();
149                                return;
150                        }
151                } else { 
152                        MainWindow.init();
153                        waitForGui();
154 
155                        //System. out. println ( "======== All System Properties ========" );
156                        //System.getProperties().list(System. out);
157                        //System. out. println ( "=======================================" );
158 
159                        while ( true ) {
160                                waitForGui();
161                        }
162                }
163        }
164}

[all classes][net.sf.madmap]
EMMA 2.0.5312 (C) Vladimir Roubtsov