blob: 924902a1c4375a67690bef3898f43f0a3e9d5f0f [file] [log] [blame]
Simon Hunt9ffbd8d2015-05-06 12:02:32 -07001/*
2 * Copyright 2015 Open Networking Laboratory
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 */
17
18package org.onosproject.ui.table.cell;
19
20import org.joda.time.DateTime;
21import org.junit.Test;
22import org.onosproject.ui.table.CellFormatter;
23
24import static org.junit.Assert.assertEquals;
25
26/**
27 * Unit tests for {@link TimeFormatter}.
28 */
29public class TimeFormatterTest {
30
31 private static final DateTime TIME = DateTime.parse("2010-06-30T01:20");
32 private static final String EXP_OUTPUT = "1:20:00 AM PDT";
33
34 private CellFormatter fmt = TimeFormatter.INSTANCE;
35
36 @Test
37 public void basic() {
38 assertEquals("wrong format", EXP_OUTPUT, fmt.format(TIME));
39 }
40}