Base projects and parents for IT tests. 94/16294/13
authorEd Warnicke <eaw@cisco.com>
Wed, 11 Mar 2015 00:31:03 +0000 (17:31 -0700)
committerEd Warnicke <hagbard@gmail.com>
Wed, 29 Jul 2015 16:49:51 +0000 (09:49 -0700)
This provides a very very simple working basis for IT tests.

Change-Id: I16fae750c32ffe6fce356c8036b6d74988aa4f99
Signed-off-by: Ed Warnicke <eaw@cisco.com>
Signed-off-by: Ed Warnicke <hagbard@gmail.com>
.gitignore
opendaylight/config/config-it-base/pom.xml [new file with mode: 0644]
opendaylight/config/config-it-base/src/main/java/org/opendaylight/controller/config/it/base/AbstractConfigTestBase.java [new file with mode: 0644]
opendaylight/config/pom.xml
opendaylight/md-sal/mdsal-it-base/pom.xml [new file with mode: 0644]
opendaylight/md-sal/mdsal-it-base/src/main/java/org/opendaylight/controller/mdsal/it/base/AbstractMdsalTestBase.java [new file with mode: 0644]
opendaylight/md-sal/mdsal-it-parent/pom.xml [new file with mode: 0644]
opendaylight/md-sal/pom.xml

index b304ffc..ead1f8e 100644 (file)
@@ -29,5 +29,4 @@ maven-eclipse.xml
 .metadata
 opendaylight/md-sal/sal-distributed-datastore/journal
 !opendaylight/distribution/opendaylight-karaf-resources/src/main/resources/bin
