Acceptance Test

Use Case #2

Build #0661

Test 1

Description: A customer calls in for a cab to arrive some time in the future, one of the cabs will get a ride request, and then will accept or reject the ride request.

Assumptions: 

1.      Customer info is complete (name, pick-up and drop-off address, and drop-off time

2.      All system clocks in sync with some reasonable error epsilon (no more than 1 second)

Procedure:

1.      Start up system server by running setup_model_rmi_server.bat in D:\eclipse\workspace\DemoProject on one lab machine.

2.      Start up 2 DispatcherUIs on 2 separate machines making sure to update the machine ip address* in setup_dispatcher_ui_rmi_client.bat and then start the batch files.

3.      In each DispatcherUI enter a fake customer that is unique and meets the aforementioned specifications.

4.      Each of the two Dispatchers enters Dispatchers enters two customers, which will get sent to some cabs. The first one will be accepted and the other will be rejected initially (either by hitting reject or waiting for a cabbie response timeout).

5.      If all the customers are eventually scheduled for some cab at some time then the test passes.

*Cab Consoles and DispatcherUI cannot be run any machine that has "Special software for 451 label" on it. That machine is running on VMWare and will not work properly due to an IP resolution issue through no fault off our software

Input:

<Server Input>

Three random zone points from database

<Dispatchers>

Two fake customers for immediate pickup (one at each dispatcher console)

<Cab Consoles>

One Cab accepts first customer, then deliver him. Second Cab Console rejects the second customer and first Cab Console accepts him.

Output:

<Cab Console: 128.95.8.43>

RMI connection successful

RMI connection successful

successful registration

acceptOrReject

Customer String beforeJoe

Bob

555-555-5555

123 Fake St

Fri Aug 09 20:17:00 PDT 2002

Customer String beforeJoe

Bob

555-555-5555

123 Fake St

Fri Aug 09 20:17:00 PDT 2002

New AcceptOrReject called

 

<Dispatcher: 128.208.8.43>

128.95.8.50

RMI connection successful

RMI connection successful

Fri Aug 09 20:19:00 PDT 2002

ETA : 20:37

 

<Dispatcher UI: 128.208.8.43>

Walker, Brendan

Phone Number: 555-555-5555

Pickup Address: 123 Fake St

Destination: 987 Z Blvd

Pickup Time: 20:19

Pickup Date: 08-09-2002

Number in Party: 1

Cab Type: X

ETA: 20:37

 

<Cab Console UI: 128.208.8.43>

Please wait for new information

------------------------

The distpacher sent you the following ride

Joe

Bob

555-555-5555

123 Fake St

Fri Aug 09 20:17:00 PDT 2002

------------------------

Thank you for accepting the ride!

 

<Cab Console: 128.95.8.56>

RMI connection successful

RMI connection successful

successful registration

acceptOrReject

Customer String beforeJoe

Bob

555-555-5555

123 Fake St

Fri Aug 09 20:17:00 PDT 2002

Customer String beforeJoe

Bob

555-555-5555

123 Fake St

Fri Aug 09 20:17:00 PDT 2002

New AcceptOrReject called

acceptOrReject

Customer String beforeBrendan

Walker

555-555-5555

123 Fake St

Fri Aug 09 20:19:00 PDT 2002

Customer String beforeBrendan

Walker

555-555-5555

123 Fake St

Fri Aug 09 20:19:00 PDT 2002

New AcceptOrReject called

 

 

<Dispatcher: 128.95.8.56>

128.95.8.50

RMI connection successful

RMI connection successful

Fri Aug 09 20:17:00 PDT 2002

ETA : 20:36

 

<Cab Console UI: 128.95.8.56>

Please wait for new information

------------------------

The distpacher sent you the following ride

Joe

Bob

555-555-5555

123 Fake St

Fri Aug 09 20:17:00 PDT 2002

------------------------

REJECT BUTTON PRESSED

------------------------

The distpacher sent you the following ride

Brendan

Walker

555-555-5555

123 Fake St

Fri Aug 09 20:19:00 PDT 2002

------------------------

Thank you for accepting the ride!

 

<Dispatcher UI: 128.95.8.56>

Bob, Joe

Phone Number: 555-555-5555

Pickup Address: 123 Fake St

Destination: 987 Z Blvd

Pickup Time: 20:17

Pickup Date: 08-09-2002

Number in Party: 1

Cab Type: X

ETA: 20:36

 

<Server: 128.95.8.50>

DataStoreConnection - constructor username = mirvin: passwd = 403mirvin

Try to read for points from Database

found x: 91 y: 170

found x: 168 y: 72

found x: 244 y: 166

Finished reading from points from database

3Got mouse click @ x: 91 y: 170

1

6

Got mouse click @ x: 168 y: 72

2

7

Got mouse click @ x: 244 y: 166

3

10

insert into mapdata values('woohaa.gif',12282417,4796028,12198639,4738444)

insert into polygonvertices values(1,1,91.0,170.0)

insert into polygonvertices values(2,1,168.0,72.0)

insert into polygonvertices values(3,1,244.0,166.0)

121.98639

47.38444

122.82417

47.96028

Model got 10 zones

Number of zones created : 10

zone_0 id : 0

zone_1 id : 1

zone_2 id : 2

zone_3 id : 3

zone_4 id : 4

zone_5 id : 5

zone_6 id : 6

zone_7 id : 7

zone_8 id : 8

zone_9 id : 9

*********   Begin : registerCabToModel  ***********

registering cab console : 15   driver : 16    gps : (122.70898,47.840107)

 

*********   Begin : string2gps  ***********

x : 122.70898

y : 47.84010

x : 122.70898

y : 47.8401

*********   End : string2gps  ***********

console 15 registered to zone 3

*********   End : registerCabToModel 5  ***********

*********   Begin : registerCabToModel  ***********

registering cab console : 17   driver : 18    gps : (122.14363,47.72611)

 

*********   Begin : string2gps  ***********

x : 122.14363

y : 47.7261

x : 122.14363

y : 47.7261

*********   End : string2gps  ***********

console 17 registered to zone 3

*********   End : registerCabToModel 5  ***********

ModelRMI addCustomer

 

Got customer

name : Joe Bob

phone number : 555-555-5555

thread created with method: addCustomer

 

addCustomer Thread Created.

Thread Running

*********   Begin : addCustomer  ***********

firstname: Joe

last name : Bob

phone : 555-555-5555

call in time : Fri Aug 09 20:16:45 PDT 2002

pickup add : 123 Fake St

pick up time : Fri Aug 09 20:17:00 PDT 2002

dest add : 987 Z Blvd

*********   Begin : getZone  ***********

*********   End : getZone  ***********

*********   Begin : getZone  ***********

*********   End : getZone  ***********

ETA is SET

pickup zone id : 3

destination zone id : 0

Customer pickup TIME : Fri Aug 09 20:17:00 PDT 2002

Insert into RideRequests values('Bob', 'Joe', '555-555-5555', 'false', '', '2002

-08-09 20:16:45.824', '2002-08-09 20:36:46.099', '123 Fake St', 3, '987 Z Blvd',

 0, 1)

Error: SQL exception - addCustomer

java.sql.SQLException: ERROR:  <unnamed> referential integrity violation - key r

eferenced from riderequests not found in zones

 

        at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:94)

        at org.postgresql.Connection.ExecSQL(Connection.java:398)

        at org.postgresql.jdbc2.Statement.execute(Statement.java:130)

        at org.postgresql.jdbc2.Statement.executeUpdate(Statement.java:73)

        at taxisrus.implementation.DataStoreConnection.addRideRequest(DataStoreC

onnection.java:252)

        at taxisrus.implementation.Model.addCustomer(Model.java:179)

        at taxisrus.implementation.rmi.ModelRMIThread.run(ModelRMIThread.java:38

)

        at taxisrus.implementation.rmi.ModelRMI.addCustomer(ModelRMI.java:58)

        at java.lang.reflect.Method.invoke(Native Method)

        at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)

        at sun.rmi.transport.Transport$1.run(Transport.java:142)

        at java.security.AccessController.doPrivileged(Native Method)

        at sun.rmi.transport.Transport.serviceCall(Transport.java:139)

        at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4

