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.model.export;
10 import static org.junit.Assert.assertNotNull;
11 import static org.junit.Assert.assertTrue;
13 import org.junit.Test;
14 import org.opendaylight.yangtools.yang.model.api.Module;
15 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
16 import org.opendaylight.yangtools.yang.model.api.stmt.ModuleEffectiveStatement;
17 import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
19 public class YangTextSnippetTest {
21 public void testNotification() {
22 final SchemaContext schema = YangParserTestUtils.parseYangResource("/bugs/bug2444/yang/notification.yang");
24 for (Module module : schema.getModules()) {
25 assertTrue(module instanceof ModuleEffectiveStatement);
26 final ModuleEffectiveStatement stmt = (ModuleEffectiveStatement) module;
28 final String str = DeclaredStatementFormatter.defaultInstance().toYangTextSnippet(stmt, stmt.getDeclared())