8077371: Binary files in JAXP test should be removed
Reviewed-by: joehw
This commit is contained in:
parent
fe52917054
commit
40106422bd
test/jdk/javax/xml/jaxp/datatype/8033980
GregorianCalAndDurSerDataTemplate.javaGregorianCalAndDurSerDataUtil.javaGregorianCalendarAndDurationSerData.javaJDK6GregorianCalendarAndDurationSerData.javaJDK6_Duration.serJDK6_XMLGregorianCalendar.serJDK7GregorianCalendarAndDurationSerData.javaJDK7_Duration.serJDK7_XMLGregorianCalendar.serJDK8GregorianCalendarAndDurationSerData.javaJDK8_Duration.serJDK8_XMLGregorianCalendar.serJDK9GregorianCalendarAndDurationSerData.javaJDK9_Duration.serJDK9_XMLGregorianCalendar.serSerializationTest.java
@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Copyright (c) 2023, 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* This class provide the template for JDK version specific GregorianCalendarAndDurationSerData.java src file.
|
||||
*/
|
||||
public class GregorianCalAndDurSerDataTemplate {
|
||||
public static final String ORACLE_COPY_RIGHT = """
|
||||
/*
|
||||
* Copyright (c) %s, 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.
|
||||
*/
|
||||
\s
|
||||
/**
|
||||
* Mechanically generated %s specific serialization bytes for XMLGregorianCalendar and Duration data type.
|
||||
* Do not edit this file.
|
||||
*/""";
|
||||
public static final String GREGO_CAL_DUR_SER_CLASS = """
|
||||
public class %sGregorianCalendarAndDurationSerData extends GregorianCalendarAndDurationSerData {
|
||||
%s
|
||||
%s
|
||||
@Override
|
||||
public byte[] getGregorianCalendarByteArray() {
|
||||
return gregorianCalendarBytes;
|
||||
}
|
||||
\s
|
||||
@Override
|
||||
public byte[] getDurationBytes() {
|
||||
return durationBytes;
|
||||
}
|
||||
};""";
|
||||
}
|
@ -0,0 +1,141 @@
|
||||
/*
|
||||
* Copyright (c) 2023, 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
|
||||
* @summary utility to generate Gregorian Calendar and Duration serialized data java classes.
|
||||
* @run junit/manual GregorianCalAndDurSerDataUtil
|
||||
*/
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Formatter;
|
||||
|
||||
import javax.xml.datatype.DatatypeConfigurationException;
|
||||
import javax.xml.datatype.DatatypeFactory;
|
||||
import javax.xml.datatype.Duration;
|
||||
import javax.xml.datatype.XMLGregorianCalendar;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestInstance;
|
||||
|
||||
/**
|
||||
* Utility to generate the java source file for Gregorian Calendar and Duration serialized data
|
||||
* for specific version of JDK to be added in SerializationTest. Execute this test with desired version
|
||||
* of JDK to generate the java source file.
|
||||
*/
|
||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||
public class GregorianCalAndDurSerDataUtil {
|
||||
static String JDK = "JDK" + System.getProperty("java.version");
|
||||
static String testsrc = System.getProperty("test.src");
|
||||
final static String EXPECTED_CAL = "0001-01-01T00:00:00.0000000-05:00";
|
||||
final static String EXPECTED_DURATION = "P1Y1M1DT1H1M1S";
|
||||
String srcFilePrefix = JDK.toUpperCase().replace("-", "_");
|
||||
|
||||
|
||||
/**
|
||||
* Create the serialized Bytes array and serialized bytes base64 string for GregorianCalender and Duration
|
||||
* with jdk under test and generate the java source file.
|
||||
* @throws DatatypeConfigurationException Unexpected.
|
||||
* @throws IOException Unexpected.
|
||||
*/
|
||||
@BeforeAll
|
||||
public void setup() throws DatatypeConfigurationException, IOException {
|
||||
DatatypeFactory dtf = DatatypeFactory.newInstance();
|
||||
XMLGregorianCalendar xmlGregorianCalendar = dtf.newXMLGregorianCalendar(EXPECTED_CAL);
|
||||
Duration duration = dtf.newDuration(EXPECTED_DURATION);
|
||||
String copyRightStr = GregorianCalAndDurSerDataTemplate.ORACLE_COPY_RIGHT;
|
||||
String classStr = GregorianCalAndDurSerDataTemplate.GREGO_CAL_DUR_SER_CLASS;
|
||||
try(ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(baos);
|
||||
ByteArrayOutputStream baos2 = new ByteArrayOutputStream(); ObjectOutputStream oos2 = new ObjectOutputStream(baos2)) {
|
||||
//Serialize the given xmlGregorianCalendar
|
||||
oos.writeObject(xmlGregorianCalendar);
|
||||
//Serialize the given xml Duration
|
||||
oos2.writeObject(duration);
|
||||
Files.deleteIfExists(Path.of(testsrc,srcFilePrefix+"GregorianCalendarAndDurationSerData.java"));
|
||||
|
||||
copyRightStr = String.format(copyRightStr, LocalDate.now().getYear(), JDK);
|
||||
classStr = String.format(classStr, srcFilePrefix, generatePseudoCodeForGregCalSerBytes(baos),
|
||||
generatePseudoCodeForDurationSerBytes(baos2));
|
||||
String srcStr = copyRightStr + "\n" + classStr;
|
||||
Files.writeString(Path.of(testsrc,srcFilePrefix+"GregorianCalendarAndDurationSerData.java"), srcStr);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify that Java source file is created.
|
||||
*/
|
||||
@Test
|
||||
void testFileCreated() {
|
||||
assertTrue(Files.exists(Path.of(testsrc,srcFilePrefix+"GregorianCalendarAndDurationSerData.java")));
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the Java Pseudo code for serialized Gregorian Calendar byte array.
|
||||
* @param baos Serialized GregorianCalendar ByteArrayOutputStream.
|
||||
* @return pseudocode String for serialized Gregorian Calendar byte array.
|
||||
*/
|
||||
public static String generatePseudoCodeForGregCalSerBytes(ByteArrayOutputStream baos) {
|
||||
byte [] bytes = baos.toByteArray();
|
||||
StringBuilder sb = new StringBuilder(bytes.length * 5);
|
||||
sb.append("private final byte[] gregorianCalendarBytes = {");
|
||||
return generatePseudoCode(sb, bytes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the Java Pseudo code for serialized Duration byte array.
|
||||
* @param baos Serialized Duration ByteArrayOutputStream.
|
||||
* @return pseudocode String for serialized Duration byte array.
|
||||
*/
|
||||
public static String generatePseudoCodeForDurationSerBytes(ByteArrayOutputStream baos) {
|
||||
byte [] bytesdur = baos.toByteArray();
|
||||
StringBuilder sb = new StringBuilder(bytesdur.length * 5);
|
||||
sb.append("private final byte[] durationBytes = {");
|
||||
return generatePseudoCode(sb, bytesdur);
|
||||
}
|
||||
|
||||
private static String generatePseudoCode(StringBuilder sb, byte [] bytes) {
|
||||
final int linelen = 8;
|
||||
// HexFormat hex = HexFormat.of().withPrefix(" (byte) 0x").withSuffix(",");
|
||||
// for (int i = 0; i < bytes.length; i += linelen) {
|
||||
// sb.append("\n");
|
||||
// sb.append(hex.formatHex(bytes, i, Math.min(i + linelen, bytes.length)));
|
||||
// }
|
||||
// sb.append("};");
|
||||
Formatter fmt = new Formatter(sb);
|
||||
for (int i = 0; i <bytes.length; i++) {
|
||||
if (i % linelen == 0) {
|
||||
fmt.format("%n ");
|
||||
}
|
||||
fmt.format(" (byte) 0x%x,", bytes[i] & 0xff);
|
||||
}
|
||||
fmt.format("%n };%n");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (c) 2023, 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Abstract class for serialized bytes of XMLGregorianCalendar and Duration data type for different JDK versions.
|
||||
*/
|
||||
public abstract class GregorianCalendarAndDurationSerData {
|
||||
//Returns byte array of serialized GregorianCalendar.
|
||||
public abstract byte[] getGregorianCalendarByteArray();
|
||||
|
||||
//Returns byte array of serialized Duration.
|
||||
public abstract byte[] getDurationBytes();
|
||||
}
|
129
test/jdk/javax/xml/jaxp/datatype/8033980/JDK6GregorianCalendarAndDurationSerData.java
Normal file
129
test/jdk/javax/xml/jaxp/datatype/8033980/JDK6GregorianCalendarAndDurationSerData.java
Normal file
@ -0,0 +1,129 @@
|
||||
/*
|
||||
* Copyright (c) 2023, 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Mechanically generated JDK 6 specific serialization bytes for XMLGregorianCalendar and Duration data type.
|
||||
* Do not edit this file.
|
||||
*/
|
||||
public class JDK6GregorianCalendarAndDurationSerData extends GregorianCalendarAndDurationSerData {
|
||||
private final byte[] gregorianCalendarBytes = {
|
||||
(byte) 0xac, (byte) 0xed, (byte) 0x0, (byte) 0x5, (byte) 0x73, (byte) 0x72, (byte) 0x0, (byte) 0x49,
|
||||
(byte) 0x63, (byte) 0x6f, (byte) 0x6d, (byte) 0x2e, (byte) 0x73, (byte) 0x75, (byte) 0x6e, (byte) 0x2e,
|
||||
(byte) 0x6f, (byte) 0x72, (byte) 0x67, (byte) 0x2e, (byte) 0x61, (byte) 0x70, (byte) 0x61, (byte) 0x63,
|
||||
(byte) 0x68, (byte) 0x65, (byte) 0x2e, (byte) 0x78, (byte) 0x65, (byte) 0x72, (byte) 0x63, (byte) 0x65,
|
||||
(byte) 0x73, (byte) 0x2e, (byte) 0x69, (byte) 0x6e, (byte) 0x74, (byte) 0x65, (byte) 0x72, (byte) 0x6e,
|
||||
(byte) 0x61, (byte) 0x6c, (byte) 0x2e, (byte) 0x6a, (byte) 0x61, (byte) 0x78, (byte) 0x70, (byte) 0x2e,
|
||||
(byte) 0x64, (byte) 0x61, (byte) 0x74, (byte) 0x61, (byte) 0x74, (byte) 0x79, (byte) 0x70, (byte) 0x65,
|
||||
(byte) 0x2e, (byte) 0x58, (byte) 0x4d, (byte) 0x4c, (byte) 0x47, (byte) 0x72, (byte) 0x65, (byte) 0x67,
|
||||
(byte) 0x6f, (byte) 0x72, (byte) 0x69, (byte) 0x61, (byte) 0x6e, (byte) 0x43, (byte) 0x61, (byte) 0x6c,
|
||||
(byte) 0x65, (byte) 0x6e, (byte) 0x64, (byte) 0x61, (byte) 0x72, (byte) 0x49, (byte) 0x6d, (byte) 0x70,
|
||||
(byte) 0x6c, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0,
|
||||
(byte) 0x1, (byte) 0x2, (byte) 0x0, (byte) 0x9, (byte) 0x49, (byte) 0x0, (byte) 0x3, (byte) 0x64,
|
||||
(byte) 0x61, (byte) 0x79, (byte) 0x49, (byte) 0x0, (byte) 0x4, (byte) 0x68, (byte) 0x6f, (byte) 0x75,
|
||||
(byte) 0x72, (byte) 0x49, (byte) 0x0, (byte) 0x6, (byte) 0x6d, (byte) 0x69, (byte) 0x6e, (byte) 0x75,
|
||||
(byte) 0x74, (byte) 0x65, (byte) 0x49, (byte) 0x0, (byte) 0x5, (byte) 0x6d, (byte) 0x6f, (byte) 0x6e,
|
||||
(byte) 0x74, (byte) 0x68, (byte) 0x49, (byte) 0x0, (byte) 0x6, (byte) 0x73, (byte) 0x65, (byte) 0x63,
|
||||
(byte) 0x6f, (byte) 0x6e, (byte) 0x64, (byte) 0x49, (byte) 0x0, (byte) 0x8, (byte) 0x74, (byte) 0x69,
|
||||
(byte) 0x6d, (byte) 0x65, (byte) 0x7a, (byte) 0x6f, (byte) 0x6e, (byte) 0x65, (byte) 0x49, (byte) 0x0,
|
||||
(byte) 0x4, (byte) 0x79, (byte) 0x65, (byte) 0x61, (byte) 0x72, (byte) 0x4c, (byte) 0x0, (byte) 0x3,
|
||||
(byte) 0x65, (byte) 0x6f, (byte) 0x6e, (byte) 0x74, (byte) 0x0, (byte) 0x16, (byte) 0x4c, (byte) 0x6a,
|
||||
(byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x6d, (byte) 0x61, (byte) 0x74, (byte) 0x68,
|
||||
(byte) 0x2f, (byte) 0x42, (byte) 0x69, (byte) 0x67, (byte) 0x49, (byte) 0x6e, (byte) 0x74, (byte) 0x65,
|
||||
(byte) 0x67, (byte) 0x65, (byte) 0x72, (byte) 0x3b, (byte) 0x4c, (byte) 0x0, (byte) 0x10, (byte) 0x66,
|
||||
(byte) 0x72, (byte) 0x61, (byte) 0x63, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x61,
|
||||
(byte) 0x6c, (byte) 0x53, (byte) 0x65, (byte) 0x63, (byte) 0x6f, (byte) 0x6e, (byte) 0x64, (byte) 0x74,
|
||||
(byte) 0x0, (byte) 0x16, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f,
|
||||
(byte) 0x6d, (byte) 0x61, (byte) 0x74, (byte) 0x68, (byte) 0x2f, (byte) 0x42, (byte) 0x69, (byte) 0x67,
|
||||
(byte) 0x44, (byte) 0x65, (byte) 0x63, (byte) 0x69, (byte) 0x6d, (byte) 0x61, (byte) 0x6c, (byte) 0x3b,
|
||||
(byte) 0x78, (byte) 0x70, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x1, (byte) 0x0, (byte) 0x0,
|
||||
(byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0,
|
||||
(byte) 0x0, (byte) 0x1, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0xff, (byte) 0xff,
|
||||
(byte) 0xfe, (byte) 0xd4, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x1, (byte) 0x70, (byte) 0x73,
|
||||
(byte) 0x72, (byte) 0x0, (byte) 0x14, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e,
|
||||
(byte) 0x6d, (byte) 0x61, (byte) 0x74, (byte) 0x68, (byte) 0x2e, (byte) 0x42, (byte) 0x69, (byte) 0x67,
|
||||
(byte) 0x44, (byte) 0x65, (byte) 0x63, (byte) 0x69, (byte) 0x6d, (byte) 0x61, (byte) 0x6c, (byte) 0x54,
|
||||
(byte) 0xc7, (byte) 0x15, (byte) 0x57, (byte) 0xf9, (byte) 0x81, (byte) 0x28, (byte) 0x4f, (byte) 0x3,
|
||||
(byte) 0x0, (byte) 0x2, (byte) 0x49, (byte) 0x0, (byte) 0x5, (byte) 0x73, (byte) 0x63, (byte) 0x61,
|
||||
(byte) 0x6c, (byte) 0x65, (byte) 0x4c, (byte) 0x0, (byte) 0x6, (byte) 0x69, (byte) 0x6e, (byte) 0x74,
|
||||
(byte) 0x56, (byte) 0x61, (byte) 0x6c, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x1,
|
||||
(byte) 0x78, (byte) 0x72, (byte) 0x0, (byte) 0x10, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61,
|
||||
(byte) 0x2e, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2e, (byte) 0x4e, (byte) 0x75,
|
||||
(byte) 0x6d, (byte) 0x62, (byte) 0x65, (byte) 0x72, (byte) 0x86, (byte) 0xac, (byte) 0x95, (byte) 0x1d,
|
||||
(byte) 0xb, (byte) 0x94, (byte) 0xe0, (byte) 0x8b, (byte) 0x2, (byte) 0x0, (byte) 0x0, (byte) 0x78,
|
||||
(byte) 0x70, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x7, (byte) 0x73, (byte) 0x72, (byte) 0x0,
|
||||
(byte) 0x14, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x6d, (byte) 0x61,
|
||||
(byte) 0x74, (byte) 0x68, (byte) 0x2e, (byte) 0x42, (byte) 0x69, (byte) 0x67, (byte) 0x49, (byte) 0x6e,
|
||||
(byte) 0x74, (byte) 0x65, (byte) 0x67, (byte) 0x65, (byte) 0x72, (byte) 0x8c, (byte) 0xfc, (byte) 0x9f,
|
||||
(byte) 0x1f, (byte) 0xa9, (byte) 0x3b, (byte) 0xfb, (byte) 0x1d, (byte) 0x3, (byte) 0x0, (byte) 0x6,
|
||||
(byte) 0x49, (byte) 0x0, (byte) 0x8, (byte) 0x62, (byte) 0x69, (byte) 0x74, (byte) 0x43, (byte) 0x6f,
|
||||
(byte) 0x75, (byte) 0x6e, (byte) 0x74, (byte) 0x49, (byte) 0x0, (byte) 0x9, (byte) 0x62, (byte) 0x69,
|
||||
(byte) 0x74, (byte) 0x4c, (byte) 0x65, (byte) 0x6e, (byte) 0x67, (byte) 0x74, (byte) 0x68, (byte) 0x49,
|
||||
(byte) 0x0, (byte) 0x13, (byte) 0x66, (byte) 0x69, (byte) 0x72, (byte) 0x73, (byte) 0x74, (byte) 0x4e,
|
||||
(byte) 0x6f, (byte) 0x6e, (byte) 0x7a, (byte) 0x65, (byte) 0x72, (byte) 0x6f, (byte) 0x42, (byte) 0x79,
|
||||
(byte) 0x74, (byte) 0x65, (byte) 0x4e, (byte) 0x75, (byte) 0x6d, (byte) 0x49, (byte) 0x0, (byte) 0xc,
|
||||
(byte) 0x6c, (byte) 0x6f, (byte) 0x77, (byte) 0x65, (byte) 0x73, (byte) 0x74, (byte) 0x53, (byte) 0x65,
|
||||
(byte) 0x74, (byte) 0x42, (byte) 0x69, (byte) 0x74, (byte) 0x49, (byte) 0x0, (byte) 0x6, (byte) 0x73,
|
||||
(byte) 0x69, (byte) 0x67, (byte) 0x6e, (byte) 0x75, (byte) 0x6d, (byte) 0x5b, (byte) 0x0, (byte) 0x9,
|
||||
(byte) 0x6d, (byte) 0x61, (byte) 0x67, (byte) 0x6e, (byte) 0x69, (byte) 0x74, (byte) 0x75, (byte) 0x64,
|
||||
(byte) 0x65, (byte) 0x74, (byte) 0x0, (byte) 0x2, (byte) 0x5b, (byte) 0x42, (byte) 0x78, (byte) 0x71,
|
||||
(byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x5, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
|
||||
(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xfe,
|
||||
(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xfe, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0,
|
||||
(byte) 0x75, (byte) 0x72, (byte) 0x0, (byte) 0x2, (byte) 0x5b, (byte) 0x42, (byte) 0xac, (byte) 0xf3,
|
||||
(byte) 0x17, (byte) 0xf8, (byte) 0x6, (byte) 0x8, (byte) 0x54, (byte) 0xe0, (byte) 0x2, (byte) 0x0,
|
||||
(byte) 0x0, (byte) 0x78, (byte) 0x70, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x78,
|
||||
(byte) 0x78,
|
||||
};
|
||||
private final byte[] durationBytes = {
|
||||
(byte) 0xac, (byte) 0xed, (byte) 0x0, (byte) 0x5, (byte) 0x73, (byte) 0x72, (byte) 0x0, (byte) 0x4c,
|
||||
(byte) 0x63, (byte) 0x6f, (byte) 0x6d, (byte) 0x2e, (byte) 0x73, (byte) 0x75, (byte) 0x6e, (byte) 0x2e,
|
||||
(byte) 0x6f, (byte) 0x72, (byte) 0x67, (byte) 0x2e, (byte) 0x61, (byte) 0x70, (byte) 0x61, (byte) 0x63,
|
||||
(byte) 0x68, (byte) 0x65, (byte) 0x2e, (byte) 0x78, (byte) 0x65, (byte) 0x72, (byte) 0x63, (byte) 0x65,
|
||||
(byte) 0x73, (byte) 0x2e, (byte) 0x69, (byte) 0x6e, (byte) 0x74, (byte) 0x65, (byte) 0x72, (byte) 0x6e,
|
||||
(byte) 0x61, (byte) 0x6c, (byte) 0x2e, (byte) 0x6a, (byte) 0x61, (byte) 0x78, (byte) 0x70, (byte) 0x2e,
|
||||
(byte) 0x64, (byte) 0x61, (byte) 0x74, (byte) 0x61, (byte) 0x74, (byte) 0x79, (byte) 0x70, (byte) 0x65,
|
||||
(byte) 0x2e, (byte) 0x44, (byte) 0x75, (byte) 0x72, (byte) 0x61, (byte) 0x74, (byte) 0x69, (byte) 0x6f,
|
||||
(byte) 0x6e, (byte) 0x49, (byte) 0x6d, (byte) 0x70, (byte) 0x6c, (byte) 0x24, (byte) 0x44, (byte) 0x75,
|
||||
(byte) 0x72, (byte) 0x61, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x53, (byte) 0x74,
|
||||
(byte) 0x72, (byte) 0x65, (byte) 0x61, (byte) 0x6d, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0,
|
||||
(byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x1, (byte) 0x2, (byte) 0x0, (byte) 0x1, (byte) 0x4c,
|
||||
(byte) 0x0, (byte) 0x7, (byte) 0x6c, (byte) 0x65, (byte) 0x78, (byte) 0x69, (byte) 0x63, (byte) 0x61,
|
||||
(byte) 0x6c, (byte) 0x74, (byte) 0x0, (byte) 0x12, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76,
|
||||
(byte) 0x61, (byte) 0x2f, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2f, (byte) 0x53,
|
||||
(byte) 0x74, (byte) 0x72, (byte) 0x69, (byte) 0x6e, (byte) 0x67, (byte) 0x3b, (byte) 0x78, (byte) 0x70,
|
||||
(byte) 0x74, (byte) 0x0, (byte) 0xe, (byte) 0x50, (byte) 0x31, (byte) 0x59, (byte) 0x31, (byte) 0x4d,
|
||||
(byte) 0x31, (byte) 0x44, (byte) 0x54, (byte) 0x31, (byte) 0x48, (byte) 0x31, (byte) 0x4d, (byte) 0x31,
|
||||
(byte) 0x53,
|
||||
};
|
||||
|
||||
|
||||
@Override
|
||||
public byte[] getGregorianCalendarByteArray() {
|
||||
return gregorianCalendarBytes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getDurationBytes() {
|
||||
return durationBytes;
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
127
test/jdk/javax/xml/jaxp/datatype/8033980/JDK7GregorianCalendarAndDurationSerData.java
Normal file
127
test/jdk/javax/xml/jaxp/datatype/8033980/JDK7GregorianCalendarAndDurationSerData.java
Normal file
@ -0,0 +1,127 @@
|
||||
/*
|
||||
* Copyright (c) 2023, 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Mechanically generated JDK 7 specific serialization bytes for XMLGregorianCalendar and Duration data type.
|
||||
* Do not edit this file.
|
||||
*/
|
||||
public class JDK7GregorianCalendarAndDurationSerData extends GregorianCalendarAndDurationSerData {
|
||||
private final byte[] gregorianCalendarBytes = {
|
||||
(byte) 0xac, (byte) 0xed, (byte) 0x0, (byte) 0x5, (byte) 0x73, (byte) 0x72, (byte) 0x0, (byte) 0x49,
|
||||
(byte) 0x63, (byte) 0x6f, (byte) 0x6d, (byte) 0x2e, (byte) 0x73, (byte) 0x75, (byte) 0x6e, (byte) 0x2e,
|
||||
(byte) 0x6f, (byte) 0x72, (byte) 0x67, (byte) 0x2e, (byte) 0x61, (byte) 0x70, (byte) 0x61, (byte) 0x63,
|
||||
(byte) 0x68, (byte) 0x65, (byte) 0x2e, (byte) 0x78, (byte) 0x65, (byte) 0x72, (byte) 0x63, (byte) 0x65,
|
||||
(byte) 0x73, (byte) 0x2e, (byte) 0x69, (byte) 0x6e, (byte) 0x74, (byte) 0x65, (byte) 0x72, (byte) 0x6e,
|
||||
(byte) 0x61, (byte) 0x6c, (byte) 0x2e, (byte) 0x6a, (byte) 0x61, (byte) 0x78, (byte) 0x70, (byte) 0x2e,
|
||||
(byte) 0x64, (byte) 0x61, (byte) 0x74, (byte) 0x61, (byte) 0x74, (byte) 0x79, (byte) 0x70, (byte) 0x65,
|
||||
(byte) 0x2e, (byte) 0x58, (byte) 0x4d, (byte) 0x4c, (byte) 0x47, (byte) 0x72, (byte) 0x65, (byte) 0x67,
|
||||
(byte) 0x6f, (byte) 0x72, (byte) 0x69, (byte) 0x61, (byte) 0x6e, (byte) 0x43, (byte) 0x61, (byte) 0x6c,
|
||||
(byte) 0x65, (byte) 0x6e, (byte) 0x64, (byte) 0x61, (byte) 0x72, (byte) 0x49, (byte) 0x6d, (byte) 0x70,
|
||||
(byte) 0x6c, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0,
|
||||
(byte) 0x1, (byte) 0x2, (byte) 0x0, (byte) 0x9, (byte) 0x49, (byte) 0x0, (byte) 0x3, (byte) 0x64,
|
||||
(byte) 0x61, (byte) 0x79, (byte) 0x49, (byte) 0x0, (byte) 0x4, (byte) 0x68, (byte) 0x6f, (byte) 0x75,
|
||||
(byte) 0x72, (byte) 0x49, (byte) 0x0, (byte) 0x6, (byte) 0x6d, (byte) 0x69, (byte) 0x6e, (byte) 0x75,
|
||||
(byte) 0x74, (byte) 0x65, (byte) 0x49, (byte) 0x0, (byte) 0x5, (byte) 0x6d, (byte) 0x6f, (byte) 0x6e,
|
||||
(byte) 0x74, (byte) 0x68, (byte) 0x49, (byte) 0x0, (byte) 0x6, (byte) 0x73, (byte) 0x65, (byte) 0x63,
|
||||
(byte) 0x6f, (byte) 0x6e, (byte) 0x64, (byte) 0x49, (byte) 0x0, (byte) 0x8, (byte) 0x74, (byte) 0x69,
|
||||
(byte) 0x6d, (byte) 0x65, (byte) 0x7a, (byte) 0x6f, (byte) 0x6e, (byte) 0x65, (byte) 0x49, (byte) 0x0,
|
||||
(byte) 0x4, (byte) 0x79, (byte) 0x65, (byte) 0x61, (byte) 0x72, (byte) 0x4c, (byte) 0x0, (byte) 0x3,
|
||||
(byte) 0x65, (byte) 0x6f, (byte) 0x6e, (byte) 0x74, (byte) 0x0, (byte) 0x16, (byte) 0x4c, (byte) 0x6a,
|
||||
(byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x6d, (byte) 0x61, (byte) 0x74, (byte) 0x68,
|
||||
(byte) 0x2f, (byte) 0x42, (byte) 0x69, (byte) 0x67, (byte) 0x49, (byte) 0x6e, (byte) 0x74, (byte) 0x65,
|
||||
(byte) 0x67, (byte) 0x65, (byte) 0x72, (byte) 0x3b, (byte) 0x4c, (byte) 0x0, (byte) 0x10, (byte) 0x66,
|
||||
(byte) 0x72, (byte) 0x61, (byte) 0x63, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x61,
|
||||
(byte) 0x6c, (byte) 0x53, (byte) 0x65, (byte) 0x63, (byte) 0x6f, (byte) 0x6e, (byte) 0x64, (byte) 0x74,
|
||||
(byte) 0x0, (byte) 0x16, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f,
|
||||
(byte) 0x6d, (byte) 0x61, (byte) 0x74, (byte) 0x68, (byte) 0x2f, (byte) 0x42, (byte) 0x69, (byte) 0x67,
|
||||
(byte) 0x44, (byte) 0x65, (byte) 0x63, (byte) 0x69, (byte) 0x6d, (byte) 0x61, (byte) 0x6c, (byte) 0x3b,
|
||||
(byte) 0x78, (byte) 0x70, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x1, (byte) 0x0, (byte) 0x0,
|
||||
(byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0,
|
||||
(byte) 0x0, (byte) 0x1, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0xff, (byte) 0xff,
|
||||
(byte) 0xfe, (byte) 0xd4, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x1, (byte) 0x70, (byte) 0x73,
|
||||
(byte) 0x72, (byte) 0x0, (byte) 0x14, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e,
|
||||
(byte) 0x6d, (byte) 0x61, (byte) 0x74, (byte) 0x68, (byte) 0x2e, (byte) 0x42, (byte) 0x69, (byte) 0x67,
|
||||
(byte) 0x44, (byte) 0x65, (byte) 0x63, (byte) 0x69, (byte) 0x6d, (byte) 0x61, (byte) 0x6c, (byte) 0x54,
|
||||
(byte) 0xc7, (byte) 0x15, (byte) 0x57, (byte) 0xf9, (byte) 0x81, (byte) 0x28, (byte) 0x4f, (byte) 0x3,
|
||||
(byte) 0x0, (byte) 0x2, (byte) 0x49, (byte) 0x0, (byte) 0x5, (byte) 0x73, (byte) 0x63, (byte) 0x61,
|
||||
(byte) 0x6c, (byte) 0x65, (byte) 0x4c, (byte) 0x0, (byte) 0x6, (byte) 0x69, (byte) 0x6e, (byte) 0x74,
|
||||
(byte) 0x56, (byte) 0x61, (byte) 0x6c, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x1,
|
||||
(byte) 0x78, (byte) 0x72, (byte) 0x0, (byte) 0x10, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61,
|
||||
(byte) 0x2e, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2e, (byte) 0x4e, (byte) 0x75,
|
||||
(byte) 0x6d, (byte) 0x62, (byte) 0x65, (byte) 0x72, (byte) 0x86, (byte) 0xac, (byte) 0x95, (byte) 0x1d,
|
||||
(byte) 0xb, (byte) 0x94, (byte) 0xe0, (byte) 0x8b, (byte) 0x2, (byte) 0x0, (byte) 0x0, (byte) 0x78,
|
||||
(byte) 0x70, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x7, (byte) 0x73, (byte) 0x72, (byte) 0x0,
|
||||
(byte) 0x14, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x6d, (byte) 0x61,
|
||||
(byte) 0x74, (byte) 0x68, (byte) 0x2e, (byte) 0x42, (byte) 0x69, (byte) 0x67, (byte) 0x49, (byte) 0x6e,
|
||||
(byte) 0x74, (byte) 0x65, (byte) 0x67, (byte) 0x65, (byte) 0x72, (byte) 0x8c, (byte) 0xfc, (byte) 0x9f,
|
||||
(byte) 0x1f, (byte) 0xa9, (byte) 0x3b, (byte) 0xfb, (byte) 0x1d, (byte) 0x3, (byte) 0x0, (byte) 0x6,
|
||||
(byte) 0x49, (byte) 0x0, (byte) 0x8, (byte) 0x62, (byte) 0x69, (byte) 0x74, (byte) 0x43, (byte) 0x6f,
|
||||
(byte) 0x75, (byte) 0x6e, (byte) 0x74, (byte) 0x49, (byte) 0x0, (byte) 0x9, (byte) 0x62, (byte) 0x69,
|
||||
(byte) 0x74, (byte) 0x4c, (byte) 0x65, (byte) 0x6e, (byte) 0x67, (byte) 0x74, (byte) 0x68, (byte) 0x49,
|
||||
(byte) 0x0, (byte) 0x13, (byte) 0x66, (byte) 0x69, (byte) 0x72, (byte) 0x73, (byte) 0x74, (byte) 0x4e,
|
||||
(byte) 0x6f, (byte) 0x6e, (byte) 0x7a, (byte) 0x65, (byte) 0x72, (byte) 0x6f, (byte) 0x42, (byte) 0x79,
|
||||
(byte) 0x74, (byte) 0x65, (byte) 0x4e, (byte) 0x75, (byte) 0x6d, (byte) 0x49, (byte) 0x0, (byte) 0xc,
|
||||
(byte) 0x6c, (byte) 0x6f, (byte) 0x77, (byte) 0x65, (byte) 0x73, (byte) 0x74, (byte) 0x53, (byte) 0x65,
|
||||
(byte) 0x74, (byte) 0x42, (byte) 0x69, (byte) 0x74, (byte) 0x49, (byte) 0x0, (byte) 0x6, (byte) 0x73,
|
||||
(byte) 0x69, (byte) 0x67, (byte) 0x6e, (byte) 0x75, (byte) 0x6d, (byte) 0x5b, (byte) 0x0, (byte) 0x9,
|
||||
(byte) 0x6d, (byte) 0x61, (byte) 0x67, (byte) 0x6e, (byte) 0x69, (byte) 0x74, (byte) 0x75, (byte) 0x64,
|
||||
(byte) 0x65, (byte) 0x74, (byte) 0x0, (byte) 0x2, (byte) 0x5b, (byte) 0x42, (byte) 0x78, (byte) 0x71,
|
||||
(byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x5, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
|
||||
(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xfe,
|
||||
(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xfe, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0,
|
||||
(byte) 0x75, (byte) 0x72, (byte) 0x0, (byte) 0x2, (byte) 0x5b, (byte) 0x42, (byte) 0xac, (byte) 0xf3,
|
||||
(byte) 0x17, (byte) 0xf8, (byte) 0x6, (byte) 0x8, (byte) 0x54, (byte) 0xe0, (byte) 0x2, (byte) 0x0,
|
||||
(byte) 0x0, (byte) 0x78, (byte) 0x70, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x78,
|
||||
(byte) 0x78,
|
||||
};
|
||||
private final byte[] durationBytes = {
|
||||
(byte) 0xac, (byte) 0xed, (byte) 0x0, (byte) 0x5, (byte) 0x73, (byte) 0x72, (byte) 0x0, (byte) 0x4c,
|
||||
(byte) 0x63, (byte) 0x6f, (byte) 0x6d, (byte) 0x2e, (byte) 0x73, (byte) 0x75, (byte) 0x6e, (byte) 0x2e,
|
||||
(byte) 0x6f, (byte) 0x72, (byte) 0x67, (byte) 0x2e, (byte) 0x61, (byte) 0x70, (byte) 0x61, (byte) 0x63,
|
||||
(byte) 0x68, (byte) 0x65, (byte) 0x2e, (byte) 0x78, (byte) 0x65, (byte) 0x72, (byte) 0x63, (byte) 0x65,
|
||||
(byte) 0x73, (byte) 0x2e, (byte) 0x69, (byte) 0x6e, (byte) 0x74, (byte) 0x65, (byte) 0x72, (byte) 0x6e,
|
||||
(byte) 0x61, (byte) 0x6c, (byte) 0x2e, (byte) 0x6a, (byte) 0x61, (byte) 0x78, (byte) 0x70, (byte) 0x2e,
|
||||
(byte) 0x64, (byte) 0x61, (byte) 0x74, (byte) 0x61, (byte) 0x74, (byte) 0x79, (byte) 0x70, (byte) 0x65,
|
||||
(byte) 0x2e, (byte) 0x44, (byte) 0x75, (byte) 0x72, (byte) 0x61, (byte) 0x74, (byte) 0x69, (byte) 0x6f,
|
||||
(byte) 0x6e, (byte) 0x49, (byte) 0x6d, (byte) 0x70, (byte) 0x6c, (byte) 0x24, (byte) 0x44, (byte) 0x75,
|
||||
(byte) 0x72, (byte) 0x61, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x53, (byte) 0x74,
|
||||
(byte) 0x72, (byte) 0x65, (byte) 0x61, (byte) 0x6d, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0,
|
||||
(byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x1, (byte) 0x2, (byte) 0x0, (byte) 0x1, (byte) 0x4c,
|
||||
(byte) 0x0, (byte) 0x7, (byte) 0x6c, (byte) 0x65, (byte) 0x78, (byte) 0x69, (byte) 0x63, (byte) 0x61,
|
||||
(byte) 0x6c, (byte) 0x74, (byte) 0x0, (byte) 0x12, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76,
|
||||
(byte) 0x61, (byte) 0x2f, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2f, (byte) 0x53,
|
||||
(byte) 0x74, (byte) 0x72, (byte) 0x69, (byte) 0x6e, (byte) 0x67, (byte) 0x3b, (byte) 0x78, (byte) 0x70,
|
||||
(byte) 0x74, (byte) 0x0, (byte) 0xe, (byte) 0x50, (byte) 0x31, (byte) 0x59, (byte) 0x31, (byte) 0x4d,
|
||||
(byte) 0x31, (byte) 0x44, (byte) 0x54, (byte) 0x31, (byte) 0x48, (byte) 0x31, (byte) 0x4d, (byte) 0x31,
|
||||
(byte) 0x53,
|
||||
};
|
||||
@Override
|
||||
public byte[] getGregorianCalendarByteArray() {
|
||||
return gregorianCalendarBytes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getDurationBytes() {
|
||||
return durationBytes;
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
128
test/jdk/javax/xml/jaxp/datatype/8033980/JDK8GregorianCalendarAndDurationSerData.java
Normal file
128
test/jdk/javax/xml/jaxp/datatype/8033980/JDK8GregorianCalendarAndDurationSerData.java
Normal file
@ -0,0 +1,128 @@
|
||||
/*
|
||||
* Copyright (c) 2023, 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Mechanically generated JDK 8 specific serialization bytes for XMLGregorianCalendar and Duration data type.
|
||||
* Do not edit this file.
|
||||
*/
|
||||
public class JDK8GregorianCalendarAndDurationSerData extends GregorianCalendarAndDurationSerData {
|
||||
private final byte[] gregorianCalendarBytes = {
|
||||
(byte) 0xac, (byte) 0xed, (byte) 0x0, (byte) 0x5, (byte) 0x73, (byte) 0x72, (byte) 0x0, (byte) 0x49,
|
||||
(byte) 0x63, (byte) 0x6f, (byte) 0x6d, (byte) 0x2e, (byte) 0x73, (byte) 0x75, (byte) 0x6e, (byte) 0x2e,
|
||||
(byte) 0x6f, (byte) 0x72, (byte) 0x67, (byte) 0x2e, (byte) 0x61, (byte) 0x70, (byte) 0x61, (byte) 0x63,
|
||||
(byte) 0x68, (byte) 0x65, (byte) 0x2e, (byte) 0x78, (byte) 0x65, (byte) 0x72, (byte) 0x63, (byte) 0x65,
|
||||
(byte) 0x73, (byte) 0x2e, (byte) 0x69, (byte) 0x6e, (byte) 0x74, (byte) 0x65, (byte) 0x72, (byte) 0x6e,
|
||||
(byte) 0x61, (byte) 0x6c, (byte) 0x2e, (byte) 0x6a, (byte) 0x61, (byte) 0x78, (byte) 0x70, (byte) 0x2e,
|
||||
(byte) 0x64, (byte) 0x61, (byte) 0x74, (byte) 0x61, (byte) 0x74, (byte) 0x79, (byte) 0x70, (byte) 0x65,
|
||||
(byte) 0x2e, (byte) 0x58, (byte) 0x4d, (byte) 0x4c, (byte) 0x47, (byte) 0x72, (byte) 0x65, (byte) 0x67,
|
||||
(byte) 0x6f, (byte) 0x72, (byte) 0x69, (byte) 0x61, (byte) 0x6e, (byte) 0x43, (byte) 0x61, (byte) 0x6c,
|
||||
(byte) 0x65, (byte) 0x6e, (byte) 0x64, (byte) 0x61, (byte) 0x72, (byte) 0x49, (byte) 0x6d, (byte) 0x70,
|
||||
(byte) 0x6c, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0,
|
||||
(byte) 0x1, (byte) 0x2, (byte) 0x0, (byte) 0x9, (byte) 0x49, (byte) 0x0, (byte) 0x3, (byte) 0x64,
|
||||
(byte) 0x61, (byte) 0x79, (byte) 0x49, (byte) 0x0, (byte) 0x4, (byte) 0x68, (byte) 0x6f, (byte) 0x75,
|
||||
(byte) 0x72, (byte) 0x49, (byte) 0x0, (byte) 0x6, (byte) 0x6d, (byte) 0x69, (byte) 0x6e, (byte) 0x75,
|
||||
(byte) 0x74, (byte) 0x65, (byte) 0x49, (byte) 0x0, (byte) 0x5, (byte) 0x6d, (byte) 0x6f, (byte) 0x6e,
|
||||
(byte) 0x74, (byte) 0x68, (byte) 0x49, (byte) 0x0, (byte) 0x6, (byte) 0x73, (byte) 0x65, (byte) 0x63,
|
||||
(byte) 0x6f, (byte) 0x6e, (byte) 0x64, (byte) 0x49, (byte) 0x0, (byte) 0x8, (byte) 0x74, (byte) 0x69,
|
||||
(byte) 0x6d, (byte) 0x65, (byte) 0x7a, (byte) 0x6f, (byte) 0x6e, (byte) 0x65, (byte) 0x49, (byte) 0x0,
|
||||
(byte) 0x4, (byte) 0x79, (byte) 0x65, (byte) 0x61, (byte) 0x72, (byte) 0x4c, (byte) 0x0, (byte) 0x3,
|
||||
(byte) 0x65, (byte) 0x6f, (byte) 0x6e, (byte) 0x74, (byte) 0x0, (byte) 0x16, (byte) 0x4c, (byte) 0x6a,
|
||||
(byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x6d, (byte) 0x61, (byte) 0x74, (byte) 0x68,
|
||||
(byte) 0x2f, (byte) 0x42, (byte) 0x69, (byte) 0x67, (byte) 0x49, (byte) 0x6e, (byte) 0x74, (byte) 0x65,
|
||||
(byte) 0x67, (byte) 0x65, (byte) 0x72, (byte) 0x3b, (byte) 0x4c, (byte) 0x0, (byte) 0x10, (byte) 0x66,
|
||||
(byte) 0x72, (byte) 0x61, (byte) 0x63, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x61,
|
||||
(byte) 0x6c, (byte) 0x53, (byte) 0x65, (byte) 0x63, (byte) 0x6f, (byte) 0x6e, (byte) 0x64, (byte) 0x74,
|
||||
(byte) 0x0, (byte) 0x16, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f,
|
||||
(byte) 0x6d, (byte) 0x61, (byte) 0x74, (byte) 0x68, (byte) 0x2f, (byte) 0x42, (byte) 0x69, (byte) 0x67,
|
||||
(byte) 0x44, (byte) 0x65, (byte) 0x63, (byte) 0x69, (byte) 0x6d, (byte) 0x61, (byte) 0x6c, (byte) 0x3b,
|
||||
(byte) 0x78, (byte) 0x70, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x1, (byte) 0x0, (byte) 0x0,
|
||||
(byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0,
|
||||
(byte) 0x0, (byte) 0x1, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0xff, (byte) 0xff,
|
||||
(byte) 0xfe, (byte) 0xd4, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x1, (byte) 0x70, (byte) 0x73,
|
||||
(byte) 0x72, (byte) 0x0, (byte) 0x14, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e,
|
||||
(byte) 0x6d, (byte) 0x61, (byte) 0x74, (byte) 0x68, (byte) 0x2e, (byte) 0x42, (byte) 0x69, (byte) 0x67,
|
||||
(byte) 0x44, (byte) 0x65, (byte) 0x63, (byte) 0x69, (byte) 0x6d, (byte) 0x61, (byte) 0x6c, (byte) 0x54,
|
||||
(byte) 0xc7, (byte) 0x15, (byte) 0x57, (byte) 0xf9, (byte) 0x81, (byte) 0x28, (byte) 0x4f, (byte) 0x3,
|
||||
(byte) 0x0, (byte) 0x2, (byte) 0x49, (byte) 0x0, (byte) 0x5, (byte) 0x73, (byte) 0x63, (byte) 0x61,
|
||||
(byte) 0x6c, (byte) 0x65, (byte) 0x4c, (byte) 0x0, (byte) 0x6, (byte) 0x69, (byte) 0x6e, (byte) 0x74,
|
||||
(byte) 0x56, (byte) 0x61, (byte) 0x6c, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x1,
|
||||
(byte) 0x78, (byte) 0x72, (byte) 0x0, (byte) 0x10, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61,
|
||||
(byte) 0x2e, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2e, (byte) 0x4e, (byte) 0x75,
|
||||
(byte) 0x6d, (byte) 0x62, (byte) 0x65, (byte) 0x72, (byte) 0x86, (byte) 0xac, (byte) 0x95, (byte) 0x1d,
|
||||
(byte) 0xb, (byte) 0x94, (byte) 0xe0, (byte) 0x8b, (byte) 0x2, (byte) 0x0, (byte) 0x0, (byte) 0x78,
|
||||
(byte) 0x70, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x7, (byte) 0x73, (byte) 0x72, (byte) 0x0,
|
||||
(byte) 0x14, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x6d, (byte) 0x61,
|
||||
(byte) 0x74, (byte) 0x68, (byte) 0x2e, (byte) 0x42, (byte) 0x69, (byte) 0x67, (byte) 0x49, (byte) 0x6e,
|
||||
(byte) 0x74, (byte) 0x65, (byte) 0x67, (byte) 0x65, (byte) 0x72, (byte) 0x8c, (byte) 0xfc, (byte) 0x9f,
|
||||
(byte) 0x1f, (byte) 0xa9, (byte) 0x3b, (byte) 0xfb, (byte) 0x1d, (byte) 0x3, (byte) 0x0, (byte) 0x6,
|
||||
(byte) 0x49, (byte) 0x0, (byte) 0x8, (byte) 0x62, (byte) 0x69, (byte) 0x74, (byte) 0x43, (byte) 0x6f,
|
||||
(byte) 0x75, (byte) 0x6e, (byte) 0x74, (byte) 0x49, (byte) 0x0, (byte) 0x9, (byte) 0x62, (byte) 0x69,
|
||||
(byte) 0x74, (byte) 0x4c, (byte) 0x65, (byte) 0x6e, (byte) 0x67, (byte) 0x74, (byte) 0x68, (byte) 0x49,
|
||||
(byte) 0x0, (byte) 0x13, (byte) 0x66, (byte) 0x69, (byte) 0x72, (byte) 0x73, (byte) 0x74, (byte) 0x4e,
|
||||
(byte) 0x6f, (byte) 0x6e, (byte) 0x7a, (byte) 0x65, (byte) 0x72, (byte) 0x6f, (byte) 0x42, (byte) 0x79,
|
||||
(byte) 0x74, (byte) 0x65, (byte) 0x4e, (byte) 0x75, (byte) 0x6d, (byte) 0x49, (byte) 0x0, (byte) 0xc,
|
||||
(byte) 0x6c, (byte) 0x6f, (byte) 0x77, (byte) 0x65, (byte) 0x73, (byte) 0x74, (byte) 0x53, (byte) 0x65,
|
||||
(byte) 0x74, (byte) 0x42, (byte) 0x69, (byte) 0x74, (byte) 0x49, (byte) 0x0, (byte) 0x6, (byte) 0x73,
|
||||
(byte) 0x69, (byte) 0x67, (byte) 0x6e, (byte) 0x75, (byte) 0x6d, (byte) 0x5b, (byte) 0x0, (byte) 0x9,
|
||||
(byte) 0x6d, (byte) 0x61, (byte) 0x67, (byte) 0x6e, (byte) 0x69, (byte) 0x74, (byte) 0x75, (byte) 0x64,
|
||||
(byte) 0x65, (byte) 0x74, (byte) 0x0, (byte) 0x2, (byte) 0x5b, (byte) 0x42, (byte) 0x78, (byte) 0x71,
|
||||
(byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x5, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
|
||||
(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xfe,
|
||||
(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xfe, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0,
|
||||
(byte) 0x75, (byte) 0x72, (byte) 0x0, (byte) 0x2, (byte) 0x5b, (byte) 0x42, (byte) 0xac, (byte) 0xf3,
|
||||
(byte) 0x17, (byte) 0xf8, (byte) 0x6, (byte) 0x8, (byte) 0x54, (byte) 0xe0, (byte) 0x2, (byte) 0x0,
|
||||
(byte) 0x0, (byte) 0x78, (byte) 0x70, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x78,
|
||||
(byte) 0x78,
|
||||
};
|
||||
private final byte[] durationBytes = {
|
||||
(byte) 0xac, (byte) 0xed, (byte) 0x0, (byte) 0x5, (byte) 0x73, (byte) 0x72, (byte) 0x0, (byte) 0x4c,
|
||||
(byte) 0x63, (byte) 0x6f, (byte) 0x6d, (byte) 0x2e, (byte) 0x73, (byte) 0x75, (byte) 0x6e, (byte) 0x2e,
|
||||
(byte) 0x6f, (byte) 0x72, (byte) 0x67, (byte) 0x2e, (byte) 0x61, (byte) 0x70, (byte) 0x61, (byte) 0x63,
|
||||
(byte) 0x68, (byte) 0x65, (byte) 0x2e, (byte) 0x78, (byte) 0x65, (byte) 0x72, (byte) 0x63, (byte) 0x65,
|
||||
(byte) 0x73, (byte) 0x2e, (byte) 0x69, (byte) 0x6e, (byte) 0x74, (byte) 0x65, (byte) 0x72, (byte) 0x6e,
|
||||
(byte) 0x61, (byte) 0x6c, (byte) 0x2e, (byte) 0x6a, (byte) 0x61, (byte) 0x78, (byte) 0x70, (byte) 0x2e,
|
||||
(byte) 0x64, (byte) 0x61, (byte) 0x74, (byte) 0x61, (byte) 0x74, (byte) 0x79, (byte) 0x70, (byte) 0x65,
|
||||
(byte) 0x2e, (byte) 0x44, (byte) 0x75, (byte) 0x72, (byte) 0x61, (byte) 0x74, (byte) 0x69, (byte) 0x6f,
|
||||
(byte) 0x6e, (byte) 0x49, (byte) 0x6d, (byte) 0x70, (byte) 0x6c, (byte) 0x24, (byte) 0x44, (byte) 0x75,
|
||||
(byte) 0x72, (byte) 0x61, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x53, (byte) 0x74,
|
||||
(byte) 0x72, (byte) 0x65, (byte) 0x61, (byte) 0x6d, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0,
|
||||
(byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x1, (byte) 0x2, (byte) 0x0, (byte) 0x1, (byte) 0x4c,
|
||||
(byte) 0x0, (byte) 0x7, (byte) 0x6c, (byte) 0x65, (byte) 0x78, (byte) 0x69, (byte) 0x63, (byte) 0x61,
|
||||
(byte) 0x6c, (byte) 0x74, (byte) 0x0, (byte) 0x12, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76,
|
||||
(byte) 0x61, (byte) 0x2f, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2f, (byte) 0x53,
|
||||
(byte) 0x74, (byte) 0x72, (byte) 0x69, (byte) 0x6e, (byte) 0x67, (byte) 0x3b, (byte) 0x78, (byte) 0x70,
|
||||
(byte) 0x74, (byte) 0x0, (byte) 0xe, (byte) 0x50, (byte) 0x31, (byte) 0x59, (byte) 0x31, (byte) 0x4d,
|
||||
(byte) 0x31, (byte) 0x44, (byte) 0x54, (byte) 0x31, (byte) 0x48, (byte) 0x31, (byte) 0x4d, (byte) 0x31,
|
||||
(byte) 0x53,
|
||||
};
|
||||
|
||||
@Override
|
||||
public byte[] getGregorianCalendarByteArray() {
|
||||
return gregorianCalendarBytes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getDurationBytes() {
|
||||
return durationBytes;
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
127
test/jdk/javax/xml/jaxp/datatype/8033980/JDK9GregorianCalendarAndDurationSerData.java
Normal file
127
test/jdk/javax/xml/jaxp/datatype/8033980/JDK9GregorianCalendarAndDurationSerData.java
Normal file
@ -0,0 +1,127 @@
|
||||
/*
|
||||
* Copyright (c) 2023, 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Mechanically generated JDK 9 specific serialization bytes for XMLGregorianCalendar and Duration data type.
|
||||
* Do not edit this file.
|
||||
*/
|
||||
public class JDK9GregorianCalendarAndDurationSerData extends GregorianCalendarAndDurationSerData {
|
||||
private final byte[] gregorianCalendarBytes = {
|
||||
(byte) 0xac, (byte) 0xed, (byte) 0x0, (byte) 0x5, (byte) 0x73, (byte) 0x72, (byte) 0x0, (byte) 0x49,
|
||||
(byte) 0x63, (byte) 0x6f, (byte) 0x6d, (byte) 0x2e, (byte) 0x73, (byte) 0x75, (byte) 0x6e, (byte) 0x2e,
|
||||
(byte) 0x6f, (byte) 0x72, (byte) 0x67, (byte) 0x2e, (byte) 0x61, (byte) 0x70, (byte) 0x61, (byte) 0x63,
|
||||
(byte) 0x68, (byte) 0x65, (byte) 0x2e, (byte) 0x78, (byte) 0x65, (byte) 0x72, (byte) 0x63, (byte) 0x65,
|
||||
(byte) 0x73, (byte) 0x2e, (byte) 0x69, (byte) 0x6e, (byte) 0x74, (byte) 0x65, (byte) 0x72, (byte) 0x6e,
|
||||
(byte) 0x61, (byte) 0x6c, (byte) 0x2e, (byte) 0x6a, (byte) 0x61, (byte) 0x78, (byte) 0x70, (byte) 0x2e,
|
||||
(byte) 0x64, (byte) 0x61, (byte) 0x74, (byte) 0x61, (byte) 0x74, (byte) 0x79, (byte) 0x70, (byte) 0x65,
|
||||
(byte) 0x2e, (byte) 0x58, (byte) 0x4d, (byte) 0x4c, (byte) 0x47, (byte) 0x72, (byte) 0x65, (byte) 0x67,
|
||||
(byte) 0x6f, (byte) 0x72, (byte) 0x69, (byte) 0x61, (byte) 0x6e, (byte) 0x43, (byte) 0x61, (byte) 0x6c,
|
||||
(byte) 0x65, (byte) 0x6e, (byte) 0x64, (byte) 0x61, (byte) 0x72, (byte) 0x49, (byte) 0x6d, (byte) 0x70,
|
||||
(byte) 0x6c, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0,
|
||||
(byte) 0x1, (byte) 0x2, (byte) 0x0, (byte) 0x9, (byte) 0x49, (byte) 0x0, (byte) 0x3, (byte) 0x64,
|
||||
(byte) 0x61, (byte) 0x79, (byte) 0x49, (byte) 0x0, (byte) 0x4, (byte) 0x68, (byte) 0x6f, (byte) 0x75,
|
||||
(byte) 0x72, (byte) 0x49, (byte) 0x0, (byte) 0x6, (byte) 0x6d, (byte) 0x69, (byte) 0x6e, (byte) 0x75,
|
||||
(byte) 0x74, (byte) 0x65, (byte) 0x49, (byte) 0x0, (byte) 0x5, (byte) 0x6d, (byte) 0x6f, (byte) 0x6e,
|
||||
(byte) 0x74, (byte) 0x68, (byte) 0x49, (byte) 0x0, (byte) 0x6, (byte) 0x73, (byte) 0x65, (byte) 0x63,
|
||||
(byte) 0x6f, (byte) 0x6e, (byte) 0x64, (byte) 0x49, (byte) 0x0, (byte) 0x8, (byte) 0x74, (byte) 0x69,
|
||||
(byte) 0x6d, (byte) 0x65, (byte) 0x7a, (byte) 0x6f, (byte) 0x6e, (byte) 0x65, (byte) 0x49, (byte) 0x0,
|
||||
(byte) 0x4, (byte) 0x79, (byte) 0x65, (byte) 0x61, (byte) 0x72, (byte) 0x4c, (byte) 0x0, (byte) 0x3,
|
||||
(byte) 0x65, (byte) 0x6f, (byte) 0x6e, (byte) 0x74, (byte) 0x0, (byte) 0x16, (byte) 0x4c, (byte) 0x6a,
|
||||
(byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x6d, (byte) 0x61, (byte) 0x74, (byte) 0x68,
|
||||
(byte) 0x2f, (byte) 0x42, (byte) 0x69, (byte) 0x67, (byte) 0x49, (byte) 0x6e, (byte) 0x74, (byte) 0x65,
|
||||
(byte) 0x67, (byte) 0x65, (byte) 0x72, (byte) 0x3b, (byte) 0x4c, (byte) 0x0, (byte) 0x10, (byte) 0x66,
|
||||
(byte) 0x72, (byte) 0x61, (byte) 0x63, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x61,
|
||||
(byte) 0x6c, (byte) 0x53, (byte) 0x65, (byte) 0x63, (byte) 0x6f, (byte) 0x6e, (byte) 0x64, (byte) 0x74,
|
||||
(byte) 0x0, (byte) 0x16, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f,
|
||||
(byte) 0x6d, (byte) 0x61, (byte) 0x74, (byte) 0x68, (byte) 0x2f, (byte) 0x42, (byte) 0x69, (byte) 0x67,
|
||||
(byte) 0x44, (byte) 0x65, (byte) 0x63, (byte) 0x69, (byte) 0x6d, (byte) 0x61, (byte) 0x6c, (byte) 0x3b,
|
||||
(byte) 0x78, (byte) 0x70, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x1, (byte) 0x0, (byte) 0x0,
|
||||
(byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0,
|
||||
(byte) 0x0, (byte) 0x1, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0xff, (byte) 0xff,
|
||||
(byte) 0xfe, (byte) 0xd4, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x1, (byte) 0x70, (byte) 0x73,
|
||||
(byte) 0x72, (byte) 0x0, (byte) 0x14, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e,
|
||||
(byte) 0x6d, (byte) 0x61, (byte) 0x74, (byte) 0x68, (byte) 0x2e, (byte) 0x42, (byte) 0x69, (byte) 0x67,
|
||||
(byte) 0x44, (byte) 0x65, (byte) 0x63, (byte) 0x69, (byte) 0x6d, (byte) 0x61, (byte) 0x6c, (byte) 0x54,
|
||||
(byte) 0xc7, (byte) 0x15, (byte) 0x57, (byte) 0xf9, (byte) 0x81, (byte) 0x28, (byte) 0x4f, (byte) 0x3,
|
||||
(byte) 0x0, (byte) 0x2, (byte) 0x49, (byte) 0x0, (byte) 0x5, (byte) 0x73, (byte) 0x63, (byte) 0x61,
|
||||
(byte) 0x6c, (byte) 0x65, (byte) 0x4c, (byte) 0x0, (byte) 0x6, (byte) 0x69, (byte) 0x6e, (byte) 0x74,
|
||||
(byte) 0x56, (byte) 0x61, (byte) 0x6c, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x1,
|
||||
(byte) 0x78, (byte) 0x72, (byte) 0x0, (byte) 0x10, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61,
|
||||
(byte) 0x2e, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2e, (byte) 0x4e, (byte) 0x75,
|
||||
(byte) 0x6d, (byte) 0x62, (byte) 0x65, (byte) 0x72, (byte) 0x86, (byte) 0xac, (byte) 0x95, (byte) 0x1d,
|
||||
(byte) 0xb, (byte) 0x94, (byte) 0xe0, (byte) 0x8b, (byte) 0x2, (byte) 0x0, (byte) 0x0, (byte) 0x78,
|
||||
(byte) 0x70, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x7, (byte) 0x73, (byte) 0x72, (byte) 0x0,
|
||||
(byte) 0x14, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x6d, (byte) 0x61,
|
||||
(byte) 0x74, (byte) 0x68, (byte) 0x2e, (byte) 0x42, (byte) 0x69, (byte) 0x67, (byte) 0x49, (byte) 0x6e,
|
||||
(byte) 0x74, (byte) 0x65, (byte) 0x67, (byte) 0x65, (byte) 0x72, (byte) 0x8c, (byte) 0xfc, (byte) 0x9f,
|
||||
(byte) 0x1f, (byte) 0xa9, (byte) 0x3b, (byte) 0xfb, (byte) 0x1d, (byte) 0x3, (byte) 0x0, (byte) 0x6,
|
||||
(byte) 0x49, (byte) 0x0, (byte) 0x8, (byte) 0x62, (byte) 0x69, (byte) 0x74, (byte) 0x43, (byte) 0x6f,
|
||||
(byte) 0x75, (byte) 0x6e, (byte) 0x74, (byte) 0x49, (byte) 0x0, (byte) 0x9, (byte) 0x62, (byte) 0x69,
|
||||
(byte) 0x74, (byte) 0x4c, (byte) 0x65, (byte) 0x6e, (byte) 0x67, (byte) 0x74, (byte) 0x68, (byte) 0x49,
|
||||
(byte) 0x0, (byte) 0x13, (byte) 0x66, (byte) 0x69, (byte) 0x72, (byte) 0x73, (byte) 0x74, (byte) 0x4e,
|
||||
(byte) 0x6f, (byte) 0x6e, (byte) 0x7a, (byte) 0x65, (byte) 0x72, (byte) 0x6f, (byte) 0x42, (byte) 0x79,
|
||||
(byte) 0x74, (byte) 0x65, (byte) 0x4e, (byte) 0x75, (byte) 0x6d, (byte) 0x49, (byte) 0x0, (byte) 0xc,
|
||||
(byte) 0x6c, (byte) 0x6f, (byte) 0x77, (byte) 0x65, (byte) 0x73, (byte) 0x74, (byte) 0x53, (byte) 0x65,
|
||||
(byte) 0x74, (byte) 0x42, (byte) 0x69, (byte) 0x74, (byte) 0x49, (byte) 0x0, (byte) 0x6, (byte) 0x73,
|
||||
(byte) 0x69, (byte) 0x67, (byte) 0x6e, (byte) 0x75, (byte) 0x6d, (byte) 0x5b, (byte) 0x0, (byte) 0x9,
|
||||
(byte) 0x6d, (byte) 0x61, (byte) 0x67, (byte) 0x6e, (byte) 0x69, (byte) 0x74, (byte) 0x75, (byte) 0x64,
|
||||
(byte) 0x65, (byte) 0x74, (byte) 0x0, (byte) 0x2, (byte) 0x5b, (byte) 0x42, (byte) 0x78, (byte) 0x71,
|
||||
(byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x5, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
|
||||
(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xfe,
|
||||
(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xfe, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0,
|
||||
(byte) 0x75, (byte) 0x72, (byte) 0x0, (byte) 0x2, (byte) 0x5b, (byte) 0x42, (byte) 0xac, (byte) 0xf3,
|
||||
(byte) 0x17, (byte) 0xf8, (byte) 0x6, (byte) 0x8, (byte) 0x54, (byte) 0xe0, (byte) 0x2, (byte) 0x0,
|
||||
(byte) 0x0, (byte) 0x78, (byte) 0x70, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x78,
|
||||
(byte) 0x78,
|
||||
};
|
||||
private final byte[] durationBytes = {
|
||||
(byte) 0xac, (byte) 0xed, (byte) 0x0, (byte) 0x5, (byte) 0x73, (byte) 0x72, (byte) 0x0, (byte) 0x4c,
|
||||
(byte) 0x63, (byte) 0x6f, (byte) 0x6d, (byte) 0x2e, (byte) 0x73, (byte) 0x75, (byte) 0x6e, (byte) 0x2e,
|
||||
(byte) 0x6f, (byte) 0x72, (byte) 0x67, (byte) 0x2e, (byte) 0x61, (byte) 0x70, (byte) 0x61, (byte) 0x63,
|
||||
(byte) 0x68, (byte) 0x65, (byte) 0x2e, (byte) 0x78, (byte) 0x65, (byte) 0x72, (byte) 0x63, (byte) 0x65,
|
||||
(byte) 0x73, (byte) 0x2e, (byte) 0x69, (byte) 0x6e, (byte) 0x74, (byte) 0x65, (byte) 0x72, (byte) 0x6e,
|
||||
(byte) 0x61, (byte) 0x6c, (byte) 0x2e, (byte) 0x6a, (byte) 0x61, (byte) 0x78, (byte) 0x70, (byte) 0x2e,
|
||||
(byte) 0x64, (byte) 0x61, (byte) 0x74, (byte) 0x61, (byte) 0x74, (byte) 0x79, (byte) 0x70, (byte) 0x65,
|
||||
(byte) 0x2e, (byte) 0x44, (byte) 0x75, (byte) 0x72, (byte) 0x61, (byte) 0x74, (byte) 0x69, (byte) 0x6f,
|
||||
(byte) 0x6e, (byte) 0x49, (byte) 0x6d, (byte) 0x70, (byte) 0x6c, (byte) 0x24, (byte) 0x44, (byte) 0x75,
|
||||
(byte) 0x72, (byte) 0x61, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x53, (byte) 0x74,
|
||||
(byte) 0x72, (byte) 0x65, (byte) 0x61, (byte) 0x6d, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0,
|
||||
(byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x1, (byte) 0x2, (byte) 0x0, (byte) 0x1, (byte) 0x4c,
|
||||
(byte) 0x0, (byte) 0x7, (byte) 0x6c, (byte) 0x65, (byte) 0x78, (byte) 0x69, (byte) 0x63, (byte) 0x61,
|
||||
(byte) 0x6c, (byte) 0x74, (byte) 0x0, (byte) 0x12, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76,
|
||||
(byte) 0x61, (byte) 0x2f, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2f, (byte) 0x53,
|
||||
(byte) 0x74, (byte) 0x72, (byte) 0x69, (byte) 0x6e, (byte) 0x67, (byte) 0x3b, (byte) 0x78, (byte) 0x70,
|
||||
(byte) 0x74, (byte) 0x0, (byte) 0xe, (byte) 0x50, (byte) 0x31, (byte) 0x59, (byte) 0x31, (byte) 0x4d,
|
||||
(byte) 0x31, (byte) 0x44, (byte) 0x54, (byte) 0x31, (byte) 0x48, (byte) 0x31, (byte) 0x4d, (byte) 0x31,
|
||||
(byte) 0x53,
|
||||
};
|
||||
@Override
|
||||
public byte[] getGregorianCalendarByteArray() {
|
||||
return gregorianCalendarBytes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getDurationBytes() {
|
||||
return durationBytes;
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2023, 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
|
||||
@ -25,160 +25,145 @@
|
||||
* @test
|
||||
* @bug 8033980
|
||||
* @summary verify serialization compatibility for XMLGregorianCalendar and Duration
|
||||
* @run main SerializationTest read
|
||||
* @run junit SerializationTest
|
||||
*/
|
||||
|
||||
import java.io.*;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import javax.xml.datatype.DatatypeConfigurationException;
|
||||
import javax.xml.datatype.DatatypeFactory;
|
||||
import javax.xml.datatype.Duration;
|
||||
import javax.xml.datatype.XMLGregorianCalendar;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.TestInstance;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
|
||||
/**
|
||||
* use "read" to test compatibility
|
||||
* SerializationTest read
|
||||
*
|
||||
* use "write" to create test files
|
||||
* SerializationTest write javaVersion
|
||||
* where javaVersion is 6, 7, 8, or 9
|
||||
*
|
||||
* Verify serialization compatibility for XMLGregorianCalendar and Duration
|
||||
* @author huizhe.wang@oracle.com</a>
|
||||
*/
|
||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||
public class SerializationTest {
|
||||
|
||||
final String FILENAME_CAL = "_XMLGregorianCalendar.ser";
|
||||
final String FILENAME_DURATION = "_Duration.ser";
|
||||
String filePath;
|
||||
|
||||
{
|
||||
filePath = System.getProperty("test.src");
|
||||
if (filePath == null) {
|
||||
//current directory
|
||||
filePath = System.getProperty("user.dir");
|
||||
}
|
||||
filePath += File.separator;
|
||||
}
|
||||
final String EXPECTED_CAL = "0001-01-01T00:00:00.0000000-05:00";
|
||||
final String EXPECTED_DURATION = "P1Y1M1DT1H1M1S";
|
||||
static String[] JDK = {"JDK6", "JDK7", "JDK8", "JDK9"};
|
||||
static String[] JDK = {System.getProperty("java.version"), "JDK6", "JDK7", "JDK8", "JDK9"};
|
||||
|
||||
public static void main(String[] args) {
|
||||
SerializationTest test = new SerializationTest();
|
||||
// If needed to add serialized data of more JDK versions, serialized data source file can be generated using
|
||||
// GregorianCalAndDurSerDataUtil class.
|
||||
private GregorianCalendarAndDurationSerData[] gregorianCalendarAndDurationSerData = {null, new JDK6GregorianCalendarAndDurationSerData(),
|
||||
new JDK7GregorianCalendarAndDurationSerData(), new JDK8GregorianCalendarAndDurationSerData(), new JDK9GregorianCalendarAndDurationSerData()};
|
||||
|
||||
if (args[0].equalsIgnoreCase("read")) {
|
||||
test.testReadCal();
|
||||
test.testReadDuration();
|
||||
test.report();
|
||||
} else {
|
||||
int ver = Integer.valueOf(args[1]).intValue();
|
||||
test.createTestFile(JDK[ver - 6]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void testReadCal() {
|
||||
try {
|
||||
for (String javaVersion : JDK) {
|
||||
XMLGregorianCalendar d1 = (XMLGregorianCalendar) fromFile(
|
||||
javaVersion + FILENAME_CAL);
|
||||
if (!d1.toString().equalsIgnoreCase(EXPECTED_CAL)) {
|
||||
fail("Java version: " + javaVersion
|
||||
+ "\nExpected: " + EXPECTED_CAL
|
||||
+ "\nActual: " + d1.toString());
|
||||
} else {
|
||||
success("testReadCal: read " + javaVersion + " serialized file, passed.");
|
||||
/**
|
||||
* Create the serialized Bytes array and serialized bytes base64 string for GregorianCalender and Duration
|
||||
* with jdk under test.
|
||||
* @throws DatatypeConfigurationException Unexpected.
|
||||
* @throws IOException Unexpected.
|
||||
*/
|
||||
@BeforeAll
|
||||
public void setup() throws DatatypeConfigurationException, IOException {
|
||||
DatatypeFactory dtf = DatatypeFactory.newInstance();
|
||||
XMLGregorianCalendar xmlGregorianCalendar = dtf.newXMLGregorianCalendar(EXPECTED_CAL);
|
||||
Duration duration = dtf.newDuration(EXPECTED_DURATION);
|
||||
try(ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(baos);
|
||||
ByteArrayOutputStream baos2 = new ByteArrayOutputStream(); ObjectOutputStream oos2 = new ObjectOutputStream(baos2)) {
|
||||
//Serialize the given xmlGregorianCalendar
|
||||
oos.writeObject(xmlGregorianCalendar);
|
||||
//Serialize the given xml Duration
|
||||
oos2.writeObject(duration);
|
||||
// Create the Data for JDK under test.
|
||||
gregorianCalendarAndDurationSerData[0] = new GregorianCalendarAndDurationSerData() {
|
||||
@Override
|
||||
public byte[] getGregorianCalendarByteArray() {
|
||||
return baos.toByteArray();
|
||||
}
|
||||
}
|
||||
} catch (ClassNotFoundException ex) {
|
||||
fail("testReadCal: " + ex.getMessage());
|
||||
} catch (IOException ex) {
|
||||
fail("testReadCal: " + ex.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public void testReadDuration() {
|
||||
try {
|
||||
for (String javaVersion : JDK) {
|
||||
Duration d1 = (Duration) fromFile(
|
||||
javaVersion + FILENAME_DURATION);
|
||||
if (!d1.toString().equalsIgnoreCase(EXPECTED_DURATION)) {
|
||||
fail("Java version: " + javaVersion
|
||||
+ "\nExpected: " + EXPECTED_DURATION
|
||||
+ "\nActual: " + d1.toString());
|
||||
} else {
|
||||
success("testReadDuration: read " + javaVersion + " serialized file, passed.");
|
||||
@Override
|
||||
public byte[] getDurationBytes() {
|
||||
return baos2.toByteArray();
|
||||
}
|
||||
}
|
||||
} catch (ClassNotFoundException ex) {
|
||||
fail("testReadDuration: " + ex.getMessage());
|
||||
} catch (IOException ex) {
|
||||
fail("testReadDuration: " + ex.getMessage());
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create test files
|
||||
*
|
||||
* @param javaVersion JDK version
|
||||
* Provide data for JDK version and Gregorian Calendar serialized bytes.
|
||||
* @return A Stream of arguments where each element is an array of size three. First element contain JDK version,
|
||||
* second element contain object reference to GregorianCalendarAndDurationSerData specific to JDK version
|
||||
* and third element contain expected Gregorian Calendar as string.
|
||||
*/
|
||||
public void createTestFile(String javaVersion) {
|
||||
try {
|
||||
DatatypeFactory dtf = DatatypeFactory.newInstance();
|
||||
XMLGregorianCalendar c = dtf.newXMLGregorianCalendar(EXPECTED_CAL);
|
||||
Duration d = dtf.newDuration(EXPECTED_DURATION);
|
||||
toFile((Serializable) c, filePath + javaVersion + FILENAME_CAL);
|
||||
toFile((Serializable) d, filePath + javaVersion + FILENAME_DURATION);
|
||||
} catch (Exception e) {
|
||||
fail(e.getMessage());
|
||||
}
|
||||
|
||||
public Stream<Arguments> gregorianCalendarDataBytes() {
|
||||
return Stream.of(
|
||||
Arguments.of(JDK[0], gregorianCalendarAndDurationSerData[0], EXPECTED_CAL),
|
||||
Arguments.of(JDK[1], gregorianCalendarAndDurationSerData[1], EXPECTED_CAL),
|
||||
Arguments.of(JDK[2], gregorianCalendarAndDurationSerData[2], EXPECTED_CAL),
|
||||
Arguments.of(JDK[3], gregorianCalendarAndDurationSerData[3], EXPECTED_CAL),
|
||||
Arguments.of(JDK[4], gregorianCalendarAndDurationSerData[4], EXPECTED_CAL)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the object from a file.
|
||||
* Provide data for JDK version and Duration serialized bytes.
|
||||
* @return A Stream of arguments where each element is an array of size three. First element contain JDK version,
|
||||
* second element contain object reference to GregorianCalendarAndDurationSerData specific to JDK version
|
||||
* and third element contain expected Duration as string.
|
||||
*/
|
||||
private static Object fromFile(String filePath) throws IOException,
|
||||
|
||||
public Stream<Arguments> durationData() {
|
||||
return Stream.of(Arguments.of(JDK[0], gregorianCalendarAndDurationSerData[0], EXPECTED_DURATION),
|
||||
Arguments.of(JDK[1], gregorianCalendarAndDurationSerData[1], EXPECTED_DURATION),
|
||||
Arguments.of(JDK[2], gregorianCalendarAndDurationSerData[2], EXPECTED_DURATION),
|
||||
Arguments.of(JDK[3], gregorianCalendarAndDurationSerData[3], EXPECTED_DURATION),
|
||||
Arguments.of(JDK[4], gregorianCalendarAndDurationSerData[4], EXPECTED_DURATION));
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify that GregorianCalendar serialized with different old JDK versions can be deserialized correctly with
|
||||
* JDK under test.
|
||||
* @param javaVersion JDK version used to GregorianCalendar serialization.
|
||||
* @param gcsd JDK version specific GregorianCalendarAndDurationSerData.
|
||||
* @param gregorianDate String representation of GregorianCalendar Date.
|
||||
* @throws IOException Unexpected.
|
||||
* @throws ClassNotFoundException Unexpected.
|
||||
*/
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource("gregorianCalendarDataBytes")
|
||||
public void testReadCalBytes(String javaVersion, GregorianCalendarAndDurationSerData gcsd, String gregorianDate) throws IOException,
|
||||
ClassNotFoundException {
|
||||
InputStream streamIn = SerializationTest.class.getResourceAsStream(
|
||||
filePath);
|
||||
ObjectInputStream objectinputstream = new ObjectInputStream(streamIn);
|
||||
Object o = objectinputstream.readObject();
|
||||
return o;
|
||||
final ByteArrayInputStream bais = new ByteArrayInputStream(gcsd.getGregorianCalendarByteArray());
|
||||
final ObjectInputStream ois = new ObjectInputStream(bais);
|
||||
final XMLGregorianCalendar xgc = (XMLGregorianCalendar) ois.readObject();
|
||||
assertEquals(gregorianDate, xgc.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Write the object to a file.
|
||||
* Verify that Duration serialized with different old JDK versions can be deserialized correctly with
|
||||
* JDK under test.
|
||||
* @param javaVersion JDK version used to GregorianCalendar serialization.
|
||||
* @param gcsd JDK version specific GregorianCalendarAndDurationSerData.
|
||||
* @param duration String representation of Duration.
|
||||
* @throws IOException Unexpected.
|
||||
* @throws ClassNotFoundException Unexpected.
|
||||
*/
|
||||
private static void toFile(Serializable o, String filePath) throws IOException {
|
||||
FileOutputStream fout = new FileOutputStream(filePath, true);
|
||||
ObjectOutputStream oos = new ObjectOutputStream(fout);
|
||||
oos.writeObject(o);
|
||||
oos.close();
|
||||
}
|
||||
|
||||
static String errMessage;
|
||||
int passed = 0, failed = 0;
|
||||
|
||||
void fail(String errMsg) {
|
||||
if (errMessage == null) {
|
||||
errMessage = errMsg;
|
||||
} else {
|
||||
errMessage = errMessage + "\n" + errMsg;
|
||||
}
|
||||
failed++;
|
||||
}
|
||||
|
||||
void success(String msg) {
|
||||
passed++;
|
||||
System.out.println(msg);
|
||||
}
|
||||
|
||||
public void report() {
|
||||
|
||||
System.out.println("\nNumber of tests passed: " + passed);
|
||||
System.out.println("Number of tests failed: " + failed + "\n");
|
||||
|
||||
if (errMessage != null) {
|
||||
throw new RuntimeException(errMessage);
|
||||
}
|
||||
@ParameterizedTest
|
||||
@MethodSource("durationData")
|
||||
public void testReadDurationBytes(String javaVersion, GregorianCalendarAndDurationSerData gcsd, String duration) throws IOException,
|
||||
ClassNotFoundException {
|
||||
final ByteArrayInputStream bais = new ByteArrayInputStream(gcsd.getDurationBytes());
|
||||
final ObjectInputStream ois = new ObjectInputStream(bais);
|
||||
final Duration d1 = (Duration) ois.readObject();
|
||||
assertEquals(duration, d1.toString().toUpperCase());
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user