0N/A/*
2362N/A * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
0N/A * published by the Free Software Foundation.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/A/* Type-specific source code for unit test
0N/A *
0N/A * Regenerate the BasicX classes via genBasic.sh whenever this file changes.
0N/A * We check in the generated source files so that the test tree can be used
0N/A * independently of the rest of the source tree.
0N/A */
0N/A
0N/A// -- This file was mechanically generated: Do not edit! -- //
0N/A
0N/Aimport java.io.*;
0N/Aimport java.math.BigDecimal;
0N/Aimport java.math.BigInteger;
0N/Aimport java.text.DateFormatSymbols;
0N/Aimport java.util.*;
0N/A
0N/A
0N/A
0N/A
0N/A
0N/Aimport static java.util.Calendar.*;
0N/A
0N/A
0N/A
0N/A
0N/A
0N/Apublic class BasicCharObject extends Basic {
0N/A
0N/A private static void test(String fs, String exp, Object ... args) {
0N/A Formatter f = new Formatter(new StringBuilder(), Locale.US);
0N/A f.format(fs, args);
0N/A ck(fs, exp, f.toString());
0N/A }
0N/A
0N/A private static void test(Locale l, String fs, String exp, Object ... args)
0N/A {
0N/A Formatter f = new Formatter(new StringBuilder(), l);
0N/A f.format(fs, args);
0N/A ck(fs, exp, f.toString());
0N/A }
0N/A
0N/A private static void test(String fs, Object ... args) {
0N/A Formatter f = new Formatter(new StringBuilder(), Locale.US);
0N/A f.format(fs, args);
0N/A ck(fs, "fail", f.toString());
0N/A }
0N/A
0N/A private static void test(String fs) {
0N/A Formatter f = new Formatter(new StringBuilder(), Locale.US);
0N/A f.format(fs, "fail");
0N/A ck(fs, "fail", f.toString());
0N/A }
0N/A
0N/A private static void testSysOut(String fs, String exp, Object ... args) {
0N/A FileOutputStream fos = null;
0N/A FileInputStream fis = null;
0N/A try {
0N/A PrintStream saveOut = System.out;
0N/A fos = new FileOutputStream("testSysOut");
0N/A System.setOut(new PrintStream(fos));
0N/A System.out.format(Locale.US, fs, args);
0N/A fos.close();
0N/A
0N/A fis = new FileInputStream("testSysOut");
0N/A byte [] ba = new byte[exp.length()];
0N/A int len = fis.read(ba);
0N/A String got = new String(ba);
0N/A if (len != ba.length)
0N/A fail(fs, exp, got);
0N/A ck(fs, exp, got);
0N/A
0N/A System.setOut(saveOut);
0N/A } catch (FileNotFoundException ex) {
0N/A fail(fs, ex.getClass());
0N/A } catch (IOException ex) {
0N/A fail(fs, ex.getClass());
0N/A } finally {
0N/A try {
0N/A if (fos != null)
0N/A fos.close();
0N/A if (fis != null)
0N/A fis.close();
0N/A } catch (IOException ex) {
0N/A fail(fs, ex.getClass());
0N/A }
0N/A }
0N/A }
0N/A
0N/A private static void tryCatch(String fs, Class<?> ex) {
0N/A boolean caught = false;
0N/A try {
0N/A test(fs);
0N/A } catch (Throwable x) {
0N/A if (ex.isAssignableFrom(x.getClass()))
0N/A caught = true;
0N/A }
0N/A if (!caught)
0N/A fail(fs, ex);
0N/A else
0N/A pass();
0N/A }
0N/A
0N/A private static void tryCatch(String fs, Class<?> ex, Object ... args) {
0N/A boolean caught = false;
0N/A try {
0N/A test(fs, args);
0N/A } catch (Throwable x) {
0N/A if (ex.isAssignableFrom(x.getClass()))
0N/A caught = true;
0N/A }
0N/A if (!caught)
0N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N/A TimeZone.setDefault(TimeZone.getTimeZone("GMT-0800"));
0N/A
0N/A // Any characters not explicitly defined as conversions, date/time
0N/A // conversion suffixes, or flags are illegal and are reserved for
0N/A // future extensions. Use of such a character in a format string will
0N/A // cause an UnknownFormatConversionException or
0N/A // UnknownFormatFlagsException to be thrown.
0N/A tryCatch("%q", UnknownFormatConversionException.class);
0N/A tryCatch("%t&", UnknownFormatConversionException.class);
0N/A tryCatch("%&d", UnknownFormatConversionException.class);
0N/A tryCatch("%^b", UnknownFormatConversionException.class);
0N/A
0N/A //---------------------------------------------------------------------
0N/A // Formatter.java class javadoc examples
0N/A //---------------------------------------------------------------------
0N/A test(Locale.FRANCE, "e = %+10.4f", "e = +2,7183", Math.E);
0N/A test("%4$2s %3$2s %2$2s %1$2s", " d c b a", "a", "b", "c", "d");
0N/A test("Amount gained or lost since last statement: $ %,(.2f",
0N/A "Amount gained or lost since last statement: $ (6,217.58)",
0N/A (new BigDecimal("-6217.58")));
0N/A Calendar c = new GregorianCalendar(1969, JULY, 20, 16, 17, 0);
0N/A testSysOut("Local time: %tT", "Local time: 16:17:00", c);
0N/A
0N/A test("Unable to open file '%1$s': %2$s",
0N/A "Unable to open file 'food': No such file or directory",
0N/A "food", "No such file or directory");
0N/A Calendar duke = new GregorianCalendar(1995, MAY, 23, 19, 48, 34);
0N/A duke.set(Calendar.MILLISECOND, 584);
0N/A test("Duke's Birthday: %1$tB %1$te, %1$tY",
0N/A "Duke's Birthday: May 23, 1995",
0N/A duke);
0N/A test("Duke's Birthday: %1$tB %1$te, %1$tY",
0N/A "Duke's Birthday: May 23, 1995",
0N/A duke.getTime());
0N/A test("Duke's Birthday: %1$tB %1$te, %1$tY",
0N/A "Duke's Birthday: May 23, 1995",
0N/A duke.getTimeInMillis());
0N/A
0N/A test("%4$s %3$s %2$s %1$s %4$s %3$s %2$s %1$s",
0N/A "d c b a d c b a", "a", "b", "c", "d");
0N/A test("%s %s %<s %<s", "a b b b", "a", "b", "c", "d");
0N/A test("%s %s %s %s", "a b c d", "a", "b", "c", "d");
0N/A test("%2$s %s %<s %s", "b a a b", "a", "b", "c", "d");
0N/A
0N/A //---------------------------------------------------------------------
0N/A // %b
0N/A //
0N/A // General conversion applicable to any argument.
0N/A //---------------------------------------------------------------------
0N/A test("%b", "true", true);
0N/A test("%b", "false", false);
0N/A test("%B", "TRUE", true);
0N/A test("%B", "FALSE", false);
0N/A test("%b", "true", Boolean.TRUE);
0N/A test("%b", "false", Boolean.FALSE);
0N/A test("%B", "TRUE", Boolean.TRUE);
0N/A test("%B", "FALSE", Boolean.FALSE);
0N/A test("%14b", " true", true);
0N/A test("%-14b", "true ", true);
0N/A test("%5.1b", " f", false);
0N/A test("%-5.1b", "f ", false);
0N/A
0N/A test("%b", "true", "foo");
0N/A test("%b", "false", (Object)null);
0N/A
0N/A // Boolean.java hardcodes the Strings for "true" and "false", so no
0N/A // localization is possible.
0N/A test(Locale.FRANCE, "%b", "true", true);
0N/A test(Locale.FRANCE, "%b", "false", false);
0N/A
0N/A // If you pass in a single array to a varargs method, the compiler
0N/A // uses it as the array of arguments rather than treating it as a
0N/A // single array-type argument.
0N/A test("%b", "false", (Object[])new String[2]);
0N/A test("%b", "true", new String[2], new String[2]);
0N/A
0N/A int [] ia = { 1, 2, 3 };
0N/A test("%b", "true", ia);
0N/A
0N/A //---------------------------------------------------------------------
0N/A // %b - errors
0N/A //---------------------------------------------------------------------
0N/A tryCatch("%#b", FormatFlagsConversionMismatchException.class);
0N/A tryCatch("%-b", MissingFormatWidthException.class);
0N/A // correct or side-effect of implementation?
0N/A tryCatch("%.b", UnknownFormatConversionException.class);
0N/A tryCatch("%,b", FormatFlagsConversionMismatchException.class);
0N/A
0N/A //---------------------------------------------------------------------
0N/A // %c
0N/A //
0N/A // General conversion applicable to any argument.
0N/A //---------------------------------------------------------------------
0N/A test("%c", "i", 'i');
0N/A test("%C", "I", 'i');
0N/A test("%4c", " i", 'i');
0N/A test("%-4c", "i ", 'i');
0N/A test("%4C", " I", 'i');
0N/A test("%-4C", "I ", 'i');
0N/A test("%c", "i", new Character('i'));
0N/A test("%c", "H", (byte) 72);
0N/A test("%c", "i", (short) 105);
0N/A test("%c", "!", (int) 33);
0N/A test("%c", "\u007F", Byte.MAX_VALUE);
0N/A test("%c", new String(Character.toChars(Short.MAX_VALUE)),
0N/A Short.MAX_VALUE);
0N/A test("%c", "null", (Object) null);
0N/A
0N/A //---------------------------------------------------------------------
0N/A // %c - errors
0N/A //---------------------------------------------------------------------
0N/A tryCatch("%c", IllegalFormatConversionException.class,
0N/A Boolean.TRUE);
0N/A tryCatch("%c", IllegalFormatConversionException.class,
0N/A (float) 0.1);
0N/A tryCatch("%c", IllegalFormatConversionException.class,
0N/A new Object());
0N/A tryCatch("%c", IllegalFormatCodePointException.class,
0N/A Byte.MIN_VALUE);
0N/A tryCatch("%c", IllegalFormatCodePointException.class,
0N/A Short.MIN_VALUE);
0N/A tryCatch("%c", IllegalFormatCodePointException.class,
0N/A Integer.MIN_VALUE);
0N/A tryCatch("%c", IllegalFormatCodePointException.class,
0N/A Integer.MAX_VALUE);
0N/A
0N/A tryCatch("%#c", FormatFlagsConversionMismatchException.class);
0N/A tryCatch("%,c", FormatFlagsConversionMismatchException.class);
0N/A tryCatch("%(c", FormatFlagsConversionMismatchException.class);
0N/A tryCatch("%$c", UnknownFormatConversionException.class);
0N/A tryCatch("%.2c", IllegalFormatPrecisionException.class);
0N/A
0N/A //---------------------------------------------------------------------
0N/A // %s
0N/A //
0N/A // General conversion applicable to any argument.
0N/A //---------------------------------------------------------------------
0N/A test("%s", "Hello, Duke", "Hello, Duke");
0N/A test("%S", "HELLO, DUKE", "Hello, Duke");
0N/A test("%20S", " HELLO, DUKE", "Hello, Duke");
0N/A test("%20s", " Hello, Duke", "Hello, Duke");
0N/A test("%-20s", "Hello, Duke ", "Hello, Duke");
0N/A test("%-20.5s", "Hello ", "Hello, Duke");
0N/A test("%s", "null", (Object)null);
0N/A
0N/A StringBuffer sb = new StringBuffer("foo bar");
0N/A test("%s", sb.toString(), sb);
0N/A test("%S", sb.toString().toUpperCase(), sb);
0N/A
0N/A //---------------------------------------------------------------------
0N/A // %s - errors
0N/A //---------------------------------------------------------------------
0N/A tryCatch("%-s", MissingFormatWidthException.class);
0N/A tryCatch("%--s", DuplicateFormatFlagsException.class);
1469N/A tryCatch("%#s", FormatFlagsConversionMismatchException.class, 0);
1469N/A tryCatch("%#s", FormatFlagsConversionMismatchException.class, 0.5f);
1469N/A tryCatch("%#s", FormatFlagsConversionMismatchException.class, "hello");
1469N/A tryCatch("%#s", FormatFlagsConversionMismatchException.class, null);
0N/A
0N/A //---------------------------------------------------------------------
0N/A // %h
0N/A //
0N/A // General conversion applicable to any argument.
0N/A //---------------------------------------------------------------------
0N/A test("%h", Integer.toHexString("Hello, Duke".hashCode()),
0N/A "Hello, Duke");
0N/A test("%10h", " ddf63471", "Hello, Duke");
0N/A test("%-10h", "ddf63471 ", "Hello, Duke");
0N/A test("%-10H", "DDF63471 ", "Hello, Duke");
0N/A test("%10h", " 402e0000", 15.0);
0N/A test("%10H", " 402E0000", 15.0);
0N/A
0N/A //---------------------------------------------------------------------
0N/A // %h - errors
0N/A //---------------------------------------------------------------------
0N/A tryCatch("%#h", FormatFlagsConversionMismatchException.class);
0N/A
0N/A //---------------------------------------------------------------------
0N/A // flag/conversion errors
0N/A //---------------------------------------------------------------------
0N/A tryCatch("%F", UnknownFormatConversionException.class);
0N/A
0N/A tryCatch("%#g", FormatFlagsConversionMismatchException.class);
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0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/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
806N/A
0N/A //---------------------------------------------------------------------
0N/A // %t
0N/A //
0N/A // Date/Time conversions applicable to Calendar, Date, and long.
0N/A //---------------------------------------------------------------------
0N/A test("%tA", "null", (Object)null);
0N/A test("%TA", "NULL", (Object)null);
0N/A
0N/A //---------------------------------------------------------------------
0N/A // %t - errors
0N/A //---------------------------------------------------------------------
0N/A tryCatch("%t", UnknownFormatConversionException.class);
0N/A tryCatch("%T", UnknownFormatConversionException.class);
0N/A tryCatch("%tP", UnknownFormatConversionException.class);
0N/A tryCatch("%TP", UnknownFormatConversionException.class);
0N/A tryCatch("%.5tB", IllegalFormatPrecisionException.class);
0N/A tryCatch("%#tB", FormatFlagsConversionMismatchException.class);
0N/A tryCatch("%-tB", MissingFormatWidthException.class);
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A //---------------------------------------------------------------------
0N/A // %n
0N/A //---------------------------------------------------------------------
0N/A test("%n", System.getProperty("line.separator"), (Object)null);
0N/A test("%n", System.getProperty("line.separator"), "");
0N/A
0N/A tryCatch("%,n", IllegalFormatFlagsException.class);
0N/A tryCatch("%.n", UnknownFormatConversionException.class);
0N/A tryCatch("%5.n", UnknownFormatConversionException.class);
0N/A tryCatch("%5n", IllegalFormatWidthException.class);
0N/A tryCatch("%.7n", IllegalFormatPrecisionException.class);
0N/A tryCatch("%<n", IllegalFormatFlagsException.class);
0N/A
0N/A //---------------------------------------------------------------------
0N/A // %%
0N/A //---------------------------------------------------------------------
0N/A test("%%", "%", (Object)null);
0N/A test("%%", "%", "");
0N/A tryCatch("%%%", UnknownFormatConversionException.class);
0N/A // perhaps an IllegalFormatArgumentIndexException should be defined?
0N/A tryCatch("%<%", IllegalFormatFlagsException.class);
0N/A }
0N/A}