use of java.text.DateFormatSymbols in project j2objc by google.
the class DateFormatTest method test_getDateTimeInstance.
/**
* @tests java.text.DateFormat#getDateTimeInstance()
*/
public void test_getDateTimeInstance() {
SimpleDateFormat f2 = (SimpleDateFormat) DateFormat.getDateTimeInstance();
assertTrue("Wrong class", f2.getClass() == SimpleDateFormat.class);
assertTrue("Wrong default", f2.equals(DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.DEFAULT, Locale.getDefault())));
assertTrue("Wrong symbols", f2.getDateFormatSymbols().equals(new DateFormatSymbols()));
assertTrue("Doesn't work", f2.format(new Date()).getClass() == String.class);
}
use of java.text.DateFormatSymbols in project j2objc by google.
the class DateFormatTest method test_getInstance.
/**
* @tests java.text.DateFormat#getInstance()
*/
public void test_getInstance() {
SimpleDateFormat f2 = (SimpleDateFormat) DateFormat.getInstance();
assertTrue("Wrong class", f2.getClass() == SimpleDateFormat.class);
assertTrue("Wrong default", f2.equals(DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, Locale.getDefault())));
assertTrue("Wrong symbols", f2.getDateFormatSymbols().equals(new DateFormatSymbols()));
assertTrue("Doesn't work", f2.format(new Date()).getClass() == String.class);
}
use of java.text.DateFormatSymbols in project j2objc by google.
the class DateFormatSymbolsTest method test_clone.
/**
* @tests java.text.DateFormatSymbols#clone()
*/
public void test_clone() {
// Test for method java.lang.Object java.text.DateFormatSymbols.clone()
DateFormatSymbols symbols = new DateFormatSymbols();
DateFormatSymbols clone = (DateFormatSymbols) symbols.clone();
assertTrue("Not equal", symbols.equals(clone));
}
use of java.text.DateFormatSymbols in project j2objc by google.
the class DateFormatSymbolsTest method test_getInstance.
/**
* @tests java.text.DateFormatSymbols#getInstance()
*/
public void test_getInstance() {
DateFormatSymbols.getInstance();
assertEquals(new DateFormatSymbols(), DateFormatSymbols.getInstance());
assertEquals(new DateFormatSymbols(Locale.getDefault()), DateFormatSymbols.getInstance());
assertNotSame(DateFormatSymbols.getInstance(), DateFormatSymbols.getInstance());
}
use of java.text.DateFormatSymbols in project j2objc by google.
the class DateFormatSymbolsTest method test_serialization.
// Test serialization mechanism of DateFormatSymbols
public void test_serialization() throws Exception {
DateFormatSymbols symbols = new DateFormatSymbols(Locale.FRANCE);
String[][] zoneStrings = symbols.getZoneStrings();
assertNotNull(zoneStrings);
// serialize
ByteArrayOutputStream byteOStream = new ByteArrayOutputStream();
ObjectOutputStream objectOStream = new ObjectOutputStream(byteOStream);
objectOStream.writeObject(symbols);
// and deserialize
ObjectInputStream objectIStream = new ObjectInputStream(new ByteArrayInputStream(byteOStream.toByteArray()));
DateFormatSymbols symbolsD = (DateFormatSymbols) objectIStream.readObject();
String[][] zoneStringsD = symbolsD.getZoneStrings();
assertNotNull(zoneStringsD);
assertEquals(symbols, symbolsD);
}
Aggregations