Source Code Cross Referenced for JUnitTaskMirror.java in  » Build » ANT » org » apache » tools » ant » taskdefs » optional » junit » 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 » Build » ANT » org.apache.tools.ant.taskdefs.optional.junit 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  Licensed to the Apache Software Foundation (ASF) under one or more
003:         *  contributor license agreements.  See the NOTICE file distributed with
004:         *  this work for additional information regarding copyright ownership.
005:         *  The ASF licenses this file to You under the Apache License, Version 2.0
006:         *  (the "License"); you may not use this file except in compliance with
007:         *  the License.  You may obtain a copy of the License at
008:         *
009:         *      http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         *  Unless required by applicable law or agreed to in writing, software
012:         *  distributed under the License is distributed on an "AS IS" BASIS,
013:         *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         *  See the License for the specific language governing permissions and
015:         *  limitations under the License.
016:         *
017:         */
018:
019:        package org.apache.tools.ant.taskdefs.optional.junit;
020:
021:        import java.io.IOException;
022:        import java.io.OutputStream;
023:        import org.apache.tools.ant.AntClassLoader;
024:        import org.apache.tools.ant.types.Permissions;
025:
026:        /**
027:         * Handles the portions of {@link JUnitTask} which need to directly access
028:         * actual JUnit classes, so that junit.jar need not be on Ant's startup classpath.
029:         * Neither JUnitTask.java nor JUnitTaskMirror.java nor their transitive static
030:         * deps may import any junit.** classes!
031:         * Specifically, need to not refer to
032:         * - JUnitResultFormatter or its subclasses
033:         * - JUnitVersionHelper
034:         * - JUnitTestRunner
035:         * Cf.  JUnitTask.SplitLoader#isSplit(String)
036:         * Public only to permit access from classes in this package; do not use directly.
037:         *
038:         * @since 1.7
039:         * @see "bug #38799"
040:         */
041:        public interface JUnitTaskMirror {
042:
043:            /**
044:             * Add the formatter to be called when the jvm exits before
045:             * the test suite finishs.
046:             * @param test the test.
047:             * @param formatter the fomatter to use.
048:             * @param out the output stream to use.
049:             * @param message the message to write out.
050:             * @param testCase the name of the test.
051:             */
052:            void addVmExit(JUnitTest test,
053:                    JUnitResultFormatterMirror formatter, OutputStream out,
054:                    String message, String testCase);
055:
056:            /**
057:             * Create a new test runner for a test.
058:             * @param test the test to run.
059:             * @param haltOnError if true halt the tests if an error occurs.
060:             * @param filterTrace if true filter the stack traces.
061:             * @param haltOnFailure if true halt the test if a failure occurs.
062:             * @param showOutput    if true show output.
063:             * @param logTestListenerEvents if true log test listener events.
064:             * @param classLoader      the classloader to use to create the runner.
065:             * @return the test runner.
066:             */
067:            JUnitTestRunnerMirror newJUnitTestRunner(JUnitTest test,
068:                    boolean haltOnError, boolean filterTrace,
069:                    boolean haltOnFailure, boolean showOutput,
070:                    boolean logTestListenerEvents, AntClassLoader classLoader);
071:
072:            /**
073:             * Create a summary result formatter.
074:             * @return the created formatter.
075:             */
076:            SummaryJUnitResultFormatterMirror newSummaryJUnitResultFormatter();
077:
078:            /** The interface that JUnitResultFormatter extends. */
079:            public interface JUnitResultFormatterMirror {
080:                /**
081:                 * Set the output stream.
082:                 * @param outputStream the stream to use.
083:                 */
084:                void setOutput(OutputStream outputStream);
085:            }
086:
087:            /** The interface that SummaryJUnitResultFormatter extends. */
088:            public interface SummaryJUnitResultFormatterMirror extends
089:                    JUnitResultFormatterMirror {
090:
091:                /**
092:                 * Set where standard out and standard error should be included.
093:                 * @param value if true include the outputs in the summary.
094:                 */
095:                void setWithOutAndErr(boolean value);
096:            }
097:
098:            /** Interface that test runners implement. */
099:            public interface JUnitTestRunnerMirror {
100:
101:                /**
102:                 * Used in formatter arguments as a placeholder for the basename
103:                 * of the output file (which gets replaced by a test specific
104:                 * output file name later).
105:                 *
106:                 * @since Ant 1.6.3
107:                 */
108:                String IGNORED_FILE_NAME = "IGNORETHIS";
109:
110:                /**
111:                 * No problems with this test.
112:                 */
113:                int SUCCESS = 0;
114:
115:                /**
116:                 * Some tests failed.
117:                 */
118:                int FAILURES = 1;
119:
120:                /**
121:                 * An error occurred.
122:                 */
123:                int ERRORS = 2;
124:
125:                /**
126:                 * Permissions for the test run.
127:                 * @param perm the permissions to use.
128:                 */
129:                void setPermissions(Permissions perm);
130:
131:                /** Run the test. */
132:                void run();
133:
134:                /**
135:                 * Add a formatter to the test.
136:                 * @param formatter the formatter to use.
137:                 */
138:                void addFormatter(JUnitResultFormatterMirror formatter);
139:
140:                /**
141:                 * Returns what System.exit() would return in the standalone version.
142:                 *
143:                 * @return 2 if errors occurred, 1 if tests failed else 0.
144:                 */
145:                int getRetCode();
146:
147:                /**
148:                 * Handle output sent to System.err.
149:                 *
150:                 * @param output coming from System.err
151:                 */
152:                void handleErrorFlush(String output);
153:
154:                /**
155:                 * Handle output sent to System.err.
156:                 *
157:                 * @param output output for System.err
158:                 */
159:                void handleErrorOutput(String output);
160:
161:                /**
162:                 * Handle output sent to System.out.
163:                 *
164:                 * @param output output for System.out.
165:                 */
166:                void handleOutput(String output);
167:
168:                /**
169:                 * Handle an input request.
170:                 *
171:                 * @param buffer the buffer into which data is to be read.
172:                 * @param offset the offset into the buffer at which data is stored.
173:                 * @param length the amount of data to read.
174:                 *
175:                 * @return the number of bytes read.
176:                 *
177:                 * @exception IOException if the data cannot be read.
178:                 */
179:                int handleInput(byte[] buffer, int offset, int length)
180:                        throws IOException;
181:
182:                /**
183:                 * Handle output sent to System.out.
184:                 *
185:                 * @param output output for System.out.
186:                 */
187:                void handleFlush(String output);
188:
189:            }
190:        }
w__w_w___.__j__a_v__a___2___s.___c___o__m | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.