< prev index next >

test/java/text/Format/NumberFormat/SerializationLoadTest.java

Print this page




  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 4101150
  27  * @library /java/text/testlib
  28  * @build SerializationLoadTest HexDumpReader
  29  * @run main SerializationLoadTest
  30  * @summary test serialization compatibility of DecimalFormat and DecimalFormatSymbols
  31  * @key randomness
  32  */
  33 
  34 import java.awt.*;
  35 import java.text.*;
  36 import java.util.*;
  37 import java.io.*;



  38 
  39 public class SerializationLoadTest {
  40 
  41     public static void main(String[] args)
  42     {
  43         try {
  44             InputStream istream1 = HexDumpReader.getStreamFromHexDump("DecimalFormat.114.txt");
  45             ObjectInputStream p = new ObjectInputStream(istream1);
  46             CheckDecimalFormat it = (CheckDecimalFormat)p.readObject();
  47             System.out.println("1.1.4 DecimalFormat Loaded ok.");
  48             System.out.println(it.Update());
  49             System.out.println("Called Update successfully.");
  50             istream1.close();
  51 
  52             InputStream istream2 = HexDumpReader.getStreamFromHexDump("DecimalFormatSymbols.114.txt");
  53             ObjectInputStream p2 = new ObjectInputStream(istream2);
  54             CheckDecimalFormatSymbols it2 = (CheckDecimalFormatSymbols)p2.readObject();
  55             System.out.println("1.1.4 DecimalFormatSymbols Loaded ok.");
  56             System.out.println("getDigit : "  + it2.Update());
  57             System.out.println("Called Update successfully.");




  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 4101150
  27  * @library /java/text/testlib
  28  * @build SerializationLoadTest HexDumpReader
  29  * @run main SerializationLoadTest
  30  * @summary test serialization compatibility of DecimalFormat and DecimalFormatSymbols
  31  * @key randomness
  32  */
  33 
  34 import java.io.InputStream;
  35 import java.io.ObjectInputStream;
  36 import java.io.Serializable;
  37 import java.text.DecimalFormat;
  38 import java.text.DecimalFormatSymbols;
  39 import java.text.NumberFormat;
  40 import java.util.Random;
  41 
  42 public class SerializationLoadTest {
  43 
  44     public static void main(String[] args)
  45     {
  46         try {
  47             InputStream istream1 = HexDumpReader.getStreamFromHexDump("DecimalFormat.114.txt");
  48             ObjectInputStream p = new ObjectInputStream(istream1);
  49             CheckDecimalFormat it = (CheckDecimalFormat)p.readObject();
  50             System.out.println("1.1.4 DecimalFormat Loaded ok.");
  51             System.out.println(it.Update());
  52             System.out.println("Called Update successfully.");
  53             istream1.close();
  54 
  55             InputStream istream2 = HexDumpReader.getStreamFromHexDump("DecimalFormatSymbols.114.txt");
  56             ObjectInputStream p2 = new ObjectInputStream(istream2);
  57             CheckDecimalFormatSymbols it2 = (CheckDecimalFormatSymbols)p2.readObject();
  58             System.out.println("1.1.4 DecimalFormatSymbols Loaded ok.");
  59             System.out.println("getDigit : "  + it2.Update());
  60             System.out.println("Called Update successfully.");


< prev index next >