SchemaContext provide findModules(String), which serves the same
purpose, remove the utility method.
Change-Id: I5f2b7cae56f8d1af404117580d1ecced160e0f7f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
@Test
public void twoRevisionsTest2() throws ReactorException {
@Test
public void twoRevisionsTest2() throws ReactorException {
- Collection<? extends Module> modules = RFC7950Reactors.defaultReactor().newBuild()
+ final var context = RFC7950Reactors.defaultReactor().newBuild()
.addSources(NETWORK_TOPOLOGY_20130712, NETWORK_TOPOLOGY_20131021, IETF_TYPES)
.addSources(NETWORK_TOPOLOGY_20130712, NETWORK_TOPOLOGY_20131021, IETF_TYPES)
- .buildEffective()
- .getModules();
- assertEquals(3, modules.size());
- assertEquals(2, StmtTestUtils.findModules(modules, "network-topology").size());
+ assertEquals(3, context.getModuleStatements().size());
+ assertEquals(2, context.findModules("network-topology").size());
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Set;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.common.YangConstants;
import java.util.Set;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.common.YangConstants;
- public static List<Module> findModules(final Collection<? extends Module> modules, final String moduleName) {
- final List<Module> result = new ArrayList<>();
- for (final Module module : modules) {
- if (module.getName().equals(moduleName)) {
- result.add(module);
- }
- }
- return result;
- }
-
public static YangStatementStreamSource sourceForResource(final String resourceName) {
try {
return YangStatementStreamSource.create(YangTextSchemaSource.forPath(Path.of(
public static YangStatementStreamSource sourceForResource(final String resourceName) {
try {
return YangStatementStreamSource.create(YangTextSchemaSource.forPath(Path.of(