Cleanup DocumentedNode
[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 static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertFalse;
12 import static org.junit.Assert.assertTrue;
13 import static org.opendaylight.yangtools.yang.model.util.type.BaseTypes.emptyType;
14
15 import java.util.Collections;
16 import org.junit.Test;
17 import org.opendaylight.yangtools.yang.model.api.Status;
18 import org.opendaylight.yangtools.yang.model.api.type.EmptyTypeDefinition;
19
20 public class EmptyTypeTest {
21
22     @Test
23     public void canCreateEmptyType() {
24         EmptyTypeDefinition emptyType = emptyType();
25
26         assertEquals("QName", BaseTypes.EMPTY_QNAME, emptyType.getQName());
27         assertEquals("Path", Collections.singletonList(BaseTypes.EMPTY_QNAME),
28                 emptyType.getPath().getPathFromRoot());
29         assertEquals("BaseType", null, emptyType.getBaseType());
30         assertEquals("DefaultValue", null, emptyType.getDefaultValue());
31         assertEquals("Status", Status.CURRENT, emptyType.getStatus());
32         assertFalse(emptyType.getReference().isPresent());
33         assertEquals("Units", null, emptyType.getUnits());
34         assertFalse(emptyType.getDescription().isPresent());
35         assertEquals("UnknownSchemaNodes", Collections.EMPTY_LIST, emptyType.getUnknownSchemaNodes());
36         assertTrue("toString", emptyType.toString().contains("empty"));
37     }
38 }