-
-
+.checkstyle
diff --git a/opendaylight/config/config-it-base/pom.xml b/opendaylight/config/config-it-base/pom.xml
new file mode 100644 (file)
index 0000000..def8cd3
--- /dev/null
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: --><!--
+Copyright (c) 2014 Cisco Systems, 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
+-->
+<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">
+
+  <parent>
+    <groupId>org.opendaylight.controller</groupId>
+    <artifactId>config-parent</artifactId>
+    <version>0.4.0-SNAPSHOT</version>
+    <relativePath/>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>config-it-base</artifactId>
+  <packaging>bundle</packaging>
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>org.opendaylight.controller</groupId>
+        <artifactId>config-artifacts</artifactId>
+        <version>${project.version}</version>
+        <type>pom</type>
+        <scope>import</scope>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+  <dependencies>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>config-util</artifactId>
+    </dependency>
+    <!-- Dependencies for pax exam karaf container -->
+    <dependency>
+        <groupId>org.ops4j.pax.exam</groupId>
+        <artifactId>pax-exam-container-karaf</artifactId>
+        <scope>compile</scope>
+    </dependency>
+    <dependency>
+        <groupId>org.ops4j.pax.exam</groupId>
+        <artifactId>pax-exam-junit4</artifactId>
+        <scope>compile</scope>
+    </dependency>
+    <dependency>
+        <groupId>org.ops4j.pax.exam</groupId>
+        <artifactId>pax-exam</artifactId>
+        <scope>compile</scope>
+    </dependency>
+    <dependency>
+        <groupId>org.ops4j.pax.url</groupId>
+        <artifactId>pax-url-aether</artifactId>
+        <scope>compile</scope>
+    </dependency>
+    <dependency>
+        <groupId>javax.inject</groupId>
+        <artifactId>javax.inject</artifactId>
+        <version>1</version>
+        <scope>compile</scope>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.karaf.features</groupId>
+        <artifactId>org.apache.karaf.features.core</artifactId>
+        <version>${karaf.version}</version>
+        <scope>compile</scope>
+    </dependency>
+    <dependency>
+        <groupId>org.osgi</groupId>
+        <artifactId>org.osgi.core</artifactId>
+        <scope>compile</scope>
+    </dependency>
+    <dependency>
+        <groupId>junit</groupId>
+        <artifactId>junit</artifactId>
+        <scope>compile</scope>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.karaf.tooling</groupId>
+        <artifactId>karaf-maven-plugin</artifactId>
+        <version>${karaf.version}</version>
+    </dependency>
+  </dependencies>
+</project>
diff --git a/opendaylight/config/config-it-base/src/main/java/org/opendaylight/controller/config/it/base/AbstractConfigTestBase.java b/opendaylight/config/config-it-base/src/main/java/org/opendaylight/controller/config/it/base/AbstractConfigTestBase.java
new file mode 100644 (file)
index 0000000..e581e50
--- /dev/null
@@ -0,0 +1,173 @@
+package org.opendaylight.controller.config.it.base;
+
+import static org.ops4j.pax.exam.CoreOptions.maven;
+import static org.ops4j.pax.exam.CoreOptions.when;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.features;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder;
+
+import com.google.common.base.Stopwatch;
+
+import java.io.File;
+import java.lang.management.ManagementFactory;
+import java.util.concurrent.TimeUnit;
+
+import javax.management.ObjectName;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.internal.AssumptionViolatedException;
+import org.junit.rules.TestRule;
+import org.junit.rules.TestWatcher;
+import org.junit.runner.Description;
+import org.opendaylight.controller.config.api.ConfigRegistry;
+import org.opendaylight.controller.config.util.ConfigRegistryJMXClient;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.karaf.options.KarafDistributionOption;
+import org.ops4j.pax.exam.karaf.options.LogLevelOption.LogLevel;
+import org.ops4j.pax.exam.options.MavenArtifactUrlReference;
+import org.ops4j.pax.exam.options.MavenUrlReference;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public abstract class AbstractConfigTestBase {
+
+    private static final String PAX_EXAM_UNPACK_DIRECTORY = "target/exam";
+    private static final String KARAF_DEBUG_PORT = "5005";
+    private static final String KARAF_DEBUG_PROP = "karaf.debug";
+    private static final String KEEP_UNPACK_DIRECTORY_PROP = "karaf.keep.unpack";
+    private static final Logger LOG = LoggerFactory.getLogger(AbstractConfigTestBase.class);
+    public static final String ORG_OPS4J_PAX_LOGGING_CFG = "etc/org.ops4j.pax.logging.cfg";
+
+    /*
+     * Default values for karaf distro version, type, groupId, and artifactId
+     */
+    private static final String KARAF_DISTRO_VERSION = "3.0.2";
+    private static final String KARAF_DISTRO_TYPE = "zip";
+    private static final String KARAF_DISTRO_ARTIFACTID = "apache-karaf";
+    private static final String KARAF_DISTRO_GROUPID = "org.apache.karaf";
+
+    /*
+     * Property names to override defaults for karaf distro artifactId, groupId, version, and type
+     */
+    private static final String KARAF_DISTRO_VERSION_PROP = "karaf.distro.version";
+    private static final String KARAF_DISTRO_TYPE_PROP = "karaf.distro.type";
+    private static final String KARAF_DISTRO_ARTIFACTID_PROP = "karaf.distro.artifactId";
+    private static final String KARAF_DISTRO_GROUPID_PROP = "karaf.distro.groupId";
+
+    /*
+     * Wait up to 10s for our configured module to come up
+     */
+    private static final int MODULE_TIMEOUT_MILLIS = 60000;
+
+    public abstract String getModuleName();
+
+    public abstract String getInstanceName();
+
+    public abstract MavenUrlReference getFeatureRepo();
+
+    public abstract String getFeatureName();
+
+    public Option getLoggingOption() {
+        Option option = editConfigurationFilePut(ORG_OPS4J_PAX_LOGGING_CFG,
+                        logConfiguration(AbstractConfigTestBase.class),
+                        LogLevel.INFO.name());
+        return option;
+    }
+
+    public String logConfiguration(Class<?> klazz) {
+        return "log4j.logger." + klazz.getPackage().getName();
+    }
+
+    public String getKarafDistro() {
+        String groupId = System.getProperty(KARAF_DISTRO_GROUPID_PROP,KARAF_DISTRO_GROUPID);
+        String artifactId = System.getProperty(KARAF_DISTRO_ARTIFACTID_PROP,KARAF_DISTRO_ARTIFACTID);
+        String version = System.getProperty(KARAF_DISTRO_VERSION_PROP,KARAF_DISTRO_VERSION);
+        String type = System.getProperty(KARAF_DISTRO_TYPE_PROP,KARAF_DISTRO_TYPE);
+        MavenArtifactUrlReference karafUrl = maven()
+                .groupId(groupId)
+                .artifactId(artifactId)
+                .version(version)
+                .type(type);
+        return karafUrl.getURL();
+    }
+
+    @Configuration
+    public Option[] config() {
+        Option[] options = new Option[] {
+                when(Boolean.getBoolean(KARAF_DEBUG_PROP))
+                        .useOptions(KarafDistributionOption.debugConfiguration(KARAF_DEBUG_PORT, true)),
+                karafDistributionConfiguration().frameworkUrl(getKarafDistro())
+                        .unpackDirectory(new File(PAX_EXAM_UNPACK_DIRECTORY))
+                        .useDeployFolder(false),
+                when(Boolean.getBoolean(KEEP_UNPACK_DIRECTORY_PROP)).useOptions(keepRuntimeFolder()),
+                features(getFeatureRepo(), getFeatureName()),
+                getLoggingOption()};
+        return options;
+    }
+
+    @Before
+    public void setup() throws Exception {
+        LOG.info("Module: {} Instance: {} attempting to configure.",
+                getModuleName(),getInstanceName());
+        Stopwatch stopWatch = Stopwatch.createStarted();
+        ObjectName objectName = null;
+        for(int i = 0;i<MODULE_TIMEOUT_MILLIS;i++) {
+            try {
+                ConfigRegistry configRegistryClient = new ConfigRegistryJMXClient(ManagementFactory
+                        .getPlatformMBeanServer());
+                objectName = configRegistryClient.lookupConfigBean(getModuleName(), getInstanceName());
+                LOG.info("Module: {} Instance: {} ObjectName: {}.",
+                        getModuleName(),getInstanceName(),objectName);
+                break;
+            } catch (Exception e) {
+                if(i<MODULE_TIMEOUT_MILLIS) {
+                    Thread.sleep(1);
+                    continue;
+                } else {
+                    throw e;
+                }
+            }
+        }
+        if(objectName != null) {
+            LOG.info("Module: {} Instance: {} configured after {} ms",
+                getModuleName(),getInstanceName(),
+                stopWatch.elapsed(TimeUnit.MILLISECONDS));
+        } else {
+            throw new RuntimeException("NOT FOUND Module: " +getModuleName() + " Instance: " + getInstanceName() +
+                    " configured after " + stopWatch.elapsed(TimeUnit.MILLISECONDS) + " ms");
+        }
+    }
+
+    @Rule
+    public TestRule watcher = new TestWatcher() {
+
+        @Override
+        protected void starting(Description description) {
+            LOG.info("TestWatcher: Starting test: {}", description.getDisplayName());
+        }
+
+        @Override
+        protected void finished(Description description) {
+            LOG.info("TestWatcher: Finished test: {}", description.getDisplayName());
+        }
+
+        @Override
+        protected void succeeded(Description description) {
+            LOG.info("TestWatcher: Test succeeded: {}", description.getDisplayName());
+        }
+
+        @Override
+        protected void failed(Throwable ex, Description description) {
+            LOG.info("TestWatcher: Test failed: {}", description.getDisplayName(), ex);
+        }
+
+        @Override
+        protected void skipped(AssumptionViolatedException ex, Description description) {
+            LOG.info("TestWatcher: Test skipped: {} ", description.getDisplayName(), ex);
+        }
+    };
+
+}
index 7601f76..72e8dd3 100644 (file)
@@ -42,6 +42,7 @@
 
     <module>config-artifacts</module>
     <module>config-parent</module>
