What this program does... j-c-lotus checks to see if the number of tasks with startDate selected (in other words, not "open") equals the number of expected selected projects. It does this by reading in the value from the first non-commented line of the input (usually from the input stream) and saving the value for comparison later. Next, the input is parsed for all project lines, saving the projects with startDates to a vector r. The size (number of elements) in r is then compared against the originally-saved value. If the values match, then the program prints "SUCCESS", otherwise it prints "FAILURE". This program is a translation of the Demeter/C++ program "c-lotus", which compares the list of tasks with startDates against the expected output. Because of time constraints in this phase, j-c-lotus only checks to make sure the number of elements in the vector of startDated projects is as expected. This program performs a slightly different function than its C++ predecessor, but it still tests DemJava. Given extra time, this program could have been written to produce exactly the same output as the C++ ver. program.input is a sample input file for testing j-c-lotus. You may write your own test input file and send it as an input stream to the Main class through java to run this test. Additionally, make test simply runs the test on the current program.input file. example. machine% cd /proj/demsys/com1205/w97/csaia/proj/phase1/j-c-lotus/gen machine% cat program.input // Number of tasks which should have a startDate. 2 // The tasks themselves. // Note that the second and third have a startDate. The first one has // no dates. The fourth task has a dueDate; the fifth has a completion // date. ( timing open open open name A (@ @) prerequisites (B) resources (sun4 sun4) timing open 3 4 1993 open name A (@ @) prerequisites (B) resources (sun4 sun4) timing open 3 4 1993 open name A (@ @) prerequisites (B) resources (sun4 sun4) timing 1 2 2000 open open name A (@ @) prerequisites (B) resources (sun4 sun4) timing open open 4 5 1999 name A (@ @) prerequisites (B) resources (sun4 sun4) ) machine% java Main < ../program.input (or `make test' from one dir up) Expected number of projects with a startDate: 2 Projects determined to have a startDate: 2 SUCCESS The `magic' behind this DemJava program... 1. We create a WorkFlowManagement object, which parses data from STDIN. 2. A concatenationvisitor object is created. This object will concatenate any projects with a startDate into a vector. 3. Next, the WorkFlowManagement traversal is called, taking the cv along with it. When it gets to a startDate (bypassing dueDate and completion Date objects indicates a through propogation, which isn't yet implemented in Demeter/Java), it concatenates the startDate object onto the vector. 4. Upon returning from the traversal, we save the concatenationvisitor's tally to a vector r. 5. A straightforward comparison is done to see if the number of startDate objects matches the expected result which was parsed in at the start of this program. If so, we print SUCCESS, otherwise we print FAILURE. NOTE: For comparison, you may wish to see the c-lotus directory, which is at the same directory level as j-c-lotus. -- CJS, 26 Feb 1997.