1 6 21 22 package de.schlichtherle.util.zip; 23 24 import java.util.logging.Logger ; 25 26 import junit.framework.*; 27 28 33 public class TextDataZipTest extends ZipTestBase { 34 35 private static final Logger logger 36 = Logger.getLogger(TextDataZipTest.class.getName()); 37 38 private static final byte[] data; 39 static { 40 boolean ea = false; 41 assert ea = true; logger.config("Java assertions enabled: " + ea); 43 44 final String text = "This is a truly compressible text!\n"; 45 final int count = 1024 * 1024 / text.length(); 46 final int length = count * text.length(); StringBuffer buf = new StringBuffer (length); 48 for (int i = 0; i < count; i++) { 49 buf.append(text); 50 } 51 data = buf.toString().getBytes(); 52 logger.config("Created " + data.length + " bytes of highly compressible text as the data."); 53 } 54 55 public static Test suite() throws Exception { 56 TestSuite suite = new TestSuite(TextDataZipTest.class); 57 58 return suite; 59 } 60 61 62 public TextDataZipTest(String testName) { 63 super(testName); 64 } 65 66 protected void setUp() throws Exception { 67 super.data = TextDataZipTest.data; 68 69 super.setUp(); 70 } 71 } 72 | Popular Tags |