Re-organise the Pax Exam IT infrastructure 15/8315/3
authorDave Tucker <djt@redhat.com>
Wed, 25 Jun 2014 02:08:06 +0000 (03:08 +0100)
committerDave Tucker <djt@redhat.com>
Wed, 25 Jun 2014 12:46:27 +0000 (13:46 +0100)
- Move parent pom to commons/integrationtest
- Move paxexam to integrationtest
- Change IT packages to be outside of system under test
- Add ConfigurationBundles to simplify creating new tests
- Use a common base class for Pax Exam based IT

Change-Id: Iefb2e3d7b0de2184d78b547ef2eb3b70ce686ce3
Signed-off-by: Dave Tucker <djt@redhat.com>
commons/integrationtest/pom.xml [moved from paxexam/common.integrationtest/pom.xml with 93% similarity]
integrationtest/.gitignore [moved from paxexam/plugin.integrationtest/.gitignore with 100% similarity]
integrationtest/pom.xml [new file with mode: 0644]
integrationtest/src/test/java/org/opendaylight/ovsdb/integrationtest/ConfigurationBundles.java [new file with mode: 0644]
integrationtest/src/test/java/org/opendaylight/ovsdb/integrationtest/OvsdbIntegrationTestBase.java [moved from paxexam/plugin.integrationtest/src/test/java/org/opendaylight/ovsdb/plugin/OvsdbTestBase.java with 90% similarity]
integrationtest/src/test/java/org/opendaylight/ovsdb/integrationtest/plugin/OvsdbPluginIT.java [new file with mode: 0644]
integrationtest/src/test/resources/exam.properties [new file with mode: 0644]
integrationtest/src/test/resources/logback.xml [moved from paxexam/plugin.integrationtest/src/test/resources/logback.xml with 84% similarity]
integrationtest/src/test/resources/tomcat-server.xml [new file with mode: 0644]
paxexam/plugin.integrationtest/pom.xml [deleted file]
paxexam/plugin.integrationtest/src/test/java/org/opendaylight/ovsdb/plugin/OvsdbPluginIT.java [deleted file]

similarity index 93%
rename from paxexam/common.integrationtest/pom.xml
rename to commons/integrationtest/pom.xml
index 05465871a2918c71b9ed3d7bb534b270d7f472ec..ac01a3f180728f132b64304c9b0b4e4649d012b9 100644 (file)
@@ -5,13 +5,18 @@
     <groupId>org.opendaylight.ovsdb</groupId>
     <artifactId>commons.ovsdb</artifactId>
     <version>1.0.1-SNAPSHOT</version>
-    <relativePath>../../commons/parent</relativePath>
+    <relativePath>../parent</relativePath>
   </parent>
 
-  <artifactId>common.integrationtest</artifactId>
+  <artifactId>commons.integrationtest</artifactId>
   <version>1.0.1-SNAPSHOT</version>
   <packaging>pom</packaging>
 
+  <properties>
+    <exam.version>3.5.0</exam.version>
+    <url.version>1.6.0</url.version>
+  </properties>
+
   <dependencies>
     <dependency>
       <groupId>ch.qos.logback</groupId>
     <dependency>
       <groupId>org.ops4j.pax.exam</groupId>
       <artifactId>pax-exam-junit4</artifactId>
+      <version>${exam.version}</version>
       <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.ops4j.pax.exam</groupId>
       <artifactId>pax-exam-link-mvn</artifactId>
+      <version>${exam.version}</version>
       <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.ops4j.pax.url</groupId>
       <artifactId>pax-url-aether</artifactId>
+      <version>${url.version}</version>
       <scope>test</scope>
     </dependency>
   </dependencies>
