<packaging>feature</packaging>
<name>OpenDaylight :: Neutron :: Hostconfig :: OVS</name>
+ <properties>
+ <explicitFeatureDependencies>true</explicitFeatureDependencies>
+ </properties>
+
<dependencyManagement>
<dependencies>
<dependency>
<properties>
<netconf.version>1.3.0-SNAPSHOT</netconf.version>
+ <explicitFeatureDependencies>true</explicitFeatureDependencies>
</properties>
<dependencyManagement>
<packaging>feature</packaging>
<name>OpenDaylight :: Neutron :: Logger</name>
+ <properties>
+ <explicitFeatureDependencies>true</explicitFeatureDependencies>
+ </properties>
+
<dependencyManagement>
<dependencies>
<dependency>
<packaging>feature</packaging>
<name>OpenDaylight :: Neutron :: Northbound</name>
+ <properties>
+ <explicitFeatureDependencies>true</explicitFeatureDependencies>
+ </properties>
+
<dependencies>
<dependency>
<groupId>org.opendaylight.aaa</groupId>
<packaging>feature</packaging>
<name>OpenDaylight :: Neutron :: Service</name>
+ <properties>
+ <explicitFeatureDependencies>true</explicitFeatureDependencies>
+ </properties>
+
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<packaging>feature</packaging>
<name>OpenDaylight :: Neutron :: API</name>
+ <properties>
+ <explicitFeatureDependencies>true</explicitFeatureDependencies>
+ </properties>
+
<dependencyManagement>
<dependencies>
<dependency>
<packaging>feature</packaging>
<name>OpenDaylight :: Neutron :: Implementation</name>
+ <properties>
+ <explicitFeatureDependencies>true</explicitFeatureDependencies>
+ </properties>
+
<dependencyManagement>
<dependencies>
<dependency>
<version>0.9.0-SNAPSHOT</version>
<packaging>feature</packaging>
+ <properties>
+ <explicitFeatureDependencies>true</explicitFeatureDependencies>
+ </properties>
+
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<packaging>feature</packaging>
<name>OpenDaylight :: Neutron :: Logger :: Test</name>
+ <properties>
+ <explicitFeatureDependencies>true</explicitFeatureDependencies>
+ </properties>
+
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<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.odlparent</groupId>
- <artifactId>features-parent</artifactId>
- <version>1.9.0</version>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>mdsal-it-parent</artifactId>
+ <version>1.6.0-SNAPSHOT</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.neutron</groupId>
<artifactId>integration-test</artifactId>
<version>0.9.0-SNAPSHOT</version>
- <packaging>jar</packaging>
-
- <!--<modules>-->
- <!--<module>features4-odl-neutron-test</module>-->
- <!--</modules>-->
-
- <!--TODO:to run integration test with karaf4: odlparent/features4-test is missing or can we just use odlparent/features-test?-->
+ <packaging>bundle</packaging>
<!-- <name> formatting is used by autorelease to parse and notify projects on
build failure. Please do not modify this unless you have a good reason. -->
<name>ODL :: neutron :: ${project.artifactId}</name>
<properties>
+ <skipITs>false</skipITs>
+ <karaf.distro.groupId>org.opendaylight.neutron</karaf.distro.groupId>
+ <karaf.distro.artifactId>neutron4-karaf</karaf.distro.artifactId>
+ <karaf.distro.version>${project.version}</karaf.distro.version>
+ <karaf.distro.type>zip</karaf.distro.type>
<checkstyle.location>${project.parent.basedir}/src/main/resources</checkstyle.location>
<sonar.jacoco.itReportPath>target/jacoco-it.exec</sonar.jacoco.itReportPath>
<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
<dependencies>
<dependency>
<groupId>org.opendaylight.neutron</groupId>
- <artifactId>features-neutron</artifactId>
- <version>${project.version}</version>
- <classifier>features</classifier>
- <type>xml</type>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.neutron</groupId>
- <artifactId>neutron-logger</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.neutron</groupId>
- <artifactId>odl-neutron-service</artifactId>
- <version>${project.version}</version>
- <classifier>features</classifier>
- <type>xml</type>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.neutron</groupId>
- <artifactId>odl-neutron-logger</artifactId>
- <version>${project.version}</version>
- <classifier>features</classifier>
- <type>xml</type>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.neutron</groupId>
- <artifactId>neutron-karaf</artifactId>
+ <artifactId>neutron4-karaf</artifactId>
<version>${project.version}</version>
<type>zip</type>
</dependency>
</plugins>
</pluginManagement>
<plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack-classes</id>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>${project.groupId}</groupId>
- <artifactId>neutron-logger</artifactId>
- <version>${project.version}</version>
- </artifactItem>
- <artifactItem>
- <groupId>${project.groupId}</groupId>
- <artifactId>neutron-spi</artifactId>
- <version>${project.version}</version>
- </artifactItem>
- <artifactItem>
- <groupId>${project.groupId}</groupId>
- <artifactId>northbound-api</artifactId>
- <version>${project.version}</version>
- </artifactItem>
- <artifactItem>
- <groupId>${project.groupId}</groupId>
- <artifactId>transcriber</artifactId>
- <version>${project.version}</version>
- </artifactItem>
- </artifactItems>
- <outputDirectory>target/classes</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
<plugin>
<groupId>org.ops4j.pax.exam</groupId>
<artifactId>maven-paxexam-plugin</artifactId>
</execution>
</executions>
</plugin>
- <plugin>
- <artifactId>maven-failsafe-plugin</artifactId>
- <version>${failsafe.version}</version>
- <executions>
- <execution>
- <id>integration-tests</id>
- <phase>integration-test</phase>
- <goals>
- <goal>integration-test</goal>
- <goal>verify</goal>
- </goals>
- <configuration>
- <argLine>${failsafeArgLine}</argLine>
- </configuration>
- </execution>
- </executions>
- </plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
-<?xml version="1.0" encoding="UTF-8"?>
-
-<features name="odl-neutron-test-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.2.0 http://karaf.apache.org/xmlns/features/v1.2.0">
- <repository>mvn:org.opendaylight.neutron/features-neutron/{{VERSION}}/xml/features</repository>
- <feature name='odl-neutron-neutron-logger-test' version='${project.version}' description="OpenDaylight :: Neutron :: Neutron Logger Test">
- <feature version='${project.version}'>odl-neutron-service</feature>
- <bundle>mvn:org.opendaylight.neutron/neutron-logger/{{VERSION}}</bundle>
- </feature>
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="features4-neutron-test">
+ <repository>mvn:org.opendaylight.neutron/odl-neutron-logger-test/0.9.0-SNAPSHOT/xml/features</repository>
+ <feature name="features4-neutron-test" description="features4-neutron-test" version="0.9.0.SNAPSHOT">
+ <feature version="0.9.0.SNAPSHOT" prerequisite="false" dependency="true">odl-neutron-logger-test</feature>
+ </feature>
</features>
+++ /dev/null
-<?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.odlparent</groupId>
- <artifactId>feature-repo-parent</artifactId>
- <version>1.9.0</version>
- </parent>
-
- <groupId>org.opendaylight.neutron</groupId>
- <artifactId>features4-odl-neutron-test</artifactId>
- <version>0.9.0-SNAPSHOT</version>
- <packaging>feature</packaging>
-
- <dependencies>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>features4-neutron-test</artifactId>
- <version>${project.version}</version>
- <type>xml</type>
- <classifier>features</classifier>
- </dependency>
- </dependencies>
-
-</project>
import static org.ops4j.pax.exam.CoreOptions.vmOption;
import static org.ops4j.pax.exam.CoreOptions.when;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.configureConsole;
-import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.logLevel;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import java.io.BufferedReader;
-import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.URL;
import java.util.Map;
import java.util.Set;
-import javax.inject.Inject;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.opendaylight.controller.mdsal.it.base.AbstractMdsalTestBase;
import org.ops4j.pax.exam.Configuration;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.PaxExam;
import org.ops4j.pax.exam.karaf.options.KarafDistributionOption;
import org.ops4j.pax.exam.karaf.options.LogLevelOption.LogLevel;
-import org.osgi.framework.BundleContext;
-import org.osgi.service.cm.ConfigurationAdmin;
+import org.ops4j.pax.exam.options.MavenUrlReference;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerClass;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
@RunWith(PaxExam.class)
-public class ITNeutronE2E {
+@ExamReactorStrategy(PerClass.class)
+public class ITNeutronE2E extends AbstractMdsalTestBase {
+ private static final Logger LOG = LoggerFactory.getLogger(ITNeutronE2E.class);
private static final String KARAF_DEBUG_PORT = "5005";
private static final String KARAF_DEBUG_PROP = "karaf.debug";
- @Inject
- private BundleContext bundleContext;
+ final String base = "http://127.0.0.1:8181/controller/nb/v2/neutron";
- @Inject
- private ConfigurationAdmin configurationAdmin;
+ @Override
+ public String getKarafDistro() {
+ return maven()
+ .groupId("org.opendaylight.neutron")
+ .artifactId("neutron4-karaf")
+ .versionAsInProject()
+ .type("zip")
+ .getURL();
+ }
+
+ @Override
+ public MavenUrlReference getFeatureRepo() {
+ return maven()
+ .groupId("org.opendaylight.neutron")
+ .artifactId("features4-neutron-test")
+ .classifier("features")
+ .type("xml")
+ .versionAsInProject();
+ }
+
+ @Override
+ public String getFeatureName() {
+ return "odl-neutron-logger-test";
+ }
@Configuration
public Option[] config() {
- return new Option[] {
- // Provision and launch a container based on a distribution of Karaf (Apache ServiceMix).
- // FIXME: need to *NOT* hardcode the version here - it breaks on
- // version bumps
- karafDistributionConfiguration()
- .frameworkUrl(maven().groupId("org.opendaylight.neutron").artifactId("neutron-karaf")
- .type("zip").versionAsInProject())
- .karafVersion("3.0.3").name("Neutron").unpackDirectory(new File("target/pax"))
- .useDeployFolder(false),
- // It is really nice if the container sticks around after the test so you can check the contents
- // of the data directory when things go wrong.
- vmOption("-javaagent:../jars/org.jacoco.agent.jar=destfile=jacoco-it.exec"), keepRuntimeFolder(),
- // Don't bother with local console output as it just ends up cluttering the logs
- configureConsole().ignoreLocalConsole(),
- // Force the log level to INFO so we have more details during the test. It defaults to WARN.
- logLevel(LogLevel.INFO),
- // provision the needed features for this test
- // features("mvn:org.opendaylight.neutron/features-test/0.5.0-SNAPSHOT/xml/features",
- // "features-neutron-test"),
- // Remember that the test executes in another process. If you want to debug it, you need
- // to tell Pax Exam to launch that process with debugging enabled. Launching the test class itself with
- // debugging enabled (for example in Eclipse) will not get you the desired results.
- when(Boolean.getBoolean(KARAF_DEBUG_PROP))
- .useOptions(KarafDistributionOption.debugConfiguration(KARAF_DEBUG_PORT, true)), };
+ Option[] options = super.config();
+ Option[] otherOptions = getOtherOptions();
+ Option[] combinedOptions = new Option[options.length + otherOptions.length];
+ System.arraycopy(options, 0, combinedOptions, 0, options.length);
+ System.arraycopy(otherOptions, 0, combinedOptions, options.length,
+ otherOptions.length);
+ return combinedOptions;
}
- final String base = "http://127.0.0.1:8080/controller/nb/v2/neutron";
+ private Option[] getOtherOptions() {
+ return new Option[] {
+ vmOption("-javaagent:../../pax/jars/org.jacoco.agent.jar=destfile=../../jacoco-it.exec"),
+ keepRuntimeFolder(), configureConsole().ignoreLocalConsole(),
+ logLevel(LogLevel.INFO),
+ when(Boolean.getBoolean(KARAF_DEBUG_PROP)).useOptions(
+ KarafDistributionOption.debugConfiguration(KARAF_DEBUG_PORT, true)),};
+ }
@Test
public void test() throws IOException, InterruptedException {
<dependency>
<groupId>org.apache.karaf.features</groupId>
<artifactId>framework</artifactId>
- <version>${karaf4.version}</version>
<type>kar</type>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>features4-neutron-test</artifactId>
- <version>${project.version}</version>
<classifier>features</classifier>
<type>xml</type>
<scope>runtime</scope>
</dependencies>
</dependencyManagement>
<dependencies>
- <dependency>
- <groupId>org.opendaylight.neutron</groupId>
- <artifactId>neutron-spi</artifactId>
- <version>${project.version}</version>
- </dependency>
<dependency>
<groupId>org.opendaylight.neutron</groupId>
<artifactId>model</artifactId>
<module>features/test</module>
<module>karaf</module>
<module>karaf4</module>
- <!-- <module>integration/test</module> -->
+ <module>integration/test</module>
<module>model</module>
<module>neutron-hostconfig</module>
</modules>