Source Code Cross Referenced for BaseFormatter.java in  » Test-Coverage » Quilt » org » quilt » reports » 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 » Quilt » org.quilt.reports 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* BaseFormatter.java */
002:
003:        // //////////////////////////////////////////////////////////////////
004:        // NEEDS DOCUMENTATION //////////////////////////////////////////////
005:        // //////////////////////////////////////////////////////////////////
006:        package org.quilt.reports;
007:
008:        import java.io.IOException;
009:        import java.io.OutputStream;
010:        import java.io.PrintWriter;
011:        import java.io.StringWriter;
012:        import java.text.NumberFormat;
013:
014:        import junit.framework.*;
015:
016:        import org.apache.tools.ant.BuildException;
017:
018:        import org.quilt.framework.*;
019:        import org.quilt.runner.Runner;
020:
021:        /**
022:         * Basic test result formatter for Ant/Quilt/JUnit.
023:         */
024:        public abstract class BaseFormatter implements  Formatter {
025:
026:            protected boolean filtertrace = true;
027:            protected NumberFormat numberFormat = NumberFormat.getInstance();
028:            protected OutputStream out;
029:            protected PrintWriter output;
030:            protected Runner runner = null;
031:            protected StringWriter results;
032:            protected PrintWriter resultWriter;
033:            protected String systemError = null;
034:            protected String systemOutput = null;
035:
036:            /** 
037:             * Root around in a junit Test and find a getName method.
038:             *
039:             * Test may be TestCase or TestSuite; in either case there will be a
040:             * getName method in JUnit 3.7 or later.
041:             *
042:             * @return Test/suite name.
043:             */
044:            public static String getTestName(Test test) {
045:                if (test instanceof  TestSuite) {
046:                    return ((TestSuite) test).getName();
047:                } else if (test instanceof  TestCase) {
048:                    return ((TestCase) test).getName();
049:                } else {
050:                    return "unknown";
051:                }
052:            }
053:
054:            // INTERFACE FORMATTER //////////////////////////////////////////
055:            // Formatter extends JUnit TestListener; these are the extra ////
056:            // methods. /////////////////////////////////////////////////////
057:
058:            /** Called at end of Quilt/JUnit test run. */
059:            public void endTestSuite(QuiltTest suite) throws BuildException {
060:            }
061:
062:            /** Whether to filter Ant/Quilt/JUnit lines from stack traces. */
063:            public void setFiltertrace(boolean b) {
064:                filtertrace = b;
065:            }
066:
067:            /** Where to send the report output. */
068:            public void setOutput(OutputStream out) {
069:                this .out = out;
070:                output = new PrintWriter(out);
071:            }
072:
073:            /** Determines which test runner to use. */
074:            public void setRunner(Runner testrunner) {
075:                runner = testrunner;
076:            }
077:
078:            /** Where to send system output. */
079:            public void setSystemOutput(String out) {
080:                systemOutput = out;
081:            }
082:
083:            /** Where to send system error output. */
084:            public void setSystemError(String err) {
085:                systemError = err;
086:            }
087:
088:            /** Called at the start of the Ant/Quilt/JUnit test run. */
089:            public void startTestSuite(QuiltTest suite) throws BuildException {
090:            }
091:
092:            // INTERFACE TESTLISTENER ///////////////////////////////////////
093:            // Stubs for the JUnit TestListener methods /////////////////////
094:
095:            /** A test caused an unexpected error. */
096:            public void addError(Test test, Throwable error) {
097:            }
098:
099:            /** A test failed. */
100:            public void addFailure(Test test, Throwable t) {
101:            }
102:
103:            /** A test failed. */
104:            public void addFailure(Test test, AssertionFailedError t) {
105:                addFailure(test, (Throwable) t);
106:            }
107:
108:            /** 
109:             * Method called at beginning of test. 
110:             * @param test JUnit Test (TestCase or TestSuite) 
111:             */
112:            public void startTest(Test test) {
113:            }
114:
115:            /** 
116:             * Method called at end of test. 
117:             * @param test JUnit Test (TestCase or TestSuite) 
118:             */
119:            public void endTest(Test test) {
120:            }
121:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.