Merge changes Ia268965a,Iefa79f99
authorEd Warnicke <eaw@cisco.com>
Fri, 29 Nov 2013 11:17:38 +0000 (11:17 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 29 Nov 2013 11:17:38 +0000 (11:17 +0000)
* changes:
  Add running configuration data to get netconf operation response
  Add support for configuration attributes based on yang leaves with custom types (typedef) to netconf.

1  2 
opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITTest.java

index 6c244a0b97d282b866d4ad32a242fca3faa84e6e,1037bf69222fa715dc308224e1890d180beaabfb..65cc2b4e373a3f551633d1cb564461ab39e0b174
@@@ -27,7 -27,6 +27,7 @@@ import java.util.Collection
  import java.util.List;
  import java.util.Set;
  import java.util.concurrent.TimeUnit;
 +import java.util.regex.Pattern;
  import javax.management.ObjectName;
  import javax.net.ssl.SSLContext;
  import javax.xml.parsers.ParserConfigurationException;
@@@ -36,22 -35,16 +36,16 @@@ import org.junit.After
  import org.junit.Before;
  import org.junit.Ignore;
  import org.junit.Test;
- import org.opendaylight.controller.config.api.ModuleIdentifier;
  import org.opendaylight.controller.config.manager.impl.AbstractConfigTest;
  import org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver;
- import org.opendaylight.controller.config.manager.impl.jmx.BaseJMXRegistrator;
- import org.opendaylight.controller.config.manager.impl.jmx.RootRuntimeBeanRegistratorImpl;
  import org.opendaylight.controller.config.persist.api.Persister;
  import org.opendaylight.controller.config.spi.ModuleFactory;
  import org.opendaylight.controller.config.util.ConfigTransactionJMXClient;
  import org.opendaylight.controller.config.yang.store.api.YangStoreException;
  import org.opendaylight.controller.config.yang.store.impl.HardcodedYangStoreService;
- import org.opendaylight.controller.config.yang.test.impl.Asdf;
  import org.opendaylight.controller.config.yang.test.impl.DepTestImplModuleFactory;
  import org.opendaylight.controller.config.yang.test.impl.NetconfTestImplModuleFactory;
  import org.opendaylight.controller.config.yang.test.impl.NetconfTestImplModuleMXBean;
- import org.opendaylight.controller.config.yang.test.impl.NetconfTestImplRuntimeMXBean;
- import org.opendaylight.controller.config.yang.test.impl.NetconfTestImplRuntimeRegistrator;
  import org.opendaylight.controller.config.yang.test.impl.TestImplModuleFactory;
  import org.opendaylight.controller.netconf.api.NetconfMessage;
  import org.opendaylight.controller.netconf.client.NetconfClient;
@@@ -66,7 -59,6 +60,7 @@@ import org.opendaylight.controller.netc
  import org.opendaylight.controller.netconf.impl.mapping.ExiEncoderHandler;
  import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceFactoryListenerImpl;
  import org.opendaylight.controller.netconf.persist.impl.ConfigPersisterNotificationHandler;
 +import org.opendaylight.controller.netconf.persist.impl.osgi.ConfigPersisterActivator;
  import org.opendaylight.controller.netconf.ssh.NetconfSSHServer;
  import org.opendaylight.controller.netconf.util.test.XmlFileLoader;
  import org.opendaylight.controller.netconf.util.xml.ExiParameters;
@@@ -165,7 -157,7 +159,7 @@@ public class NetconfITTest extends Abst
  
      static Collection<InputStream> getBasicYangs() throws IOException {
          List<String> paths = Arrays.asList("/META-INF/yang/config.yang", "/META-INF/yang/rpc-context.yang",
-                 "/META-INF/yang/config-test.yang", "/META-INF/yang/config-test-impl.yang",
+                 "/META-INF/yang/config-test.yang", "/META-INF/yang/config-test-impl.yang", "/META-INF/yang/test-types.yang",
                  "/META-INF/yang/ietf-inet-types.yang");
          final Collection<InputStream> yangDependencies = new ArrayList<>();
          List<String> failedToFind = new ArrayList<>();
  
      @Test
      public void testTwoSessions() throws Exception {
 -        try (NetconfClient netconfClient = new NetconfClient("1", tcpAddress, 4000, clientDispatcher))  {
 -            try (NetconfClient netconfClient2 = new NetconfClient("2", tcpAddress, 4000, clientDispatcher))  {
 +        try (NetconfClient netconfClient = new NetconfClient("1", tcpAddress, 10000, clientDispatcher))  {
 +            try (NetconfClient netconfClient2 = new NetconfClient("2", tcpAddress, 10000, clientDispatcher)) {
              }
          }
      }
          Persister persister = mock(Persister.class);
          doReturn("mockPersister").when(persister).toString();
          doReturn(Optional.absent()).when(persister).loadLastConfig();
 -        ConfigPersisterNotificationHandler h = new ConfigPersisterNotificationHandler(persister, tcpAddress, ManagementFactory.getPlatformMBeanServer());
 +        ConfigPersisterNotificationHandler h =
 +                new ConfigPersisterNotificationHandler(persister, tcpAddress, ManagementFactory.getPlatformMBeanServer(), Pattern.compile(ConfigPersisterActivator.DEFAULT_IGNORED_REGEX));
          h.init();
      }
  
          NetconfTestImplModuleMXBean proxy = configRegistryClient
                  .newMXBeanProxy(impl, NetconfTestImplModuleMXBean.class);
          proxy.setTestingDep(dep);
-         registerRuntimeBean();
+         proxy.setSimpleShort((short)0);
  
          transaction.commit();
  
          }
      }
  
-     private void registerRuntimeBean() {
-         BaseJMXRegistrator baseJMXRegistrator = new BaseJMXRegistrator(ManagementFactory.getPlatformMBeanServer());
-         RootRuntimeBeanRegistratorImpl runtimeBeanRegistrator = baseJMXRegistrator
-                 .createRuntimeBeanRegistrator(new ModuleIdentifier(NetconfTestImplModuleFactory.NAME, "instance"));
-         NetconfTestImplRuntimeRegistrator reg = new NetconfTestImplRuntimeRegistrator(runtimeBeanRegistrator);
-         reg.register(new NetconfTestImplRuntimeMXBean() {
-             @Override
-             public Asdf getAsdf() {
-                 return null;
-             }
-             @Override
-             public Long getCreatedSessions() {
-                 return null;
-             }
-             @Override
-             public String noArg(String arg1) {
-                 return "from no arg";
-             }
-         });
-     }
      @Test
  //    @Ignore
      public void testStartExi() throws Exception {