2 * Copyright (c) 2015 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.mdsal.binding.generator.impl;
10 import static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertThrows;
13 import org.junit.Test;
14 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
15 import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
17 public class Bug4621Test {
19 public void testMissingLeafrefTarget() {
20 final EffectiveModelContext context = YangParserTestUtils.parseYangResource("/bug4621.yang");
21 final IllegalArgumentException ex = assertThrows(IllegalArgumentException.class,
22 () -> DefaultBindingGenerator.generateFor(context));
23 assertEquals("Failed to find leafref target /foo:neighbor/foo:mystring1", ex.getMessage());