+    <module>config-it-base</module>
   </modules>
 
   <dependencies>
diff --git a/opendaylight/md-sal/mdsal-it-base/pom.xml b/opendaylight/md-sal/mdsal-it-base/pom.xml
new file mode 100644 (file)
index 0000000..50d054f
--- /dev/null
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: --><!--
+Copyright (c) 2014 Cisco Systems, 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
+-->
+<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">
+
+  <parent>
+    <groupId>org.opendaylight.controller</groupId>
+    <artifactId>config-parent</artifactId>
+    <version>0.4.0-SNAPSHOT</version>
+    <relativePath/>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>mdsal-it-base</artifactId>
+  <version>1.3.0-SNAPSHOT</version>
+  <packaging>bundle</packaging>
+  <properties>
+    <config.version>0.4.0-SNAPSHOT</config.version>
+  </properties>
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>${project.groupId}</groupId>
+        <artifactId>mdsal-artifacts</artifactId>
+        <version>${project.version}</version>
+        <type>pom</type>
+        <scope>import</scope>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+  <dependencies>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>config-it-base</artifactId>
+      <version>${config.version}</version>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>sal-binding-api</artifactId>
+    </dependency>
+        <!-- Dependencies for pax exam karaf container -->
+    <dependency>
+        <groupId>org.ops4j.pax.exam</groupId>
+        <artifactId>pax-exam-container-karaf</artifactId>
+        <scope>compile</scope>
+    </dependency>
+    <dependency>
+        <groupId>org.ops4j.pax.exam</groupId>
+        <artifactId>pax-exam-junit4</artifactId>
+        <scope>compile</scope>
+    </dependency>
+    <dependency>
+        <groupId>org.ops4j.pax.exam</groupId>
+        <artifactId>pax-exam</artifactId>
+        <scope>compile</scope>
+    </dependency>
+    <dependency>
+        <groupId>org.ops4j.pax.url</groupId>
+        <artifactId>pax-url-aether</artifactId>
+        <scope>compile</scope>
+    </dependency>
+    <dependency>
+        <groupId>javax.inject</groupId>
+        <artifactId>javax.inject</artifactId>
+        <version>1</version>
+        <scope>compile</scope>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.karaf.features</groupId>
+        <artifactId>org.apache.karaf.features.core</artifactId>
+        <version>${karaf.version}</version>
+        <scope>compile</scope>
+    </dependency>
+    <dependency>
+        <groupId>org.osgi</groupId>
+        <artifactId>org.osgi.core</artifactId>
+        <scope>compile</scope>
+    </dependency>
+    <dependency>
+        <groupId>junit</groupId>
+        <artifactId>junit</artifactId>
+        <scope>compile</scope>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.karaf.tooling</groupId>
+        <artifactId>karaf-maven-plugin</artifactId>
+        <version>${karaf.version}</version>
+    </dependency>
+  </dependencies>
+</project>
diff --git a/opendaylight/md-sal/mdsal-it-base/src/main/java/org/opendaylight/controller/mdsal/it/base/AbstractMdsalTestBase.java b/opendaylight/md-sal/mdsal-it-base/src/main/java/org/opendaylight/controller/mdsal/it/base/AbstractMdsalTestBase.java
new file mode 100644 (file)
index 0000000..34728a9
--- /dev/null
@@ -0,0 +1,75 @@
+package org.opendaylight.controller.mdsal.it.base;
+
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
+import static org.ops4j.pax.exam.CoreOptions.composite;
+
+import java.util.Calendar;
+
+import javax.inject.Inject;
+
+import org.junit.Before;
+import org.opendaylight.controller.config.it.base.AbstractConfigTestBase;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
+import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.karaf.options.LogLevelOption.LogLevel;
+import org.ops4j.pax.exam.util.Filter;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public abstract class AbstractMdsalTestBase extends AbstractConfigTestBase implements BindingAwareProvider {
+
+    private static final Logger LOG = LoggerFactory.getLogger(AbstractMdsalTestBase.class);
+    private static final int REGISTRATION_TIMEOUT = 70000;
+    @Inject @Filter(timeout=60000)
+    private BundleContext context;
+    private ProviderContext session = null;
+
+    public ProviderContext getSession() {
+        return session;
+    }
+
+    @Override
+    public void onSessionInitiated(ProviderContext session) {
+        LOG.info("Session Initiated: {}",session);
+        this.session = session;
+    }
+
+    @Override
+    @Before
+    public void setup() throws Exception {
+        super.setup();
+        Calendar start = Calendar.getInstance();
+        ServiceReference<BindingAwareBroker> serviceReference = context.getServiceReference(BindingAwareBroker.class);
+        if(serviceReference == null) {
+            throw new RuntimeException("BindingAwareBroker not found");
+        }
+        BindingAwareBroker broker = context.getService(serviceReference);
+        broker.registerProvider(this);
+        for(int i=0;i<REGISTRATION_TIMEOUT;i++) {
+            if(session !=null) {
+                Calendar stop = Calendar.getInstance();
+                LOG.info("Registered session {} with the MD-SAL after {} ms",
+                        session,
+                        stop.getTimeInMillis() - start.getTimeInMillis());
+                return;
+            } else {
+                Thread.sleep(1);
+            }
+        }
+        throw new RuntimeException("Session not initiated after " + REGISTRATION_TIMEOUT + " ms");
+    }
+
+    @Override
+    public Option getLoggingOption() {
+        Option option = editConfigurationFilePut(ORG_OPS4J_PAX_LOGGING_CFG,
+                        logConfiguration(AbstractMdsalTestBase.class),
+                        LogLevel.INFO.name());
+        option = composite(option, super.getLoggingOption());
+        return option;
+    }
+
+}
diff --git a/opendaylight/md-sal/mdsal-it-parent/pom.xml b/opendaylight/md-sal/mdsal-it-parent/pom.xml
new file mode 100644 (file)
index 0000000..1273077
--- /dev/null
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: --><!--
+Copyright (c) 2014 Cisco Systems, 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
+-->
+<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">
+
+  <parent>
+    <groupId>org.opendaylight.controller</groupId>
+    <artifactId>config-parent</artifactId>
+    <version>0.4.0-SNAPSHOT</version>
+    <relativePath/>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>mdsal-it-parent</artifactId>
+  <version>1.3.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+  <properties>
+    <karaf.distro.groupId>org.opendaylight.controller</karaf.distro.groupId>
+    <karaf.distro.artifactId>opendaylight-karaf-empty</karaf.distro.artifactId>
+    <karaf.distro.version>1.6.0-SNAPSHOT</karaf.distro.version>
+    <karaf.distro.type>zip</karaf.distro.type>
+    <karaf.keep.unpack>false</karaf.keep.unpack>
+  </properties>
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>org.opendaylight.controller</groupId>
+        <artifactId>mdsal-artifacts</artifactId>
+        <version>${mdsal.version}</version>
+        <type>pom</type>
+        <scope>import</scope>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>mdsal-it-base</artifactId>
+      <version>${mdsal.version}</version>
+    </dependency>
+
+    <!-- Dependencies for pax exam karaf container -->
+    <dependency>
+        <groupId>org.ops4j.pax.exam</groupId>
+        <artifactId>pax-exam-container-karaf</artifactId>
+    </dependency>
+    <dependency>
+        <groupId>org.ops4j.pax.exam</groupId>
+        <artifactId>pax-exam-junit4</artifactId>
+    </dependency>
+    <dependency>
+        <groupId>org.ops4j.pax.exam</groupId>
+        <artifactId>pax-exam</artifactId>
+    </dependency>
+    <dependency>
+        <groupId>org.ops4j.pax.url</groupId>
+        <artifactId>pax-url-aether</artifactId>
+    </dependency>
+    <dependency>
+        <groupId>javax.inject</groupId>
+        <artifactId>javax.inject</artifactId>
+        <version>1</version>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.karaf.features</groupId>
+        <artifactId>org.apache.karaf.features.core</artifactId>
+        <version>${karaf.version}</version>
+    </dependency>
+    <dependency>
+        <groupId>org.osgi</groupId>
+        <artifactId>org.osgi.core</artifactId>
+    </dependency>
+    <dependency>
+        <groupId>junit</groupId>
+        <artifactId>junit</artifactId>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.karaf.tooling</groupId>
+        <artifactId>karaf-maven-plugin</artifactId>
+        <version>${karaf.version}</version>
+    </dependency>
+
+    <!-- Testing Dependencies -->
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-all</artifactId>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-failsafe-plugin</artifactId>
+        <executions>
+          <execution>
+            <goals>
+              <goal>integration-test</goal>
+              <goal>verify</goal>
+            </goals>
+            <configuration>
+              <systemProperties>
+                <property>
+                 <name>karaf.distro.groupId</name>
+                 <value>${karaf.distro.groupId}</value>
+                </property>
+                <property>
+                 <name>karaf.distro.artifactId</name>
+                 <value>${karaf.distro.artifactId}</value>
+                </property>
+                <property>
+                 <name>karaf.distro.version</name>
+                 <value>${karaf.distro.version}</value>
+                </property>
+                <property>
+                 <name>karaf.distro.type</name>
+                 <value>${karaf.distro.type}</value>
+                </property>
+                <property>
+                 <name>karaf.keep.unpack</name>
+                 <value>${karaf.keep.unpack}</value>
+                </property>
+              </systemProperties>
+              <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <!-- Needed if you use versionAsInProject() -->
+      <plugin>
+          <groupId>org.apache.servicemix.tooling</groupId>
+          <artifactId>depends-maven-plugin</artifactId>
+          <executions>
+              <execution>
+                  <id>generate-depends-file</id>
+                  <goals>
+                      <goal>generate-depends-file</goal>
+                  </goals>
+              </execution>
+          </executions>
+      </plugin>
+
+      <!-- Copy the Base Test classes into test-classes so they can become available in the karaf container -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <executions>
+          <execution>
+           <id>unpack-karaf-resources</id>
+           <goals>
+            <goal>unpack-dependencies</goal>
+           </goals>
+           <phase>process-test-resources</phase>
+           <configuration>
+            <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
+            <groupId>org.opendaylight.controller</groupId>
+            <includeArtifactIds>config-it-base,mdsal-it-base</includeArtifactIds>
+            <excludes>META-INF\/**</excludes>
+            <ignorePermissions>false</ignorePermissions>
+           </configuration>
+          </execution>
+         </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>
index 9834008..2a363ba 100644 (file)
     <!-- PAX EXAM ITs -->
     <module>sal-binding-it</module>
     <module>sal-binding-dom-it</module>
+
+    <!-- IT Base and Parent -->
+    <module>mdsal-it-base</module>
+    <module>mdsal-it-parent</module>
+
   </modules>
 
   <build>

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.