Disable the original TestHelper and use the new MDSAL-it-base classes 14/36414/8
authorKevin Wang <kwang@brocade.com>
Wed, 16 Mar 2016 22:47:47 +0000 (15:47 -0700)
committerMilos Fabian <milfabia@cisco.com>
Mon, 4 Apr 2016 11:22:41 +0000 (11:22 +0000)
Change-Id: Ic2e626a2bc56b2cda0e776fc42d1b8bbbe88b6ed
Signed-off-by: Kevin Wang <kevixw@gmail.com>
integration-tests/pom.xml
integration-tests/src/test/java/org/opendaylight/protocol/integration/pcep/AbstractPcepOsgiTest.java
integration-tests/src/test/java/org/opendaylight/protocol/integration/pcep/PcepRpcServicesRoutingTest.java

index 4a757c0bd64d2dfe6aaf7871ed54a08f76aaafa8..524f3ea78f6022ce860507fac32532571aabf8fa 100644 (file)
  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">
+<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>
-    <scm>
-        <connection>scm:git:ssh://git.opendaylight.org:29418/bgpcep.git</connection>
-        <developerConnection>scm:git:ssh://git.opendaylight.org:29418/bgpcep.git</developerConnection>
-        <url>https://wiki.opendaylight.org/view/BGP_LS_PCEP:Main</url>
-        <tag>HEAD</tag>
-    </scm>
     <parent>
-        <groupId>org.opendaylight.bgpcep</groupId>
-        <artifactId>bgpcep-parent</artifactId>
-        <version>0.6.0-SNAPSHOT</version>
-        <relativePath>../parent</relativePath>
+        <groupId>org.opendaylight.controller</groupId>
+        <artifactId>mdsal-it-parent</artifactId>
+        <version>1.4.0-SNAPSHOT</version>
+        <relativePath/>
     </parent>
 
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>org.opendaylight.bgpcep</groupId>
+    <version>0.6.0-SNAPSHOT</version>
     <artifactId>integration-tests</artifactId>
     <description>BGPCEP integration tests</description>
-    <packaging>jar</packaging>
+    <packaging>bundle</packaging>
     <name>${project.artifactId}</name>
     <prerequisites>
         <maven>3.0.4</maven>
     </prerequisites>
 
     <properties>
-        <moxy.controller.version>2.5.0</moxy.controller.version>
+        <skipITs>false</skipITs>
+        <karaf.distro.groupId>org.opendaylight.bgpcep</karaf.distro.groupId>
+        <karaf.distro.artifactId>bgpcep-karaf</karaf.distro.artifactId>
+        <karaf.distro.version>${project.version}</karaf.distro.version>
+        <karaf.distro.type>zip</karaf.distro.type>
     </properties>
 
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.ops4j.pax.exam</groupId>
-                <artifactId>maven-paxexam-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>generate-config</id>
-                        <goals>
-                            <goal>generate-depends-file</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-
-        <!--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>
-                <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 />
-                                </action>
-                            </pluginExecution>
-                        </pluginExecutions>
-                    </lifecycleMappingMetadata>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-
     <dependencies>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>logback-config</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>config-manager</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.netconf</groupId>
