/* * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions.
*/
/* * @test * @bug 4263142 4172661 * @summary First run verifies that objects serialize and deserialize * correctly against the current release. * Second run verifies that objects from previous releases * still deserialize correctly. The serial_1_6.out file was * created using the "write" option under release 1.6. * The test was modified after fixing 4172661 to add testing * of Path2D serialization (and to recut the test file with * the new serialVersionUID of GeneralPath). * @run main SerialTest * @run main SerialTest read serial_1_6.out
*/
publicclass SerialTest { publicstatic Object testobjects[] = { // non-shapes... new Point2D.Float(37, 42), new Point2D.Double(85, 63), new AffineTransform(10, 20, 30, 40, 50, 60),
// shapes... new QuadCurve2D.Float(10f, 10f, 50f, 50f, 100f, 10f), new QuadCurve2D.Double(20f, 20f, 50f, 50f, 100f, 20f), new CubicCurve2D.Float(10f, 10f, 50f, 10f, 10f, 50f, 50f, 50f), new CubicCurve2D.Double(0.0, 0.0, 50.0, 0.0, 0.0, 50.0, 50.0, 50.0), new GeneralPath(), new GeneralPath(PathIterator.WIND_NON_ZERO), new GeneralPath(PathIterator.WIND_EVEN_ODD),
makeGeneralPath(PathIterator.WIND_NON_ZERO, 5f),
makeGeneralPath(PathIterator.WIND_EVEN_ODD, 23f), new Line2D.Float(20f, 20f, 25f, 50f), new Line2D.Double(20.0, 20.0, 35.0, 50.0), new Rectangle2D.Float(100f, 100f, 50f, 25f), new Rectangle2D.Double(200.0, 200.0, 75.0, 35.0), new RoundRectangle2D.Float(120f, 120f, 50f, 35f, 5f, 7f), new RoundRectangle2D.Double(220.0, 220.0, 85.0, 45.0, 3.0, 9.0), new Ellipse2D.Float(110f, 110f, 50f, 55f), new Ellipse2D.Double(210.0, 210.0, 75.0, 45.0), new Arc2D.Float(10f, 10f, 50f, 40f, 45f, 72f, Arc2D.OPEN), new Arc2D.Float(10f, 10f, 40f, 50f, 135f, 72f, Arc2D.PIE), new Arc2D.Float(10f, 10f, 40f, 60f, 225f, 72f, Arc2D.CHORD), new Arc2D.Double(10.0, 20.0, 50.0, 40.0, 45.0, 72.0, Arc2D.OPEN), new Arc2D.Double(10.0, 20.0, 40.0, 50.0, 135.0, 72.0, Arc2D.PIE), new Arc2D.Double(10.0, 20.0, 40.0, 60.0, 225.0, 72.0, Arc2D.CHORD),
// Paths new Path2D.Float(), new Path2D.Float(PathIterator.WIND_NON_ZERO), new Path2D.Float(PathIterator.WIND_EVEN_ODD),
makePath2DFloat(PathIterator.WIND_NON_ZERO, 5f),
makePath2DFloat(PathIterator.WIND_EVEN_ODD, 23f), new Path2D.Double(), new Path2D.Double(PathIterator.WIND_NON_ZERO), new Path2D.Double(PathIterator.WIND_EVEN_ODD),
makePath2DDouble(PathIterator.WIND_NON_ZERO, 5f),
makePath2DDouble(PathIterator.WIND_EVEN_ODD, 23f),
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.