43)

        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport

.java:643)

        at java.lang.Thread.run(Thread.java:484)

End of addCustomer in Model

******************************  BUSY CAB LIST ********************

NO BUSY CABS

******************************  END ******************************

*********   End : addCustomer  ***********

addCustomer Thread Finished

addCustomer Thread Stopped

20:36

Accessing cab in CabComm at index: 0

*********   Begin : getAllCabs  ***********

*********   End : getAllCabs  ***********

*********   Begin : rideRequest  ***********

RIDE REQUEST FOR : Bob with cab_id : 15

******************************  BUSY CAB LIST ********************

NO BUSY CABS

******************************  END ******************************

*********   Begin : makeStringForCabConsole  ***********

*********   End : makeStringForCabConsole  ***********

Received REJECT from cab console

Insert into RideDenials values(15, '2002-08-09 20:16:54.64')

*********   End : rideRequest  ***********

*********   Begin : cabRefusedRide  ***********

*********   End : cabRefusedRide  ***********

Accessing cab in CabComm at index: 1

*********   Begin : getAllCabs  ***********

*********   End : getAllCabs  ***********

*********   Begin : rideRequest  ***********

RIDE REQUEST FOR : Bob with cab_id : 17

******************************  BUSY CAB LIST ********************

NO BUSY CABS

