Bug 3899: Milestone Increase test coverage for YangTools - Types
[yangtools.git] / yang / yang-model-util / src / test / java / org / opendaylight / yangtools / yang / model / util / EmptyTypeTest.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.yangtools.yang.model.util;
9
10 import org.junit.Test;
11 import org.opendaylight.yangtools.yang.model.api.Status;
12
13 import java.util.Collections;
14
15 import static org.junit.Assert.assertEquals;
16 import static org.junit.Assert.assertNotEquals;
17 import static org.junit.Assert.assertTrue;
18
19 public class EmptyTypeTest {
20
21     @Test
22     public void canCreateEmptyType() {
23         EmptyType emptyType = EmptyType.getInstance();
24
25         assertEquals("QName", BaseTypes.EMPTY_QNAME, emptyType.getQName());
26         assertEquals("Path", Collections.singletonList(BaseTypes.EMPTY_QNAME),
27                 emptyType.getPath().getPathFromRoot());
28         assertEquals("BaseType", null, emptyType.getBaseType());
29         assertEquals("DefaultValue", null, emptyType.getDefaultValue());
30         assertEquals("Status", Status.CURRENT, emptyType.getStatus());
31         assertTrue("Reference", emptyType.getReference().contains("rfc6020"));
32         assertEquals("Units", null, emptyType.getUnits());
33         assertNotEquals("Description is not null", null, emptyType.getDescription());
34         assertEquals("UnknownSchemaNodes", Collections.EMPTY_LIST, emptyType.getUnknownSchemaNodes());
35         assertTrue("toString", emptyType.toString().contains("empty"));
36     }
37 }