Source Code Cross Referenced for ClassMarkSetUTest.java in  » Test-Coverage » GroboUtils » net » sourceforge » groboutils » codecoverage » v2 » report » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Test Coverage » GroboUtils » net.sourceforge.groboutils.codecoverage.v2.report 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * @(#)ClassMarkSetUTest.java
003:         *
004:         * Copyright (C) 2003 Matt Albrecht
005:         * groboclown@users.sourceforge.net
006:         * http://groboutils.sourceforge.net
007:         *
008:         *  Permission is hereby granted, free of charge, to any person obtaining a
009:         *  copy of this software and associated documentation files (the "Software"),
010:         *  to deal in the Software without restriction, including without limitation
011:         *  the rights to use, copy, modify, merge, publish, distribute, sublicense,
012:         *  and/or sell copies of the Software, and to permit persons to whom the 
013:         *  Software is furnished to do so, subject to the following conditions:
014:         *
015:         *  The above copyright notice and this permission notice shall be included in 
016:         *  all copies or substantial portions of the Software. 
017:         *
018:         *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
019:         *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
020:         *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL 
021:         *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
022:         *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
023:         *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
024:         *  DEALINGS IN THE SOFTWARE.
025:         */
026:
027:        package net.sourceforge.groboutils.codecoverage.v2.report;
028:
029:        import java.util.ArrayList;
030:        import java.util.List;
031:
032:        import junit.framework.Test;
033:        import junit.framework.TestCase;
034:        import junit.framework.TestSuite;
035:        import net.sourceforge.groboutils.autodoc.v1.AutoDoc;
036:        import net.sourceforge.groboutils.codecoverage.v2.CCCreatorUtil;
037:        import net.sourceforge.groboutils.codecoverage.v2.IAnalysisMetaData;
038:        import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule;
039:        import net.sourceforge.groboutils.codecoverage.v2.IChannelLogRecord;
040:        import net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecord;
041:        import net.sourceforge.groboutils.codecoverage.v2.datastore.MarkRecord;
042:        import net.sourceforge.groboutils.codecoverage.v2.logger.DefaultChannelLogRecord;
043:
044:        /**
045:         * Tests the ClassMarkSet class.
046:         *
047:         * @author    Matt Albrecht <a href="mailto:groboclown@users.sourceforge.net">groboclown@users.sourceforge.net</a>
048:         * @version   $Date: 2004/04/15 05:48:29 $
049:         * @since     January 22, 2003
050:         */
051:        public class ClassMarkSetUTest extends TestCase {
052:            //-------------------------------------------------------------------------
053:            // Standard JUnit Class-specific declarations
054:
055:            private static final Class THIS_CLASS = ClassMarkSetUTest.class;
056:            private static final AutoDoc DOC = new AutoDoc(THIS_CLASS);
057:
058:            public ClassMarkSetUTest(String name) {
059:                super (name);
060:            }
061:
062:            //-------------------------------------------------------------------------
063:            // Tests
064:
065:            public void testConstructor1() {
066:                try {
067:                    new ClassMarkSet(null, null, null, null);
068:                    fail("Did not throw IllegalArgumentException.");
069:                } catch (IllegalArgumentException ex) {
070:                    // test exception
071:                }
072:            }
073:
074:            public void testConstructor2() {
075:                try {
076:                    new ClassMarkSet(
077:                            "a",
078:                            new String[] { "1", "2" },
079:                            new MarkRecord[] { createMarkRecord(0, "1", "2", 3), },
080:                            null);
081:                    fail("Did not throw IllegalArgumentException.");
082:                } catch (IllegalArgumentException ex) {
083:                    // test exception
084:                }
085:            }
086:
087:            public void testConstructor3() {
088:                try {
089:                    new ClassMarkSet("a", new String[] { "1", "2" }, null,
090:                            new IChannelLogRecord[] { createChannelLogRecord(
091:                                    "a.M", 0, 0), });
092:                    fail("Did not throw IllegalArgumentException.");
093:                } catch (IllegalArgumentException ex) {
094:                    // test exception
095:                }
096:            }
097:
098:            public void testConstructor4() {
099:                try {
100:                    new ClassMarkSet("a", new String[] { "1", "2" },
101:                            new MarkRecord[1], new IChannelLogRecord[1]);
102:                    fail("Did not throw IllegalArgumentException.");
103:                } catch (IllegalArgumentException ex) {
104:                    // test exception
105:                }
106:            }
107:
108:            public void testConstructor5() {
109:                try {
110:                    new ClassMarkSet("a.Name", new String[] { "1", "2" },
111:                            processMarks("a.Name",
112:                                    new MarkRecord[] { createMarkRecord(0, "1",
113:                                            "2", 3), }),
114:                            new IChannelLogRecord[1]);
115:                    fail("Did not throw IllegalArgumentException.");
116:                } catch (IllegalArgumentException ex) {
117:                    // test exception
118:                }
119:            }
120:
121:            public void testConstructor5a() {
122:                try {
123:                    new ClassMarkSet(
124:                            "a",
125:                            new String[] { "1", "2" },
126:                            new MarkRecord[] { createMarkRecord(0, "1", "2", 3), },
127:                            new IChannelLogRecord[1]);
128:                    fail("Did not throw IllegalStateException.");
129:                } catch (IllegalStateException ex) {
130:                    // test exception
131:                    assertTrue("Did not fail due to process.", ex.getMessage()
132:                            .indexOf("process") >= 0);
133:                }
134:            }
135:
136:            public void testConstructor6() {
137:                try {
138:                    new ClassMarkSet("a", new String[] { "1", "2" },
139:                            new MarkRecord[1],
140:                            new IChannelLogRecord[] { createChannelLogRecord(
141:                                    "a.M", 0, 0), });
142:                    fail("Did not throw IllegalArgumentException.");
143:                } catch (IllegalArgumentException ex) {
144:                    // test exception
145:                }
146:                //ClassMarkSet( MarkRecord[] marks, IChannelLogRecord[] classLogs )
147:            }
148:
149:            public void testConstructor7() {
150:                try {
151:                    new ClassMarkSet("a.M", new String[] { "1", "2" },
152:                            processMarks("a.M",
153:                                    new MarkRecord[] { createMarkRecord(0, "1",
154:                                            "2", 10), }),
155:                            new IChannelLogRecord[] { createChannelLogRecord(
156:                                    "a.M", 0, 0), });
157:                    fail("Did not throw IllegalArgumentException.");
158:                } catch (IllegalArgumentException iae) {
159:                    /*
160:                    assertTrue(
161:                        "Did not mention mark 0 ["+iae.getMessage()+"].",
162:                        iae.getMessage().indexOf( "mark 0" ) >= 0 );
163:                     */
164:                }
165:            }
166:
167:            public void testConstructor8() {
168:                new ClassMarkSet("a.M", new String[] { "2", "1" },
169:                        processMarks("a.M",
170:                                new MarkRecord[] { createMarkRecord(0, "1",
171:                                        "2", 0), }),
172:                        new IChannelLogRecord[] { createChannelLogRecord("a.M",
173:                                0, 0), });
174:            }
175:
176:            public void testConstructor9() {
177:                MarkRecord mr[] = processMarks("a.M", new MarkRecord[] {
178:                        createMarkRecord(0, "1", "m1()V", 3),
179:                        createMarkRecord(0, "1", "m2()V", 3),
180:                        createMarkRecord(0, "1", "m2()V", 1), });
181:                try {
182:                    new ClassMarkSet("a.M", new String[] { "m1()V", "m2()V" },
183:                            mr,
184:                            new IChannelLogRecord[] { createChannelLogRecord(
185:                                    "a.M", 0, 1), });
186:                    fail("Did not throw IllegalArgumentException.");
187:                } catch (IllegalArgumentException iae) {
188:                    assertTrue("Did not mention mark 1 [" + iae.getMessage()
189:                            + "].", iae.getMessage().indexOf("mark 1") >= 0);
190:                }
191:            }
192:
193:            public void testConstructor10() {
194:                MarkRecord mr[] = processMarks("a.M", new MarkRecord[] {
195:                        createMarkRecord(0, "1", "m1()V", 3),
196:                        createMarkRecord(0, "1", "m2()V", 3),
197:                        createMarkRecord(0, "1", "m2()V", 1), });
198:                try {
199:                    new ClassMarkSet("a.M", new String[] { "m1()V", "m2()V" },
200:                            mr, new IChannelLogRecord[] {
201:                                    createChannelLogRecord("a.M", 0, 1),
202:                                    createChannelLogRecord("a.M", 0, 5), });
203:                    fail("Did not throw IllegalArgumentException.");
204:                } catch (IllegalArgumentException iae) {
205:                    assertTrue("Did not mention mark 1 or 5 ["
206:                            + iae.getMessage() + "].", iae.getMessage()
207:                            .indexOf("mark 1") >= 0
208:                            || iae.getMessage().indexOf("mark 5") >= 0);
209:                }
210:            }
211:
212:            public void testConstructor11() {
213:                MarkRecord mr[] = processMarks("a.M", new MarkRecord[] {
214:                        createMarkRecord(0, "1", "m1()V", 1),
215:                        createMarkRecord(0, "1", "m1()V", 2),
216:                        createMarkRecord(0, "1", "m1()V", 3),
217:                        createMarkRecord(0, "1", "m2()V", 1),
218:                        createMarkRecord(0, "1", "m2()V", 2),
219:                        createMarkRecord(0, "1", "m2()V", 3), });
220:                try {
221:                    new ClassMarkSet("a.M", new String[] { "m1()V", "m2()V" },
222:                            mr, new IChannelLogRecord[] {
223:                                    createChannelLogRecord("a.M", 0, 3),
224:                                    createChannelLogRecord("a.M", 0, 4),
225:                                    createChannelLogRecord("a.M", 1, 1),
226:                                    createChannelLogRecord("a.M", 1, 2), });
227:                    fail("Did not throw IllegalArgumentException.");
228:                } catch (IllegalArgumentException iae) {
229:                    assertTrue("Did not mention mark 4 [" + iae.getMessage()
230:                            + "].", iae.getMessage().indexOf("mark 4") >= 0);
231:                }
232:            }
233:
234:            public void testGetMethodSignatures1() {
235:                ClassMarkSet cms = new ClassMarkSet("a.M", new String[] {},
236:                        new MarkRecord[0], new IChannelLogRecord[0]);
237:                String[] methods = cms.getMethodSignatures();
238:                assertNotNull("Returned null method signature list.", methods);
239:                assertEquals("Created methods out of nothing.", 0,
240:                        methods.length);
241:            }
242:
243:            public void testGetMethodSignatures1a() {
244:                try {
245:                    ClassMarkSet cms = new ClassMarkSet("a.M", new String[] {
246:                            "m1()V", "m2()V" }, new MarkRecord[0],
247:                            new IChannelLogRecord[] { createChannelLogRecord(
248:                                    "a.M", 0, 1), });
249:                } catch (IllegalArgumentException ex) {
250:                    /*
251:                    assertTrue(
252:                        "Did not mention method 0 ["+ex.getMessage()+"].",
253:                        ex.getMessage().indexOf( "method 0" ) >= 0 );
254:                    assertTrue(
255:                        "Did not mention mark 1 ["+ex.getMessage()+"].",
256:                        ex.getMessage().indexOf( "mark 1" ) >= 0 );
257:                     */
258:                }
259:            }
260:
261:            public void testGetMethodSignatures2() {
262:                MarkRecord mr[] = processMarks(
263:                        "a.M",
264:                        new MarkRecord[] { createMarkRecord(0, "1", "m()V", 0), });
265:                ClassMarkSet cms = new ClassMarkSet("a.M",
266:                        new String[] { "m()V" }, mr,
267:                        new IChannelLogRecord[] { createChannelLogRecord("a.M",
268:                                0, 0), });
269:
270:                String[] methods = cms.getMethodSignatures();
271:                assertEquals("Did not return the right number of methods.", 1,
272:                        methods.length);
273:                assertEquals("Did not return the right method.", "m()V",
274:                        methods[0]);
275:            }
276:
277:            public void testGetMethodSignatures3() {
278:                MarkRecord mr[] = processMarks("a.M", new MarkRecord[] {
279:                        createMarkRecord(0, "1", "m1()V", 0),
280:                        createMarkRecord(0, "1", "m1()V", 1),
281:                        createMarkRecord(0, "1", "m1()V", 2),
282:                        createMarkRecord(0, "1", "m2()V", 3),
283:                        createMarkRecord(0, "1", "m2()V", 2),
284:                        createMarkRecord(0, "1", "m2()V", 1),
285:                        createMarkRecord(0, "1", "m2()V", 0), });
286:                ClassMarkSet cms = new ClassMarkSet("a.M", new String[] {
287:                        "m1()V", "m2()V" }, mr,
288:                        new IChannelLogRecord[] { createChannelLogRecord("a.M",
289:                                1, 1), });
290:
291:                String[] methods = cms.getMethodSignatures();
292:                assertEquals("Did not return the right number of methods.", 2,
293:                        methods.length);
294:                assertTrue("Did not return the right methods.", (methods[0]
295:                        .equals("m1()V") && methods[1].equals("m2()V"))
296:                        || (methods[0].equals("m2()V") && methods[1]
297:                                .equals("m1()V")));
298:            }
299:
300:            public void testGetMethodSignatures4() {
301:                ClassMarkSet cms = new ClassMarkSet("a.M", new String[] { "1",
302:                        "2" }, new MarkRecord[0], new IChannelLogRecord[0]);
303:                String[] methods = cms.getMethodSignatures();
304:                assertNotNull("Returned null method signature list.", methods);
305:                assertEquals("Did not return right methods.", 2, methods.length);
306:            }
307:
308:            public void testGetCoveredMarksForMethod3() {
309:                MarkRecord mr[] = processMarks("a.M", new MarkRecord[] {
310:                        createMarkRecord(0, "1", "m1()V", 0),
311:                        createMarkRecord(0, "1", "m1()V", 1),
312:                        createMarkRecord(0, "1", "m1()V", 2),
313:                        createMarkRecord(0, "1", "m1()V", 3),
314:                        createMarkRecord(0, "1", "m2()V", 0),
315:                        createMarkRecord(0, "1", "m2()V", 1),
316:                        createMarkRecord(0, "1", "m2()V", 2),
317:                        createMarkRecord(0, "1", "m2()V", 3), });
318:                ClassMarkSet cms = new ClassMarkSet("a.M", new String[] {
319:                        "m1()V", "m2()V" }, mr,
320:                        new IChannelLogRecord[] { createChannelLogRecord("a.M",
321:                                0, 3), });
322:                MarkRecord covered[] = cms.getCoveredMarksForMethod("m1()V");
323:                assertEquals("Returned incorrect coverage list.", 1,
324:                        covered.length);
325:                assertEquals("Returned bad mark method.", "m1()V", covered[0]
326:                        .getMethodSignature());
327:                assertEquals("Returned bad mark id.", (short) 3, covered[0]
328:                        .getMarkIndex());
329:            }
330:
331:            public void testGetCoveredMarksForMethod4() {
332:                MarkRecord mr[] = processMarks("a.M", new MarkRecord[] {
333:                        createMarkRecord(0, "1", "m1()V", 0),
334:                        createMarkRecord(0, "1", "m1()V", 1),
335:                        createMarkRecord(0, "1", "m1()V", 2),
336:                        createMarkRecord(0, "1", "m1()V", 3),
337:                        createMarkRecord(0, "1", "m2()V", 0),
338:                        createMarkRecord(0, "1", "m2()V", 1),
339:                        createMarkRecord(0, "1", "m2()V", 2),
340:                        createMarkRecord(0, "1", "m2()V", 3), });
341:                ClassMarkSet cms = new ClassMarkSet("a.M", new String[] {
342:                        "m1()V", "m2()V" }, mr, new IChannelLogRecord[] {
343:                        createChannelLogRecord("a.M", 0, 3),
344:                        //createChannelLogRecord( "a.M", 0, 4 ),
345:                        createChannelLogRecord("a.M", 1, 1),
346:                        createChannelLogRecord("a.M", 1, 2), });
347:                MarkRecord covered[] = cms.getCoveredMarksForMethod("m2()V");
348:                assertEquals("Returned incorrect coverage list.", 2,
349:                        covered.length);
350:                assertEquals("Returned bad mark method [0].", "m2()V",
351:                        covered[0].getMethodSignature());
352:                assertEquals("Returned bad mark method [1].", "m2()V",
353:                        covered[1].getMethodSignature());
354:
355:                assertTrue(
356:                        "Returned bad mark ids.",
357:                        (covered[0].getMarkIndex() == (short) 1 && covered[1]
358:                                .getMarkIndex() == (short) 2)
359:                                || (covered[0].getMarkIndex() == (short) 2 && covered[1]
360:                                        .getMarkIndex() == (short) 1));
361:            }
362:
363:            public void testGetNotCoveredMarksForMethod1() {
364:                MarkRecord mr[] = processMarks("a.M", new MarkRecord[] {
365:                        createMarkRecord(0, "1", "m1()V", 0),
366:                        createMarkRecord(0, "1", "m1()V", 1),
367:                        createMarkRecord(0, "1", "m1()V", 2),
368:                        createMarkRecord(0, "1", "m1()V", 3),
369:                        createMarkRecord(0, "1", "m2()V", 0),
370:                        createMarkRecord(0, "1", "m2()V", 1),
371:                        createMarkRecord(0, "1", "m2()V", 2),
372:                        createMarkRecord(0, "1", "m2()V", 3), });
373:                ClassMarkSet cms = new ClassMarkSet("a.M", new String[] {
374:                        "m1()V", "m2()V" }, mr, new IChannelLogRecord[] {
375:                        createChannelLogRecord("a.M", 0, 3),
376:                        //createChannelLogRecord( "a.M", 0, 4 ),
377:                        createChannelLogRecord("a.M", 1, 0),
378:                        createChannelLogRecord("a.M", 1, 1),
379:                        createChannelLogRecord("a.M", 1, 2), });
380:                MarkRecord nc[] = cms.getNotCoveredMarksForMethod("m2()V");
381:                assertEquals("Returned incorrect coverage list.", 1, nc.length);
382:                assertEquals("Returned bad mark method.", "m2()V", nc[0]
383:                        .getMethodSignature());
384:                assertEquals("Returned bad mark id.", (short) 3, nc[0]
385:                        .getMarkIndex());
386:            }
387:
388:            public void testGetNotCoveredMarksForMethod2() {
389:                MarkRecord mr[] = processMarks("a.M", new MarkRecord[] {
390:                        createMarkRecord(0, "1", "m1()V", 0),
391:                        createMarkRecord(0, "1", "m1()V", 1),
392:                        createMarkRecord(0, "1", "m1()V", 2),
393:                        createMarkRecord(0, "1", "m1()V", 3), });
394:                ClassMarkSet cms = new ClassMarkSet("a.M", new String[] {
395:                        "m1()V", "m2()V" }, mr, new IChannelLogRecord[] {
396:                        createChannelLogRecord("a.M", 0, 0),
397:                        createChannelLogRecord("a.M", 0, 1),
398:                        createChannelLogRecord("a.M", 0, 2),
399:                        createChannelLogRecord("a.M", 0, 3),
400:                //createChannelLogRecord( "a.M", 0, 4 ),
401:                        });
402:                MarkRecord nc[] = cms.getNotCoveredMarksForMethod("m1()V");
403:                assertNotNull("Returned null not-covered list.", nc);
404:                assertEquals("Returned incorrect not-coverage list length.", 0,
405:                        nc.length);
406:            }
407:
408:            //-------------------------------------------------------------------------
409:            // Helpers
410:
411:            protected IAnalysisMetaData createAnalysisMetaData(int weight) {
412:                return CCCreatorUtil.createIAnalysisMetaData("a", "b",
413:                        (byte) weight);
414:            }
415:
416:            protected MarkRecord createMarkRecord(int metaDataWeight,
417:                    String am, String methSig, int markId) {
418:                MarkRecord mr = new MarkRecord(
419:                        createAnalysisMetaData(metaDataWeight), am, methSig,
420:                        (short) markId, 1);
421:                return mr;
422:            }
423:
424:            protected MarkRecord[] processMarks(String className,
425:                    MarkRecord mr[]) {
426:                // don't use a real set so we can keep the original order
427:                List methodSet = new ArrayList();
428:                List measureSet = new ArrayList();
429:                for (int i = 0; i < mr.length; ++i) {
430:                    if (!methodSet.contains(mr[i].getMethodSignature())) {
431:                        methodSet.add(mr[i].getMethodSignature());
432:                    }
433:                    if (!measureSet.contains(mr[i].getAnalysisModule())) {
434:                        measureSet.add(mr[i].getAnalysisModule());
435:                    }
436:                }
437:
438:                // create measures
439:                IAnalysisModule modules[] = new IAnalysisModule[measureSet
440:                        .size()];
441:                for (int i = 0; i < modules.length; ++i) {
442:                    modules[i] = CCCreatorUtil.createIAnalysisModule(
443:                            (String) measureSet.get(i), "a", "b");
444:                }
445:                String methods[] = (String[]) methodSet
446:                        .toArray(new String[methodSet.size()]);
447:
448:                ClassRecord cr = new ClassRecord(className, 100L, "a", methods,
449:                        CCCreatorUtil.createAnalysisModuleSet(modules));
450:                for (int i = 0; i < mr.length; ++i) {
451:                    cr.addMark(mr[i]);
452:                }
453:
454:                return mr;
455:            }
456:
457:            protected IChannelLogRecord createChannelLogRecord(String classSig,
458:                    int methodIndex, int markIndex) {
459:                return new DefaultChannelLogRecord(classSig,
460:                        (short) methodIndex, (short) markIndex);
461:            }
462:
463:            //-------------------------------------------------------------------------
464:            // Standard JUnit declarations
465:
466:            public static Test suite() {
467:                TestSuite suite = new TestSuite(THIS_CLASS);
468:
469:                return suite;
470:            }
471:
472:            public static void main(String[] args) {
473:                String[] name = { THIS_CLASS.getName() };
474:
475:                // junit.textui.TestRunner.main( name );
476:                // junit.swingui.TestRunner.main( name );
477:
478:                junit.textui.TestRunner.main(name);
479:            }
480:
481:            /**
482:             * 
483:             * @exception Exception thrown under any exceptional condition.
484:             */
485:            protected void setUp() throws Exception {
486:                super .setUp();
487:
488:                // set ourself up
489:            }
490:
491:            /**
492:             * 
493:             * @exception Exception thrown under any exceptional condition.
494:             */
495:            protected void tearDown() throws Exception {
496:                // tear ourself down
497:
498:                super.tearDown();
499:            }
500:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.