Merge "Bug 946: Fixed eclipse errors with nagasena projects"
authorTony Tkacik <ttkacik@cisco.com>
Wed, 7 May 2014 11:14:22 +0000 (11:14 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 7 May 2014 11:14:22 +0000 (11:14 +0000)
1  2 
opendaylight/commons/opendaylight/pom.xml
opendaylight/distribution/opendaylight/pom.xml
opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/pax/IdentityRefNetconfTest.java

index c0fc4024ce5c090224cbcec8df6edc3821211834,fbcacbdc83ac0b9d7b0f6c36e934d155612ba02d..6ec506b030f8d1ffe008b4ee2a0f375f2e6a4096
@@@ -19,7 -19,6 +19,7 @@@
      <appauth.version>0.4.2-SNAPSHOT</appauth.version>
      <!-- Controller Modules Versions -->
      <arphandler.version>0.5.2-SNAPSHOT</arphandler.version>
 +    <asm.version>4.1</asm.version>
      <!-- Plugin Versions -->
      <bouncycastle.version>1.50</bouncycastle.version>
      <bundle.plugin.version>2.3.7</bundle.plugin.version>
@@@ -56,9 -55,8 +56,9 @@@
      <exam.version>3.0.0</exam.version>
  
      <!-- OpenEXI third party lib for netconf-->
-     <exi.nagasena.version>0000.0002.0038.0-SNAPSHOT</exi.nagasena.version>
+     <exi.nagasena.version>0000.0002.0038.0</exi.nagasena.version>
      <failsafe.version>2.15</failsafe.version>
 +    <feature.transaction.version>1.0.1</feature.transaction.version>
      <felix.dependencymanager.shell.version>3.0.1</felix.dependencymanager.shell.version>
      <felix.dependencymanager.version>3.1.0</felix.dependencymanager.version>
      <felix.fileinstall.version>3.1.6</felix.fileinstall.version>
@@@ -79,7 -77,7 +79,7 @@@
      <ietf-inet-types.version>2010.09.24.4-SNAPSHOT</ietf-inet-types.version>
      <ietf-topology.version>2013.10.21.2-SNAPSHOT</ietf-topology.version>
      <ietf-yang-types.version>2010.09.24.4-SNAPSHOT</ietf-yang-types.version>
 -    <jackson.version>2.3.0</jackson.version>
 +    <jackson.version>2.3.2</jackson.version>
      <jacoco.version>0.6.2.201302030002</jacoco.version>
      <jar.plugin.version>2.4</jar.plugin.version>
      <java.version.source>1.7</java.version.source>
@@@ -94,7 -92,6 +94,7 @@@
      <jsr305.api.version>2.0.1</jsr305.api.version>
      <jsr311.api.version>1.1.1</jsr311.api.version>
      <junit.version>4.8.1</junit.version>
 +    <karaf.version>3.0.1</karaf.version>
      <logback.version>1.0.9</logback.version>
      <logging.bridge.version>0.4.2-SNAPSHOT</logging.bridge.version>
      <maven.compile.plugin.version>2.5.1</maven.compile.plugin.version>
      <!-- ODL repository / plugin repository -->
      <nexusproxy>http://nexus.opendaylight.org/content</nexusproxy>
      <opendaylight-l2-types.version>2013.08.27.4-SNAPSHOT</opendaylight-l2-types.version>
 +    <org.json.version>20080701</org.json.version>
      <osgi-brandfragment.web.version>0.0.2-SNAPSHOT</osgi-brandfragment.web.version>
      <osgi.compendium.version>5.0.0</osgi.compendium.version>
      <osgi.core.version>5.0.0</osgi.core.version>
      <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
      <sonar.language>java</sonar.language>
      <sonar.skippedModules>org.openflow.openflowj,net.sf.jung2</sonar.skippedModules>
 +    <spifly.version>1.0.0</spifly.version>
      <spring-osgi.version>1.2.1</spring-osgi.version>
 +    <spring-security-karaf.version>3.1.4.RELEASE</spring-security-karaf.version>
      <spring-security.version>3.1.3.RELEASE</spring-security.version>
      <spring.version>3.1.3.RELEASE</spring.version>
      <statistics.northbound.version>0.4.2-SNAPSHOT</statistics.northbound.version>
          <artifactId>jackson-databind</artifactId>
          <version>${jackson.version}</version>
        </dependency>
 +      <dependency>
 +        <groupId>com.fasterxml.jackson.datatype</groupId>
 +        <artifactId>jackson-datatype-json-org</artifactId>
 +        <version>${jackson.version}</version>
 +      </dependency>
 +
        <dependency>
          <groupId>com.fasterxml.jackson.jaxrs</groupId>
          <artifactId>jackson-jaxrs-base</artifactId>
          <artifactId>jolokia-osgi</artifactId>
          <version>${jolokia.version}</version>
        </dependency>
 +      <dependency>
 +        <groupId>org.json</groupId>
 +        <artifactId>json</artifactId>
 +        <version>${org.json.version}</version>
 +      </dependency>
        <dependency>
          <groupId>org.opendaylight.controller</groupId>
          <artifactId>appauth</artifactId>
          <artifactId>netconf-client</artifactId>
          <version>${netconf.version}</version>
        </dependency>
 +
 +      <!--Netconf config-->
 +      <dependency>
 +        <groupId>org.opendaylight.controller</groupId>
 +        <artifactId>netconf-config-dispatcher</artifactId>
 +        <version>${netconf.version}</version>
 +      </dependency>
        <dependency>
          <groupId>org.opendaylight.controller</groupId>
          <artifactId>netconf-impl</artifactId>
          <artifactId>sal-rest-connector</artifactId>
          <version>${mdsal.version}</version>
        </dependency>
 +      <dependency>
 +        <groupId>org.opendaylight.controller</groupId>
 +        <artifactId>sal-rest-docgen</artifactId>
 +        <version>${mdsal.version}</version>
 +      </dependency>
        <dependency>
          <groupId>org.opendaylight.controller</groupId>
          <artifactId>sal-restconf-broker</artifactId>
          <artifactId>ganymed</artifactId>
          <version>1.1-SNAPSHOT</version>
        </dependency>
-       <dependency>
-         <groupId>org.opendaylight.controller.thirdparty</groupId>
-         <artifactId>nagasena</artifactId>
-         <version>${exi.nagasena.version}</version>
-       </dependency>
-       <dependency>
-         <groupId>org.opendaylight.controller.thirdparty</groupId>
-         <artifactId>nagasena-rta</artifactId>
-         <version>${exi.nagasena.version}</version>
-       </dependency>
        <!-- Third parties from opendaylight released -->
        <dependency>
          <groupId>org.opendaylight.controller.thirdparty</groupId>
          <artifactId>yang-model-util</artifactId>
          <version>${yangtools.version}</version>
        </dependency>
 +      <dependency>
 +        <groupId>org.opendaylight.yangtools</groupId>
 +        <artifactId>yang-parser-api</artifactId>
 +        <version>${yangtools.version}</version>
 +      </dependency>
        <dependency>
          <groupId>org.opendaylight.yangtools</groupId>
          <artifactId>yang-parser-impl</artifactId>
          <artifactId>yang-ext</artifactId>
          <version>${yang-ext.version}</version>
        </dependency>
+       <dependency>
+         <groupId>org.openexi</groupId>
+         <artifactId>nagasena</artifactId>
+         <version>${exi.nagasena.version}</version>
+       </dependency>
+       <dependency>
+         <groupId>org.openexi</groupId>
+         <artifactId>nagasena-rta</artifactId>
+         <version>${exi.nagasena.version}</version>
+       </dependency>
        <dependency>
          <groupId>org.osgi</groupId>
          <artifactId>org.osgi.compendium</artifactId>
index 615668f5ebd766c07705161698826a2c4c3f6c90,b751394cfa9e5b08c96ea6becf0531091d91dba1..221866fdd9e75302aed3cd4664dcf1d7d237ae40
        <artifactId>jackson-databind</artifactId>
      </dependency>
  
 +    <dependency>
 +      <groupId>com.fasterxml.jackson.datatype</groupId>
 +      <artifactId>jackson-datatype-json-org</artifactId>
 +    </dependency>
 +
      <dependency>
        <groupId>com.fasterxml.jackson.jaxrs</groupId>
        <artifactId>jackson-jaxrs-base</artifactId>
@@@ -58,7 -53,6 +58,7 @@@
        <groupId>com.fasterxml.jackson.module</groupId>
        <artifactId>jackson-module-jaxb-annotations</artifactId>
      </dependency>
 +
      <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <groupId>org.jolokia</groupId>
        <artifactId>jolokia-osgi</artifactId>
      </dependency>
 +
 +    <dependency>
 +      <groupId>org.json</groupId>
 +      <artifactId>json</artifactId>
 +    </dependency>
      <dependency>
        <groupId>org.opendaylight.controller</groupId>
        <artifactId>appauth</artifactId>
            <groupId>org.opendaylight.controller</groupId>
            <artifactId>netconf-client</artifactId>
          </dependency>
 +
 +        <!--Netconf config-->
 +        <dependency>
 +          <groupId>org.opendaylight.controller</groupId>
 +          <artifactId>netconf-config-dispatcher</artifactId>
 +        </dependency>
          <dependency>
            <groupId>org.opendaylight.controller</groupId>
            <artifactId>netconf-impl</artifactId>
            <groupId>org.opendaylight.controller</groupId>
            <artifactId>sal-rest-connector</artifactId>
          </dependency>
 +        <dependency>
 +          <groupId>org.opendaylight.controller</groupId>
 +          <artifactId>sal-rest-docgen</artifactId>
 +        </dependency>
          <dependency>
            <groupId>org.opendaylight.controller</groupId>
            <artifactId>sal-restconf-broker</artifactId>
            <groupId>org.opendaylight.controller.thirdparty</groupId>
            <artifactId>ganymed</artifactId>
          </dependency>
-         <dependency>
-           <groupId>org.opendaylight.controller.thirdparty</groupId>
-           <artifactId>nagasena</artifactId>
-         </dependency>
-         <dependency>
-           <groupId>org.opendaylight.controller.thirdparty</groupId>
-           <artifactId>nagasena-rta</artifactId>
-         </dependency>
          <dependency>
            <groupId>org.opendaylight.yangtools</groupId>
            <artifactId>binding-generator-api</artifactId>
            <artifactId>xtend-lib-osgi</artifactId>
            <version>2.4.3</version>
          </dependency>
+         <dependency>
+           <groupId>org.openexi</groupId>
+           <artifactId>nagasena</artifactId>
+         </dependency>
+         <dependency>
+           <groupId>org.openexi</groupId>
+           <artifactId>nagasena-rta</artifactId>
+         </dependency>
          <dependency>
            <groupId>org.zeromq</groupId>
            <artifactId>jeromq</artifactId>
index ebfcff3cd4fdc1e957714a5798c7a4977b51e829,0aacfeef83bf5a51247bb4fb6f516bf47bf155b4..981f1148e48520f300e6af00810054380285f31c
@@@ -19,9 -19,8 +19,9 @@@ import static org.ops4j.pax.exam.CoreOp
  import static org.ops4j.pax.exam.CoreOptions.streamBundle;
  import static org.ops4j.pax.exam.CoreOptions.systemPackages;
  import static org.ops4j.pax.exam.CoreOptions.systemProperty;
 -import io.netty.channel.nio.NioEventLoopGroup;
  
 +import io.netty.util.HashedWheelTimer;
 +import io.netty.util.Timer;
  import java.io.IOException;
  import java.net.InetSocketAddress;
  import java.util.concurrent.ExecutionException;
@@@ -35,15 -34,11 +35,15 @@@ import org.junit.Test
  import org.junit.matchers.JUnitMatchers;
  import org.junit.runner.RunWith;
  import org.opendaylight.controller.netconf.api.NetconfMessage;
 -import org.opendaylight.controller.netconf.client.NetconfClientDispatcher;
 +import org.opendaylight.controller.netconf.client.NetconfClientDispatcherImpl;
 +import org.opendaylight.controller.netconf.client.SimpleNetconfClientSessionListener;
 +import org.opendaylight.controller.netconf.client.conf.NetconfClientConfiguration;
 +import org.opendaylight.controller.netconf.client.conf.NetconfClientConfigurationBuilder;
  import org.opendaylight.controller.netconf.client.test.TestingNetconfClient;
  import org.opendaylight.controller.netconf.util.test.XmlFileLoader;
  import org.opendaylight.controller.netconf.util.xml.XmlUtil;
  import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
 +import org.opendaylight.protocol.framework.NeverReconnectStrategy;
  import org.ops4j.pax.exam.Configuration;
  import org.ops4j.pax.exam.Option;
  import org.ops4j.pax.exam.junit.PaxExam;
@@@ -56,9 -51,6 +56,9 @@@ import org.xml.sax.SAXException
  import com.google.common.base.Preconditions;
  import com.google.common.base.Throwables;
  
 +import io.netty.channel.nio.NioEventLoopGroup;
 +import io.netty.util.concurrent.GlobalEventExecutor;
 +
  @Ignore
  @RunWith(PaxExam.class)
  public class IdentityRefNetconfTest {
                  mavenBundle("org.slf4j", "log4j-over-slf4j").versionAsInProject(),
                  mavenBundle("ch.qos.logback", "logback-core").versionAsInProject(),
                  mavenBundle("ch.qos.logback", "logback-classic").versionAsInProject(),
-                 mavenBundle("org.opendaylight.controller.thirdparty", "nagasena").versionAsInProject(),
-                 mavenBundle("org.opendaylight.controller.thirdparty", "nagasena-rta").versionAsInProject());
+                 mavenBundle("org.openexi", "nagasena").versionAsInProject(),
+                 mavenBundle("org.openexi", "nagasena-rta").versionAsInProject());
  
  
      }
      public void testIdRef() throws Exception {
          Preconditions.checkNotNull(broker, "Controller not initialized");
  
 -        NioEventLoopGroup nettyThreadgroup = new NioEventLoopGroup();
 -        NetconfClientDispatcher clientDispatcher = new NetconfClientDispatcher(nettyThreadgroup, nettyThreadgroup,
 -                CLIENT_CONNECTION_TIMEOUT_MILLIS);
  
          NetconfMessage edit = xmlFileToNetconfMessage("netconfMessages/editConfig_identities.xml");
          NetconfMessage commit = xmlFileToNetconfMessage("netconfMessages/commit.xml");
          NetconfMessage getConfig = xmlFileToNetconfMessage("netconfMessages/getConfig.xml");
  
 -        try (TestingNetconfClient netconfClient = new TestingNetconfClient("client", tcpAddress, CLIENT_CONNECTION_TIMEOUT_MILLIS, clientDispatcher)) {
 +        NioEventLoopGroup nettyThreadgroup = new NioEventLoopGroup();
 +        Timer timer = new HashedWheelTimer();
 +        NetconfClientDispatcherImpl clientDispatcher = new NetconfClientDispatcherImpl(nettyThreadgroup, nettyThreadgroup, timer);
 +        try (TestingNetconfClient netconfClient = new TestingNetconfClient("client", clientDispatcher, getClientConfiguration(tcpAddress))) {
              sendMessage(edit, netconfClient);
              sendMessage(commit, netconfClient);
              sendMessage(getConfig, netconfClient, "id-test",
              clientDispatcher.close();
          } catch (Exception e) {
              fail(Throwables.getStackTraceAsString(e));
 +        } finally {
 +            nettyThreadgroup.shutdownGracefully().get();
 +            timer.stop();
          }
      }
  
              ParserConfigurationException {
          return XmlFileLoader.xmlFileToNetconfMessage(fileName);
      }
 +
 +    public NetconfClientConfiguration getClientConfiguration(final InetSocketAddress tcpAddress) {
 +        final NetconfClientConfigurationBuilder b = NetconfClientConfigurationBuilder.create();
 +        b.withAddress(tcpAddress);
 +        b.withSessionListener(new SimpleNetconfClientSessionListener());
 +        b.withReconnectStrategy(new NeverReconnectStrategy(GlobalEventExecutor.INSTANCE,
 +                CLIENT_CONNECTION_TIMEOUT_MILLIS));
 +        b.withConnectionTimeoutMillis(CLIENT_CONNECTION_TIMEOUT_MILLIS);
 +        return b.build();
 +    }
  }