2 * Copyright (c) 2017 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.stmt;
10 import static org.junit.jupiter.api.Assertions.assertEquals;
11 import static org.junit.jupiter.api.Assertions.fail;
13 import java.util.Optional;
14 import org.junit.jupiter.api.Test;
15 import org.opendaylight.yangtools.yang.common.Revision;
17 class Bug8597Test extends AbstractYangTest {
20 for (var moduleImport : assertEffectiveModelDir("/bugs/bug8597").findModule("foo").orElseThrow().getImports()) {
21 switch (moduleImport.getModuleName().getLocalName()) {
23 assertEquals(Revision.ofNullable("1970-01-01"), moduleImport.getRevision());
24 assertEquals(Optional.of("bar-ref"), moduleImport.getReference());
25 assertEquals(Optional.of("bar-desc"), moduleImport.getDescription());
28 assertEquals(Revision.ofNullable("2010-10-10"), moduleImport.getRevision());
29 assertEquals(Optional.of("baz-ref"), moduleImport.getReference());
30 assertEquals(Optional.of("baz-desc"), moduleImport.getDescription());
33 fail("Module 'foo' should only contains import of module 'bar' and 'baz'");