Reduce time spent in testEncodeDecodeOctetStringType by reducing the number of ASN1 test types to 4 key values (0, 127, 128, and 255).
Cobertura took over 90 seconds for this single test method, now it only takes 1-2 seconds.
| | |
| | | @SuppressWarnings("javadoc") |
| | | public abstract class ASN1WriterTestCase extends ForgeRockTestCase { |
| | | |
| | | // Create an array with all of the valid single-byte types. We don't |
| | | // Create an array with a selection of the valid single-byte types. We don't |
| | | // support multi-byte types, so this should be a comprehensive data set. |
| | | private final byte[] testTypes = new byte[0xFF]; |
| | | { |
| | | for (int i = 0x00; i < 0xFF; i++) { |
| | | testTypes[i] = (byte) (i & 0xFF); |
| | | } |
| | | } |
| | | private final byte[] testTypes = { 0x00, 0x7f, (byte) 0x80, (byte) 0xff }; |
| | | |
| | | /** |
| | | * Create byte arrays to use for element values. |