diff --git a/integrationtest/pom.xml b/integrationtest/pom.xml
new file mode 100644 (file)
index 0000000..ac2af33
--- /dev/null
@@ -0,0 +1,677 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.opendaylight.ovsdb</groupId>
+    <artifactId>commons.integrationtest</artifactId>
+    <version>1.0.1-SNAPSHOT</version>
+    <relativePath>../commons/integrationtest</relativePath>
+  </parent>
+
+  <artifactId>integrationtest</artifactId>
+  <version>0.5.1-SNAPSHOT</version>
+  <packaging>jar</packaging>
+
+  <properties>
+    <sonar.jacoco.itReportPath>../implementation/target/jacoco-it.exec</sonar.jacoco.itReportPath>
+    <!-- Sonar jacoco plugin to get integration test coverage info -->
+    <sonar.jacoco.reportPath>../implementation/target/jacoco.exec</sonar.jacoco.reportPath>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>ch.qos.logback</groupId>
+      <artifactId>logback-classic</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>ch.qos.logback</groupId>
+      <artifactId>logback-core</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-annotations</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-core</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-databind</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>com.fasterxml.jackson.jaxrs</groupId>
+      <artifactId>jackson-jaxrs-json-provider</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>com.fasterxml.jackson.module</groupId>
+      <artifactId>jackson-module-jaxb-annotations</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.google.code.gson</groupId>
+      <artifactId>gson</artifactId>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.google.guava</groupId>
+      <artifactId>guava</artifactId>
+      <version>${guava.version}</version>
+    </dependency>
+    <!-- Jersey for JAXRS -->
+    <dependency>
+      <groupId>com.sun.jersey</groupId>
+      <artifactId>jersey-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.sun.jersey</groupId>
+      <artifactId>jersey-server</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.sun.jersey</groupId>
+      <artifactId>jersey-client</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>commons-codec</groupId>
+      <artifactId>commons-codec</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>commons-collections</groupId>
+      <artifactId>commons-collections</artifactId>
+      <version>1.0</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-fileupload</groupId>
+      <artifactId>commons-fileupload</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>commons-io</groupId>
+      <artifactId>commons-io</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+      <version>2.3</version>
+    </dependency>
+    <dependency>
+      <groupId>eclipselink</groupId>
+      <artifactId>javax.persistence</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>eclipselink</groupId>
+      <artifactId>javax.resource</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>equinoxSDK381</groupId>
+      <artifactId>javax.servlet</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>equinoxSDK381</groupId>
+      <artifactId>javax.servlet.jsp</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>equinoxSDK381</groupId>
+      <artifactId>org.apache.felix.gogo.command</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>equinoxSDK381</groupId>
+      <artifactId>org.apache.felix.gogo.runtime</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>equinoxSDK381</groupId>
+      <artifactId>org.apache.felix.gogo.shell</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>equinoxSDK381</groupId>
+      <artifactId>org.eclipse.equinox.cm</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>equinoxSDK381</groupId>
+      <artifactId>org.eclipse.equinox.console</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>equinoxSDK381</groupId>
+      <artifactId>org.eclipse.equinox.ds</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>equinoxSDK381</groupId>
+      <artifactId>org.eclipse.equinox.launcher</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>equinoxSDK381</groupId>
+      <artifactId>org.eclipse.equinox.util</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>equinoxSDK381</groupId>
+      <artifactId>org.eclipse.osgi</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>equinoxSDK381</groupId>
+      <artifactId>org.eclipse.osgi.services</artifactId>
+    </dependency>
+    <!-- Gemini Web -->
+    <dependency>
+      <groupId>geminiweb</groupId>
+      <artifactId>org.eclipse.gemini.web.core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>geminiweb</groupId>
+      <artifactId>org.eclipse.gemini.web.extender</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>geminiweb</groupId>
+      <artifactId>org.eclipse.gemini.web.tomcat</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>geminiweb</groupId>
+      <artifactId>org.eclipse.virgo.kernel.equinox.extensions</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>geminiweb</groupId>
+      <artifactId>org.eclipse.virgo.util.common</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>geminiweb</groupId>
+      <artifactId>org.eclipse.virgo.util.io</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>geminiweb</groupId>
+      <artifactId>org.eclipse.virgo.util.math</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>geminiweb</groupId>
+      <artifactId>org.eclipse.virgo.util.osgi</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>geminiweb</groupId>
+      <artifactId>org.eclipse.virgo.util.osgi.manifest</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>geminiweb</groupId>
+      <artifactId>org.eclipse.virgo.util.parser.manifest</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.netty</groupId>
+      <artifactId>netty-buffer</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.netty</groupId>
+      <artifactId>netty-codec</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.netty</groupId>
+      <artifactId>netty-common</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.netty</groupId>
+      <artifactId>netty-handler</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.netty</groupId>
+      <artifactId>netty-transport</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>javax.portlet</groupId>
+      <artifactId>portlet-api</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>orbit</groupId>
+      <artifactId>javax.activation</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>orbit</groupId>
+      <artifactId>javax.annotation</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>orbit</groupId>
+      <artifactId>javax.ejb</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>orbit</groupId>
+      <artifactId>javax.el</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>orbit</groupId>
+      <artifactId>javax.mail.glassfish</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>orbit</groupId>
+      <artifactId>javax.servlet.jsp.jstl</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>orbit</groupId>
+      <artifactId>javax.servlet.jsp.jstl.impl</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>orbit</groupId>
+      <artifactId>javax.xml.rpc</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>orbit</groupId>
+      <artifactId>org.apache.catalina</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>orbit</groupId>
+      <artifactId>org.apache.catalina.ha</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>orbit</groupId>
+      <artifactId>org.apache.catalina.tribes</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>orbit</groupId>
+      <artifactId>org.apache.coyote</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>orbit</groupId>
+      <artifactId>org.apache.el</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>orbit</groupId>
+      <artifactId>org.apache.jasper</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>orbit</groupId>
+      <artifactId>org.apache.juli.extras</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>orbit</groupId>
+      <artifactId>org.apache.tomcat.api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>orbit</groupId>
+      <artifactId>org.apache.tomcat.util</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.aopalliance</groupId>
+      <artifactId>com.springsource.org.aopalliance</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-lang3</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.felix</groupId>
+      <artifactId>org.apache.felix.dependencymanager</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.felix</groupId>
+      <artifactId>org.apache.felix.dependencymanager.shell</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.felix</groupId>
+      <artifactId>org.apache.felix.fileinstall</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.httpcomponents</groupId>
+      <artifactId>httpcore-nio</artifactId>
+      <version>4.2.1</version>
+      <optional>true</optional>
+    </dependency>
+
+    <dependency>
+      <groupId>org.codehaus.enunciate</groupId>
+      <artifactId>enunciate-core-annotations</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.codehaus.jettison</groupId>
+      <artifactId>jettison</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.spec.javax.transaction</groupId>
+      <artifactId>jboss-transaction-api_1.1_spec</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>arphandler</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>bundlescanner</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>bundlescanner.implementation</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>clustering.services</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>clustering.services-implementation</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>commons.httpclient</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>commons.northbound</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>configuration</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>configuration.implementation</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>connectionmanager</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>connectionmanager.implementation</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>containermanager</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>containermanager.it.implementation</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>flowprogrammer.northbound</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>forwarding.staticrouting</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>forwarding.staticrouting.northbound</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>forwardingrulesmanager</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>forwardingrulesmanager.implementation</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>hosttracker</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>hosttracker.implementation</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>hosttracker.northbound</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>logging.bridge</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>protocol_plugins.stub</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>routing.dijkstra_implementation</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>sal</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>sal.connection</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>sal.connection.implementation</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>sal.implementation</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>sal.networkconfiguration</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>sal.networkconfiguration.implementation</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>security</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>statistics.northbound</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>statisticsmanager</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>statisticsmanager.implementation</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>subnets.northbound</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>switchmanager</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>switchmanager.implementation</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>switchmanager.northbound</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>topology.northbound</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>topologymanager</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>usermanager</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>usermanager.implementation</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller.thirdparty</groupId>
+      <artifactId>com.sun.jersey.jersey-servlet</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller.thirdparty</groupId>
+      <artifactId>org.apache.catalina.filters.CorsFilter</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.ovsdb</groupId>
+      <artifactId>ovsdb</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.ovsdb</groupId>
+      <artifactId>ovsdb.northbound</artifactId>
+      <version>0.5.1-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.ops4j.pax.exam</groupId>
+      <artifactId>pax-exam</artifactId>
+      <version>${exam.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.ow2.asm</groupId>
+      <artifactId>asm-all</artifactId>
+    </dependency>
+    <!-- Visual VM hook -->
+    <dependency>
+      <groupId>org.ow2.chameleon.management</groupId>
+      <artifactId>chameleon-mbeans</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>jcl-over-slf4j</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>log4j-over-slf4j</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>org.springframework.aop</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>org.springframework.asm</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>org.springframework.beans</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>org.springframework.context</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>org.springframework.context.support</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>org.springframework.core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>org.springframework.expression</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>org.springframework.transaction</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>org.springframework.web</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>org.springframework.web.servlet</artifactId>
+    </dependency>
+    <!-- Spring security -->
+    <dependency>
+      <groupId>org.springframework.security</groupId>
+      <artifactId>spring-security-config</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.security</groupId>
+      <artifactId>spring-security-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.security</groupId>
+      <artifactId>spring-security-taglibs</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.security</groupId>
+      <artifactId>spring-security-web</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>virgomirror</groupId>
+      <artifactId>org.eclipse.jdt.core.compiler.batch</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.11</version>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.yaml</groupId>
+      <artifactId>snakeyaml</artifactId>
+      <version>1.10</version>
+    </dependency>
+
+    <!-- Add Pax Exam -->
+    <dependency>
+      <groupId>org.ops4j.pax.exam</groupId>
+      <artifactId>pax-exam-container-forked</artifactId>
+      <version>${exam.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.ops4j.pax.exam</groupId>
+      <artifactId>pax-exam-junit4</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.ops4j.pax.exam</groupId>
+      <artifactId>pax-exam-link-mvn</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.ops4j.pax.url</groupId>
+      <artifactId>pax-url-aether</artifactId>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.jacoco</groupId>
+        <artifactId>jacoco-maven-plugin</artifactId>
+        <configuration>
+          <destFile>../implementation/target/jacoco-it.exec</destFile>
+          <includes>
+            <include>org.opendaylight.controller.*</include>
+            <include>org.opendaylight.ovsdb.*</include>
+          </includes>
+        </configuration>
+        <executions>
+          <execution>
+            <id>pre-test</id>
+            <goals>
+              <goal>prepare-agent</goal>
+            </goals>
+          </execution>
+          <execution>
+            <id>post-test</id>
+            <configuration>
+              <skip>true</skip>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  <scm>
+    <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
+    <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
+    <tag>HEAD</tag>
+    <url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
+  </scm>
+
+</project>
diff --git a/integrationtest/src/test/java/org/opendaylight/ovsdb/integrationtest/ConfigurationBundles.java b/integrationtest/src/test/java/org/opendaylight/ovsdb/integrationtest/ConfigurationBundles.java
new file mode 100644 (file)
index 0000000..c14b1ef
--- /dev/null
@@ -0,0 +1,192 @@
+/*
+ * Copyright (C) 2014 Red Hat, Inc.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ *  Authors : Dave Tucker
+ */
+
+package org.opendaylight.ovsdb.integrationtest;
+
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.options.DefaultCompositeOption;
+
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+import static org.ops4j.pax.exam.CoreOptions.systemPackages;
+import static org.ops4j.pax.exam.CoreOptions.systemProperty;
+
+
+public class ConfigurationBundles {
+
+    public static Option controllerBundles() {
+        return new DefaultCompositeOption(
+
+                // Set the systemPackages (used by clustering)
+                systemPackages("sun.reflect", "sun.reflect.misc", "sun.misc"),
+                mavenBundle("ch.qos.logback", "logback-classic").versionAsInProject(),
+                mavenBundle("ch.qos.logback", "logback-core").versionAsInProject(),
+                mavenBundle("com.google.code.gson", "gson").versionAsInProject(),
+                mavenBundle("com.google.guava", "guava").versionAsInProject(),
+                mavenBundle("eclipselink", "javax.resource").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "javax.servlet").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.command").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.runtime").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.shell").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.console").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.ds").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.util").versionAsInProject(),
+                mavenBundle("equinoxSDK381","org.eclipse.osgi.services").versionAsInProject(),
+                mavenBundle("org.apache.commons", "commons-lang3").versionAsInProject(),
+                mavenBundle("org.apache.felix", "org.apache.felix.dependencymanager").versionAsInProject(),
+                mavenBundle("org.apache.felix", "org.apache.felix.dependencymanager.shell").versionAsInProject(),
+                mavenBundle("org.jboss.spec.javax.transaction", "jboss-transaction-api_1.1_spec").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "clustering.services").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "clustering.services-implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "configuration").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "containermanager").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "containermanager.it.implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "sal").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "sal.connection").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "sal.connection.implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "sal.implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "sal.networkconfiguration").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "sal.networkconfiguration.implementation").versionAsInProject(),
+                mavenBundle("org.slf4j", "log4j-over-slf4j").versionAsInProject(),
+                mavenBundle("org.slf4j", "slf4j-api").versionAsInProject()
+
+                );
+    }
+
+    public static Option controllerNorthboundBundles() {
+        return new DefaultCompositeOption(
+                // setting default level. Jersey bundles will need to be started
+                // earlier.
+                systemProperty("osgi.bundles.defaultStartLevel").value("4"),
+                mavenBundle("com.fasterxml.jackson.jaxrs", "jackson-jaxrs-base").versionAsInProject(),
+                mavenBundle("com.fasterxml.jackson.jaxrs", "jackson-jaxrs-json-provider").versionAsInProject(),
+                mavenBundle("com.fasterxml.jackson.module", "jackson-module-jaxb-annotations").versionAsInProject(),
+                mavenBundle("com.sun.jersey", "jersey-client").versionAsInProject(),
+                mavenBundle("com.sun.jersey", "jersey-core").versionAsInProject().startLevel(2),
+                mavenBundle("com.sun.jersey", "jersey-server").versionAsInProject().startLevel(2),
+                mavenBundle("commons-codec", "commons-codec").versionAsInProject(),
+                mavenBundle("commons-fileupload", "commons-fileupload").versionAsInProject(),
+                mavenBundle("commons-io", "commons-io").versionAsInProject(),
+                mavenBundle("eclipselink", "javax.persistence").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "javax.servlet.jsp").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.cm").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.launcher").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.osgi.services").versionAsInProject(),
+                mavenBundle("geminiweb", "org.eclipse.gemini.web.core").versionAsInProject(),
+                mavenBundle("geminiweb", "org.eclipse.gemini.web.extender").versionAsInProject(),
+                mavenBundle("geminiweb", "org.eclipse.gemini.web.tomcat").versionAsInProject(),
+                mavenBundle("geminiweb", "org.eclipse.virgo.kernel.equinox.extensions").versionAsInProject().noStart(),
+                mavenBundle("geminiweb", "org.eclipse.virgo.util.common").versionAsInProject(),
+                mavenBundle("geminiweb", "org.eclipse.virgo.util.io").versionAsInProject(),
+                mavenBundle("geminiweb", "org.eclipse.virgo.util.math").versionAsInProject(),
+                mavenBundle("geminiweb", "org.eclipse.virgo.util.osgi").versionAsInProject(),
+                mavenBundle("geminiweb", "org.eclipse.virgo.util.osgi.manifest").versionAsInProject(),
+                mavenBundle("geminiweb", "org.eclipse.virgo.util.parser.manifest").versionAsInProject(),
+                mavenBundle("orbit", "javax.activation").versionAsInProject(),
+                mavenBundle("orbit", "javax.annotation").versionAsInProject(),
+                mavenBundle("orbit", "javax.ejb").versionAsInProject(),
+                mavenBundle("orbit", "javax.el").versionAsInProject(),
+                mavenBundle("orbit", "javax.mail.glassfish").versionAsInProject(),
+                mavenBundle("orbit", "javax.servlet.jsp.jstl").versionAsInProject(),
+                mavenBundle("orbit", "javax.servlet.jsp.jstl.impl").versionAsInProject(),
+                mavenBundle("orbit", "javax.xml.rpc").versionAsInProject(),
+                mavenBundle("orbit", "javax.xml.rpc").versionAsInProject(),
+                mavenBundle("orbit", "org.apache.catalina").versionAsInProject(),
+                mavenBundle("orbit", "org.apache.catalina.ha").versionAsInProject().noStart(),
+                mavenBundle("orbit", "org.apache.catalina.tribes").versionAsInProject().noStart(),
+                mavenBundle("orbit", "org.apache.coyote").versionAsInProject().noStart(),
+                mavenBundle("orbit", "org.apache.el").versionAsInProject(),
+                mavenBundle("orbit", "org.apache.jasper").versionAsInProject().noStart(),
+                mavenBundle("orbit", "org.apache.juli.extras").versionAsInProject(),
+                mavenBundle("orbit", "org.apache.tomcat.api").versionAsInProject(),
+                mavenBundle("orbit", "org.apache.tomcat.util").versionAsInProject().noStart(),
+                mavenBundle("org.aopalliance", "com.springsource.org.aopalliance").versionAsInProject(),
+                mavenBundle("org.apache.felix", "org.apache.felix.fileinstall").versionAsInProject(),
+                mavenBundle("org.codehaus.jettison", "jettison").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "arphandler").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "arphandler").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "bundlescanner").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "bundlescanner.implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "commons.httpclient").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "commons.northbound").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "configuration.implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "connectionmanager").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "connectionmanager.implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "flowprogrammer.northbound").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "forwarding.staticrouting").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "forwarding.staticrouting.northbound").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "forwardingrulesmanager").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "hosttracker").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "hosttracker.implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "hosttracker.northbound").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "logging.bridge").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "routing.dijkstra_implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "security").versionAsInProject().noStart(),
+                mavenBundle("org.opendaylight.controller", "statistics.northbound").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "statisticsmanager").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "statisticsmanager.implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "subnets.northbound").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "switchmanager").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "switchmanager.implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "switchmanager.northbound").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "topology.northbound").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "topologymanager").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "usermanager").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "usermanager.implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller","forwardingrulesmanager.implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller","sal.connection.implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller","sal.implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller","sal.networkconfiguration").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller","sal.networkconfiguration.implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller.thirdparty", "com.sun.jersey.jersey-servlet").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller.thirdparty", "net.sf.jung2").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller.thirdparty", "org.apache.catalina.filters.CorsFilter").versionAsInProject().noStart(),
+                mavenBundle("org.opendaylight.ovsdb", "ovsdb").versionAsInProject(),
+                mavenBundle("org.ow2.asm", "asm-all").versionAsInProject(),
+                mavenBundle("org.ow2.chameleon.management", "chameleon-mbeans").versionAsInProject(),
+                mavenBundle("org.slf4j", "jcl-over-slf4j").versionAsInProject(),
+                mavenBundle("org.slf4j", "slf4j-api").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.aop").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.asm").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.beans").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.context").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.context.support").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.core").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.expression").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.transaction").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.web").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.web.servlet").versionAsInProject(),
+                mavenBundle("org.springframework.security", "spring-security-config").versionAsInProject(),
+                mavenBundle("org.springframework.security", "spring-security-core").versionAsInProject(),
+                mavenBundle("org.springframework.security", "spring-security-taglibs").versionAsInProject(),
+                mavenBundle("org.springframework.security", "spring-security-web").versionAsInProject(),
+                mavenBundle("virgomirror", "org.eclipse.jdt.core.compiler.batch").versionAsInProject(),
+                mavenBundle("org.yaml", "snakeyaml").versionAsInProject()
+                );
+    }
+
+    public static Option ovsdbLibraryBundles() {
+        return new DefaultCompositeOption(
+
+                //ovsdb
+                mavenBundle("io.netty", "netty-buffer").versionAsInProject(),
+                mavenBundle("io.netty", "netty-codec").versionAsInProject(),
+                mavenBundle("io.netty", "netty-common").versionAsInProject(),
+                mavenBundle("io.netty", "netty-handler").versionAsInProject(),
+                mavenBundle("io.netty", "netty-transport").versionAsInProject(),
+                mavenBundle("com.fasterxml.jackson.core", "jackson-annotations").versionAsInProject(),
+                mavenBundle("com.fasterxml.jackson.core", "jackson-core").versionAsInProject(),
+                mavenBundle("com.fasterxml.jackson.core", "jackson-databind").versionAsInProject(),
+                mavenBundle("javax.portlet", "portlet-api").versionAsInProject(),
+                mavenBundle("com.google.guava", "guava").versionAsInProject(),
+                mavenBundle("org.opendaylight.ovsdb", "ovsdb").versionAsInProject()
+        );
+    }
+
+}
similarity index 90%
rename from paxexam/plugin.integrationtest/src/test/java/org/opendaylight/ovsdb/plugin/OvsdbTestBase.java
rename to integrationtest/src/test/java/org/opendaylight/ovsdb/integrationtest/OvsdbIntegrationTestBase.java
index d510a3cc7cf9b610095416d24343b06b964c5784..d6f4354be4880dc0870fa02f42780635c530fcda 100644 (file)
@@ -7,7 +7,7 @@
  *
  * Authors : Madhu Venugopal
  */
