< prev index next >

test/java/lang/StringBuffer/CompactStringBufferSerialization.java

Print this page
rev 17324 : 8181759: add explicit @build actions for jdk.test.lib classes in all :tier1 tests
Reviewed-by: duke


  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 import java.io.*;
  25 
  26 import org.testng.annotations.DataProvider;
  27 import org.testng.annotations.Test;
  28 
  29 import static jdk.test.lib.util.SerializationUtils.*;
  30 import static org.testng.Assert.*;
  31 
  32 /*
  33  * @test
  34  * @bug 8077559
  35  * @library /test/lib

  36  * @summary Tests Compact String. This one is testing StringBuffer serialization
  37  *          among -XX:+CompactStrings/-XX:-CompactStrings/LegacyStringBuffer
  38  * @run testng/othervm -XX:+CompactStrings CompactStringBufferSerialization
  39  * @run testng/othervm -XX:-CompactStrings CompactStringBufferSerialization
  40  */
  41 
  42 public class CompactStringBufferSerialization {
  43     @DataProvider
  44     public Object[][] provider() {
  45         return new Object[][] {
  46                 // every byte array is serialized from corresponding StringBuilder object
  47                 // by previous JDK(build 1.8.0_45-b14).
  48                 new Object[] {
  49                         new StringBuffer(""),
  50                         new byte[] { -84, -19, 0, 5, 115, 114, 0, 22, 106, 97, 118, 97, 46, 108, 97, 110, 103, 46, 83, 116, 114, 105, 110, 103, 66, 117, 102,
  51                                 102, 101, 114, 47, 7, 7, -39, -22, -56, -22, -45, 3, 0, 3, 73, 0, 5, 99, 111, 117, 110, 116, 90, 0, 6, 115, 104, 97, 114, 101,
  52                                 100, 91, 0, 5, 118, 97, 108, 117, 101, 116, 0, 2, 91, 67, 120, 112, 0, 0, 0, 0, 0, 117, 114, 0, 2, 91, 67, -80, 38, 102, -80,
  53                                 -30, 93, -124, -84, 2, 0, 0, 120, 112, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  54                                 0, 0, 0, 0, 0, 0, 0, 120 } },
  55                 new Object[] {




  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 import java.io.*;
  25 
  26 import org.testng.annotations.DataProvider;
  27 import org.testng.annotations.Test;
  28 
  29 import static jdk.test.lib.util.SerializationUtils.*;
  30 import static org.testng.Assert.*;
  31 
  32 /*
  33  * @test
  34  * @bug 8077559
  35  * @library /test/lib
  36  * @build jdk.test.lib.util.SerializationUtils
  37  * @summary Tests Compact String. This one is testing StringBuffer serialization
  38  *          among -XX:+CompactStrings/-XX:-CompactStrings/LegacyStringBuffer
  39  * @run testng/othervm -XX:+CompactStrings CompactStringBufferSerialization
  40  * @run testng/othervm -XX:-CompactStrings CompactStringBufferSerialization
  41  */
  42 
  43 public class CompactStringBufferSerialization {
  44     @DataProvider
  45     public Object[][] provider() {
  46         return new Object[][] {
  47                 // every byte array is serialized from corresponding StringBuilder object
  48                 // by previous JDK(build 1.8.0_45-b14).
  49                 new Object[] {
  50                         new StringBuffer(""),
  51                         new byte[] { -84, -19, 0, 5, 115, 114, 0, 22, 106, 97, 118, 97, 46, 108, 97, 110, 103, 46, 83, 116, 114, 105, 110, 103, 66, 117, 102,
  52                                 102, 101, 114, 47, 7, 7, -39, -22, -56, -22, -45, 3, 0, 3, 73, 0, 5, 99, 111, 117, 110, 116, 90, 0, 6, 115, 104, 97, 114, 101,
  53                                 100, 91, 0, 5, 118, 97, 108, 117, 101, 116, 0, 2, 91, 67, 120, 112, 0, 0, 0, 0, 0, 117, 114, 0, 2, 91, 67, -80, 38, 102, -80,
  54                                 -30, 93, -124, -84, 2, 0, 0, 120, 112, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  55                                 0, 0, 0, 0, 0, 0, 0, 120 } },
  56                 new Object[] {


< prev index next >