X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsamples%2Ftoaster-it%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsample%2Ftoaster%2Fit%2FToasterTest.java;h=0b4ea8e72a13cfabf78bd75fe47f304925de5f94;hb=HEAD;hp=c115fc9114c06cadd224fed0df577faba9da1e65;hpb=dceb9db7853dabfbd4abdfb3d886a79871097831;p=controller.git diff --git a/opendaylight/md-sal/samples/toaster-it/src/test/java/org/opendaylight/controller/sample/toaster/it/ToasterTest.java b/opendaylight/md-sal/samples/toaster-it/src/test/java/org/opendaylight/controller/sample/toaster/it/ToasterTest.java index c115fc9114..0b4ea8e72a 100644 --- a/opendaylight/md-sal/samples/toaster-it/src/test/java/org/opendaylight/controller/sample/toaster/it/ToasterTest.java +++ b/opendaylight/md-sal/samples/toaster-it/src/test/java/org/opendaylight/controller/sample/toaster/it/ToasterTest.java @@ -10,6 +10,7 @@ package org.opendaylight.controller.sample.toaster.it; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.ops4j.pax.exam.CoreOptions.maven; + import java.lang.management.ManagementFactory; import javax.inject.Inject; import javax.management.MBeanServer; @@ -20,6 +21,7 @@ import org.opendaylight.controller.mdsal.it.base.AbstractMdsalTestBase; import org.opendaylight.controller.sample.kitchen.api.EggsType; import org.opendaylight.controller.sample.kitchen.api.KitchenService; import org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.HashBrown; +import org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.MakeToast; import org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.WhiteBread; import org.ops4j.pax.exam.junit.PaxExam; import org.ops4j.pax.exam.options.MavenUrlReference; @@ -28,23 +30,17 @@ import org.ops4j.pax.exam.util.Filter; @RunWith(PaxExam.class) public class ToasterTest extends AbstractMdsalTestBase { @Inject - @Filter(timeout=60*1000) + @Filter(timeout = 60 * 1000) KitchenService kitchenService; - - @Override - public String getModuleName() { - return "toaster-provider-impl"; - } - - @Override - public String getInstanceName() { - return "toaster-provider-impl"; - } + @Inject + @Filter(timeout = 60 * 1000) + // proxy for the entire toaster, nothing else + MakeToast makeToast; @Override public MavenUrlReference getFeatureRepo() { - return maven().groupId("org.opendaylight.controller").artifactId("features-mdsal").classifier("features") - .type("xml").versionAsInProject(); + return maven().groupId("org.opendaylight.controller").artifactId("features-controller-experimental") + .classifier("features").type("xml").versionAsInProject(); } @Override @@ -55,7 +51,8 @@ public class ToasterTest extends AbstractMdsalTestBase { @Test public void testToaster() throws Exception { MBeanServer platformMBeanServer = ManagementFactory.getPlatformMBeanServer(); - ObjectName providerOn = new ObjectName("org.opendaylight.controller:name=OpendaylightToaster,type=toaster-provider"); + ObjectName providerOn = new ObjectName( + "org.opendaylight.controller:name=OpendaylightToaster,type=toaster-provider"); long toastsMade = (long) platformMBeanServer.getAttribute(providerOn, "ToastsMade"); assertEquals(0, toastsMade); @@ -63,8 +60,8 @@ public class ToasterTest extends AbstractMdsalTestBase { boolean success = true; // Make toasts using OSGi service - success &= kitchenService.makeBreakfast( EggsType.SCRAMBLED, HashBrown.class, 4).get().isSuccessful(); - success &= kitchenService.makeBreakfast( EggsType.POACHED, WhiteBread.class, 8 ).get().isSuccessful(); + success &= kitchenService.makeBreakfast(EggsType.SCRAMBLED, HashBrown.VALUE, 4).get().isSuccessful(); + success &= kitchenService.makeBreakfast(EggsType.POACHED, WhiteBread.VALUE, 8).get().isSuccessful(); assertTrue("Not all breakfasts succeeded", success);