blob: e74fb47c349a2233f5b7145318cc24cb4139fc2e [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.junit.Test;
21import org.onosproject.core.ApplicationId;
22import org.onosproject.ui.table.CellFormatter;
23
24import static org.junit.Assert.assertEquals;
25
26/**
27 * Unit tests for {@link AppIdFormatter}.
28 */
29public class AppIdFormatterTest {
30
31 private static final ApplicationId APP_ID = new ApplicationId() {
32 @Override
33 public short id() {
34 return 25;
35 }
36
37 @Override
38 public String name() {
39 return "some app";
40 }
41 };
42
43 private CellFormatter fmt = AppIdFormatter.INSTANCE;
44
45 @Test
46 public void basic() {
47 assertEquals("wrong format", "25 : some app", fmt.format(APP_ID));
48 }
49
50}