2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.yangtools.yang.model.util;
10 import org.junit.Test;
11 import org.opendaylight.yangtools.yang.model.api.Status;
13 import java.util.Collections;
15 import static org.junit.Assert.assertEquals;
16 import static org.junit.Assert.assertNotEquals;
17 import static org.junit.Assert.assertTrue;
19 public class EmptyTypeTest {
22 public void canCreateEmptyType() {
23 EmptyType emptyType = EmptyType.getInstance();
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"));