2 * Copyright (c) 2020 PANTHEON.tech, 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.hamcrest.CoreMatchers.containsString;
11 import static org.hamcrest.CoreMatchers.not;
12 import static org.hamcrest.MatcherAssert.assertThat;
13 import static org.junit.jupiter.api.Assertions.assertEquals;
15 import java.io.ByteArrayOutputStream;
16 import java.io.PrintStream;
17 import java.nio.charset.StandardCharsets;
18 import org.junit.jupiter.api.Test;
19 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
21 class YT1133Test extends AbstractYangTest {
23 @SuppressWarnings("checkstyle:regexpSinglelineJava")
24 void testAugmentKeys() throws Exception {
25 final PrintStream stdout = System.out;
26 final ByteArrayOutputStream output = new ByteArrayOutputStream();
27 final EffectiveModelContext ctx;
29 try (PrintStream out = new PrintStream(output, true, StandardCharsets.UTF_8)) {
31 ctx = assertEffectiveModelDir("/bugs/YT1133");
33 System.setOut(stdout);
36 assertEquals(2, ctx.getModules().size());
37 final String log = output.toString();
38 assertThat(log, not(containsString("Configuration list (bar)values")));