Reduce logged messages during build and concentrate only on the ones
[controller.git] / opendaylight / md-sal / samples / toaster-it / src / test / java / org / opendaylight / controller / sample / toaster / it / ToasterTest.java
1 package org.opendaylight.controller.sample.toaster.it;
2
3 import org.junit.Test;
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;
12
13 import javax.inject.Inject;
14
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;
21
22 @RunWith(PaxExam.class)
23 public class ToasterTest {
24
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";
28
29     @Test
30     public void properInitialized() throws Exception {
31
32         Thread.sleep(500); // Waiting for services to get wired.
33
34         assertTrue(consumer.createToast(WhiteBread.class, 5));
35
36     }
37
38     @Inject
39     BindingAwareBroker broker;
40
41     @Inject
42     ToastConsumer consumer;
43
44     @Inject
45     BundleContext ctx;
46
47     @Configuration
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(), //
60                 
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(), //
65                 
66                 mavenBundle(ODL, "config-api").versionAsInProject(), //
67                 mavenBundle(ODL, "config-manager").versionAsInProject(), //
68                 mavenBundle("commons-io", "commons-io").versionAsInProject(),
69                 
70                 
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(),
80                 junitBundles()
81                 );
82     }
83
84 }