test/java/io/Serializable/replaceStringArray/ReplaceStringArray.java

Print this page
rev 6075 : 7152866: Tests not run because they are missing the @run tag
Reviewed-by: chegar, dholmes


   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   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 /* @test
  25  * @clean A SubstituteObjectOutputStream SubstituteObjectInputStream
  26  * @bug 4099013
  27  * @summary Enable substitution of String and Array by ObjectStreams.
  28  */
  29 
  30 import java.io.*;
  31 import java.lang.reflect.Array;
  32 
  33 class A implements Serializable {
  34     String stringA;
  35     String stringB;
  36     String stringC;
  37     String[] arrayOfString;
  38 
  39     A() {
  40         stringA = "hello";
  41         stringB = "goodbye";
  42         stringC = stringA;
  43         arrayOfString = new String[2];
  44         for (int i = 0; i < arrayOfString.length; i++)
  45             arrayOfString[i] = new String("array element " + i);




   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   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 /* @test

  25  * @bug 4099013
  26  * @summary Enable substitution of String and Array by ObjectStreams.
  27  */
  28 
  29 import java.io.*;
  30 import java.lang.reflect.Array;
  31 
  32 class A implements Serializable {
  33     String stringA;
  34     String stringB;
  35     String stringC;
  36     String[] arrayOfString;
  37 
  38     A() {
  39         stringA = "hello";
  40         stringB = "goodbye";
  41         stringC = stringA;
  42         arrayOfString = new String[2];
  43         for (int i = 0; i < arrayOfString.length; i++)
  44             arrayOfString[i] = new String("array element " + i);