Fix star import and enable checkstyle rule to prevent it.
[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
21 @RunWith(PaxExam.class)
22 public class ToasterTest {
23
24     public static final String ODL = "org.opendaylight.controller";
25     public static final String YANG = "org.opendaylight.yangtools";
26     public static final String SAMPLE = "org.opendaylight.controller.samples";
27
28     @Test
29     public void properInitialized() throws Exception {
30
31         Thread.sleep(500); // Waiting for services to get wired.
32
33         assertTrue(consumer.createToast(WhiteBread.class, 5));
34
35     }
36
37     @Inject
38     BindingAwareBroker broker;
39
40     @Inject
41     ToastConsumer consumer;
42
43     @Inject
44     BundleContext ctx;
45
46     @Configuration
47     public Option[] config() {
48         return options(systemProperty("osgi.console").value("2401"), 
49                 mavenBundle("org.slf4j", "slf4j-api").versionAsInProject(), //
50                 mavenBundle("org.slf4j", "log4j-over-slf4j").versionAsInProject(), //
51                 mavenBundle("ch.qos.logback", "logback-core").versionAsInProject(), //
52                 mavenBundle("ch.qos.logback", "logback-classic").versionAsInProject(), //
53                 mavenBundle(ODL, "sal-binding-api").versionAsInProject(), //
54                 mavenBundle(ODL, "sal-binding-config").versionAsInProject(), 
55                 mavenBundle(ODL, "sal-binding-broker-impl").versionAsInProject(), //
56                 
57                 mavenBundle(ODL, "sal-common").versionAsInProject(), //
58                 mavenBundle(ODL, "sal-common-api").versionAsInProject(),//
59                 mavenBundle(ODL, "sal-common-impl").versionAsInProject(), //
60                 mavenBundle(ODL, "sal-common-util").versionAsInProject(), //
61                 
62                 mavenBundle(ODL, "config-api").versionAsInProject(), //
63                 mavenBundle(ODL, "config-manager").versionAsInProject(), //
64                 mavenBundle("commons-io", "commons-io").versionAsInProject(),
65                 
66                 
67                 mavenBundle(SAMPLE, "sample-toaster").versionAsInProject(), //
68                 mavenBundle(SAMPLE, "sample-toaster-consumer").versionAsInProject(), //
69                 mavenBundle(SAMPLE, "sample-toaster-provider").versionAsInProject(), //
70                 mavenBundle(YANG, "concepts").versionAsInProject(),
71                 mavenBundle(YANG, "yang-binding").versionAsInProject(), //
72                 mavenBundle(YANG, "yang-common").versionAsInProject(), //
73                 mavenBundle(YANG+".thirdparty", "xtend-lib-osgi").versionAsInProject(),
74                 mavenBundle("com.google.guava", "guava").versionAsInProject(), //
75                 mavenBundle("org.javassist", "javassist").versionAsInProject(),
76                 junitBundles()
77                 );
78     }
79
80 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.