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.maven;
11 import javax.inject.Inject;
12 import org.opendaylight.controller.mdsal.it.base.AbstractMdsalTestBase;
13 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
14 import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
15 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey;
16 import org.ops4j.pax.exam.options.MavenUrlReference;
17 import org.ops4j.pax.exam.util.Filter;
18 import org.osgi.framework.BundleContext;
19 import org.osgi.framework.ServiceReference;
21 public class AbstractPcepOsgiTest extends AbstractMdsalTestBase {
24 @Filter(timeout = 60 * 1000)
25 BundleContext bundleContext;
26 BindingAwareBroker broker = null;
28 public BindingAwareBroker getBroker() {
29 if (this.broker == null) {
30 ServiceReference<BindingAwareBroker> serviceReference = this.bundleContext.getServiceReference(BindingAwareBroker.class);
31 if (serviceReference == null) {
32 throw new RuntimeException("BindingAwareBroker not found");
34 this.broker = this.bundleContext.getService(serviceReference);
40 public String getModuleName() {
41 return "pcep-topology-provider";
45 public String getInstanceName() {
46 return "pcep-topology";
50 public MavenUrlReference getFeatureRepo() {
51 return maven().groupId("org.opendaylight.bgpcep").artifactId("features-pcep")
52 .classifier("features").type("xml").versionAsInProject();
56 public String getFeatureName() {
57 return "odl-bgpcep-pcep-all";
60 TopologyKey getTopologyId(final String id) {
61 return new TopologyKey(new org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId(id));
64 abstract class AbstractTestProvider implements BindingAwareProvider {