From 0b91f92995d9907afab39ee765ff9d08dcb9cf98 Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Fri, 05 Oct 2012 12:23:44 +0000
Subject: [PATCH] Reduce time spent in testEncodeDecodeOctetStringType by reducing the number of ASN1 test types to 4 key values (0, 127, 128, and 255).

---
 opendj3/opendj-ldap-sdk/src/test/java/org/forgerock/opendj/asn1/ASN1WriterTestCase.java |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/opendj3/opendj-ldap-sdk/src/test/java/org/forgerock/opendj/asn1/ASN1WriterTestCase.java b/opendj3/opendj-ldap-sdk/src/test/java/org/forgerock/opendj/asn1/ASN1WriterTestCase.java
index 7dbf562..a8382a2 100644
--- a/opendj3/opendj-ldap-sdk/src/test/java/org/forgerock/opendj/asn1/ASN1WriterTestCase.java
+++ b/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.

--
Gitblit v1.10.0