2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.protocol.integration.pcep;
10 import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
11 import static org.ops4j.pax.exam.CoreOptions.options;
12 import static org.ops4j.pax.exam.CoreOptions.systemPackages;
13 import static org.ops4j.pax.exam.CoreOptions.systemProperty;
14 import javax.inject.Inject;
15 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
16 import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
17 import org.opendaylight.controller.test.sal.binding.it.TestHelper;
18 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey;
19 import org.ops4j.pax.exam.Configuration;
20 import org.ops4j.pax.exam.Option;
21 import org.ops4j.pax.exam.options.DefaultCompositeOption;
22 import org.ops4j.pax.exam.util.Filter;
23 import org.osgi.framework.BundleContext;
25 //FIXME: merge with org.opendaylight.controller.test.sal.binding.it.AbstractTest ?
26 public class AbstractPcepOsgiTest {
28 @Filter(timeout = 120 * 1000)
29 BindingAwareBroker broker;
31 BundleContext bundleContext;
33 public BindingAwareBroker getBroker() {
37 public void setBroker(final BindingAwareBroker broker) {
41 public BundleContext getBundleContext() {
42 return this.bundleContext;
45 public void setBundleContext(final BundleContext bundleContext) {
46 this.bundleContext = bundleContext;
50 public Option[] config() {
52 // TestHelper.getLoggingBundles(), //
55 systemProperty("osgi.bundles.defaultStartLevel").value("4"),
56 systemProperty("pax.exam.osgi.unresolved.fail").value("true"),
57 systemPackages("sun.nio.ch"),
59 mavenBundle("org.slf4j", "slf4j-api").versionAsInProject(), //
60 mavenBundle("org.slf4j", "log4j-over-slf4j").versionAsInProject(), //
61 mavenBundle("ch.qos.logback", "logback-core").versionAsInProject(), //
62 mavenBundle("ch.qos.logback", "logback-classic").versionAsInProject(),
63 mavenBundle("openexi", "nagasena").versionAsInProject(),
64 mavenBundle("com.github.romix", "java-concurrent-hash-trie-map").versionAsInProject(),
66 TestHelper.mdSalCoreBundles(),
68 TestHelper.bindingAwareSalBundles(), TestHelper.configMinumumBundles(), TestHelper.baseModelBundles(),
69 TestHelper.junitAndMockitoBundles());
72 private Option pcepModules() {
73 return new DefaultCompositeOption(
74 mavenBundle("org.opendaylight.yangtools.model", "ietf-topology").versionAsInProject(), //
75 mavenBundle("org.opendaylight.yangtools", "object-cache-api").versionAsInProject(), //
76 mavenBundle("org.opendaylight.bgpcep", "pcep-topology-api").versionAsInProject(), //
77 mavenBundle("org.opendaylight.bgpcep", "pcep-tunnel-api").versionAsInProject(), //
78 mavenBundle("org.opendaylight.bgpcep", "pcep-api").versionAsInProject(), //
79 mavenBundle("org.opendaylight.bgpcep", "pcep-impl").versionAsInProject(), //
80 mavenBundle("org.opendaylight.bgpcep", "pcep-spi").versionAsInProject(), //
81 mavenBundle("org.opendaylight.bgpcep", "pcep-ietf-stateful02").versionAsInProject(), //
82 mavenBundle("org.opendaylight.bgpcep", "pcep-ietf-stateful07").versionAsInProject(), //
83 mavenBundle("org.opendaylight.tcpmd5", "tcpmd5-api").versionAsInProject(), //
84 mavenBundle("org.opendaylight.tcpmd5", "tcpmd5-netty").versionAsInProject(), //
85 mavenBundle("org.opendaylight.bgpcep", "topology-api").versionAsInProject(), //
86 mavenBundle("org.opendaylight.bgpcep", "topology-tunnel-api").versionAsInProject(), //
87 mavenBundle("org.opendaylight.bgpcep", "programming-topology-api").versionAsInProject(), //
88 mavenBundle("org.opendaylight.bgpcep", "programming-tunnel-api").versionAsInProject(), //
89 mavenBundle("org.opendaylight.bgpcep", "concepts").versionAsInProject(), //
90 mavenBundle("org.opendaylight.bgpcep", "util").versionAsInProject(), //
91 mavenBundle("org.opendaylight.bgpcep", "rsvp-api").versionAsInProject(), //
92 mavenBundle("org.opendaylight.bgpcep", "programming-api").versionAsInProject());
95 abstract class AbstractTestProvider implements BindingAwareProvider {
99 TopologyKey getTopologyId(final String id) {
100 return new TopologyKey(new org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId(id));