--- /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.controller</groupId>
+ <artifactId>commons.opendaylight</artifactId>
+ <version>1.4.1-SNAPSHOT</version>
+ <relativePath>../../commons/opendaylight</relativePath>
+ </parent>
+ <scm>
+ <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
+ <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main</url>
+ <tag>HEAD</tag>
+ </scm>
+
+ <artifactId>sanitytest</artifactId>
+ <version>0.4.1-SNAPSHOT</version>
+ <packaging>bundle</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <version>${bundle.plugin.version}</version>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Export-Package>
+ org.opendaylight.controller.sanitytest
+ </Export-Package>
+ <Import-Package>
+ javax.xml.bind.annotation,
+ org.osgi.service.component,
+ org.slf4j,
+ org.eclipse.osgi.framework.console,
+ org.osgi.framework,
+ org.eclipse.osgi.baseadaptor,
+ org.eclipse.osgi.framework.adaptor
+ </Import-Package>
+ <Bundle-Activator>
+ org.opendaylight.controller.sanitytest.internal.Activator
+ </Bundle-Activator>
+ </instructions>
+ <manifestLocation>${project.basedir}/META-INF</manifestLocation>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
--- /dev/null
+package org.opendaylight.controller.sanitytest.internal;
+
+import org.osgi.framework.*;
+
+import java.util.Timer;
+import java.util.TimerTask;
+
+public class Activator implements BundleActivator {
+ //30 Second
+ private static final int DELAY = 30000;
+
+
+ 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";
+ }
+ }
+
+ public void start(final BundleContext bundleContext) throws Exception {
+ Timer monitorTimer = new Timer("monitor timer", true);
+
+ monitorTimer.schedule(new TimerTask() {
+ @Override
+ public void run() {
+ boolean failed = false;
+ for(Bundle bundle : bundleContext.getBundles()){
+ if(bundle.getState() != Bundle.ACTIVE && bundle.getState() != Bundle.RESOLVED) {
+ System.out.println("Failed to activate/resolve bundle = " + bundle.getSymbolicName() + " state = " + stateToString(bundle.getState()));
+ failed = true;
+ }
+ }
+
+ if(failed){
+ System.exit(-1);
+ } else {
+ System.exit(0);
+ }
+ }
+ }, DELAY);
+ }
+
+ public void stop(BundleContext bundleContext) throws Exception {
+
+ }
+}