-            <artifactId>config-netconf-connector</artifactId>
-            <version>${netconf.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>yang-jmx-generator</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.netconf</groupId>
-            <artifactId>netconf-monitoring</artifactId>
-            <version>${netconf.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.netconf</groupId>
-            <artifactId>netconf-impl</artifactId>
-            <version>${netconf.version}</version>
-            <scope>test</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.opendaylight.netconf</groupId>
-            <artifactId>ietf-netconf-monitoring</artifactId>
-            <version>${netconf.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>config-persister-impl</artifactId>
-            <version>${controller.config.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>config-persister-file-xml-adapter</artifactId>
-            <scope>test</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.mdsal</groupId>
-            <artifactId>mdsal-binding-api</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>pcep-topology-api</artifactId>
-            <version>${project.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>pcep-tunnel-api</artifactId>
-            <version>${project.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>pcep-api</artifactId>
-            <version>${project.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>programming-topology-api</artifactId>
-            <version>${project.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>bgp-parser-mock</artifactId>
-            <version>${project.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>bgp-rib-mock</artifactId>
-            <version>${project.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>bgp-testtool</artifactId>
-            <version>${project.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>bgp-util</artifactId>
-            <version>${project.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>pcep-testtool</artifactId>
-            <version>${project.version}</version>
-            <scope>test</scope>
-        </dependency>
-
+        <!-- claims all the dependency features in case we want to test them -->
         <dependency>
             <groupId>${project.groupId}</groupId>
-            <artifactId>programming-api</artifactId>
+            <artifactId>features-bgp</artifactId>
             <version>${project.version}</version>
-            <scope>test</scope>
+            <classifier>features</classifier>
+            <type>xml</type>
         </dependency>
         <dependency>
             <groupId>${project.groupId}</groupId>
-            <artifactId>programming-tunnel-api</artifactId>
+            <artifactId>features-pcep</artifactId>
             <version>${project.version}</version>
-            <scope>test</scope>
+            <classifier>features</classifier>
+            <type>xml</type>
         </dependency>
         <dependency>
             <groupId>${project.groupId}</groupId>
-            <artifactId>topology-api</artifactId>
+            <artifactId>features-bmp</artifactId>
             <version>${project.version}</version>
-            <scope>test</scope>
+            <classifier>features</classifier>
+            <type>xml</type>
         </dependency>
         <dependency>
             <groupId>${project.groupId}</groupId>
-            <artifactId>topology-segment-routing</artifactId>
+            <artifactId>features-rsvp</artifactId>
             <version>${project.version}</version>
-            <scope>test</scope>
+            <classifier>features</classifier>
+            <type>xml</type>
         </dependency>
         <dependency>
             <groupId>${project.groupId}</groupId>
-            <artifactId>topology-tunnel-api</artifactId>
+            <artifactId>features-extras</artifactId>
             <version>${project.version}</version>
-            <scope>test</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>sal-binding-broker-impl</artifactId>
-            <exclusions>
-                <exclusion>
-                    <groupId>xml-apis</groupId>
-                    <artifactId>xml-apis</artifactId>
-                </exclusion>
-            </exclusions>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.mdsal</groupId>
-            <artifactId>mdsal-binding-util</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>sal-broker-impl</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.yangtools</groupId>
-            <artifactId>concepts</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.mdsal</groupId>
-            <artifactId>yang-binding</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.yangtools</groupId>
-            <artifactId>yang-common</artifactId>
-            <scope>test</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>com.google.guava</groupId>
-            <artifactId>guava</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.ops4j.pax.exam</groupId>
-            <artifactId>pax-exam-container-native</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.ops4j.pax.exam</groupId>
-            <artifactId>pax-exam-junit4</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.ops4j.pax.exam</groupId>
-            <artifactId>pax-exam</artifactId>
-            <version>${exam.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.ops4j.pax.exam</groupId>
-            <artifactId>pax-exam-spi</artifactId>
-            <version>${exam.version}</version>
-            <scope>test</scope>
+            <classifier>features</classifier>
+            <type>xml</type>
         </dependency>
-        <dependency>
-            <groupId>org.ops4j.pax.exam</groupId>
-            <artifactId>pax-exam-link-mvn</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.ops4j.pax.url</groupId>
-            <artifactId>pax-url-aether</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.eclipse.tycho</groupId>
-            <artifactId>org.eclipse.osgi</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <!--
-        <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.framework</artifactId>
-            <version>4.2.1</version>
-            <scope>test</scope>
-        </dependency>
-        -->
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.yangtools</groupId>
-            <artifactId>mockito-configuration</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>sal-binding-it</artifactId>
-            <scope>test</scope>
-        </dependency>
-
-        <dependency>
-          <groupId>org.opendaylight.netconf</groupId>
-          <artifactId>netconf-client</artifactId>
-            <version>${netconf.version}</version>
-          <scope>test</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>sal-binding-broker-impl</artifactId>
-            <scope>test</scope>
-            <type>test-jar</type>
-        </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.mdsal.model</groupId>
-            <artifactId>ietf-topology</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.core</artifactId>
-            <scope>test</scope>
-        </dependency>
-
     </dependencies>
 
-  <!--
-      Maven Site Configuration
-
-      The following configuration is necessary for maven-site-plugin to
-      correctly identify the correct deployment path for OpenDaylight Maven
-      sites.
-  -->
-  <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>
-
-  <distributionManagement>
-    <site>
-      <id>opendaylight-site</id>
-      <url>${nexus.site.url}/${project.artifactId}/</url>
-    </site>
-  </distributionManagement>
+    <!--
+        Maven Site Configuration
+
+        The following configuration is necessary for maven-site-plugin to
+        correctly identify the correct deployment path for OpenDaylight Maven
+        sites.
+    -->
+    <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>
+
+    <distributionManagement>
+        <site>
+            <id>opendaylight-site</id>
+            <url>${nexus.site.url}/${project.artifactId}/</url>
+        </site>
+    </distributionManagement>
 </project>
index d6ab0252047c53a914a2bddd002d12ea9318fef9..4b3fc6d864f09b120ea323615616930d837b5b9a 100644 (file)
@@ -7,95 +7,60 @@
  */
 package org.opendaylight.protocol.integration.pcep;
 
-import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
-import static org.ops4j.pax.exam.CoreOptions.options;
-import static org.ops4j.pax.exam.CoreOptions.systemPackages;
-import static org.ops4j.pax.exam.CoreOptions.systemProperty;
+import static org.ops4j.pax.exam.CoreOptions.maven;
 import javax.inject.Inject;
+import org.opendaylight.controller.mdsal.it.base.AbstractMdsalTestBase;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
 import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
-import org.opendaylight.controller.test.sal.binding.it.TestHelper;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey;
-import org.ops4j.pax.exam.Configuration;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.options.DefaultCompositeOption;
+import org.ops4j.pax.exam.options.MavenUrlReference;
 import org.ops4j.pax.exam.util.Filter;
 import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+public class AbstractPcepOsgiTest extends AbstractMdsalTestBase {
 
-//FIXME: merge with org.opendaylight.controller.test.sal.binding.it.AbstractTest ?
-public class AbstractPcepOsgiTest {
-    @Inject
-    @Filter(timeout = 120 * 1000)
-    BindingAwareBroker broker;
     @Inject
+    @Filter(timeout = 60 * 1000)
     BundleContext bundleContext;
+    BindingAwareBroker broker = null;
 
     public BindingAwareBroker getBroker() {
+        if (broker == null) {
+            ServiceReference<BindingAwareBroker> serviceReference = bundleContext.getServiceReference(BindingAwareBroker.class);
+            if (serviceReference == null) {
+                throw new RuntimeException("BindingAwareBroker not found");
+            }
+            broker = bundleContext.getService(serviceReference);
+        }
         return this.broker;
     }
 
-    public void setBroker(final BindingAwareBroker broker) {
-        this.broker = broker;
+    @Override
+    public String getModuleName() {
+        return "pcep-topology-provider";
     }
 
-    public BundleContext getBundleContext() {
-        return this.bundleContext;
+    @Override
+    public String getInstanceName() {
+        return "pcep-topology";
     }
 
-    public void setBundleContext(final BundleContext bundleContext) {
-        this.bundleContext = bundleContext;
+    @Override
+    public MavenUrlReference getFeatureRepo() {
+        return maven().groupId("org.opendaylight.bgpcep").artifactId("features-pcep")
+                .classifier("features").type("xml").versionAsInProject();
     }
 
-    @Configuration
-    public Option[] config() {
-        return options(
-                // TestHelper.getLoggingBundles(), //
-
-                pcepModules(), //
-                systemProperty("osgi.bundles.defaultStartLevel").value("4"),
-                systemProperty("pax.exam.osgi.unresolved.fail").value("true"),
-                systemPackages("sun.nio.ch"),
-
-                mavenBundle("org.slf4j", "slf4j-api").versionAsInProject(), //
-                mavenBundle("org.slf4j", "log4j-over-slf4j").versionAsInProject(), //
-                mavenBundle("ch.qos.logback", "logback-core").versionAsInProject(), //
-                mavenBundle("ch.qos.logback", "logback-classic").versionAsInProject(),
-                mavenBundle("openexi", "nagasena").versionAsInProject(),
-                mavenBundle("com.github.romix", "java-concurrent-hash-trie-map").versionAsInProject(),
-
-                TestHelper.mdSalCoreBundles(),
-
-                TestHelper.bindingAwareSalBundles(), TestHelper.configMinumumBundles(), TestHelper.baseModelBundles(),
-                TestHelper.junitAndMockitoBundles(), TestHelper.protocolFrameworkBundles());
+    @Override
+    public String getFeatureName() {
+        return "odl-bgpcep-pcep-all";
     }
 
-    private Option pcepModules() {
-        return new DefaultCompositeOption(
-                mavenBundle("org.opendaylight.mdsal.model", "ietf-topology").versionAsInProject(), //
-                mavenBundle("org.opendaylight.yangtools", "object-cache-api").versionAsInProject(), //
-                mavenBundle("org.opendaylight.bgpcep", "pcep-topology-api").versionAsInProject(), //
-                mavenBundle("org.opendaylight.bgpcep", "pcep-tunnel-api").versionAsInProject(), //
-                mavenBundle("org.opendaylight.bgpcep", "pcep-api").versionAsInProject(), //
-                mavenBundle("org.opendaylight.bgpcep", "pcep-impl").versionAsInProject(), //
-                mavenBundle("org.opendaylight.bgpcep", "pcep-spi").versionAsInProject(), //
-                mavenBundle("org.opendaylight.bgpcep", "pcep-ietf-stateful07").versionAsInProject(), //
-                mavenBundle("org.opendaylight.tcpmd5", "tcpmd5-api").versionAsInProject(), //
-                mavenBundle("org.opendaylight.tcpmd5", "tcpmd5-netty").versionAsInProject(), //
-                mavenBundle("org.opendaylight.bgpcep", "topology-api").versionAsInProject(), //
-                mavenBundle("org.opendaylight.bgpcep", "topology-tunnel-api").versionAsInProject(), //
-                mavenBundle("org.opendaylight.bgpcep", "programming-topology-api").versionAsInProject(), //
-                mavenBundle("org.opendaylight.bgpcep", "programming-tunnel-api").versionAsInProject(), //
-                mavenBundle("org.opendaylight.bgpcep", "concepts").versionAsInProject(), //
-                mavenBundle("org.opendaylight.bgpcep", "util").versionAsInProject(), //
-                mavenBundle("org.opendaylight.bgpcep", "rsvp-api").versionAsInProject(), //
-                mavenBundle("org.opendaylight.bgpcep", "programming-api").versionAsInProject());
+    TopologyKey getTopologyId(final String id) {
+        return new TopologyKey(new org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId(id));
     }
 
     abstract class AbstractTestProvider implements BindingAwareProvider {
-
-    }
-
-    TopologyKey getTopologyId(final String id) {
-        return new TopologyKey(new org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId(id));
     }
 }
index 84d57e729dfae85614a0d913e197f28f53ce989e..214788b726b1fe4068442cfe3ad6f42df436b850 100644 (file)
@@ -14,7 +14,10 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.verifyZeroInteractions;
 import static org.mockito.Mockito.when;
-
+import static org.ops4j.pax.exam.CoreOptions.frameworkProperty;
+import static org.ops4j.pax.exam.CoreOptions.junitBundles;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+import static org.ops4j.pax.exam.CoreOptions.options;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import java.lang.reflect.Method;
@@ -57,13 +60,63 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
+import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.options.DefaultCompositeOption;
 import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerClass;
 
 @RunWith(PaxExam.class)
-@ExamReactorStrategy(org.ops4j.pax.exam.spi.reactors.PerClass.class)
+@ExamReactorStrategy(PerClass.class)
 public class PcepRpcServicesRoutingTest extends AbstractPcepOsgiTest {
 
+    @Override
+    protected Option[] getAdditionalOptions() {
+        // register option to provide Mockito as a bundle dependency
+        return options(
+                new DefaultCompositeOption(
+                        // Repository required to load harmcrest (OSGi-fied version).
+                        // Mockito
+                        mavenBundle("org.mockito", "mockito-core", "1.10.19"),
+                        mavenBundle("org.objenesis", "objenesis", "2.2"),
+                        junitBundles(),
+
+                /*
+                 * Felix has implicit boot delegation enabled by default. It
+                 * conflicts with Mockito: java.lang.LinkageError: loader
+                 * constraint violation in interface itable initialization: when
+                 * resolving method
+                 * "org.osgi.service.useradmin.User$$EnhancerByMockitoWithCGLIB$$dd2f81dc
+                 * .
+                 * newInstance(Lorg/mockito/cglib/proxy/Callback;)Ljava/lang/Object
+                 * ;" the class loader (instance of
+                 * org/mockito/internal/creation/jmock/SearchingClassLoader) of
+                 * the current class, org/osgi/service/useradmin/
+                 * User$$EnhancerByMockitoWithCGLIB$$dd2f81dc, and the class
+                 * loader (instance of org/apache/felix/framework/
+                 * BundleWiringImpl$BundleClassLoaderJava5) for interface
+                 * org/mockito/cglib/proxy/Factory have different Class objects
+                 * for the type org/mockito/cglib/ proxy/Callback used in the
+                 * signature
+                 *
+                 * So we disable the bootdelegation. this property has no effect
+                 * on the other OSGi implementation.
+                 */
+                        frameworkProperty("felix.bootdelegation.implicit").value("false"))
+        );
+    }
+
+    private static <T> T getInputForRpc(final InstanceIdentifier<Topology> topology, final Class<?> builderClass, final Class<T> builtObjectClass) {
+        try {
+            final Object builderInstance = builderClass.newInstance();
+            final Method method = builderClass.getMethod("setNetworkTopologyRef", NetworkTopologyRef.class);
+            method.invoke(builderInstance, new NetworkTopologyRef(topology));
+            return builtObjectClass.cast(builderClass.getMethod("build").invoke(builderInstance));
+        } catch (final Exception e) {
+            throw new RuntimeException("Unable to create instance from " + builderClass, e);
+        }
+    }
+
     @Test
     public void testRoutedRpcNetworkTopologyPcepService() throws Exception {
         final NetworkTopologyPcepService pcepService1 = mock(NetworkTopologyPcepService.class, "First pcep Service");
@@ -89,7 +142,7 @@ public class PcepRpcServicesRoutingTest extends AbstractPcepOsgiTest {
             }
         };
 
-        broker.registerProvider(provider1, getBundleContext());
+        broker.registerProvider(provider1);
 
         final InstanceIdentifier<Topology> topology2 = InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class,
                 new TopologyKey(getTopologyId("Topo2"))).build();
@@ -105,7 +158,7 @@ public class PcepRpcServicesRoutingTest extends AbstractPcepOsgiTest {
             }
         };
 
-        broker.registerProvider(provider2, getBundleContext());
+        broker.registerProvider(provider2);
 
         final BindingAwareConsumer consumer = new BindingAwareConsumer() {
             @Override
@@ -138,7 +191,7 @@ public class PcepRpcServicesRoutingTest extends AbstractPcepOsgiTest {
 
             private void testTriggerSyncRpce(final NetworkTopologyPcepService consumerPcepService) {
                 TriggerSyncInput triggerInput = getInputForRpc(topology, TriggerSyncInputBuilder.class,
-                    TriggerSyncInput.class);
+                        TriggerSyncInput.class);
                 consumerPcepService.triggerSync(triggerInput);
 
                 verify(pcepService1).triggerSync(triggerInput);
@@ -169,12 +222,11 @@ public class PcepRpcServicesRoutingTest extends AbstractPcepOsgiTest {
                 verify(pcepService2).ensureLspOperational(ensureInput);
             }
         };
-        broker.registerConsumer(consumer, getBundleContext());
+        broker.registerConsumer(consumer);
     }
 
     @SuppressWarnings("unchecked")
     private void initMock(final NetworkTopologyPcepService pcepService) {
-
         @SuppressWarnings("rawtypes")
         final ListenableFuture future = Futures.immediateFuture(RpcResultBuilder.<AddLspOutput>success().build());
         final ListenableFuture futureSyncTrigger = Futures.immediateFuture(RpcResultBuilder.<TriggerSyncOutput>success().build());
@@ -187,17 +239,6 @@ public class PcepRpcServicesRoutingTest extends AbstractPcepOsgiTest {
 
     }
 
-    private static <T> T getInputForRpc(final InstanceIdentifier<Topology> topology, final Class<?> builderClass, final Class<T> builtObjectClass) {
-        try {
-            final Object builderInstance = builderClass.newInstance();
-            final Method method = builderClass.getMethod("setNetworkTopologyRef", NetworkTopologyRef.class);
-            method.invoke(builderInstance, new NetworkTopologyRef(topology));
-            return builtObjectClass.cast(builderClass.getMethod("build").invoke(builderInstance));
-        } catch (final Exception e) {
-            throw new RuntimeException("Unable to create instance from " + builderClass, e);
-        }
-    }
-
     @Test
     public void testRoutedRpcNetworkTopologyPcepProgrammingService() throws Exception {
         final NetworkTopologyPcepProgrammingService pcepService1 = mock(NetworkTopologyPcepProgrammingService.class,
@@ -212,7 +253,6 @@ public class PcepRpcServicesRoutingTest extends AbstractPcepOsgiTest {
                 new TopologyKey(getTopologyId("Topo1"))).build();
 
         final BindingAwareProvider provider1 = new AbstractTestProvider() {
-
             @Override
             public void onSessionInitiated(final BindingAwareBroker.ProviderContext session) {
                 assertNotNull(session);
@@ -225,13 +265,12 @@ public class PcepRpcServicesRoutingTest extends AbstractPcepOsgiTest {
             }
         };
 
-        broker.registerProvider(provider1, getBundleContext());
+        broker.registerProvider(provider1);
 
         final InstanceIdentifier<Topology> topology2 = InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class,
                 new TopologyKey(getTopologyId("Topo2"))).build();
 
         final BindingAwareProvider provider2 = new AbstractTestProvider() {
-
             @Override
             public void onSessionInitiated(final BindingAwareBroker.ProviderContext session) {
                 assertNotNull(session);
@@ -241,7 +280,7 @@ public class PcepRpcServicesRoutingTest extends AbstractPcepOsgiTest {
             }
         };
 
-        broker.registerProvider(provider2, getBundleContext());
+        broker.registerProvider(provider2);
 
         final BindingAwareConsumer consumer = new BindingAwareConsumer() {
             @Override
@@ -290,15 +329,15 @@ public class PcepRpcServicesRoutingTest extends AbstractPcepOsgiTest {
 
             private void testTriggerSyncRpc(final NetworkTopologyPcepProgrammingService consumerPcepService) {
                 SubmitTriggerSyncInput submitTriggerSyncInput = getInputForRpc(topology,
-                    SubmitTriggerSyncInputBuilder.class,
-                    SubmitTriggerSyncInput.class);
+                        SubmitTriggerSyncInputBuilder.class,
+                        SubmitTriggerSyncInput.class);
                 consumerPcepService.submitTriggerSync(submitTriggerSyncInput);
 
                 verify(pcepService1).submitTriggerSync(submitTriggerSyncInput);
                 verifyZeroInteractions(pcepService2);
 
                 submitTriggerSyncInput = getInputForRpc(topology2, SubmitTriggerSyncInputBuilder.class,
-                    SubmitTriggerSyncInput.class);
+                        SubmitTriggerSyncInput.class);
 
                 consumerPcepService.submitTriggerSync(submitTriggerSyncInput);
 
@@ -306,7 +345,7 @@ public class PcepRpcServicesRoutingTest extends AbstractPcepOsgiTest {
                 verify(pcepService2).submitTriggerSync(submitTriggerSyncInput);
             }
         };
-        broker.registerConsumer(consumer, getBundleContext());
+        broker.registerConsumer(consumer);
     }
 
     @SuppressWarnings("unchecked")
@@ -335,7 +374,6 @@ public class PcepRpcServicesRoutingTest extends AbstractPcepOsgiTest {
                 new TopologyKey(getTopologyId("Topo1"))).build();
 
         final BindingAwareProvider provider1 = new AbstractTestProvider() {
-
             @Override
             public void onSessionInitiated(final BindingAwareBroker.ProviderContext session) {
                 assertNotNull(session);
@@ -348,13 +386,12 @@ public class PcepRpcServicesRoutingTest extends AbstractPcepOsgiTest {
             }
         };
 
-        broker.registerProvider(provider1, getBundleContext());
+        broker.registerProvider(provider1);
 
         final InstanceIdentifier<Topology> topology2 = InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class,
                 new TopologyKey(getTopologyId("Topo2"))).build();
 
         final BindingAwareProvider provider2 = new AbstractTestProvider() {
-
             @Override
             public void onSessionInitiated(final BindingAwareBroker.ProviderContext session) {
                 assertNotNull(session);
@@ -364,7 +401,7 @@ public class PcepRpcServicesRoutingTest extends AbstractPcepOsgiTest {
             }
         };
 
-        broker.registerProvider(provider2, getBundleContext());
+        broker.registerProvider(provider2);
 
         final BindingAwareConsumer consumer = new BindingAwareConsumer() {
             @Override
@@ -381,7 +418,7 @@ public class PcepRpcServicesRoutingTest extends AbstractPcepOsgiTest {
 
             private void testCreateP2pTunnel(final TopologyTunnelPcepProgrammingService consumerPcepService) {
                 PcepCreateP2pTunnelInput addLspInput = getInputForRpc(topology, PcepCreateP2pTunnelInputBuilder.class,
-                    PcepCreateP2pTunnelInput.class);
+                        PcepCreateP2pTunnelInput.class);
                 consumerPcepService.pcepCreateP2pTunnel(addLspInput);
 
                 verify(pcepService1).pcepCreateP2pTunnel(addLspInput);
@@ -411,11 +448,10 @@ public class PcepRpcServicesRoutingTest extends AbstractPcepOsgiTest {
                 verify(pcepService2).pcepDestroyTunnel(addLspInput);
             }
         };
-        broker.registerConsumer(consumer, getBundleContext());
+        broker.registerConsumer(consumer);
     }
 
     private void initMock(final TopologyTunnelPcepProgrammingService pcepService) {
-
         @SuppressWarnings("rawtypes")
         final ListenableFuture future = Futures.immediateFuture(RpcResultBuilder.<AddLspOutput>success().build());
         when(pcepService.pcepCreateP2pTunnel(Mockito.<PcepCreateP2pTunnelInput>any())).thenReturn(future);