Skip to content

Commit a40b989

Browse files
author
Bruce Eckel
committed
Update to latest
1 parent e7291af commit a40b989

File tree

197 files changed

+2295
-753
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

197 files changed

+2295
-753
lines changed

Ant-Clean.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<include name="**/*.tmp" />
1515
<include name="**/*.xml" />
1616
<include name="**/*.out" />
17+
<include name="**/*.err" />
1718
<include name="**/*.dat" />
1819
<include name="**/*.log" />
1920
<include name="**/failures" />

Ant-Common.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@
3434
timeout="@{timeOut}"
3535
output="${antoutput}" append="true">
3636
<arg line="@{arguments}"/>
37+
<redirector
38+
output="@{cls}.out"
39+
error="@{cls}.err"
40+
createemptyfiles="false"
41+
append="false" />
3742
</java>
3843
<echo file="${antoutput}" append="true">[${chapter}] Finished: java @{cls} @{arguments}&#13;</echo>
3944
<echo file="${antoutput}" append="true">@{msg}&#13;</echo>
@@ -102,6 +107,12 @@
102107
<compilerarg value="-Xmaxerrs"/>
103108
<compilerarg value="10"/>
104109
</javac>
110+
<javac includeantruntime="false"
111+
classpath="${java.class.path};${basedir};${basedir}/.."
112+
srcdir="${basedir}/../polymorphism/music/">
113+
<compilerarg value="-Xmaxerrs"/>
114+
<compilerarg value="10"/>
115+
</javac>
105116
</target>
106117

107118
<target
@@ -143,4 +154,13 @@
143154
<echo file="${antoutput}" append="true" message="Build '${chapter}' succeeded&#13;"/>
144155
</target>
145156

157+
<target
158+
depends="base"
159+
description="Verify output; requires Python 3.5"
160+
name="verify">
161+
<exec dir="${basedir}" executable="python" failonerror="true">
162+
<arg line="../verify_output.py" />
163+
</exec>
164+
</target>
165+
146166
</project>

annotations/AtUnitComposition.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ public class AtUnitComposition {
1818
}
1919
public static void main(String[] args) throws Exception {
2020
OSExecute.command(
21-
"java com.mindviewinc.atunit.AtUnit AtUnitComposition");
21+
"java com.mindviewinc.atunit.AtUnit " +
22+
" AtUnitComposition");
2223
}
2324
}
2425
/* Output:
2526
annotations.AtUnitComposition
2627
. _methodOne
2728
. _methodTwo This is methodTwo
29+
2830
OK (2 tests)
2931
*/

annotations/AtUnitExample1.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@ public static void main(String[] args) throws Exception {
3030
/* Output:
3131
annotations.AtUnitExample1
3232
. anotherDisappointment (failed)
33-
. failureTest (failed)
3433
. methodOneTest
35-
. m2 This is methodTwo
34+
. failureTest (failed)
3635
. m3
36+
. m2 This is methodTwo
37+
3738
(5 tests)
39+
3840
>>> 2 FAILURES <<<
3941
annotations.AtUnitExample1: anotherDisappointment
4042
annotations.AtUnitExample1: failureTest

annotations/AtUnitExample2.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,14 @@ public static void main(String[] args) throws Exception {
4040
. assertFailureExample java.lang.AssertionError: What a
4141
surprise!
4242
(failed)
43+
. assertExample
44+
. assertAndReturn This is methodTwo
45+
4346
. exceptionExample java.io.FileNotFoundException:
4447
nofile.txt (The system cannot find the file specified)
4548
(failed)
46-
. assertAndReturn This is methodTwo
47-
. assertExample
4849
(4 tests)
50+
4951
>>> 2 FAILURES <<<
5052
annotations.AtUnitExample2: assertFailureExample
5153
annotations.AtUnitExample2: exceptionExample

annotations/AtUnitExample3.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ public static void main(String[] args) throws Exception {
3232
}
3333
/* Output:
3434
annotations.AtUnitExample3
35-
. methodOneTest
3635
. initialization
36+
. methodOneTest
3737
. m2 This is methodTwo
38+
3839
OK (3 tests)
3940
*/

annotations/AtUnitExample4.java

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,18 @@ public static void main(String[] args) throws Exception {
6464
/* Output:
6565
starting
6666
annotations.AtUnitExample4
67-
. scramble1 'All'
68-
lAl
69-
. scramble2 'brontosauruses'
70-
tsaeborornussu
71-
. words 'are'
72-
OK (3 tests)
67+
. words 'All'
68+
(failed)
69+
. scramble1 'brontosauruses'
70+
ntsaueorosurbs
71+
(failed)
72+
. scramble2 'are'
73+
are
74+
(failed)
75+
(3 tests)
76+
77+
>>> 3 FAILURES <<<
78+
annotations.AtUnitExample4: words
79+
annotations.AtUnitExample4: scramble1
80+
annotations.AtUnitExample4: scramble2
7381
*/

annotations/AtUnitExample5.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ public static void main(String[] args) throws Exception {
4747
}
4848
/* Output:
4949
annotations.AtUnitExample5
50-
. test3
51-
Running cleanup
5250
. test1
5351
Running cleanup
5452
. test2
53+
Running cleanup
54+
. test3
5555
Running cleanup
5656
OK (3 tests)
5757
*/

annotations/AtUnitExternalTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@ public class AtUnitExternalTest extends AtUnitExample1 {
1212
return methodOne().equals("This is methodOne");
1313
}
1414
@Test boolean _methodTwo() { return methodTwo() == 2; }
15-
public static void main(String[] args) throws Exception {
15+
public static void main(String[] args) throws Exception{
1616
OSExecute.command(
17-
"java com.mindviewinc.atunit.AtUnit AtUnitExternalTest");
17+
"java com.mindviewinc.atunit.AtUnit " +
18+
"AtUnitExternalTest");
1819
}
1920
}
2021
/* Output:
2122
annotations.AtUnitExternalTest
2223
. _methodTwo This is methodTwo
24+
2325
. _methodOne
2426
OK (2 tests)
2527
*/

annotations/HashSetTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public static void main(String[] args) throws Exception {
2929
/* Output:
3030
annotations.HashSetTest
3131
. initialization
32-
. _remove
3332
. _contains
33+
. _remove
3434
OK (3 tests)
3535
*/

0 commit comments

Comments
 (0)