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 org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
11 import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
12 import org.opendaylight.protocol.integration.TestHelper;
13 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey;
14 import org.opendaylight.yangtools.yang.binding.RpcService;
15 import org.ops4j.pax.exam.Configuration;
16 import org.ops4j.pax.exam.Option;
17 import org.ops4j.pax.exam.options.DefaultCompositeOption;
18 import org.ops4j.pax.exam.util.Filter;
19 import org.osgi.framework.BundleContext;
21 import javax.inject.Inject;
22 import java.util.Collection;
23 import java.util.Collections;
25 import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
26 import static org.ops4j.pax.exam.CoreOptions.options;
27 import static org.ops4j.pax.exam.CoreOptions.systemProperty;
29 public class AbstractPcepOsgiTest {
31 @Filter(timeout=60*1000)
32 BindingAwareBroker broker;
34 BundleContext bundleContext;
36 public BindingAwareBroker getBroker() {
40 public void setBroker(BindingAwareBroker broker) {
44 public BundleContext getBundleContext() {
48 public void setBundleContext(BundleContext bundleContext) {
49 this.bundleContext = bundleContext;
53 public Option[] config() {
54 return options(TestHelper.getLoggingBundles(), //
57 systemProperty("osgi.bundles.defaultStartLevel").value("4"),
59 TestHelper.mdSalCoreBundles(),
61 TestHelper.bindingAwareSalBundles(),
62 TestHelper.configMinumumBundles(),
63 TestHelper.baseModelBundles(),
64 TestHelper.flowCapableModelBundles(),
65 TestHelper.junitAndMockitoBundles());
68 private Option pcepModules() {
69 return new DefaultCompositeOption(mavenBundle("org.opendaylight.yangtools.model", "ietf-topology").versionAsInProject(), //
70 mavenBundle("org.opendaylight.bgpcep", "pcep-topology-api").versionAsInProject(), //
71 mavenBundle("org.opendaylight.bgpcep", "pcep-tunnel-api").versionAsInProject(), //
72 mavenBundle("org.opendaylight.bgpcep", "pcep-api").versionAsInProject(), //
73 mavenBundle("org.opendaylight.bgpcep", "topology-api").versionAsInProject(), //
74 mavenBundle("org.opendaylight.bgpcep", "topology-tunnel-api").versionAsInProject(), //
75 mavenBundle("org.opendaylight.bgpcep", "programming-topology-api").versionAsInProject(), //
76 mavenBundle("org.opendaylight.bgpcep", "programming-tunnel-api").versionAsInProject(), //
77 mavenBundle("org.opendaylight.bgpcep", "concepts").versionAsInProject(), //
78 mavenBundle("org.opendaylight.bgpcep", "util").versionAsInProject(), //
79 mavenBundle("org.opendaylight.bgpcep", "rsvp-api").versionAsInProject(), //
80 mavenBundle("org.opendaylight.bgpcep", "programming-api").versionAsInProject());
83 abstract class AbstractTestProvider implements BindingAwareProvider {
86 public Collection<? extends RpcService> getImplementations() {
87 return Collections.emptySet();
91 public Collection<? extends ProviderFunctionality> getFunctionality() {
92 return Collections.emptySet();
96 public void onSessionInitialized(BindingAwareBroker.ConsumerContext session) {}
100 TopologyKey getTopologyId(String id) {
101 return new TopologyKey(new org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId(id));