Fixes for Validate.py

This commit is contained in:
Bruce Eckel 2015-05-07 17:25:05 -07:00
parent 4b7adc67f4
commit c9838c0b89
18 changed files with 48 additions and 47 deletions

View File

@ -17,7 +17,7 @@
<jrun cls="annotations.Multiplier" dirpath="../annotations" />
<jrun cls="annotations.StackLStringTest" dirpath="../annotations" />
<jrun cls="UseCaseTracker" />
<jrun cls="annotations.database.TableCreator" dirpath="../annotations/database" arguments='annotations.database.Member' />
<jrun cls="annotations.database.TableCreator" dirpath="../annotations/database" arguments="annotations.database.Member" />
</target>
</project>

View File

@ -1,4 +1,5 @@
//: concurrency/ExceptionThread.java
// {RunByHand}
// {ThrowsException}
import java.util.concurrent.*;

View File

@ -1,4 +1,5 @@
//: concurrency/NaiveExceptionHandling.java
// {RunByHand}
// {ThrowsException}
import java.util.concurrent.*;

View File

@ -11,7 +11,7 @@
<jrun cls="AtomicIntegerTest" />
<jrun cls="AtomicityTest" />
<jrun cls="AttemptLocking" />
<jrun cls="BankTellerSimulation" arguments='5' />
<jrun cls="BankTellerSimulation" arguments="5" />
<jrun cls="BasicThreads" />
<jrun cls="CachedThreadPool" />
<jrun cls="CallableDemo" />
@ -23,28 +23,26 @@
<jrun cls="DaemonFromFactory" />
<jrun cls="Daemons" />
<jrun cls="DaemonsDontRunFinally" />
<jrun cls="DeadlockingDiningPhilosophers" arguments='0 5 timeout' />
<jrun cls="DeadlockingDiningPhilosophers" arguments="0 5 timeout" />
<jrun cls="DelayQueueDemo" />
<jrun cls="EvenGenerator" />
<jrun cls="ExceptionThread" failOnError='false' msg='* Exception was Expected *' />
<jrun cls="ExchangerDemo" />
<jrun cls="concurrency.ExplicitCriticalSection" dirpath="../concurrency" failOnError='false' msg='* Exception was Expected *' />
<jrun cls="FastSimulation" />
<jrun cls="FixedDiningPhilosophers" arguments='5 5 timeout' />
<jrun cls="FixedDiningPhilosophers" arguments="5 5 timeout" />
<jrun cls="FixedThreadPool" />
<jrun cls="GreenhouseScheduler" arguments='5000' />
<jrun cls="GreenhouseScheduler" arguments="5000" />
<jrun cls="HorseRace" />
<jrun cls="Interrupting" />
<jrun cls="Interrupting2" />
<jrun cls="InterruptingIdiom" arguments='1100' />
<jrun cls="InterruptingIdiom" arguments="1100" />
<jrun cls="Joining" />
<jrun cls="ListComparisons" arguments='1 10 10' />
<jrun cls="ListComparisons" arguments="1 10 10" />
<jrun cls="MainThread" />
<jrun cls="MapComparisons" arguments='1 10 10' />
<jrun cls="MapComparisons" arguments="1 10 10" />
<jrun cls="MoreBasicThreads" />
<jrun cls="MultiLock" />
<jrun cls="MutexEvenGenerator" failOnError='false' timeOut='4000' msg='* Timeout for Testing *' />
<jrun cls="NaiveExceptionHandling" failOnError='false' msg='* Exception was Expected *' />
<jrun cls="NIOInterruption" />
<jrun cls="NotifyVsNotifyAll" />
<jrun cls="OrnamentalGarden" />
@ -55,7 +53,7 @@
<jrun cls="Restaurant" />
<jrun cls="SelfManaged" />
<jrun cls="SemaphoreDemo" />
<jrun cls="SerialNumberChecker" arguments='4' />
<jrun cls="SerialNumberChecker" arguments="4" />
<jrun cls="SettingDefaultHandler" failOnError='false' timeOut='4000' msg='* Timeout for Testing *' />
<jrun cls="SimpleDaemons" />
<jrun cls="SimpleMicroBenchmark" />
@ -70,7 +68,7 @@
<jrun cls="ThreadLocalVariableHolder" />
<jrun cls="ThreadVariations" />
<jrun cls="ToastOMatic" />
<jrun cls="concurrency.restaurant2.RestaurantWithQueues" dirpath="../concurrency/restaurant2" arguments='5' />
<jrun cls="concurrency.restaurant2.RestaurantWithQueues" dirpath="../concurrency/restaurant2" arguments="5" />
<jrun cls="concurrency.waxomatic.WaxOMatic" dirpath="../concurrency/waxomatic" />
<jrun cls="concurrency.waxomatic2.WaxOMatic2" dirpath="../concurrency/waxomatic2" />
</target>

