@Test
public void createHour() throws Exception {

    // test all 3 ways to create an hour
    DateTimePeriod period0 = DateTimePeriod.createHour(2009, 2, 1, 9, DateTimeZone.UTC);
    DateTimePeriod period1 = DateTimePeriod.createHour(new DateTime(2009,2,1,9,0,0,0,DateTimeZone.UTC));
    DateTimePeriod period2 = DateTimePeriod.create(DateTimeDuration.HOUR, new DateTime(2009,2,1,9,0,0,0,DateTimeZone.UTC));
    DateTime correctStart = new DateTime(2009,2,1,9,0,0,0,DateTimeZone.UTC);
    DateTime correctEnd = new DateTime(2009,2,1,10,0,0,0,DateTimeZone.UTC);
    Assert.assertEquals(correctStart, period0.getStart());
    Assert.assertEquals(correctEnd, period0.getEnd());
    Assert.assertEquals(DateTimeDuration.HOUR, period0.getDuration());
    Assert.assertEquals("2009-02-01-09", period0.getKey());
    Assert.assertEquals("February 1, 2009 09:00", period0.getLongName());
    Assert.assertEquals("09:00", period0.getShortName());
    Assert.assertEquals("09", period0.getIndexName());
    Assert.assertEquals(correctStart, period1.getStart());
    Assert.assertEquals(correctEnd, period1.getEnd());
    Assert.assertEquals(DateTimeDuration.HOUR, period1.getDuration());
    Assert.assertEquals("2009-02-01-09", period1.getKey());
    Assert.assertEquals("February 1, 2009 09:00", period0.getLongName());
    Assert.assertEquals("09:00", period0.getShortName());
    Assert.assertEquals("09", period0.getIndexName());
    Assert.assertEquals(correctStart, period2.getStart());
    Assert.assertEquals(correctEnd, period2.getEnd());
    Assert.assertEquals(DateTimeDuration.HOUR, period2.getDuration());
    Assert.assertEquals("2009-02-01-09", period2.getKey());
    Assert.assertEquals("February 1, 2009 09:00", period0.getLongName());
    Assert.assertEquals("09:00", period0.getShortName());
    Assert.assertEquals("09", period0.getIndexName());
}