ds.ov2.test
Class Misc_protocols_test_stubs

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

public class Misc_protocols_test_stubs
extends Object

Stub code for running methods in the testframe on the host. Defines one stub method for each protocol step in Misc_protocols.id. This class is the test-frame alternative to Misc_protocols_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 Misc_protocols.id

Nested Class Summary
static class Misc_protocols_test_stubs.Mem_size_result
          Result record for step mem_size of protocol mem_size.
static class Misc_protocols_test_stubs.Status_result
          Result record for step status of protocol status.
 
Field Summary
private  PrintWriter out
          The output channel for debugging information of the OV-chip protocol layer.
private  Misc_protocols_description protocol_description
          A protocol description instance from Misc_protocols.id.
 
Constructor Summary
Misc_protocols_test_stubs(Misc_protocols_description d, PrintWriter o, boolean script)
          Stub constructor.
 
Method Summary
 Misc_protocols_test_stubs.Mem_size_result mem_size_call(CardChannel _cc)
          Call step mem_size of protocol mem_size in the test environment.
 long ping_call(CardChannel _cc)
          Call step ping of protocol Ping in the test environment.
 void set_size_call(CardChannel _cc, int _short_bignat_size_host_arg, int _long_bignat_size_host_arg, int _double_bignat_size_host_arg, int _cipher_size_host_arg)
          Call step set_size of protocol set_size in the test environment.
 Misc_protocols_test_stubs.Status_result status_call(CardChannel _cc)
          Call step status of protocol status 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 Misc_protocols_description protocol_description
A protocol description instance from Misc_protocols.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

Misc_protocols_test_stubs

public Misc_protocols_test_stubs(Misc_protocols_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 Misc_protocols_stubs, it is ignored here.

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

ping_call

public long ping_call(CardChannel _cc)
Call step ping of protocol Ping in the test environment.

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

set_size_call

public void set_size_call(CardChannel _cc,
                          int _short_bignat_size_host_arg,
                          int _long_bignat_size_host_arg,
                          int _double_bignat_size_host_arg,
                          int _cipher_size_host_arg)
Call step set_size of protocol set_size in the test environment.

Parameters:
_cc - ignored here, can be null, card channel in Misc_protocols_stubs
_short_bignat_size_host_arg - argument short_bignat_size to be converted to APDU_short
_long_bignat_size_host_arg - argument long_bignat_size to be converted to APDU_short
_double_bignat_size_host_arg - argument double_bignat_size to be converted to APDU_short
_cipher_size_host_arg - argument cipher_size to be converted to APDU_short

mem_size_call

public Misc_protocols_test_stubs.Mem_size_result mem_size_call(CardChannel _cc)
Call step mem_size of protocol mem_size in the test environment.

Parameters:
_cc - ignored here, can be null, card channel in Misc_protocols_stubs
Returns:
Mem_size_result record containing all results.

status_call

public Misc_protocols_test_stubs.Status_result status_call(CardChannel _cc)
Call step status of protocol status in the test environment.

Parameters:
_cc - ignored here, can be null, card channel in Misc_protocols_stubs
Returns:
Status_result record containing all results.