3 import java.io.IOException;
5 import static org.junit.Assert.*;
11 public class WayBackTimeParserTest {
15 public void testParseYYYYMMDD_H_M_S() throws IOException {
16 final String text = "2011/08/19 00:00:12";
17 final long expected = 1313679612L;
18 final long actual = WayBackTimeParser.parse(text);
19 assertEquals(expected, actual);
24 public void testParseYYYYMMDD_H_M() throws IOException {
25 final String text = "2011/08/19 00:00";
26 final long expected = 1313679600L;
27 final long actual = WayBackTimeParser.parse(text);
28 assertEquals(expected, actual);
31 /** 1970 年 1 月 1 日 00:00:00 GMT からの秒数指定(一般的なミリ秒指定ではないことに注意 */
33 public void testParseNumber() throws IOException {
34 final String text = "1313679600";
35 final long actual = WayBackTimeParser.parse(text);
36 assertEquals(Long.parseLong(text), actual);