//#endif
TimeZone PT = TimeZone.getTimeZone("America/Los_Angeles");
for (j = 0, exp = 0; j < COUNT; ++j) {
// String str;
DateFormat df = dateFormats[j];
df.setTimeZone(PT);
logln(" Pattern = " + ((SimpleDateFormat) df).toPattern());
try {
logln(" Result = " + df.format(aug13));
} catch (Exception e) {
errln("FAIL: " + e);
e.printStackTrace();
continue;
}
FieldPosition pos;
String field;
for (i = 0; i < DateFormat.FIELD_COUNT; ++i, ++exp) {
pos = new FieldPosition(i);
buf.setLength(0);
df.format(aug13, buf, pos);
field = buf.substring(pos.getBeginIndex(), pos.getEndIndex());
assertEquals("pattern#" + j + " field #" + i + " " + DATEFORMAT_FIELD_NAMES[i],
EXPECTED[exp], field);
}
//#if defined(FOUNDATION10) || defined(J2SE13)
//#else
// FieldPostion initialized by DateFormat.Field trac#6089
for(i = 0; i < DTFMT_FIELDS.length; i++) {
// The format method only set position for the first occurrence of
// the specified field.
pos = new FieldPosition(DTFMT_FIELDS[i]);
buf.setLength(0);
df.format(aug13, buf, pos);
field = buf.substring(pos.getBeginIndex(), pos.getEndIndex());
assertEquals("pattern#" + j + " " + DTFMT_FIELDS[i].toString(), EXPECTED_BY_FIELD[j][i], field);
}
//#endif
}