MCPcopy Create free account
hub / github.com/OpenTSDB/opentsdb / unitsToCalendarType

Method unitsToCalendarType

test/utils/TestDateTime.java:994–1016  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

992 }
993
994 @Test
995 public void unitsToCalendarType() {
996 assertEquals(Calendar.MILLISECOND, DateTime.unitsToCalendarType("ms"));
997 assertEquals(Calendar.SECOND, DateTime.unitsToCalendarType("s"));
998 assertEquals(Calendar.MINUTE, DateTime.unitsToCalendarType("m"));
999 assertEquals(Calendar.HOUR_OF_DAY, DateTime.unitsToCalendarType("h"));
1000 assertEquals(Calendar.DAY_OF_MONTH, DateTime.unitsToCalendarType("d"));
1001 assertEquals(Calendar.DAY_OF_WEEK, DateTime.unitsToCalendarType("w"));
1002 assertEquals(Calendar.MONTH, DateTime.unitsToCalendarType("n"));
1003 assertEquals(Calendar.YEAR, DateTime.unitsToCalendarType("y"));
1004 try {
1005 DateTime.unitsToCalendarType("j");
1006 fail("Expected IllegalArgumentException");
1007 } catch (IllegalArgumentException e) { }
1008 try {
1009 DateTime.unitsToCalendarType(null);
1010 fail("Expected IllegalArgumentException");
1011 } catch (IllegalArgumentException e) { }
1012 try {
1013 DateTime.unitsToCalendarType("");
1014 fail("Expected IllegalArgumentException");
1015 } catch (IllegalArgumentException e) { }
1016 }
1017
1018
1019 @Test

Callers

nothing calls this directly

Calls 1

unitsToCalendarTypeMethod · 0.95

Tested by

no test coverage detected