Running the Transit Sample from the Command Line
The TransitDemo or TransitDemo.bat script automatically starts and stops cref when needed to simulate interaction sessions with the POS terminal and the turnstile transit terminal.
- Open a Command Prompt window and perform the following:
- Navigate to the JC_CLASSIC_HOME
\bindirectory. - Start the RI by using the following command at the command prompt:
cref -o transitCard
- Navigate to the JC_CLASSIC_HOME
- Open a second Command Prompt window and perform the following:
- Navigate to the JC_CLASSIC_HOME
\samples\reference_apps\Transit\Transit\appletdirectory. - Enter the following command at the command prompt:
ant allIn this sample's
appletdirectory, theantallcommand generates the APDU script and downloads the CAP file.
- Navigate to the JC_CLASSIC_HOME
- In the
crefCommand Prompt window, restart the RI by using the following command:cref -i transitCard -o transitCardStarting the RI with the
-itransitCard-otransitCardoptions and filenames causes the RI to use the contents of thetransitCardfile to initialize the EEPROM and to save the EEPROM contents to a file namedtransitCard. See Using the Reference Implementation for more information about usingcrefand its command line options. - In the applet Command Prompt window, perform the following:
- Navigate to the JC_CLASSIC_HOME
\samples\reference_apps\Transit\Transit\clientdirectory. - Enter the following command at the command prompt:
ant run1In this sample's
clientdirectory, theantrun1 command compiles and builds theclient.jarand generates theactual_output1.txtfile.
- Navigate to the JC_CLASSIC_HOME
- Verify that the contents of the
actual_output1.txtfile are the same as the contents of theTransitClient_1.expected.outputfile.Because the terminal uses random number generation for challenge/response and for generating session key, the contents of theactual_output1.txtfile varies from theTransitClient_1.expected.outputfile for the following instructions:CLA:80 INS:30CLA:80 INS:40
- In the
crefCommand Prompt window, restart the RI by using the following command:cref -i transitCard -o transitCard - In the applet Command Prompt window, enter the following command at the command prompt:
ant run2In this sample's
clientdirectory, theantrun2 command compiles and builds theclient.jarand generates theactual_output2.txtfile. - Verify that the contents of the
actual_output2.txtfile are the same as the contents of theTransitClient_2.expected.outputfile.Because the terminal uses random number generation for challenge/response and for generating session key, the contents of theactual_output2.txtfile varies from theTransitClient_2.expected.outputfile for the following instructions:CLA:80 INS:30CLA:80 INS:40
- In the
crefCommand Prompt window, restart the RI by using the following command:cref -i transitCard -o transitCard - In the applet Command Prompt window, enter the following command at the command prompt:
ant run3In this sample's
clientdirectory, theantrun3 command compiles and builds theclient.jarand generates theactual_output3.txtfile. - Verify that the contents of the
actual_output3.txtfile are the same as the contents of theTransitClient_3.expected.outputfile.Because the terminal uses random number generation for challenge/response and for generating session key, the contents of theactual_output3.txtfile varies from theTransitClient_3.expected.outputfile for the following instructions:CLA:80 INS:30CLA:80 INS:40
- In the
crefCommand Prompt window, restart the RI by using the following command:cref -i transitCard -o transitCard - In the applet Command Prompt window, enter the following command at the command prompt:
ant run4In this sample's
clientdirectory, theantrun4 command compiles and builds theclient.jarand generates theactual_output4.txtfile - Verify that the contents of the
actual_output4.txtfile are the same as the contents of theTransitClient_4.expected.outputfile.Because the terminal uses random number generation for challenge/response and for generating session key, the contents of theactual_output4.txtfile varies from theTransitClient_4.expected.outputfile for the following instructions:CLA:80 INS:30CLA:80 INS:40

