File: changes21.html

package info (click to toggle)
junit 3.8.2-9
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, sid
  • size: 1,704 kB
  • sloc: java: 1,762; sh: 43; makefile: 34; xml: 26
file content (108 lines) | stat: -rw-r--r-- 3,625 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
   <meta name="GENERATOR" content="Mozilla/4.5 [en] (Win95; I) [Netscape]">
   <meta name="Author" content="Erich Gamma">
   <title>JUnit 2</title>
</head>
<body>

<h2>
Summary of Changes between 1.0 and 2.1</h2>
The focus of this release was to refactor parts of the framework and to
make it more consistent. In addition, we have simplified the writing and
running of tests.
<ul>
<li>
We renamed the package prefix for all junit classes from "test" to "junit."</li>

<li>
<a NAME="Support to extract TestSuites"></a>This version extracts test
suites automatically. TestSuite now provides a constructor <tt><b>TestSuite(Class</b>
theClass)</tt>. This constructor adds all the methods from the given class
starting with "test" as test cases to the suite. This avoids you having
to update the suite method manually when adding a new test. For example,
the <b>suite</b>() method of the VectorTest can now be written as:</li>

<ul>publ<tt>ic static Test suite() {</tt>
<br><tt>&nbsp; return new <b>TestSuite(VectorTest.class);</b></tt>
<br><tt>}</tt></ul>

<li>
Several new assert methods were added:</li>

<ul>
<li>
<tt>assertNotNull(Object object)</tt></li>

<li>
<tt>assertNotNull(String message, Object object)</tt></li>

<li>
<tt>assertNull(Object object)</tt></li>

<li>
<tt>assertNull(String message, Object object)</tt></li>

<li>
<tt>assertSame(Object actual, Object expected)</tt></li>

<li>
<tt>assertSame(String message, Object actual, Object expected)</tt></li>

<li>
<tt>fail()</tt></li>

<li>
<tt>fail(String message)</tt>.</li>
</ul>

<li>
Exceptions during setUp() and tearDown() are now caught and reported.</li>

<li>
A warning is now given when a TestCase class isn't public or has no test
methods.</li>

<li>
All the assert methods are now public.</li>
</ul>

<ul>
<li>
Both the batch and the interactive TestRunner no longer require that the
Test class provides a static suite() method. If there is no suite method
all the public void methods starting with "test" and no arguments are run
(see above). There is a new variation of the graphical TestRunner (junit.ui.TestRunner)
the LoadingTestRunner. The LoadingTestRunner uses a custom class loader
to reload user classes for each test run. This avoids that the TestRunner
tool needs to be restarted for each run. The old TestRunner attempted to
address this by making assumptions about the garbage collection of classes
which were not portable.&nbsp; In particular, the old scheme would not
work at Notice, in an environment with dynamic object migration support
or hot code updating like VisualAge for Java this isn't an issue.</li>

<br>There, the environment takes care of updating the code and objects
run by the TestRunner. When using JUnit with VisualAge for Java, just use
the standard junit.ui.TestRunner.
<li>
When the graphical TestRunner is run under Visual Age for Java there is
an additional run button to rerun a failed test. This is typically used
to set a breakpoint in the test method and to rerun it under the debugger.</li>

<li>
The TestRunners support the command line option -c TestClassName. This
allows you to run them&nbsp; as VisualAge for Java tools.</li>

<br>Once you have JUnit installed as a VAJ tool you can select the Test
class and run its tests from a VAJ menu (see how to run JUnit as a VisualAge
for Java tool).
<li>
The batch TestRunner supports a runAndWait method to run a suite and wait
until the user types RETURN.</li>
</ul>

<hr WIDTH="100%">
</body>
</html>