cs445 - Fall 2014
Project - Testing Script
NOTE: Please make sure you save the state of the bakery under /tmp/bakery-<first_name>-<last_name>.ser
such that we keep the testing of various projects neatly separated from each other.
Testing your project will pretty much follow the sequence of commands listewd below, where pn is short
for Panem Nostrum, the name of your executable.
This is just a subset of all possible test cases. We reserve to right to test with a more comprehensive set of
commands.
For all commands that return an ID, we'll take the ID your application returns since we never prescribed an
algorithn for ID generation. If your IDs are different, then tell us what they are so that we can adjust the
commands. Better yet, provide an updated set of commands when you deliver the project.
We'll accept the messages printed by your application, as long as they are sensible, because we never specified
the specific format for messages.
For all test files, we'll attempt to load them from the same directory where we're running your executable.
The test script should work well as long as testing is completed before end-of-day on 11/28/14.
In all places where we have something like <today> or <tomorrow> in the command, this will be
replaced by the actual date when the command is being run. For example, for the command:
$ java pn admin revenue -f <today> -l <tomorrow>
we'd probably run the following:
$ java pn admin revenue -f `date +%m%d%y -d 'today'` -l `date +%m%d%y -d 'next sunday'`
If <today> or <tomorrow> appear in the application response, then we expect them to be replaced
by actual dates, in the mm/dd/yy format.
Finally, testing will take place in two consecutive days, "Day 1" and "Day 2". On "Day 1" the test commands
will setup a user or more and her/their subscriptions. On "Day 2" the delivery person is out delivering
to customers, so we'll test delivery confirmation and revenue numbers.
Day 1
$ java pn search
Nothing found.
$ java pn customer load -f "bakery-customer-1-20141003.xml"
1
$ java pn customer load -f "bakery-customer-1-20141003.xml"
User with email address jane.roe@example.com already loaded.
$ java pn search
1, "Jane Roe", "330 S Federal ST", "Chicago", "IL", "60616", "jane.roe@example.com", "123-456-7890", twitter: "@janeroe"
$ java pn search -k "virgil"
Nothing found.
$ java pn search -k "example"
1, "Jane Roe", "330 S Federal ST", "Chicago", "IL", "60616", "jane.roe@example.com", "123-456-7890", twitter: "@janeroe"
$ java pn customer modify -u 1 -a "3300 S Federal ST"
1, "Jane Roe", "3300 S Federal ST", "Chicago", "IL", "60616", "jane.roe@example.com", "123-456-7890", twitter: "@janeroe"
$ java pn recipe load -f "bakery-recipe-1-20141003.xml"
2
$ java pn product add -n "French baguette" -d 2.95 -r 2
3
$ java pn product view -p 3
3, "French baguette", $2.95, recipe: "Baguette" (id=2)
$ java pn product modify -n "French Baguette"
Must specify a product to modify ("-p" is required)
$ java pn product modify -p 3 -n "French Baguette"
OK
$ java pn product view -p 3
3, "French Baguette", $2.95, recipe: "Baguette" (id=2)
$ java pn product modify -p 3 -r 4 -n "French Baguette"
No such recipe (id=4)
$ java pn product modify -p 3 -d -2.95
Price must be greater than zero.
$ java pn product view -p 3
3, "French Baguette", $2.95, recipe: "Baguette" (id=2)
$ java pn customer view -u 1
1, "Jane Roe", "3300 S Federal ST", "Chicago", "IL", "60616", "jane.roe@example.com", "123-456-7890", twitter: "@janeroe"
Customer since: 11/24/14
Subscription status: nothing in the subscription
Current or future subscription suspension(s): none
Future special deliveries: none
Weekly value: $0.00
$ java pn subscription addmodify -u 1 -w 0 -p 3 -q 4
OK
$ java pn customer view -u 1
1, "Jane Roe", "3300 S Federal ST", "Chicago", "IL", "60616", "jane.roe@example.com", "123-456-7890", twitter: "@janeroe"
Customer since: 11/24/14
Subscription status: active
Current or future subscription suspension(s): none
Future special deliveries: none
Weekly value: $11.80
$ java pn subscription view -u 1
1, "Jane Roe", "3300 S Federal ST", "Chicago", "IL", "60616", "jane.roe@example.com", "123-456-7890", twitter: "@janeroe"
Sun: 4 x "French Baguette"
Mon: nothing
Tue: nothing
Wed: nothing
Thu: nothing
Fri: nothing
Sat: nothing
Current or future subscription suspension(s): none
Future special deliveries: none
$ java pn subscription addmodify -u 1 -f 122514 -p 3 -q 5
OK
$ java pn subscription view -u 1
1, "Jane Roe", "3300 S Federal ST", "Chicago", "IL", "60616", "jane.roe@example.com", "123-456-7890", twitter: "@janeroe"
Sun: 4 x "French Baguette"
Mon: nothing
Tue: nothing
Wed: nothing
Thu: nothing
Fri: nothing
Sat: nothing
Current or future subscription suspension(s): none
Future special deliveries: Thu, 12/25/14, 5 x "French Baguette"
$ java pn subscription addmodify -u 2 -f 122514 -p 3 -q 5
No such user (id=2)
$ java pn subscription addmodify -u 1 -f 122513 -p 3 -q 5
Date must be in the future
$ java pn subscription addmodify -u 1 -f 122514 -p 7 -q 5
No such product (id=7)
$ java pn subscription addmodify -u 1 -f 122514 -p 3 -q -5
The quantity must be greater than zero
$ java pn subscription suspend -u 1 -f 113014 -l 120614
OK
$ java pn subscription view -u 1
1, "Jane Roe", "3300 S Federal ST", "Chicago", "IL", "60616", "jane.roe@example.com", "123-456-7890", twitter: "@janeroe"
Sun: 4 x "French Baguette"
Mon: nothing
Tue: nothing
Wed: nothing
Thu: nothing
Fri: nothing
Sat: nothing
Current or future subscription suspension(s): 11/30/14 through 12/06/14
Future special deliveries: Thu, 12/25/14, 5 x "French Baguette"
$ java pn subscription addmodify -u 1 -w 1 -p 3 -q 4
OK
$ java pn subscription addmodify -u 1 -w 2 -p 3 -q 4
OK
$ java pn subscription addmodify -u 1 -w 3 -p 3 -q 4
OK
$ java pn subscription addmodify -u 1 -w 4 -p 3 -q 4
OK
$ java pn subscription addmodify -u 1 -w 5 -p 3 -q 4
OK
$ java pn subscription addmodify -u 1 -w 6 -p 3 -q 4
OK
$ java pn subscription addmodify -u 1 -w 7 -p 3 -q 4
Invalid day of the week
$ java pn subscription view -u 1
1, "Jane Roe", "3300 S Federal ST", "Chicago", "IL", "60616", "jane.roe@example.com", "123-456-7890", twitter: "@janeroe"
Sun: 4 x "French Baguette"
Mon: 4 x "French Baguette"
Tue: 4 x "French Baguette"
Wed: 4 x "French Baguette"
Thu: 4 x "French Baguette"
Fri: 4 x "French Baguette"
Sat: 4 x "French Baguette"
Current or future subscription suspension(s): 11/30/14 through 12/06/14
Future special deliveries: Thu, 12/25/14, 5 x "French Baguette"
$ java pn admin daily
Bill of materials for <tomorrow>
Product: "French Baguette", loafs to make: 4
Flour (White): 30 oz
Water: 18 floz
Salt: 1 tbsp
Yeast: 1.5 tsp
$ java pn admin weekly
Bill of materials for next week
Product: "French Baguette", loafs to make: 0
Flour (White): 0 oz
Water: 0 floz
Salt: 0 tbsp
Yeast: 0 tsp
$ java pn admin revenue -f 010113 -l 123113
Revenue realized between 01/01/13 and 12/31/13:
Bakery products: $0.00
Delivery fees: $0.00
Revenue projected between 01/01/13 and 12/31/13:
Bakery products: $0.00
Delivery fees: $0.00
$ java pn admin revenue -f 113014 -l 120614
Revenue realized between 11/30/14 and 12/06/14:
Bakery products: $0.00
Delivery fees: $0.00
Revenue projected between 11/30/14 and 12/06/14:
Bakery products: $0.00
Delivery fees: $0.00
$ java pn admin revenue -f 122514 -l 122514
Revenue realized between 12/25/14 and 12/25/14:
Bakery products: $0.00
Delivery fees: $0.00
Revenue projected between 12/25/14 and 12/25/14:
Bakery products: $14.75
Delivery fees: $0.00
$ java pn admin delivery_charge -d 4.05 -f 120114
OK
$ java pn admin revenue -f 122514 -l 122514
Revenue realized between 12/25/14 and 12/25/14:
Bakery products: $0.00
Delivery fees: $0.00
Revenue projected between 12/25/14 and 12/25/14:
Bakery products: $14.75
Delivery fees: $4.05
Day 2
$ java pn admin revenue -f <today> -l <tomorrow>
Revenue realized between <today> and <tomorrow>:
Bakery products: $0.00
Delivery fees: $0.00
Revenue projected between <today> and <tomorrow>
Bakery products: $23.60
Delivery fees: $0.00
$ java pn admin delivery_list
1, "Jane Roe", "3300 S Federal ST", "Chicago", "IL", "60616". Special instructions: none
$ java pn admin confirm_delivery -u 1
OK
$ java pn admin revenue -f <today> -l <today>
Revenue realized between <today> and <today>:
Bakery products: $11.80
Delivery fees: $0.00
Revenue projected between <today> and <today>
Bakery products: $11.80
Delivery fees: $0.00
$ java pn subscription cancel -u 1
OK
$ java pn customer view -u 1
1, "Jane Roe", "3300 S Federal ST", "Chicago", "IL", "60616", "jane.roe@example.com", "123-456-7890", twitter: "@janeroe"
Customer since: 11/24/14
Subscription status: cancelled
Current or future subscription suspension(s): none
Future special deliveries: none
Weekly value: $0.00
$ java pn subscription view -u 1
1, "Jane Roe", "3300 S Federal ST", "Chicago", "IL", "60616", "jane.roe@example.com", "123-456-7890", twitter: "@janeroe"
Sun: nothing
Mon: nothing
Tue: nothing
Wed: nothing
Thu: nothing
Fri: nothing
Sat: nothing
Current or future subscription suspension(s): none
Future special deliveries: none
$ java pn admin revenue -f <today> -l <tomorrow>
Revenue realized between <today> and <tomorrow>:
Bakery products: $11.80
Delivery fees: $0.00
Revenue projected between <today> and <tomorrow>
Bakery products: $0.00
Delivery fees: $0.00
$Id: test-script.html,v 1.1 2014/11/20 19:38:41 virgil Exp $
|