-package org.opendaylight.ovsdb.plugin;
+package org.opendaylight.ovsdb.integrationtest;
 
 import java.io.IOException;
 import java.util.HashMap;
@@ -17,8 +17,9 @@ import java.util.Properties;
 import org.opendaylight.controller.sal.connection.ConnectionConstants;
 import org.opendaylight.controller.sal.core.Node;
 import org.opendaylight.controller.sal.utils.ServiceHelper;
+import org.opendaylight.ovsdb.plugin.IConnectionServiceInternal;
 
-public abstract class OvsdbTestBase {
+public abstract class OvsdbIntegrationTestBase {
     private final static String identifier = "TEST";
 
     public Node getTestConnection() throws IOException {
diff --git a/integrationtest/src/test/java/org/opendaylight/ovsdb/integrationtest/plugin/OvsdbPluginIT.java b/integrationtest/src/test/java/org/opendaylight/ovsdb/integrationtest/plugin/OvsdbPluginIT.java
new file mode 100644 (file)
index 0000000..a3c8c77
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2014 Red Hat, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Authors : Madhu Venugopal
+ */
+package org.opendaylight.ovsdb.integrationtest.plugin;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.ops4j.pax.exam.CoreOptions.junitBundles;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.propagateSystemProperty;
+import static org.ops4j.pax.exam.CoreOptions.systemProperty;
+
+import java.io.IOException;
+import java.util.List;
+
+import javax.inject.Inject;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.opendaylight.controller.sal.core.Node;
+import org.opendaylight.controller.sal.utils.ServiceHelper;
+import org.opendaylight.ovsdb.integrationtest.ConfigurationBundles;
+import org.opendaylight.ovsdb.integrationtest.OvsdbIntegrationTestBase;
+import org.opendaylight.ovsdb.plugin.OVSDBConfigService;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.util.PathUtils;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@RunWith(PaxExam.class)
+public class OvsdbPluginIT extends OvsdbIntegrationTestBase {
+    private Logger log = LoggerFactory.getLogger(OvsdbPluginIT.class);
+    @Inject
+    private BundleContext bc;
+    private OVSDBConfigService ovsdbConfigService = null;
+    private Node node = null;
+
+    // Configure the OSGi container
+    @Configuration
+    public Option[] config() {
+        return options(
+            //
+            systemProperty("logback.configurationFile").value(
+                    "file:" + PathUtils.getBaseDir()
+                    + "/src/test/resources/logback.xml"
+            ),
+            // To start OSGi console for inspection remotely
+            systemProperty("osgi.console").value("2401"),
+
+            propagateSystemProperty("ovsdbserver.ipaddress"),
+            propagateSystemProperty("ovsdbserver.port"),
+
+            ConfigurationBundles.controllerBundles(),
+            ConfigurationBundles.ovsdbLibraryBundles(),
+            junitBundles()
+        );
+    }
+
+    private String stateToString(int state) {
+        switch (state) {
+        case Bundle.ACTIVE:
+            return "ACTIVE";
+        case Bundle.INSTALLED:
+            return "INSTALLED";
+        case Bundle.RESOLVED:
+            return "RESOLVED";
+        case Bundle.UNINSTALLED:
+            return "UNINSTALLED";
+        default:
+            return "Not CONVERTED";
+        }
+    }
+
+    @Before
+    public void areWeReady() throws InterruptedException {
+        assertNotNull(bc);
+        boolean debugit = false;
+        Bundle b[] = bc.getBundles();
+        for (Bundle element : b) {
+            int state = element.getState();
+            if (state != Bundle.ACTIVE && state != Bundle.RESOLVED) {
+                log.info("Bundle:" + element.getSymbolicName() + " state:"
+                          + stateToString(state));
+                debugit = true;
+            }
+        }
+        if (debugit) {
+            log.debug("Do some debugging because some bundle is unresolved");
+        }
+
+        // Assert if true, if false we are good to go!
+        assertFalse(debugit);
+        try {
+            node = getTestConnection();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        this.ovsdbConfigService = (OVSDBConfigService)ServiceHelper.getGlobalInstance(OVSDBConfigService.class, this);
+    }
+
+    @Test
+    public void tableTest() throws Exception {
+        assertNotNull("Invalid Node. Check connection params", node);
+        Thread.sleep(3000); // Wait for a few seconds to get the Schema exchange done
+        List<String> tables = ovsdbConfigService.getTables(node);
+        System.out.println("Tables = "+tables);
+        assertNotNull(tables);
+    }
+}
diff --git a/integrationtest/src/test/resources/exam.properties b/integrationtest/src/test/resources/exam.properties
new file mode 100644 (file)
index 0000000..4936b4a
--- /dev/null
@@ -0,0 +1,2 @@
+pax.exam.logging = none
+pax.exam.service.timeout = 5000
similarity index 84%
rename from paxexam/plugin.integrationtest/src/test/resources/logback.xml
rename to integrationtest/src/test/resources/logback.xml
index 6d9dfda9a365f9a08f9d4ba5b7733f2cb6340ba6..0a137c5c6e3662a68d01fd580a1f2b5eff076eda 100644 (file)
@@ -6,6 +6,8 @@
     </encoder>
   </appender>
 
+  <logger name="org.opendaylight.ovsdb.*" level="INFO" />
+
   <root level="error">
     <appender-ref ref="STDOUT" />
   </root>
diff --git a/integrationtest/src/test/resources/tomcat-server.xml b/integrationtest/src/test/resources/tomcat-server.xml
new file mode 100644 (file)
index 0000000..aa47aea
--- /dev/null
@@ -0,0 +1,46 @@
+<?xml version='1.0' encoding='utf-8'?>
+<Server>
+  <!--APR library loader. Documentation at /docs/apr.html -->
+  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
+  <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
+  <Listener className="org.apache.catalina.core.JasperListener" />
+  <!-- Prevent memory leaks due to use of particular java/javax APIs-->
+  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
+  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
+  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
+
+  <Service name="Catalina">
+    <Connector port="8088" protocol="HTTP/1.1"
+               connectionTimeout="20000"
+               redirectPort="8443" />
+
+    <!--
+            Please remove the comments around the following Connector tag to enable HTTPS Authentication support.
+            Remember to add a valid keystore in the configuration folder.
+            More info : http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
+    -->
+
+    <!--
+       <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
+                  maxThreads="150" scheme="https" secure="true"
+                  clientAuth="false" sslProtocol="TLS"
+                  keystoreFile="configuration/keystore"
+                  keystorePass="changeit"/>
+    -->
+
+    <Engine name="Catalina" defaultHost="localhost">
+      <Host name="localhost" appBase=""
+            unpackWARs="false" autoDeploy="false"
+            deployOnStartup="false" createDirs="false">
+        <Realm className="org.opendaylight.controller.security.ControllerCustomRealm" />
+        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
+
+        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
+               prefix="web_access_log_" suffix=".txt" resolveHosts="false"
+               rotatable="true" fileDateFormat="yyyy-MM"
+               pattern="%{yyyy-MM-dd HH:mm:ss.SSS z}t - [%a] - %r"/>
+
+      </Host>
+    </Engine>
+  </Service>
+</Server>
diff --git a/paxexam/plugin.integrationtest/pom.xml b/paxexam/plugin.integrationtest/pom.xml
deleted file mode 100644 (file)
index a2bdd04..0000000
+++ /dev/null
@@ -1,234 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <parent>
-    <groupId>org.opendaylight.ovsdb</groupId>
-    <artifactId>common.integrationtest</artifactId>
-    <version>1.0.1-SNAPSHOT</version>
-    <relativePath>../common.integrationtest</relativePath>
-  </parent>
-
-  <artifactId>ovsdb.plugin.integrationtest</artifactId>
-  <version>0.4.2-SNAPSHOT</version>
-  <properties>
-    <sonar.jacoco.itReportPath>../implementation/target/jacoco-it.exec</sonar.jacoco.itReportPath>
-    <!-- Sonar jacoco plugin to get integration test coverage info -->
-    <sonar.jacoco.reportPath>../implementation/target/jacoco.exec</sonar.jacoco.reportPath>
-  </properties>
-
-  <dependencies>
-    <dependency>
-      <groupId>ch.qos.logback</groupId>
-      <artifactId>logback-classic</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>ch.qos.logback</groupId>
-      <artifactId>logback-core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>com.fasterxml.jackson.core</groupId>
-      <artifactId>jackson-annotations</artifactId>
-      <version>${jackson.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>com.fasterxml.jackson.core</groupId>
-      <artifactId>jackson-core</artifactId>
-      <version>${jackson.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>com.fasterxml.jackson.core</groupId>
-      <artifactId>jackson-databind</artifactId>
-      <version>${jackson.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>com.google.code.gson</groupId>
-      <artifactId>gson</artifactId>
-      <version>2.1</version>
-      <scope>compile</scope>
-    </dependency>
-    <dependency>
-      <groupId>com.google.guava</groupId>
-      <artifactId>guava</artifactId>
-      <version>${guava.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>commons-codec</groupId>
-      <artifactId>commons-codec</artifactId>
-      <optional>true</optional>
-    </dependency>
-    <dependency>
-      <groupId>commons-codec</groupId>
-      <artifactId>commons-codec</artifactId>
-      <version>1.4</version>
-    </dependency>
-    <dependency>
-      <groupId>commons-collections</groupId>
-      <artifactId>commons-collections</artifactId>
-      <version>1.0</version>
-    </dependency>
-    <dependency>
-      <groupId>commons-lang</groupId>
-      <artifactId>commons-lang</artifactId>
-      <version>2.3</version>
-    </dependency>
-    <dependency>
-      <groupId>eclipselink</groupId>
-      <artifactId>javax.resource</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>equinoxSDK381</groupId>
-      <artifactId>javax.servlet</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>equinoxSDK381</groupId>
-      <artifactId>org.eclipse.osgi</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>io.netty</groupId>
-      <artifactId>netty-buffer</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>io.netty</groupId>
-      <artifactId>netty-codec</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>io.netty</groupId>
-      <artifactId>netty-common</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>io.netty</groupId>
-      <artifactId>netty-handler</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>io.netty</groupId>
-      <artifactId>netty-transport</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>javax.portlet</groupId>
-      <artifactId>portlet-api</artifactId>
-      <version>2.0</version>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.dependencymanager.shell</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.httpcomponents</groupId>
-      <artifactId>httpcore-nio</artifactId>
-      <version>4.2.1</version>
-      <optional>true</optional>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>clustering.services</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>clustering.services-implementation</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>containermanager</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>containermanager.it.implementation</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal.connection</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal.connection.implementation</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal.implementation</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal.networkconfiguration</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal.networkconfiguration.implementation</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.ovsdb</groupId>
-      <artifactId>ovsdb</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>log4j-over-slf4j</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.ops4j.pax.exam</groupId>
-      <artifactId>pax-exam-container-native</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.ops4j.pax.exam</groupId>
-      <artifactId>pax-exam-junit4</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.ops4j.pax.exam</groupId>
-      <artifactId>pax-exam-link-mvn</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.ops4j.pax.url</groupId>
-      <artifactId>pax-url-aether</artifactId>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.jacoco</groupId>
-        <artifactId>jacoco-maven-plugin</artifactId>
-        <configuration>
-          <destFile>../implementation/target/jacoco-it.exec</destFile>
-          <includes>
-            <include>org.opendaylight.controller.*</include>
-            <include>org.opendaylight.ovsdb.*</include>
-          </includes>
-        </configuration>
-        <executions>
-          <execution>
-            <id>pre-test</id>
-            <goals>
-              <goal>prepare-agent</goal>
-            </goals>
-          </execution>
-          <execution>
-            <id>post-test</id>
-            <configuration>
-              <skip>true</skip>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
-  <scm>
-    <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
-    <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
-    <tag>HEAD</tag>
-    <url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
-  </scm>
-</project>
diff --git a/paxexam/plugin.integrationtest/src/test/java/org/opendaylight/ovsdb/plugin/OvsdbPluginIT.java b/paxexam/plugin.integrationtest/src/test/java/org/opendaylight/ovsdb/plugin/OvsdbPluginIT.java
deleted file mode 100644 (file)
index e97181d..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Copyright (c) 2014 Red Hat, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Authors : Madhu Venugopal
- */
-package org.opendaylight.ovsdb.plugin;\r
-\r
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.ops4j.pax.exam.CoreOptions.junitBundles;
-import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
-import static org.ops4j.pax.exam.CoreOptions.options;
-import static org.ops4j.pax.exam.CoreOptions.systemPackages;
-import static org.ops4j.pax.exam.CoreOptions.systemProperty;
-
-import java.io.IOException;
-import java.util.List;
-
-import javax.inject.Inject;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.utils.ServiceHelper;
-import org.ops4j.pax.exam.Configuration;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.PaxExam;
-import org.ops4j.pax.exam.util.PathUtils;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-\r
-@RunWith(PaxExam.class)\r
-public class OvsdbPluginIT extends OvsdbTestBase {\r
-    private Logger log = LoggerFactory.getLogger(OvsdbPluginIT.class);\r
-    @Inject\r
-    private BundleContext bc;\r
-    private OVSDBConfigService ovsdbConfigService = null;
-    private Node node = null;\r
-\r
-    // Configure the OSGi container\r
-    @Configuration\r
-    public Option[] config() {\r
-        return options(\r
-            //\r
-            systemProperty("logback.configurationFile").value(\r
-                "file:" + PathUtils.getBaseDir()\r
-                + "/src/test/resources/logback.xml"),\r
-            // To start OSGi console for inspection remotely\r
-            systemProperty("osgi.console").value("2401"),\r
-            // Set the systemPackages (used by clustering)\r
-            systemPackages("sun.reflect", "sun.reflect.misc", "sun.misc"),\r
-            // List framework bundles\r
-            mavenBundle("equinoxSDK381",\r
-                        "org.eclipse.equinox.console").versionAsInProject(),\r
-            mavenBundle("equinoxSDK381",\r
-                        "org.eclipse.equinox.util").versionAsInProject(),\r
-            mavenBundle("equinoxSDK381",\r
-                        "org.eclipse.osgi.services").versionAsInProject(),\r
-            mavenBundle("equinoxSDK381",\r
-                        "org.eclipse.equinox.ds").versionAsInProject(),\r
-            mavenBundle("equinoxSDK381",\r
-                        "org.apache.felix.gogo.command").versionAsInProject(),\r
-            mavenBundle("equinoxSDK381",\r
-                        "org.apache.felix.gogo.runtime").versionAsInProject(),\r
-            mavenBundle("equinoxSDK381",\r
-                        "org.apache.felix.gogo.shell").versionAsInProject(),
-            mavenBundle("equinoxSDK381", "javax.servlet").versionAsInProject(),
-
-            mavenBundle("com.google.guava",
-                        "guava").versionAsInProject(),
-\r
-            // List logger bundles\r
-            mavenBundle("org.slf4j", "slf4j-api").versionAsInProject(),\r
-            mavenBundle("org.slf4j", "log4j-over-slf4j").versionAsInProject(),\r
-            mavenBundle("ch.qos.logback", "logback-core").versionAsInProject(),\r
-            mavenBundle("ch.qos.logback", "logback-classic").versionAsInProject(),\r
-            // List all the bundles on which the test case depends
-            mavenBundle("org.opendaylight.ovsdb", "ovsdb").versionAsInProject(),\r
-            mavenBundle("org.opendaylight.controller",\r
-                        "clustering.services").versionAsInProject(),\r
-            mavenBundle("org.opendaylight.controller",\r
-                        "clustering.services-implementation").versionAsInProject(),\r
-            mavenBundle("org.opendaylight.controller", "sal").versionAsInProject(),\r
-            mavenBundle("org.opendaylight.controller",\r
-                        "sal.implementation").versionAsInProject(),
-            mavenBundle("org.opendaylight.controller", "sal.connection").versionAsInProject(),
-            mavenBundle("org.opendaylight.controller",
-                        "sal.connection.implementation").versionAsInProject(),
-            mavenBundle("org.opendaylight.controller",
-                        "sal.networkconfiguration").versionAsInProject(),
-            mavenBundle("org.opendaylight.controller",
-                        "sal.networkconfiguration.implementation").versionAsInProject(),\r
-            mavenBundle("org.opendaylight.controller", "configuration").versionAsInProject(),\r
-            mavenBundle("org.opendaylight.controller", "containermanager").versionAsInProject(),\r
-            mavenBundle("org.opendaylight.controller",\r
-                        "containermanager.it.implementation").versionAsInProject(),
-            mavenBundle("com.fasterxml.jackson.core", "jackson-annotations").versionAsInProject(),
-            mavenBundle("com.fasterxml.jackson.core", "jackson-core").versionAsInProject(),
-            mavenBundle("com.fasterxml.jackson.core", "jackson-databind").versionAsInProject(),
-            mavenBundle("io.netty", "netty-buffer").versionAsInProject(),
-            mavenBundle("io.netty", "netty-common").versionAsInProject(),
-            mavenBundle("io.netty", "netty-codec").versionAsInProject(),
-            mavenBundle("io.netty", "netty-transport").versionAsInProject(),
-            mavenBundle("io.netty", "netty-handler").versionAsInProject(),
-
-            mavenBundle("org.apache.httpcomponents", "httpcore-nio").versionAsInProject(),
-            mavenBundle("com.google.code.gson", "gson").versionAsInProject(),\r
-            mavenBundle("org.jboss.spec.javax.transaction",\r
-                        "jboss-transaction-api_1.1_spec").versionAsInProject(),\r
-            mavenBundle("org.apache.commons", "commons-lang3").versionAsInProject(),\r
-            mavenBundle("org.apache.felix",\r
-                        "org.apache.felix.dependencymanager").versionAsInProject(),\r
-            mavenBundle("org.apache.felix",\r
-                        "org.apache.felix.dependencymanager.shell").versionAsInProject(),\r
-            mavenBundle("eclipselink", "javax.resource").versionAsInProject(),\r
-            junitBundles());\r
-    }\r
-\r
-    private String stateToString(int state) {\r
-        switch (state) {\r
-        case Bundle.ACTIVE:\r
-            return "ACTIVE";\r
-        case Bundle.INSTALLED:\r
-            return "INSTALLED";\r
-        case Bundle.RESOLVED:\r
-            return "RESOLVED";\r
-        case Bundle.UNINSTALLED:\r
-            return "UNINSTALLED";\r
-        default:\r
-            return "Not CONVERTED";\r
-        }\r
-    }\r
-\r
-    @Before\r
-    public void areWeReady() throws InterruptedException {\r
-        assertNotNull(bc);\r
-        boolean debugit = false;\r
-        Bundle b[] = bc.getBundles();\r
-        for (Bundle element : b) {\r
-            int state = element.getState();\r
-            if (state != Bundle.ACTIVE && state != Bundle.RESOLVED) {\r
-                log.info("Bundle:" + element.getSymbolicName() + " state:"\r
-                          + stateToString(state));\r
-                debugit = true;\r
-            }\r
-        }\r
-        if (debugit) {\r
-            log.debug("Do some debugging because some bundle is unresolved");
-        }\r
-\r
-        // Assert if true, if false we are good to go!\r
-        assertFalse(debugit);
-        try {
-            node = getTestConnection();
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-        this.ovsdbConfigService = (OVSDBConfigService)ServiceHelper.getGlobalInstance(OVSDBConfigService.class, this);\r
-    }\r
-\r
-    @Test\r
-    public void tableTest() throws Exception {
-        assertNotNull("Invalid Node. Check connection params", node);
-        Thread.sleep(3000); // Wait for a few seconds to get the Schema exchange done
-        List<String> tables = ovsdbConfigService.getTables(node);
-        System.out.println("Tables = "+tables);\r
-        assertNotNull(tables);
-    }\r
-}\r