assertNull(factory.getNullFormatter());
}
public void testJFormattedTextFieldFormat() {
Format format = new SimpleDateFormat();
InternationalFormatter formatter;
DefaultFormatterFactory factory;
JFormattedTextField tf1 = new JFormattedTextField(format);
assertNull(tf1.getValue());
assertEquals(JFormattedTextField.COMMIT_OR_REVERT, tf1.getFocusLostBehavior());
assertTrue(tf1.getFormatter() instanceof DateFormatter);
formatter = (InternationalFormatter) tf1.getFormatter();
assertEquals(format, formatter.getFormat());
assertTrue(tf1.getFormatterFactory() instanceof DefaultFormatterFactory);
factory = (DefaultFormatterFactory) tf1.getFormatterFactory();
assertEquals(formatter, factory.getDefaultFormatter());
format = new MessageFormat("");
tf1 = new JFormattedTextField(format);
assertTrue(tf1.getFormatter() instanceof InternationalFormatter);
formatter = (InternationalFormatter) tf1.getFormatter();
assertEquals(format, formatter.getFormat());
factory = (DefaultFormatterFactory) tf1.getFormatterFactory();
assertEquals(formatter, factory.getDefaultFormatter());
format = new DecimalFormat();
tf1 = new JFormattedTextField(format);
assertTrue(tf1.getFormatter() instanceof NumberFormatter);
formatter = (InternationalFormatter) tf1.getFormatter();
assertEquals(format, formatter.getFormat());
factory = (DefaultFormatterFactory) tf1.getFormatterFactory();
assertEquals(formatter, factory.getDefaultFormatter());
}