1 /* 2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 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 /* 25 * @test 26 * @bug 4429875 7186799 27 * @compile -source 1.4 GetObjectMinValue.java 28 * @run main GetObjectMinValue 29 * @summary Tests the getObject{Min,Max}Value method of 30 * IIOMetadataFormatImpl for an inclusive range 31 */ 32 33 // Compiled with -source 1.4 to work around javac bug 5041233 34 35 import javax.imageio.metadata.IIOMetadataFormatImpl; 36 import javax.imageio.ImageTypeSpecifier; 37 38 public class GetObjectMinValue { 39 40 public static void main(String argv[]) { 41 test(true, true); 42 test(true, false); 43 test(false, true); 44 test(false, false); 45 } 46 47 private static void test(boolean minInclusive, boolean maxInclusive) { 48 Integer defValue = new Integer(1); 49 Integer minValue = new Integer(0); 50 Integer maxValue = new Integer(10); 51 52 MyFormatImpl fmt = new MyFormatImpl("root", 1, 10); 53 | 1 /* 2 * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 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 /* 25 * @test 26 * @bug 4429875 7186799 27 * @compile GetObjectMinValue.java 28 * @run main GetObjectMinValue 29 * @summary Tests the getObject{Min,Max}Value method of 30 * IIOMetadataFormatImpl for an inclusive range 31 */ 32 33 import javax.imageio.metadata.IIOMetadataFormatImpl; 34 import javax.imageio.ImageTypeSpecifier; 35 36 public class GetObjectMinValue { 37 38 public static void main(String argv[]) { 39 test(true, true); 40 test(true, false); 41 test(false, true); 42 test(false, false); 43 } 44 45 private static void test(boolean minInclusive, boolean maxInclusive) { 46 Integer defValue = new Integer(1); 47 Integer minValue = new Integer(0); 48 Integer maxValue = new Integer(10); 49 50 MyFormatImpl fmt = new MyFormatImpl("root", 1, 10); 51 |