mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Matthew Swift
05.23.2012 fcafeaaba05120f30399a607ce806fcc44f8c70c
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.
1 files modified
9 ■■■■ changed files
opendj-sdk/opendj3/opendj-ldap-sdk/src/test/java/org/forgerock/opendj/asn1/ASN1WriterTestCase.java 9 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj3/opendj-ldap-sdk/src/test/java/org/forgerock/opendj/asn1/ASN1WriterTestCase.java
@@ -48,14 +48,9 @@
@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.