Fix YANG export with duplicate imports
[yangtools.git] / model / yang-model-export / src / test / java / org / opendaylight / yangtools / yang / model / export / YT1313Test.java
1 /*
2  * Copyright (c) 2021 PANTHEON.tech, s.r.o. 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.export;
9
10 import static org.junit.Assert.assertNotNull;
11
12 import org.junit.Test;
13 import org.opendaylight.yangtools.yang.common.QNameModule;
14 import org.opendaylight.yangtools.yang.common.XMLNamespace;
15 import org.opendaylight.yangtools.yang.model.api.stmt.ModuleEffectiveStatement;
16 import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
17
18 public class YT1313Test {
19     @Test
20     public void testSubmoduleImportPrefixes() {
21         final ModuleEffectiveStatement bar = YangParserTestUtils.parseYangResourceDirectory("/bugs/yt1313")
22             .getModuleStatement(QNameModule.create(XMLNamespace.of("bar")));
23
24         final StatementPrefixResolver resolver = StatementPrefixResolver.forModule(bar);
25         assertNotNull(resolver);
26     }
27 }