******************************  END ******************************

*********   Begin : makeStringForCabConsole  ***********

*********   End : makeStringForCabConsole  ***********

Received OK from cab console

*********   End : rideRequest  ***********

*********   Begin : cabIsScheduled  ***********

******************************  BUSY CAB LIST ********************

NO BUSY CABS

******************************  END ******************************

*********   Begin : moveCabFromZoneToBusy  ***********

MoveCabFromZoneToBusy : cabid : 17   zoneid : 3

******************************  BUSY CAB LIST ********************

NO BUSY CABS

******************************  END ******************************

MoveCabFromZoneToBusy 2

******************************  BUSY CAB LIST ********************

cab id : 17   customer last name : Bob

******************************  END ******************************

*********   End : moveCabFromZoneToBusy 1  ***********

cabIsScheduled : cust. pickup time : Fri Aug 09 20:17:00 PDT 2002

delete from rideRequests where lastname='Bob' and firstname='Joe' and phone = '5

55-555-5555' and eta='2002-08-09 20:36:46.099'

select DISTINCT * from customers where lastname='Bob' and firstname='Joe' and ph

one='555-555-5555'

insert into customers values('Bob', 'Joe', '555-555-5555', 'false', '')

insert into rideLog values ('Bob', '555-555-5555', 17, 'false', '', '2002-08-09

20:16:45.824', '2002-08-09 20:36:46.099', '2002-08-09 20:17:00.0', '123 Fake St'

, 3, '987 Z Blvd', 0, 1, 0.0, 'false', 0.0)

Error: SQLException - DataStoreConnection.createRideLogEntry

java.sql.SQLException: ERROR:  <unnamed> referential integrity violation - key r

eferenced from ridelog not found in zones

 

        at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:94)

        at org.postgresql.Connection.ExecSQL(Connection.java:398)

        at org.postgresql.jdbc2.Statement.execute(Statement.java:130)

        at org.postgresql.jdbc2.Statement.executeUpdate(Statement.java:73)

        at taxisrus.implementation.DataStoreConnection.createRideLogEntry(DataSt

oreConnection.java:1447)

        at taxisrus.implementation.DataStoreConnection.storeCabRideAssignment(Da

taStoreConnection.java:423)

        at taxisrus.implementation.Model.cabIsScheduled(Model.java:478)

        at taxisrus.implementation.Scheduler.confirmCab(Scheduler.java:383)

        at taxisrus.implementation.scheduler_stuff.CabCommunicationTask.run(CabC

ommunicationTask.java:85)

        at java.util.TimerThread.mainLoop(Timer.java:435)

        at java.util.TimerThread.run(Timer.java:385)

*********   End : cabIsScheduled 4  ***********

ModelRMI addCustomer

 

Got customer

name : Brendan Walker

phone number : 555-555-5555

thread created with method: addCustomer

 

addCustomer Thread Created.

Thread Running

*********   Begin : addCustomer  ***********

firstname: Brendan

last name : Walker

phone : 555-555-5555

call in time : Fri Aug 09 20:17:32 PDT 2002

pickup add : 123 Fake St

pick up time : Fri Aug 09 20:19:00 PDT 2002

dest add : 987 Z Blvd

*********   Begin : getZone  ***********

*********   End : getZone  ***********

*********   Begin : getZone  ***********

*********   End : getZone  ***********

ETA is SET

pickup zone id : 3

destination zone id : 0

Customer pickup TIME : Fri Aug 09 20:19:00 PDT 2002

