.metadata
opendaylight/md-sal/sal-distributed-datastore/journal
!opendaylight/distribution/opendaylight-karaf-resources/src/main/resources/bin
-.checkstyle
+
+
<properties>
<branding.version>1.1.1-SNAPSHOT</branding.version>
<karaf.resources.version>1.5.1-SNAPSHOT</karaf.resources.version>
- <odlparent.karaf.plugin.version>1.5.1-SNAPSHOT</odlparent.karaf.plugin.version>
<karaf.localFeature>standard</karaf.localFeature>
<!-- Karaf Maven plugin 3.023 reinstalls already installed
boot features to container, which could be observed
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</execution>
+ <execution>
+ <id>copy-dependencies</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${project.build.directory}/assembly/system</outputDirectory>
+ <excludeArtifactIds>distribution.vtn-coordinator</excludeArtifactIds>
+ <overWriteReleases>false</overWriteReleases>
+ <overWriteSnapshots>true</overWriteSnapshots>
+ <overWriteIfNewer>true</overWriteIfNewer>
+ <useRepositoryLayout>true</useRepositoryLayout>
+ <addParentPoms>true</addParentPoms>
+ <copyPom>true</copyPom>
+ </configuration>
+ </execution>
</executions>
</plugin>
<plugin>
</execution>
</executions>
</plugin>
- <plugin>
- <groupId>org.opendaylight.odlparent</groupId>
- <artifactId>karaf-plugin</artifactId>
- <version>${odlparent.karaf.plugin.version}</version>
- <executions>
- <execution>
- <id>populate-local-repo</id>
- <goals>
- <goal>populate-local-repo</goal>
- </goals>
- <configuration>
- <localRepo>${project.build.directory}/assembly/system</localRepo>
- </configuration>
- </execution>
- </executions>
- </plugin>
</plugins>
</pluginManagement>
<plugins>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
</plugin>
- <plugin>
- <groupId>org.opendaylight.odlparent</groupId>
- <artifactId>karaf-plugin</artifactId>
- <version>${odlparent.karaf.plugin.version}</version>
- </plugin>
</plugins>
</build>
<include>pom.xml</include>
</includes>
</fileSet>
-
- <!-- it -->
- <fileSet filtered="true" encoding="UTF-8">
- <directory>it</directory>
- <includes>
- <include>pom.xml</include>
- </includes>
- </fileSet>
- <fileSet filtered="true" encoding="UTF-8">
- <directory>it/src/test/java</directory>
- <includes>
- <include>**/*.java</include>
- </includes>
- </fileSet>
</fileSets>
</archetype-descriptor>
<properties>
<mdsal.version>1.2.1-SNAPSHOT</mdsal.version>
<yangtools.version>0.7.1-SNAPSHOT</yangtools.version>
- <dlux.version>0.2.1-SNAPSHOT</dlux.version>
<configfile.directory>etc/opendaylight/karaf</configfile.directory>
</properties>
<dependencyManagement>
<type>xml</type>
<scope>runtime</scope>
</dependency>
- <dependency>
- <groupId>org.opendaylight.dlux</groupId>
- <artifactId>features-dlux</artifactId>
- <classifier>features</classifier>
- <version>${dlux.version}</version>
- <type>xml</type>
- <scope>runtime</scope>
- </dependency>
<dependency>
<groupId>${symbol_dollar}{project.groupId}</groupId>
<artifactId>${artifactId}-impl</artifactId>
<repository>mvn:org.opendaylight.yangtools/features-yangtools/${symbol_dollar}{yangtools.version}/xml/features</repository>
<repository>mvn:org.opendaylight.controller/features-mdsal/${symbol_dollar}{mdsal.version}/xml/features</repository>
<repository>mvn:org.opendaylight.controller/features-restconf/${symbol_dollar}{mdsal.version}/xml/features</repository>
- <repository>mvn:org.opendaylight.dlux/features-dlux/${symbol_dollar}{dlux.version}/xml/features</repository>
<feature name='odl-${artifactId}-api' version='${symbol_dollar}{project.version}' description='OpenDaylight :: ${artifactId} :: api'>
<feature version='${symbol_dollar}{yangtools.version}'>odl-yangtools-models</feature>
<bundle>mvn:${groupId}/${artifactId}-api/${symbol_dollar}{project.version}</bundle>
<feature version="${symbol_dollar}{project.version}">odl-${artifactId}-rest</feature>
<feature version="${symbol_dollar}{mdsal.version}">odl-mdsal-apidocs</feature>
<feature version="${symbol_dollar}{mdsal.version}">odl-mdsal-xsql</feature>
- <feature version="${symbol_dollar}{dlux.version}">odl-dlux-yangui</feature>
</feature>
</features>
--- /dev/null
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+#set( $provider = "${classPrefix}Provider" )
+/*
+ * ${copyright} 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
+ */
+package ${package}.impl;
+
+import org.junit.Test;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
+
+import static org.mockito.Mockito.mock;
+
+public class ${classPrefix}ProviderTest {
+ @Test
+ public void testOnSessionInitiated() {
+ ${provider} provider = new ${provider}();
+
+ // ensure no exceptions
+ // currently this method is empty
+ provider.onSessionInitiated(mock(BindingAwareBroker.ProviderContext.class));
+ }
+
+ @Test
+ public void testClose() throws Exception {
+ ${provider} provider = new ${provider}();
+
+ // ensure no exceptions
+ // currently this method is empty
+ provider.close();
+ }
+}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-${copyright} 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>mdsal-it-parent</artifactId>
- <version>1.2.1-SNAPSHOT</version>
- <relativePath/>
- </parent>
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>${groupId}</groupId>
- <artifactId>${artifactId}-it</artifactId>
- <version>${version}</version>
- <packaging>bundle</packaging>
-
- <properties>
- <skipITs>false</skipITs>
- <karaf.distro.groupId>org.opendaylight.${artifactId}</karaf.distro.groupId>
- <karaf.distro.artifactId>${artifactId}-karaf</karaf.distro.artifactId>
- <karaf.distro.version>${version}</karaf.distro.version>
- <karaf.distro.type>zip</karaf.distro.type>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>${artifactId}-features</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
-</project>
\ No newline at end of file
+++ /dev/null
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * ${copyright} 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
- */
-package ${package}.it;
-
-import static org.ops4j.pax.exam.CoreOptions.composite;
-import static org.ops4j.pax.exam.CoreOptions.maven;
-import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
-
-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.Option;
-import org.ops4j.pax.exam.junit.PaxExam;
-import org.ops4j.pax.exam.karaf.options.LogLevelOption.LogLevel;
-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)
-@ExamReactorStrategy(PerClass.class)
-public class ${classPrefix}IT extends AbstractMdsalTestBase {
- private static final Logger LOG = LoggerFactory.getLogger(${classPrefix}IT.class);
-
- @Override
- public String getModuleName() {
- return "${artifactId}";
- }
-
- @Override
- public String getInstanceName() {
- return "${artifactId}-default";
- }
-
- @Override
- public MavenUrlReference getFeatureRepo() {
- return maven()
- .groupId("${groupId}")
- .artifactId("${artifactId}-features")
- .classifier("features")
- .type("xml")
- .versionAsInProject();
- }
-
- @Override
- public String getFeatureName() {
- return "odl-${artifactId}-ui";
- }
-
- @Override
- public Option getLoggingOption() {
- Option option = editConfigurationFilePut(ORG_OPS4J_PAX_LOGGING_CFG,
- logConfiguration(${classPrefix}IT.class),
- LogLevel.INFO.name());
- option = composite(option, super.getLoggingOption());
- return option;
- }
-
- @Test
- public void test${artifactId}FeatureLoad() {
- Assert.assertTrue(true);
- }
-}
<skip>true</skip>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-install-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
</plugins>
</build>
</project>
<module>karaf</module>
<module>features</module>
<module>artifacts</module>
- <module>it</module>
</modules>
<!-- DO NOT install or deploy the repo root pom as it's only needed to initiate a build -->
<build>
+++ /dev/null
-<?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.3.1-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>
+++ /dev/null
-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);
- }
- };
-
-}
<module>config-artifacts</module>
<module>config-parent</module>
- <module>config-it-base</module>
</modules>
<dependencies>
+++ /dev/null
-<?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.3.1-SNAPSHOT</version>
- <relativePath/>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>mdsal-it-base</artifactId>
- <version>1.2.1-SNAPSHOT</version>
- <packaging>bundle</packaging>
- <properties>
- <config.version>0.3.1-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>
+++ /dev/null
-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;
- }
-
-}
+++ /dev/null
-<?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.3.1-SNAPSHOT</version>
- <relativePath/>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>mdsal-it-parent</artifactId>
- <version>1.2.1-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>
<module>messagebus-spi</module>
<module>messagebus-impl</module>
<module>messagebus-config</module>
-
- <!-- 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>