2 * Copyright (c) 2019 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.mdsal.binding.generator.impl;
10 import static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertNotNull;
13 import java.util.List;
14 import org.junit.Test;
15 import org.opendaylight.mdsal.binding.model.api.GeneratedType;
16 import org.opendaylight.mdsal.binding.model.api.MethodSignature;
17 import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
19 public class Mdsal500Test {
21 public void testAugmentedAction() {
22 final List<GeneratedType> types = DefaultBindingGenerator.generateFor(
23 YangParserTestUtils.parseYangResource("/mdsal500.yang"));
25 assertEquals(3, types.size());
27 final GeneratedType rpcService = types.get(2);
28 assertEquals("Mdsal500Service", rpcService.getName());
29 final List<MethodSignature> methods = rpcService.getMethodDefinitions();
30 assertEquals(1, methods.size());
32 final MethodSignature signature = methods.get(0);
33 assertEquals("switch$", signature.getName());