--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: -->
+<!-- Copyright (c) 2013 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>
+ <artifactId>yangtools</artifactId>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <version>0.6.2-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>yangtools-it</artifactId>
+
+ <properties>
+ <exam.version>3.0.0</exam.version>
+ </properties>
+
+ <repositories>
+ <repository>
+ <id>thirdparty</id>
+ <name>thirdparty</name>
+ <url>${nexusproxy}/repositories/thirdparty/</url>
+ </repository>
+ </repositories>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.ops4j.pax.exam</groupId>
+ <artifactId>pax-exam-container-native</artifactId>
+ <version>${exam.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <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>equinoxSDK381</groupId>
+ <artifactId>org.eclipse.osgi</artifactId>
+ <version>3.8.1.v20120830-144521</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>1.0.9</version>
+ </dependency>
+ <dependency>
+ <groupId>org.sonatype.plexus</groupId>
+ <artifactId>plexus-build-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-slf4j-logging</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-data-util</artifactId>
+ <version>${project.parent.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>maven-sal-api-gen-plugin</artifactId>
+ <version>${project.parent.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools.thirdparty</groupId>
+ <artifactId>antlr4-runtime-osgi-nohead</artifactId>
+ <version>4.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools.thirdparty</groupId>
+ <artifactId>xtend-lib-osgi</artifactId>
+ <version>2.4.3</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.ops4j.pax.exam</groupId>
+ <artifactId>maven-paxexam-plugin</artifactId>
+ <version>1.2.4</version>
+ <executions>
+ <execution>
+ <id>generate-config</id>
+ <goals>
+ <goal>generate-depends-file</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ <!--This plugin's configuration is used to store Eclipse m2e settings
+ only. It has no influence on the Maven build itself. -->
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>org.ops4j.pax.exam</groupId>
+ <artifactId>
+ maven-paxexam-plugin
+ </artifactId>
+ <versionRange>[1.2.4,)</versionRange>
+ <goals>
+ <goal>generate-depends-file</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore></ignore>
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+</project>
--- /dev/null
+/*
+ * Copyright (c) 2013 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
+ */
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.ops4j.pax.exam.CoreOptions.*;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.inject.Inject;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+
+@RunWith(PaxExam.class)
+public class BundleStartTest {
+ private static final String GROUP = "org.opendaylight.yangtools";
+
+ @Inject
+ BundleContext ctx;
+
+ private List<Option> coreBundles() {
+ List<Option> options = new ArrayList<>();
+
+ options.add(mavenBundle("org.slf4j", "slf4j-api").versionAsInProject());
+ options.add(mavenBundle("ch.qos.logback", "logback-core").versionAsInProject());
+ options.add(mavenBundle("ch.qos.logback", "logback-classic").versionAsInProject());
+ options.add(mavenBundle("com.google.guava", "guava").versionAsInProject());
+ options.add(mavenBundle("org.apache.commons", "commons-lang3").versionAsInProject());
+ options.add(mavenBundle("org.opendaylight.yangtools.thirdparty", "antlr4-runtime-osgi-nohead")
+ .versionAsInProject());
+ options.add(mavenBundle("org.opendaylight.yangtools.thirdparty", "xtend-lib-osgi").versionAsInProject());
+ options.add(mavenBundle("org.sonatype.plexus", "plexus-build-api").versionAsInProject());
+ options.add(mavenBundle("org.codehaus.plexus", "plexus-slf4j-logging").versionAsInProject());
+ options.add(mavenBundle("org.javassist", "javassist").versionAsInProject());
+
+ options.add(mavenBundle(GROUP, "concepts").versionAsInProject());
+ options.add(mavenBundle(GROUP, "yang-binding").versionAsInProject());
+ options.add(mavenBundle(GROUP, "yang-common").versionAsInProject());
+ options.add(mavenBundle(GROUP, "yang-data-api").versionAsInProject());
+ options.add(mavenBundle(GROUP, "yang-data-impl").versionAsInProject());
+ options.add(mavenBundle(GROUP, "yang-data-util").versionAsInProject());
+ options.add(mavenBundle(GROUP, "yang-model-api").versionAsInProject());
+ options.add(mavenBundle(GROUP, "yang-model-util").versionAsInProject());
+ options.add(mavenBundle(GROUP, "yang-parser-api").versionAsInProject());
+ options.add(mavenBundle(GROUP, "yang-parser-impl").versionAsInProject());
+
+ options.add(mavenBundle(GROUP, "binding-generator-api").versionAsInProject());
+ options.add(mavenBundle(GROUP, "binding-generator-impl").versionAsInProject());
+ options.add(mavenBundle(GROUP, "binding-generator-spi").versionAsInProject());
+ options.add(mavenBundle(GROUP, "binding-generator-util").versionAsInProject());
+ options.add(mavenBundle(GROUP, "binding-java-api-generator").versionAsInProject());
+ options.add(mavenBundle(GROUP, "binding-model-api").versionAsInProject());
+ options.add(mavenBundle(GROUP, "binding-type-provider").versionAsInProject());
+ options.add(mavenBundle(GROUP, "maven-sal-api-gen-plugin").versionAsInProject());
+
+ options.add(junitBundles());
+ return options;
+ }
+
+ @Configuration
+ public final Option[] config() {
+ final List<Option> options = coreBundles();
+ return options.toArray(new Option[0]);
+ }
+
+ @Test
+ public void testBundleActivation() throws BundleException {
+ testBundle("yang-binding");
+ testBundle("yang-common");
+ testBundle("yang-data-api");
+ testBundle("yang-data-impl");
+ testBundle("yang-data-util");
+ testBundle("yang-model-api");
+ testBundle("yang-model-util");
+ testBundle("yang-parser-api");
+ testBundle("yang-parser-impl");
+
+ testBundle("binding-generator-api");
+ testBundle("binding-generator-impl");
+ testBundle("binding-generator-spi");
+ testBundle("binding-generator-util");
+ testBundle("binding-model-api");
+ testBundle("binding-java-api-generator");
+ testBundle("binding-type-provider");
+ testBundle("maven-sal-api-gen-plugin");
+ }
+
+ private void testBundle(String name) throws BundleException {
+ Bundle bundle = getBundle(name);
+ assertNotNull("Bundle '" + name + "' not found", bundle);
+ assertEquals("Bundle '" + name + "' is not in ACTIVE state", Bundle.ACTIVE, bundle.getState());
+ }
+
+ private Bundle getBundle(final String name) {
+ final String bn = GROUP + "." + name;
+ for (Bundle b : ctx.getBundles()) {
+ if (bn.equals(b.getSymbolicName())) {
+ return b;
+ }
+ }
+ return null;
+ }
+
+}