ds.ov2.test
Class Data_protocol_test_stubs

java.lang.Object
  extended by ds.ov2.test.Data_protocol_test_stubs

public class Data_protocol_test_stubs
extends Object

Stub code for running methods in the testframe on the host. Defines one stub method for each protocol step in Data_protocol.id. This class is the test-frame alternative to Data_protocol_stubs. It provides the same public interface, but instead of communicating with a Java Card and invoking methods there, it directly invokes the methods on the very same Java Virtual machine. This is of course only possible, if (almost) all of the applet code is available on the host. All CardChannel arguments in this class are unused.

Each stub method here performs the following actions:

  1. argument conversion (for instance from BigInteger to Bignat)
  2. running the specified action for this step
  3. result conversion
  4. and finally packages several results into one tuple object

CPP Preprocessing
no cpp preprocessing needed
Execution Environment:
host
Author:
idl compiler
Version:
automatically generated from Data_protocol.id

Nested Class Summary
static class Data_protocol_test_stubs.Check_data_result
          Result record for step check_data of protocol check_data.
static class Data_protocol_test_stubs.Data_perf_answer_to_challenge_result
          Result record for step data_perf_answer_to_challenge of protocol data_perf_proof.
static class Data_protocol_test_stubs.Data_perf_proof_commit_result
          Result record for step data_perf_proof_commit of protocol data_perf_proof.
static class Data_protocol_test_stubs.Data_performance_send_result
          Result record for step data_performance_send of protocol data_performance_send.
 
Field Summary
private  PrintWriter out
          The output channel for debugging information of the OV-chip protocol layer.
private  Data_protocol_description protocol_description
          A protocol description instance from Data_protocol.id.
 
Constructor Summary
Data_protocol_test_stubs(Data_protocol_description d, PrintWriter o, boolean script)
          Stub constructor.
 
Method Summary
 Data_protocol_test_stubs.Check_data_result check_data_call(CardChannel _cc, Resizable_buffer _buf_0_host_arg, Resizable_buffer _buf_1_host_arg, Resizable_buffer _buf_2_host_arg, Resizable_buffer _buf_3_host_arg, Resizable_buffer _buf_4_host_arg)
          Call step check_data of protocol check_data in the test environment.
 Data_protocol_test_stubs.Data_perf_answer_to_challenge_result data_perf_answer_to_challenge_call(CardChannel _cc, Resizable_buffer _buf_4_host_arg)
          Call step data_perf_answer_to_challenge of protocol data_perf_proof in the test environment.
 Data_protocol_test_stubs.Data_perf_proof_commit_result data_perf_proof_commit_call(CardChannel _cc, Resizable_buffer _buf_0_host_arg)
          Call step data_perf_proof_commit of protocol data_perf_proof in the test environment.
 long data_performance_receive_call(CardChannel _cc, Resizable_buffer _buf_0_host_arg)
          Call step data_performance_receive of protocol data_performance_receive in the test environment.
 Data_protocol_test_stubs.Data_performance_send_result data_performance_send_call(CardChannel _cc)
          Call step data_performance_send of protocol data_performance_send in the test environment.
 int[] set_size_call(CardChannel _cc, int[] _buf_sizes_host_arg, boolean _performance_test_host_arg)
          Call step set_size of protocol set_size in the test environment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

protocol_description

private Data_protocol_description protocol_description
A protocol description instance from Data_protocol.id. Used to access the host initializers, which are additional parameters for the APDU type constructors of arguments or results. Initialized in the constructor.


out

private PrintWriter out
The output channel for debugging information of the OV-chip protocol layer. Initialized in the constructor.

Constructor Detail

Data_protocol_test_stubs

public Data_protocol_test_stubs(Data_protocol_description d,
                                PrintWriter o,
                                boolean script)
Stub constructor. In this test-frame alternative there are no Host_protocol data structures to initialize. Therefore this constructor only saves the first two arguments into object local fields. The argument script is only there for compatibility with Data_protocol_stubs, it is ignored here.

Parameters:
d - protocol description instance for Data_protocol.id
o - channel for printing debugging information, pass null for disabling debugging information
script - ignored here, controls printing of apdutool lines in Data_protocol_stubs
Method Detail

check_data_call

public Data_protocol_test_stubs.Check_data_result check_data_call(CardChannel _cc,
                                                                  Resizable_buffer _buf_0_host_arg,
                                                                  Resizable_buffer _buf_1_host_arg,
                                                                  Resizable_buffer _buf_2_host_arg,
                                                                  Resizable_buffer _buf_3_host_arg,
                                                                  Resizable_buffer _buf_4_host_arg)
Call step check_data of protocol check_data in the test environment.

Parameters:
_cc - ignored here, can be null, card channel in Data_protocol_stubs
_buf_0_host_arg - argument buf_0
_buf_1_host_arg - argument buf_1
_buf_2_host_arg - argument buf_2
_buf_3_host_arg - argument buf_3
_buf_4_host_arg - argument buf_4
Returns:
Check_data_result record containing all results, including the duration of the call.

set_size_call

public int[] set_size_call(CardChannel _cc,
                           int[] _buf_sizes_host_arg,
                           boolean _performance_test_host_arg)
Call step set_size of protocol set_size in the test environment.

Parameters:
_cc - ignored here, can be null, card channel in Data_protocol_stubs
_buf_sizes_host_arg - argument buf_sizes to be converted to APDU_short_array
_performance_test_host_arg - argument performance_test to be converted to APDU_boolean
Returns:
result buf_sizes converted from APDU_short_array

data_performance_receive_call

public long data_performance_receive_call(CardChannel _cc,
                                          Resizable_buffer _buf_0_host_arg)
Call step data_performance_receive of protocol data_performance_receive in the test environment.

Parameters:
_cc - ignored here, can be null, card channel in Data_protocol_stubs
_buf_0_host_arg - argument buf_0
Returns:
Duration of the call in nanoseconds. The measurement includes (de-)serialization but not the allocation of argument and result arrays.

data_performance_send_call

public Data_protocol_test_stubs.Data_performance_send_result data_performance_send_call(CardChannel _cc)
Call step data_performance_send of protocol data_performance_send in the test environment.

Parameters:
_cc - ignored here, can be null, card channel in Data_protocol_stubs
Returns:
Data_performance_send_result record containing all results, including the duration of the call.

data_perf_proof_commit_call

public Data_protocol_test_stubs.Data_perf_proof_commit_result data_perf_proof_commit_call(CardChannel _cc,
                                                                                          Resizable_buffer _buf_0_host_arg)
Call step data_perf_proof_commit of protocol data_perf_proof in the test environment.

Parameters:
_cc - ignored here, can be null, card channel in Data_protocol_stubs
_buf_0_host_arg - argument buf_0
Returns:
Data_perf_proof_commit_result record containing all results.

data_perf_answer_to_challenge_call

public Data_protocol_test_stubs.Data_perf_answer_to_challenge_result data_perf_answer_to_challenge_call(CardChannel _cc,
                                                                                                        Resizable_buffer _buf_4_host_arg)
Call step data_perf_answer_to_challenge of protocol data_perf_proof in the test environment.

Parameters:
_cc - ignored here, can be null, card channel in Data_protocol_stubs
_buf_4_host_arg - argument buf_4
Returns:
Data_perf_answer_to_challenge_result record containing all results.