Merge "Initial implementation of netconf monitoring module according to http://tools...
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / test / java / org / opendaylight / controller / sal / restconf / impl / test / YangAndXmlAndDataSchemaLoader.java
1 package org.opendaylight.controller.sal.restconf.impl.test;
2
3 import static org.junit.Assert.assertEquals;
4 import static org.junit.Assert.assertNotNull;
5
6 import java.util.Set;
7 import org.opendaylight.yangtools.yang.model.api.*;
8
9 public abstract class YangAndXmlAndDataSchemaLoader {
10
11     protected static Set<Module> modules;
12     protected static DataSchemaNode dataSchemaNode;
13
14     protected static void dataLoad(String yangPath) {
15         dataLoad(yangPath, 1, null, null);
16     }
17
18     protected static void dataLoad(String yangPath, int modulesNumber, String moduleName, String dataSchemaName) {
19         modules = TestUtils.resolveModules(yangPath);
20         assertEquals(modulesNumber, modules.size());
21         Module module = TestUtils.resolveModule(moduleName, modules);
22         assertNotNull(module);
23         dataSchemaNode = TestUtils.resolveDataSchemaNode(module, dataSchemaName);
24         assertNotNull(dataSchemaNode);
25     }
26
27 }