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
\bin
directory. - 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\applet
directory. - Enter the following command at the command prompt:
ant all
In this sample's
applet
directory, theant
all
command generates the APDU script and downloads the CAP file.
- Navigate to the JC_CLASSIC_HOME
- In the
cref
Command Prompt window, restart the RI by using the following command:cref -i transitCard -o transitCard
Starting the RI with the
-i
transitCard
-o
transitCard
options and filenames causes the RI to use the contents of thetransitCard
file to initialize the EEPROM and to save the EEPROM contents to a file namedtransitCard
. See Using the Reference Implementation for more information about usingcref
and its command line options. - In the applet Command Prompt window, perform the following:
- Navigate to the JC_CLASSIC_HOME
\samples\reference_apps\Transit\Transit\client
directory. - Enter the following command at the command prompt:
ant run1
In this sample's
client
directory, theant
run1 command compiles and builds theclient.jar
and generates theactual_output1.txt
file.
- Navigate to the JC_CLASSIC_HOME
- Verify that the contents of the
actual_output1.txt
file are the same as the contents of theTransitClient_1.expected.output
file.Because the terminal uses random number generation for challenge/response and for generating session key, the contents of theactual_output1.txt
file varies from theTransitClient_1.expected.output
file for the following instructions:CLA:80 INS:30
CLA:80 INS:40
- In the
cref
Command 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 run2
In this sample's
client
directory, theant
run2 command compiles and builds theclient.jar
and generates theactual_output2.txt
file. - Verify that the contents of the
actual_output2.txt
file are the same as the contents of theTransitClient_2.expected.output
file.Because the terminal uses random number generation for challenge/response and for generating session key, the contents of theactual_output2.txt
file varies from theTransitClient_2.expected.output
file for the following instructions:CLA:80 INS:30
CLA:80 INS:40
- In the
cref
Command 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 run3
In this sample's
client
directory, theant
run3 command compiles and builds theclient.jar
and generates theactual_output3.txt
file. - Verify that the contents of the
actual_output3.txt
file are the same as the contents of theTransitClient_3.expected.output
file.Because the terminal uses random number generation for challenge/response and for generating session key, the contents of theactual_output3.txt
file varies from theTransitClient_3.expected.output
file for the following instructions:CLA:80 INS:30
CLA:80 INS:40
- In the
cref
Command 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 run4
In this sample's
client
directory, theant
run4 command compiles and builds theclient.jar
and generates theactual_output4.txt
file - Verify that the contents of the
actual_output4.txt
file are the same as the contents of theTransitClient_4.expected.output
file.Because the terminal uses random number generation for challenge/response and for generating session key, the contents of theactual_output4.txt
file varies from theTransitClient_4.expected.output
file for the following instructions:CLA:80 INS:30
CLA:80 INS:40