Split out yang-model-ri
[yangtools.git] / yang / yang-model-ri / src / test / java / org / opendaylight / yangtools / yang / model / ri / type / 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.ri.type;
9
10 import static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertFalse;
12 import static org.junit.Assert.assertTrue;
13
14 import java.util.Collections;
15 import java.util.Optional;
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     @Test
22     public void canCreateEmptyType() {
23         EmptyTypeDefinition emptyType = BaseTypes.emptyType();
24
25         assertEquals("QName", EmptyTypeDefinition.QNAME, emptyType.getQName());
26         assertEquals("BaseType", null, emptyType.getBaseType());
27         assertEquals("DefaultValue", Optional.empty(), emptyType.getDefaultValue());
28         assertEquals("Status", Status.CURRENT, emptyType.getStatus());
29         assertFalse(emptyType.getReference().isPresent());
30         assertEquals("Units", Optional.empty(), emptyType.getUnits());
31         assertFalse(emptyType.getDescription().isPresent());
32         assertEquals("UnknownSchemaNodes", Collections.emptyList(), emptyType.getUnknownSchemaNodes());
33         assertTrue("toString", emptyType.toString().contains("empty"));
34     }
35 }