blob: 7068c16f9fde6631e3fb4aa85efd4c8cb827b093 [file] [log] [blame]
Simon Huntf844f632015-05-20 19:06:35 -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.cord.gui.model;
19
20import org.junit.Test;
21
22import static org.junit.Assert.assertEquals;
23import static org.junit.Assert.assertTrue;
24import static org.onosproject.cord.gui.model.XosFunctionDescriptor.*;
25
26/**
27 * Sanity unit tests for {@link XosFunctionDescriptor}.
28 */
29public class XosFunctionDescriptorTest {
30
31 @Test
32 public void numberOfFunctions() {
33 assertEquals("unexpected constant count", 3, values().length);
34 }
35
36 @Test
37 public void internet() {
38 assertEquals("wrong id", "internet", INTERNET.id());
39 assertEquals("wrong display", "Internet", INTERNET.displayName());
40 assertTrue("wrong desc", INTERNET.description().startsWith("Basic"));
41 }
42
43 @Test
44 public void firewall() {
45 assertEquals("wrong id", "firewall", FIREWALL.id());
46 assertEquals("wrong display", "Firewall", FIREWALL.displayName());
47 assertTrue("wrong desc", FIREWALL.description().startsWith("Normal"));
48 }
49
50 @Test
51 public void urlFiltering() {
52 assertEquals("wrong id", "url_filtering", URL_FILTERING.id());
53 assertEquals("wrong display", "Parental Control", URL_FILTERING.displayName());
54 assertTrue("wrong desc", URL_FILTERING.description().startsWith("Variable"));
55 }
56}