2 * Copyright (c) 2018 Pantheon Technologies, s.r.o. 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.stmt;
10 import static org.junit.jupiter.api.Assertions.assertEquals;
11 import static org.junit.jupiter.api.Assertions.assertInstanceOf;
13 import org.junit.jupiter.api.Test;
14 import org.opendaylight.yangtools.yang.common.QName;
15 import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
17 class YT956Test extends AbstractYangTest {
18 private static final QName ANOTHER_CONTAINER = QName.create("http://www.example.com/anothermodule",
20 private static final QName FIRST_AUGMENT = QName.create("http://www.example.com/mainmodule", "first-augment");
23 void testAugmentationConditional() {
24 final var another = assertEffectiveModelDir("/bugs/YT956/").getDataChildByName(ANOTHER_CONTAINER);
25 final var anotherContainer = assertInstanceOf(ContainerSchemaNode.class, another);
27 final var first = anotherContainer.getDataChildByName(FIRST_AUGMENT);
28 final var firstAugment = assertInstanceOf(ContainerSchemaNode.class, first);
30 // Augmentation needs to be added
31 assertEquals(3, firstAugment.getChildNodes().size());