X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-testtool%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Ftest%2Ftool%2FNetconfDeviceSimulator.java;h=3476b11fbeaf6379c512ba8dbcc0ca3a3328330c;hb=0f3ae2f9e4151a60245a2b295cc7998f0d0e745f;hp=bb67af2032793fdac1a8038377c8550b5f045d50;hpb=e3998d55e33da9f6ecb69da75ecc71a047b6362b;p=controller.git diff --git a/opendaylight/netconf/netconf-testtool/src/main/java/org/opendaylight/controller/netconf/test/tool/NetconfDeviceSimulator.java b/opendaylight/netconf/netconf-testtool/src/main/java/org/opendaylight/controller/netconf/test/tool/NetconfDeviceSimulator.java index bb67af2032..3476b11fbe 100644 --- a/opendaylight/netconf/netconf-testtool/src/main/java/org/opendaylight/controller/netconf/test/tool/NetconfDeviceSimulator.java +++ b/opendaylight/netconf/netconf-testtool/src/main/java/org/opendaylight/controller/netconf/test/tool/NetconfDeviceSimulator.java @@ -43,8 +43,8 @@ import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.NavigableMap; import java.util.Set; -import java.util.TreeMap; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -64,7 +64,6 @@ import org.opendaylight.controller.netconf.impl.NetconfServerDispatcherImpl; import org.opendaylight.controller.netconf.impl.NetconfServerSessionNegotiatorFactory; import org.opendaylight.controller.netconf.impl.SessionIdProvider; import org.opendaylight.controller.netconf.impl.osgi.AggregatedNetconfOperationServiceFactory; -import org.opendaylight.controller.netconf.impl.osgi.NetconfMonitoringServiceImpl; import org.opendaylight.controller.netconf.mapping.api.NetconfOperation; import org.opendaylight.controller.netconf.mapping.api.NetconfOperationService; import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceFactory; @@ -142,13 +141,14 @@ public class NetconfDeviceSimulator implements Closeable { final SessionIdProvider idProvider = new SessionIdProvider(); - final AggregatedNetconfOperationServiceFactory aggregatedNetconfOperationServiceFactory = new AggregatedNetconfOperationServiceFactory(); final SimulatedOperationProvider simulatedOperationProvider = new SimulatedOperationProvider(idProvider, capabilities, notificationsFile); - final NetconfMonitoringService monitoringService1 = new NetconfMonitoringServiceImpl(aggregatedNetconfOperationServiceFactory); + final NetconfMonitoringService monitoringService1 = new DummyMonitoringService(capabilities); + final NetconfMonitoringActivator.NetconfMonitoringOperationServiceFactory monitoringService = - new NetconfMonitoringActivator.NetconfMonitoringOperationServiceFactory(new NetconfMonitoringOperationService(monitoringService1)); + new NetconfMonitoringActivator.NetconfMonitoringOperationServiceFactory( + new NetconfMonitoringOperationService(monitoringService1)); aggregatedNetconfOperationServiceFactory.onAddNetconfOperationServiceFactory(simulatedOperationProvider); aggregatedNetconfOperationServiceFactory.onAddNetconfOperationServiceFactory(monitoringService); @@ -173,7 +173,7 @@ public class NetconfDeviceSimulator implements Closeable { return input.getKey().getAST(); } }); - final Map> namespaceContext = BuilderUtils.createYangNamespaceContext( + final Map> namespaceContext = BuilderUtils.createYangNamespaceContext( asts.values(), Optional.absent()); final ParseTreeWalker walker = new ParseTreeWalker(); @@ -354,8 +354,11 @@ public class NetconfDeviceSimulator implements Closeable { SourceIdentifier sId = new SourceIdentifier("ietf-netconf-monitoring", "2010-10-04"); registerSource(consumer, "/META-INF/yang/ietf-netconf-monitoring.yang", sId); - sId = new SourceIdentifier("ietf-yang-types", "2013-07-15"); - registerSource(consumer, "/META-INF/yang/ietf-yang-types@2013-07-15.yang", sId); + sId = new SourceIdentifier("ietf-netconf-monitoring-extension", "2013-12-10"); + registerSource(consumer, "/META-INF/yang/ietf-netconf-monitoring-extension.yang", sId); + + sId = new SourceIdentifier("ietf-yang-types", "2010-09-24"); + registerSource(consumer, "/META-INF/yang/ietf-yang-types.yang", sId); sId = new SourceIdentifier("ietf-inet-types", "2010-09-24"); registerSource(consumer, "/META-INF/yang/ietf-inet-types.yang", sId); @@ -420,6 +423,7 @@ public class NetconfDeviceSimulator implements Closeable { @Override public AutoCloseable registerCapabilityListener(final CapabilityListener listener) { + listener.onCapabilitiesAdded(caps); return new AutoCloseable() { @Override public void close() throws Exception {}