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.systemPackages;
29 import static org.ops4j.pax.exam.CoreOptions.systemProperty;
31 @RunWith(PaxExam.class)
32 public abstract class AbstractTest {
34 public static final String CONTROLLER = "org.opendaylight.controller";
35 public static final String YANGTOOLS = "org.opendaylight.yangtools";
37 public static final String CONTROLLER_MODELS = "org.opendaylight.controller.model";
38 public static final String YANGTOOLS_MODELS = "org.opendaylight.yangtools.model";
41 @Filter(timeout=120*1000)
42 BindingAwareBroker broker;
45 BundleContext bundleContext;
47 public BindingAwareBroker getBroker() {
51 public void setBroker(BindingAwareBroker broker) {
55 public BundleContext getBundleContext() {
59 public void setBundleContext(BundleContext bundleContext) {
60 this.bundleContext = bundleContext;
64 public Option[] config() {
65 return options(systemProperty("osgi.console").value("2401"), mavenBundle("org.slf4j", "slf4j-api")
66 .versionAsInProject(), //
67 // systemProperty("logback.configurationFile").value(
68 // "file:" + PathUtils.getBaseDir()
69 // + "/src/test/resources/logback.xml"),
70 mavenBundle("org.slf4j", "log4j-over-slf4j").versionAsInProject(), //
71 mavenBundle("ch.qos.logback", "logback-core").versionAsInProject(), //
72 mavenBundle("ch.qos.logback", "logback-classic").versionAsInProject(),
73 mavenBundle("org.opendaylight.controller.thirdparty", "nagasena").versionAsInProject(),
74 mavenBundle("org.opendaylight.controller.thirdparty", "nagasena-rta").versionAsInProject(),
76 systemProperty("osgi.bundles.defaultStartLevel").value("4"),
77 systemPackages("sun.nio.ch"),
81 bindingAwareSalBundles(),
82 configMinumumBundles(),
85 flowCapableModelBundles(),
87 // Set fail if unresolved bundle present
88 systemProperty("pax.exam.osgi.unresolved.fail").value("true"),
89 junitAndMockitoBundles());