1 package org.opendaylight.controller.sample.toaster.it;
4 import org.junit.runner.RunWith;
5 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
6 import org.opendaylight.controller.sample.toaster.provider.api.ToastConsumer;
7 import org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.WhiteBread;
8 import org.ops4j.pax.exam.Configuration;
9 import org.ops4j.pax.exam.Option;
10 import org.ops4j.pax.exam.junit.PaxExam;
11 import org.osgi.framework.BundleContext;
13 import javax.inject.Inject;
15 import static org.junit.Assert.assertTrue;
16 import static org.ops4j.pax.exam.CoreOptions.junitBundles;
17 import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
18 import static org.ops4j.pax.exam.CoreOptions.options;
19 import static org.ops4j.pax.exam.CoreOptions.systemProperty;
20 import org.ops4j.pax.exam.util.PathUtils;
22 @RunWith(PaxExam.class)
23 public class ToasterTest {
25 public static final String ODL = "org.opendaylight.controller";
26 public static final String YANG = "org.opendaylight.yangtools";
27 public static final String SAMPLE = "org.opendaylight.controller.samples";
30 public void properInitialized() throws Exception {
32 Thread.sleep(500); // Waiting for services to get wired.
34 assertTrue(consumer.createToast(WhiteBread.class, 5));
39 BindingAwareBroker broker;
42 ToastConsumer consumer;
48 public Option[] config() {
49 return options(systemProperty("osgi.console").value("2401"),
50 systemProperty("logback.configurationFile").value(
51 "file:" + PathUtils.getBaseDir()
52 + "/src/test/resources/logback.xml"),
53 mavenBundle("org.slf4j", "slf4j-api").versionAsInProject(), //
54 mavenBundle("org.slf4j", "log4j-over-slf4j").versionAsInProject(), //
55 mavenBundle("ch.qos.logback", "logback-core").versionAsInProject(), //
56 mavenBundle("ch.qos.logback", "logback-classic").versionAsInProject(), //
57 mavenBundle(ODL, "sal-binding-api").versionAsInProject(), //
58 mavenBundle(ODL, "sal-binding-config").versionAsInProject(),
59 mavenBundle(ODL, "sal-binding-broker-impl").versionAsInProject(), //
61 mavenBundle(ODL, "sal-common").versionAsInProject(), //
62 mavenBundle(ODL, "sal-common-api").versionAsInProject(),//
63 mavenBundle(ODL, "sal-common-impl").versionAsInProject(), //
64 mavenBundle(ODL, "sal-common-util").versionAsInProject(), //
66 mavenBundle(ODL, "config-api").versionAsInProject(), //
67 mavenBundle(ODL, "config-manager").versionAsInProject(), //
68 mavenBundle("commons-io", "commons-io").versionAsInProject(),
71 mavenBundle(SAMPLE, "sample-toaster").versionAsInProject(), //
72 mavenBundle(SAMPLE, "sample-toaster-consumer").versionAsInProject(), //
73 mavenBundle(SAMPLE, "sample-toaster-provider").versionAsInProject(), //
74 mavenBundle(YANG, "concepts").versionAsInProject(),
75 mavenBundle(YANG, "yang-binding").versionAsInProject(), //
76 mavenBundle(YANG, "yang-common").versionAsInProject(), //
77 mavenBundle(YANG+".thirdparty", "xtend-lib-osgi").versionAsInProject(),
78 mavenBundle("com.google.guava", "guava").versionAsInProject(), //
79 mavenBundle("org.javassist", "javassist").versionAsInProject(),