BUG-865: remove unused model.util 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 static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertNull;
12 import static org.junit.Assert.assertTrue;
13 import static org.opendaylight.yangtools.yang.model.util.type.BaseTypes.emptyType;
14 import java.util.Collections;
15 import org.junit.Test;
16 import org.opendaylight.yangtools.yang.model.api.Status;
17 import org.opendaylight.yangtools.yang.model.api.type.EmptyTypeDefinition;
18
19 public class EmptyTypeTest {
20
21     @Test
22     public void canCreateEmptyType() {
23         EmptyTypeDefinition emptyType = emptyType();
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         assertNull("Reference", emptyType.getReference());
32         assertEquals("Units", null, emptyType.getUnits());
33         assertNull("Description is not null", emptyType.getDescription());
34         assertEquals("UnknownSchemaNodes", Collections.EMPTY_LIST, emptyType.getUnknownSchemaNodes());
35         assertTrue("toString", emptyType.toString().contains("empty"));
36     }
37 }