View File

@ -19,17 +19,17 @@
<jrun cls="FillingLists" />
<jrun cls="IndividualTest" />
<jrun cls="LinkedHashMapDemo" />
<jrun cls="ListPerformance" arguments='100 500' />
<jrun cls="ListPerformance" arguments="100 500" />
<jrun cls="Lists" />
<jrun cls="ListSortSearch" />
<jrun cls="MapDataTest" />
<jrun cls="MapPerformance" arguments='100 5000' />
<jrun cls="MapPerformance" arguments="100 5000" />
<jrun cls="Maps" />
<jrun cls="QueueBehavior" />
<jrun cls="RandomBounds" arguments='lower' failOnError='false' timeOut='4000' msg='* Timeout for Testing *' />
<jrun cls="RandomBounds" arguments="lower" failOnError='false' timeOut='4000' msg='* Timeout for Testing *' />
<jrun cls="ReadOnly" />
<jrun cls="References" />
<jrun cls="SetPerformance" arguments='100 5000' />
<jrun cls="SetPerformance" arguments="100 5000" />
<jrun cls="SimpleHashMap" />
<jrun cls="SlowMap" />
<jrun cls="SortedMapDemo" />

View File

@ -28,7 +28,7 @@
<jrun cls="InterruptableLongRunningTask" failOnError='false' timeOut='4000' msg='* Timeout for Testing *' />
<jrun cls="List" failOnError='false' timeOut='4000' msg='* Timeout for Testing *' />
<jrun cls="LongRunningTask" failOnError='false' timeOut='4000' msg='* Timeout for Testing *' />
<jrun cls="LookAndFeel" arguments='motif' failOnError='false' timeOut='4000' msg='* Timeout for Testing *' />
<jrun cls="LookAndFeel" arguments="motif" failOnError='false' timeOut='4000' msg='* Timeout for Testing *' />
<jrun cls="Menus" failOnError='false' timeOut='4000' msg='* Timeout for Testing *' />
<jrun cls="MessageBoxes" failOnError='false' timeOut='4000' msg='* Timeout for Testing *' />
<jrun cls="MonitoredLongRunningCallable" failOnError='false' timeOut='4000' msg='* Timeout for Testing *' />

View File

@ -15,7 +15,7 @@
<jrun cls="DotThis" />
<jrun cls="Factories" />
<jrun cls="Games" />
<jrun cls="GreenhouseController" arguments='5000' />
<jrun cls="GreenhouseController" arguments="5000" />
<jrun cls="InheritInner" />
<jrun cls="LambdaExpressions" />
<jrun cls="LocalInnerClass" />

View File

@ -1,6 +1,6 @@
//: io/DirList.java
// Display a directory listing using regular expressions.
// {Args: "D.*\.java"}
// {Args: 'D.*\.java'}
import java.util.regex.*;
import java.io.*;
import java.util.*;

View File

@ -1,6 +1,6 @@
//: io/DirList2.java
// Uses anonymous inner classes.
// {Args: "D.*\.java"}
// {Args: 'D.*\.java'}
import java.util.regex.*;
import java.io.*;
import java.util.*;

