Package org.springframework.osgi.test.internal

Examples of org.springframework.osgi.test.internal.TestRunnerService


  public void testStart() throws Exception {
    MockControl ctxCtrl = MockControl.createControl(BundleContext.class);
    BundleContext ctx = (BundleContext) ctxCtrl.getMock();

    MockControl servCtrl = MockControl.createControl(TestRunnerService.class);
    TestRunnerService runner = (TestRunnerService) servCtrl.getMock();

    ServiceReference ref = new MockServiceReference();

    ctxCtrl.expectAndReturn(ctx.getServiceReference(TestRunnerService.class.getName()), ref);
    ctxCtrl.expectAndReturn(ctx.getService(ref), runner);
View Full Code Here


  public void testLoadTest() throws Exception {
    BundleContext ctx = new MockBundleContext();

    MockControl servCtrl = MockControl.createControl(TestRunnerService.class);
    TestRunnerService runner = (TestRunnerService) servCtrl.getMock();

    try {
      activator.executeTest();
      fail("should have thrown exception");
    }
    catch (RuntimeException ex) {
      // expected
    }

    setActivatorField("service", runner);
    runner.runTest(null);
    servCtrl.setMatcher(MockControl.ALWAYS_MATCHER);
    servCtrl.replay();

    setActivatorField("context", ctx);
    OsgiTestInfoHolder.INSTANCE.setTestClassName(TestExample.class.getName());
View Full Code Here

TOP

Related Classes of org.springframework.osgi.test.internal.TestRunnerService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.