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.opendaylight.controller.test.sal.binding.it.TestHelper.baseModelBundles;
11 import static org.opendaylight.controller.test.sal.binding.it.TestHelper.bindingAwareSalBundles;
12 import static org.opendaylight.controller.test.sal.binding.it.TestHelper.configMinumumBundles;
13 import static org.opendaylight.controller.test.sal.binding.it.TestHelper.junitAndMockitoBundles;
14 import static org.opendaylight.controller.test.sal.binding.it.TestHelper.mdSalCoreBundles;
15 import static org.opendaylight.controller.test.sal.binding.it.TestHelper.salTestModelBundles;
16 import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
17 import static org.ops4j.pax.exam.CoreOptions.options;
18 import static org.ops4j.pax.exam.CoreOptions.systemPackages;
19 import static org.ops4j.pax.exam.CoreOptions.systemProperty;
21 import javax.inject.Inject;
22 import org.junit.runner.RunWith;
23 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
24 import org.ops4j.pax.exam.Configuration;
25 import org.ops4j.pax.exam.Option;
26 import org.ops4j.pax.exam.junit.PaxExam;
27 import org.ops4j.pax.exam.util.Filter;
28 import org.osgi.framework.BundleContext;
30 @RunWith(PaxExam.class)
31 public abstract class AbstractIT {
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(final BindingAwareBroker broker) {
54 public BundleContext getBundleContext() {
58 public void setBundleContext(final 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 mavenBundle("org.slf4j", "log4j-over-slf4j").versionAsInProject(), //
67 mavenBundle("ch.qos.logback", "logback-core").versionAsInProject(), //
68 mavenBundle("ch.qos.logback", "logback-classic").versionAsInProject(),
69 mavenBundle("org.openexi", "nagasena").versionAsInProject(),
70 mavenBundle("org.openexi", "nagasena-rta").versionAsInProject(),
72 systemProperty("osgi.bundles.defaultStartLevel").value("4"),
73 systemPackages("sun.nio.ch"),
76 configMinumumBundles(),
77 bindingAwareSalBundles(),
81 salTestModelBundles(),
83 // Set fail if unresolved bundle present
84 systemProperty("pax.exam.osgi.unresolved.fail").value("true"),
85 junitAndMockitoBundles());