--- /dev/null
+/*
+ * Copyright (c) 2022 Verizon and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yangtools.yang.stmt;
+
+import org.junit.Test;
+
+public class YT1408Test extends AbstractYangTest {
+ @Test
+ public void testChoiceCaseDeviateCase() throws AssertionError {
+ assertEffectiveModelDir("/bugs/YT1408/choice-case-deviate-case");
+ }
+
+ @Test
+ public void testChoiceDeviateCase() throws AssertionError {
+ assertEffectiveModelDir("/bugs/YT1408/choice-deviate-case");
+ }
+
+ @Test
+ public void testAugmentChoiceCaseDeviateCase() throws AssertionError {
+ assertEffectiveModelDir("/bugs/YT1408/aug-choice-case-deviate-case");
+ }
+
+ @Test
+ public void testAugmentChoiceDeviateCase() throws AssertionError {
+ assertEffectiveModelDir("/bugs/YT1408/aug-choice-deviate-case");
+ }
+}
*/
package org.opendaylight.yangtools.yang.stmt;
+import static org.hamcrest.CoreMatchers.allOf;
import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.CoreMatchers.endsWith;
import static org.hamcrest.CoreMatchers.startsWith;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.isA;
import com.google.common.base.Throwables;
import org.junit.Test;
-import org.opendaylight.yangtools.yang.model.spi.meta.SubstatementIndexingException;
import org.opendaylight.yangtools.yang.parser.spi.meta.InferenceException;
import org.opendaylight.yangtools.yang.parser.spi.meta.SomeModifiersUnresolvedException;
import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
() -> TestUtils.parseYangSource(
"/negative-scenario/duplicity/augment0.yang", "/negative-scenario/duplicity/augment2.yang"));
final Throwable rootCause = Throwables.getRootCause(ex);
- assertThat(rootCause, isA(SubstatementIndexingException.class));
- assertThat(rootCause.getMessage(), containsString("Cannot add schema tree child with name "
- + "(urn:simple.augment2.demo?revision=2014-06-02)delta, a conflicting child already exists"));
+ assertThat(rootCause, isA(SourceException.class));
+ assertThat(rootCause.getMessage(), allOf(
+ startsWith("Error in module 'augment0': cannot add "
+ + "'(urn:simple.augment2.demo?revision=2014-06-02)delta'. Node name collision: "
+ + "'(urn:simple.augment2.demo?revision=2014-06-02)delta' already declared at "),
+ endsWith("duplicity/augment2.yang:17:9]")));
}
@Test