Insert into RideRequests values('Walker', 'Brendan', '555-555-5555', 'false', ''

, '2002-08-09 20:17:32.37', '2002-08-09 20:37:32.653', '123 Fake St', 3, '987 Z

Blvd', 0, 1)

End of addCustomer in Model

******************************  BUSY CAB LIST ********************

cab id : 17   customer last name : Bob

******************************  END ******************************

*********   End : addCustomer  ***********

addCustomer Thread Finished

addCustomer Thread Stopped

20:37

Accessing cab in CabComm at index: 0

*********   Begin : getAllCabs  ***********

*********   End : getAllCabs  ***********

*********   Begin : rideRequest  ***********

RIDE REQUEST FOR : Walker with cab_id : 15

******************************  BUSY CAB LIST ********************

cab id : 17   customer last name : Bob

******************************  END ******************************

*********   Begin : makeStringForCabConsole  ***********

*********   End : makeStringForCabConsole  ***********

Received OK from cab console

*********   End : rideRequest  ***********

*********   Begin : cabIsScheduled  ***********

******************************  BUSY CAB LIST ********************

cab id : 17   customer last name : Bob

******************************  END ******************************

*********   Begin : moveCabFromZoneToBusy  ***********

MoveCabFromZoneToBusy : cabid : 15   zoneid : 3

******************************  BUSY CAB LIST ********************

cab id : 17   customer last name : Bob

******************************  END ******************************

MoveCabFromZoneToBusy 2

******************************  BUSY CAB LIST ********************

cab id : 17   customer last name : Bob

cab id : 15   customer last name : Walker

******************************  END ******************************

*********   End : moveCabFromZoneToBusy 1  ***********

cabIsScheduled : cust. pickup time : Fri Aug 09 20:19:00 PDT 2002

delete from rideRequests where lastname='Walker' and firstname='Brendan' and pho

ne = '555-555-5555' and eta='2002-08-09 20:37:32.653'

Error: sqlException - DataStoreConnection.findAndDeleteRideRequest

java.sql.SQLException: ERROR:  <unnamed> referential integrity violation - key r

eferenced from riderequests not found in zones

 

        at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:94)

        at org.postgresql.Connection.ExecSQL(Connection.java:398)

        at org.postgresql.jdbc2.Statement.execute(Statement.java:130)

        at org.postgresql.jdbc2.Statement.executeUpdate(Statement.java:73)

        at taxisrus.implementation.DataStoreConnection.findAndDeleteRideRequest(

DataStoreConnection.java:1481)

        at taxisrus.implementation.DataStoreConnection.storeCabRideAssignment(Da

taStoreConnection.java:373)

        at taxisrus.implementation.Model.cabIsScheduled(Model.java:478)

        at taxisrus.implementation.Scheduler.confirmCab(Scheduler.java:383)

        at taxisrus.implementation.scheduler_stuff.CabCommunicationTask.run(CabC

ommunicationTask.java:85)

        at java.util.TimerThread.mainLoop(Timer.java:435)

        at java.util.TimerThread.run(Timer.java:385)

select DISTINCT * from customers where lastname='Walker' and firstname='Brendan'

 and phone='555-555-5555'

sql exception - DataStoreConnection.checkNewCustomer

No results were returned by the query.

        at org.postgresql.jdbc2.Statement.executeQuery(Statement.java:58)

        at taxisrus.implementation.DataStoreConnection.checkNewCustomer(DataStor

eConnection.java:472)

        at taxisrus.implementation.DataStoreConnection.storeCabRideAssignment(Da

taStoreConnection.java:395)

        at taxisrus.implementation.Model.cabIsScheduled(Model.java:478)

        at taxisrus.implementation.Scheduler.confirmCab(Scheduler.java:383)

        at taxisrus.implementation.scheduler_stuff.CabCommunicationTask.run(CabC

ommunicationTask.java:85)

        at java.util.TimerThread.mainLoop(Timer.java:435)

        at java.util.TimerThread.run(Timer.java:385)

insert into customers values('Walker', 'Brendan', '555-555-5555', 'false', '')

Error: SQL exception - storeCabRideAssignment

A result was returned by the statement, when none was expected.

        at org.postgresql.jdbc2.Statement.executeUpdate(Statement.java:75)

        at taxisrus.implementation.DataStoreConnection.storeCabRideAssignment(Da

taStoreConnection.java:415)

        at taxisrus.implementation.Model.cabIsScheduled(Model.java:478)

        at taxisrus.implementation.Scheduler.confirmCab(Scheduler.java:383)

        at taxisrus.implementation.scheduler_stuff.CabCommunicationTask.run(CabC

ommunicationTask.java:85)

        at java.util.TimerThread.mainLoop(Timer.java:435)

        at java.util.TimerThread.run(Timer.java:385)

Datastore failure in CabIsScheduled

*********   End : cabIsScheduled 3  ***********

Result: PASS

Both customers were scheduled and assigned to cabs properly. But again, the same mysterious, but seemingly unrelated SQL error:

Error: SQL exception - addCustomer

java.sql.SQLException: ERROR:  <unnamed> referential integrity violation - key r

eferenced from riderequests not found in zones