< prev index next >

test/java/util/zip/FlaterTest.java

Print this page




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /**
  25  * @test
  26  * @bug 6348045
  27  * @summary GZipOutputStream/InputStream goes critical(calls JNI_Get*Critical)
  28  * and causes slowness.  This test uses Deflater and Inflater directly.

  29  */
  30 
  31 import java.io.*;
  32 import java.nio.*;
  33 import java.util.*;
  34 import java.util.zip.*;
  35 
  36 /**
  37  * This test runs Inflater and Defalter in a number of simultaneous threads,
  38  * validating that the deflated & then inflated data matches the original
  39  * data.
  40  */
  41 public class FlaterTest extends Thread {
  42     private static final int DATA_LEN = 1024 * 128;
  43     private static byte[] data;
  44 
  45     // If true, print extra info.
  46     private static final boolean debug = false;
  47 
  48     // Set of Flater threads running.




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /**
  25  * @test
  26  * @bug 6348045
  27  * @summary GZipOutputStream/InputStream goes critical(calls JNI_Get*Critical)
  28  * and causes slowness.  This test uses Deflater and Inflater directly.
  29  * @key randomness
  30  */
  31 
  32 import java.io.*;
  33 import java.nio.*;
  34 import java.util.*;
  35 import java.util.zip.*;
  36 
  37 /**
  38  * This test runs Inflater and Defalter in a number of simultaneous threads,
  39  * validating that the deflated & then inflated data matches the original
  40  * data.
  41  */
  42 public class FlaterTest extends Thread {
  43     private static final int DATA_LEN = 1024 * 128;
  44     private static byte[] data;
  45 
  46     // If true, print extra info.
  47     private static final boolean debug = false;
  48 
  49     // Set of Flater threads running.


< prev index next >