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 /*
25 * @test
26 * @bug 8075526 8135108
27 * @key intermittent
28 * @summary Test timestamp via ZipEntry.get/setTimeLocal()
29 */
30
31 import java.io.*;
32 import java.nio.file.*;
33 import java.time.*;
34 import java.util.*;
35 import java.util.zip.*;
36
37 public class TestLocalTime {
38 private static TimeZone tz0 = TimeZone.getDefault();
39
40 public static void main(String[] args) throws Throwable{
41 try {
42 LocalDateTime ldt = LocalDateTime.now();
43 test(getBytes(ldt), ldt); // now
44
45 ldt = ldt.withYear(1968); test(getBytes(ldt), ldt);
46 ldt = ldt.withYear(1970); test(getBytes(ldt), ldt);
47 ldt = ldt.withYear(1982); test(getBytes(ldt), ldt);
|
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 /*
25 * @test
26 * @bug 8075526 8135108
27 * @summary Test timestamp via ZipEntry.get/setTimeLocal()
28 */
29
30 import java.io.*;
31 import java.nio.file.*;
32 import java.time.*;
33 import java.util.*;
34 import java.util.zip.*;
35
36 public class TestLocalTime {
37 private static TimeZone tz0 = TimeZone.getDefault();
38
39 public static void main(String[] args) throws Throwable{
40 try {
41 LocalDateTime ldt = LocalDateTime.now();
42 test(getBytes(ldt), ldt); // now
43
44 ldt = ldt.withYear(1968); test(getBytes(ldt), ldt);
45 ldt = ldt.withYear(1970); test(getBytes(ldt), ldt);
46 ldt = ldt.withYear(1982); test(getBytes(ldt), ldt);
|