2 * Copyright (c) 2014 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.controller.test.sal.binding.it;
10 import org.junit.runner.RunWith;
11 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
12 import org.ops4j.pax.exam.Configuration;
13 import org.ops4j.pax.exam.Option;
14 import org.ops4j.pax.exam.junit.PaxExam;
15 import org.ops4j.pax.exam.util.Filter;
16 import org.osgi.framework.BundleContext;
18 import javax.inject.Inject;
20 import static org.opendaylight.controller.test.sal.binding.it.TestHelper.baseModelBundles;
21 import static org.opendaylight.controller.test.sal.binding.it.TestHelper.bindingAwareSalBundles;
22 import static org.opendaylight.controller.test.sal.binding.it.TestHelper.configMinumumBundles;
23 import static org.opendaylight.controller.test.sal.binding.it.TestHelper.flowCapableModelBundles;
24 import static org.opendaylight.controller.test.sal.binding.it.TestHelper.junitAndMockitoBundles;
25 import static org.opendaylight.controller.test.sal.binding.it.TestHelper.mdSalCoreBundles;
26 import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
27 import static org.ops4j.pax.exam.CoreOptions.options;
28 import static org.ops4j.pax.exam.CoreOptions.systemProperty;
30 @RunWith(PaxExam.class)
31 public abstract class AbstractTest {
33 public static final String CONTROLLER = "org.opendaylight.controller";
34 public static final String YANGTOOLS = "org.opendaylight.yangtools";
36 public static final String CONTROLLER_MODELS = "org.opendaylight.controller.model";
37 public static final String YANGTOOLS_MODELS = "org.opendaylight.yangtools.model";
40 @Filter(timeout=120*1000)
41 BindingAwareBroker broker;
44 BundleContext bundleContext;
46 public BindingAwareBroker getBroker() {
50 public void setBroker(BindingAwareBroker broker) {
54 public BundleContext getBundleContext() {
58 public void setBundleContext(BundleContext bundleContext) {
59 this.bundleContext = bundleContext;
63 public Option[] config() {
64 return options(systemProperty("osgi.console").value("2401"), mavenBundle("org.slf4j", "slf4j-api")
65 .versionAsInProject(), //
66 // systemProperty("logback.configurationFile").value(
67 // "file:" + PathUtils.getBaseDir()
68 // + "/src/test/resources/logback.xml"),
69 mavenBundle("org.slf4j", "log4j-over-slf4j").versionAsInProject(), //
70 mavenBundle("ch.qos.logback", "logback-core").versionAsInProject(), //
71 mavenBundle("ch.qos.logback", "logback-classic").versionAsInProject(), //
72 systemProperty("osgi.bundles.defaultStartLevel").value("4"),
76 bindingAwareSalBundles(),
77 configMinumumBundles(),
80 flowCapableModelBundles(),
82 // Set fail if unresolved bundle present
83 systemProperty("pax.exam.osgi.unresolved.fail").value("true"),
84 junitAndMockitoBundles());