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 static org.ops4j.pax.exam.CoreOptions.*;
11 import static org.opendaylight.controller.test.sal.binding.it.TestHelper.*;
13 import javax.inject.Inject;
15 import org.junit.runner.RunWith;
16 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
17 import org.ops4j.pax.exam.Configuration;
18 import org.ops4j.pax.exam.Option;
19 import org.ops4j.pax.exam.junit.PaxExam;
20 import org.ops4j.pax.exam.options.DefaultCompositeOption;
21 import org.ops4j.pax.exam.util.Filter;
22 import org.ops4j.pax.exam.util.PathUtils;
23 import org.osgi.framework.BundleContext;
25 @RunWith(PaxExam.class)
26 public abstract class AbstractTest {
28 public static final String CONTROLLER = "org.opendaylight.controller";
29 public static final String YANGTOOLS = "org.opendaylight.yangtools";
31 public static final String CONTROLLER_MODELS = "org.opendaylight.controller.model";
32 public static final String YANGTOOLS_MODELS = "org.opendaylight.yangtools.model";
35 @Filter(timeout=60*1000)
36 BindingAwareBroker broker;
39 BundleContext bundleContext;
41 public BindingAwareBroker getBroker() {
45 public void setBroker(BindingAwareBroker broker) {
49 public BundleContext getBundleContext() {
53 public void setBundleContext(BundleContext bundleContext) {
54 this.bundleContext = bundleContext;
58 public Option[] config() {
59 return options(systemProperty("osgi.console").value("2401"), mavenBundle("org.slf4j", "slf4j-api")
60 .versionAsInProject(), //
61 // systemProperty("logback.configurationFile").value(
62 // "file:" + PathUtils.getBaseDir()
63 // + "/src/test/resources/logback.xml"),
64 mavenBundle("org.slf4j", "log4j-over-slf4j").versionAsInProject(), //
65 mavenBundle("ch.qos.logback", "logback-core").versionAsInProject(), //
66 mavenBundle("ch.qos.logback", "logback-classic").versionAsInProject(), //
67 systemProperty("osgi.bundles.defaultStartLevel").value("4"),
71 bindingAwareSalBundles(),
72 configMinumumBundles(),
75 flowCapableModelBundles(),
77 // Set fail if unresolved bundle present
78 systemProperty("pax.exam.osgi.unresolved.fail").value("true"),
79 junitAndMockitoBundles());