View File

@ -1,6 +1,6 @@
//: io/DirList3.java
// Building the anonymous inner class "in-place."
// {Args: "D.*\.java"}
// {Args: 'D.*\.java'}
import java.util.regex.*;
import java.io.*;
import java.util.*;

View File

@ -19,7 +19,7 @@ public class ZipCompress {
// No corresponding getComment(), though.
for (String arg : args) {
print("Writing file " + arg);
try (InputStream in = new BufferedInputStream(
try(InputStream in = new BufferedInputStream(
new FileInputStream(arg))) {
zos.putNextEntry(new ZipEntry(arg));
int c;
@ -37,17 +37,18 @@ public class ZipCompress {
CheckedInputStream csumi =
new CheckedInputStream(fi, new Adler32());
ZipInputStream in2 = new ZipInputStream(csumi);
BufferedInputStream bis = new BufferedInputStream(in2);
ZipEntry ze;
while((ze = in2.getNextEntry()) != null) {
print("Reading file " + ze);
int x;
while((x = bis.read()) != -1)
System.out.write(x);
try(BufferedInputStream bis =
new BufferedInputStream(in2)) {
ZipEntry ze;
while((ze = in2.getNextEntry()) != null) {
print("Reading file " + ze);
int x;
while((x = bis.read()) != -1)
System.out.write(x);
}
if(args.length == 1)
print("Checksum: " + csumi.getChecksum().getValue());
}
if(args.length == 1)
print("Checksum: " + csumi.getChecksum().getValue());
bis.close();
// Alternative way to open and read Zip files:
ZipFile zf = new ZipFile("test.zip");
Enumeration e = zf.entries();

View File

@ -14,11 +14,11 @@
<jrun cls="BufferedInputFile" />
<jrun cls="BufferToText" />
<jrun cls="ChangeSystemOut" />
<jrun cls="ChannelCopy" arguments='ChannelCopy.java test.txt' />
<jrun cls="ChannelCopy" arguments="ChannelCopy.java test.txt" />
<jrun cls="DirectoryDemo" />
<jrun cls="DirList" arguments='"D.*\.java"' />
<jrun cls="DirList2" arguments='"D.*\.java"' />
<jrun cls="DirList3" arguments='"D.*\.java"' />
<jrun cls="DirList" arguments="'D.*\.java'" />
<jrun cls="DirList2" arguments="'D.*\.java'" />
<jrun cls="DirList3" arguments="'D.*\.java'" />
<jrun cls="Echo" failOnError='false' timeOut='4000' msg='* Timeout for Testing *' />
<jrun cls="Endians" />
<jrun cls="FileLocking" />
@ -27,12 +27,12 @@
<jrun cls="FreezeAlien" />
<jrun cls="GetChannel" />
<jrun cls="GetData" />
<jrun cls="GZIPcompress" arguments='GZIPcompress.java' />
<jrun cls="GZIPcompress" arguments="GZIPcompress.java" />
<jrun cls="IntBufferDemo" />
<jrun cls="LargeMappedFiles" />
<jrun cls="LockingMappedFiles" />
<jrun cls="Logon" />
<jrun cls="MakeDirectories" arguments='MakeDirectoriesTest' />
<jrun cls="MakeDirectories" arguments="MakeDirectoriesTest" />
<jrun cls="MappedIO" />
<jrun cls="MemoryInput" />
<jrun cls="MyWorld" />
@ -43,12 +43,12 @@
<jrun cls="SerialCtl" />
<jrun cls="StoringAndRecoveringData" />
<jrun cls="TestEOF" />
<jrun cls="TransferTo" arguments='TransferTo.java TransferTo.txt' />
<jrun cls="TransferTo" arguments="TransferTo.java TransferTo.txt" />
<jrun cls="UsingBuffers" />
<jrun cls="UsingRandomAccessFile" />
<jrun cls="ViewBuffers" />
<jrun cls="Worm" />
<jrun cls="ZipCompress" arguments='ZipCompress.java' />
<jrun cls="ZipCompress" arguments="ZipCompress.java" />
<jrun cls="ThawAlien" failOnError='false' msg='* Exception was Expected *' />
</target>

View File

@ -7,7 +7,7 @@
<target name="run" description="Compile and run" depends="build">
<jrun cls="net.mindview.atunit.AtUnit" dirpath="../net/mindview/atunit" />
<jrun cls="net.mindview.atunit.AtUnitRemover" dirpath="../net/mindview/atunit" arguments='..' failOnError='false' msg='* Exception was Expected *' />
<jrun cls="net.mindview.atunit.AtUnitRemover" dirpath="../net/mindview/atunit" arguments=".." failOnError='false' msg='* Exception was Expected *' />
<jrun cls="net.mindview.atunit.ClassNameFinder" dirpath="../net/mindview/atunit" />
<jrun cls="net.mindview.util.ContainerMethodDifferences" dirpath="../net/mindview/util" />
<jrun cls="net.mindview.util.CountingIntegerList" dirpath="../net/mindview/util" />

View File

@ -12,7 +12,7 @@
<jrun cls="MultiSimpleServer" failOnError='false' timeOut='4000' msg='* Timeout for Testing *' />
<jrun cls="SimpleClient" failOnError='false' msg='* Exception was Expected *' />
<jrun cls="SimpleServer" failOnError='false' timeOut='4000' msg='* Timeout for Testing *' />
<jrun cls="WhoAmI" arguments='MindviewToshibaLaptop' />
<jrun cls="WhoAmI" arguments="MindviewToshibaLaptop" />
</target>
</project>

View File

@ -1,6 +1,6 @@
//: strings/JGrep.java
// A very simple version of the "grep" program.
// {Args: JGrep.java "\\b[Ssct]\\w+"}
// {Args: JGrep.java '\\b[Ssct]\\w+'}
import java.util.regex.*;
import net.mindview.util.*;

View File

@ -1,6 +1,6 @@
//: strings/TestRegularExpression.java
// Easily try out regular expressions.
// {Args: abcabcabcdefabc "abc+" "(abc)+" "(abc){2,}" }
// {Args: abcabcabcdefabc 'abc+' '(abc)+' '(abc){2,}' }
import java.util.regex.*;
import static net.mindview.util.Print.*;

View File

@ -16,7 +16,7 @@
<jrun cls="Immutable" />
<jrun cls="InfiniteRecursion" failOnError='false' msg='* Exception was Expected *' />
<jrun cls="IntegerMatch" />
<jrun cls="JGrep" arguments='JGrep.java "\\b[Ssct]\\w+"' />
<jrun cls="JGrep" arguments="JGrep.java '\\b[Ssct]\\w+'" />
<jrun cls="Receipt" />
<jrun cls="ReFlags" />
<jrun cls="Replacing" />
@ -29,7 +29,7 @@
<jrun cls="SplitDemo" />
<jrun cls="Splitting" />
<jrun cls="StartEnd" />
<jrun cls="TestRegularExpression" arguments='abcabcabcdefabc "abc+" "(abc)+" "(abc){2,}" ' />
<jrun cls="TestRegularExpression" arguments="abcabcabcdefabc 'abc+' '(abc)+' '(abc){2,}' " />
<jrun cls="TheReplacements" />
<jrun cls="ThreatAnalyzer" />
<jrun cls="Turtle" />

View File

@ -25,7 +25,7 @@
<jrun cls="RegisteredFactories" />
<jrun cls="SelectingMethods" />
<jrun cls="Shapes" />
<jrun cls="ShowMethods" arguments='ShowMethods' />
<jrun cls="ShowMethods" arguments="ShowMethods" />
<jrun cls="SimpleDynamicProxy" />
<jrun cls="SimpleProxyDemo" />
<jrun cls="SnowRemovalRobot" />