Examples of TestService


Examples of org.knowhowlab.osgi.testing.it.paxexam.service.TestService

    @Test
    public void test_RegisterService_Async() {
        // service unregistered
        assertServiceUnavailable(TestService.class);
        // register service in 2 sec
        registerServiceAsync(getBundleContext(), TestService.class, new TestService(), null, 2, TimeUnit.SECONDS);
        // service still unregistered
        assertServiceUnavailable(TestService.class);
        // service registered
        assertServiceAvailable(TestService.class, 5, TimeUnit.SECONDS);
    }
View Full Code Here

Examples of org.knowhowlab.osgi.testing.it.paxexam.service.TestService

    }

    @Test
    public void test_Service_Event() {
        // register service in 2 sec
        registerServiceAsync(getBundleContext(), TestService.class, new TestService(), null, 2, TimeUnit.SECONDS);
        // service registered within 5 sec
        assertServiceEvent(ServiceEvent.REGISTERED, TestService.class, 5, TimeUnit.SECONDS);
    }
View Full Code Here

Examples of org.knowhowlab.osgi.testing.it.paxexam.service.TestService

    @Test
    public void test_RegisterService_Async() {
        // service unregistered
        assertServiceUnavailable(TestService.class);
        // register service in 2 sec
        registerServiceAsync(getBundleContext(), TestService.class, new TestService(), null, 2, TimeUnit.SECONDS);
        // service still unregistered
        assertServiceUnavailable(TestService.class);
        // service registered
        assertServiceAvailable(TestService.class, 5, TimeUnit.SECONDS);
    }
View Full Code Here

Examples of org.knowhowlab.osgi.testing.it.paxexam.service.TestService

    }

    @Test
    public void test_Service_Event() {
        // register service in 2 sec
        registerServiceAsync(getBundleContext(), TestService.class, new TestService(), null, 2, TimeUnit.SECONDS);
        // service registered within 5 sec
        assertServiceEvent(ServiceEvent.REGISTERED, TestService.class, 5, TimeUnit.SECONDS);
    }
View Full Code Here

Examples of org.nanocontainer.nanowar.TestService

        String actionType = StrutsTestAction.class.getName();
        mapping = new ActionMapping();
        mapping.setPath("/myPath1");
        mapping.setType(actionType);

        service = new TestService();
        container = new DefaultPicoContainer();
        container.registerComponentInstance(TestService.class, service);

        requestMock.stubs().method("getAttribute").with(eq(KeyConstants.ACTIONS_CONTAINER)).will(returnValue(container));
    }
View Full Code Here

Examples of org.nanocontainer.nanowar.TestService

        requestMock.stubs().method("getSession").will(returnValue(session));
        sessionMock.stubs().method("getServletContext").will(returnValue(servletContext));

        actionFactory = new ActionFactory();
        service = new TestService();
    }
View Full Code Here

Examples of org.rioproject.gnostic.service.test.TestService

    }

    @Test
    public void verifyThatInvocationsOnTestServiceAreDisallowedIfUtilizationIsBreached() {
        Assert.assertNotNull(testManager);
        TestService t = testManager.waitForService(TestService.class);
        Assert.assertNotNull(t);
        Throwable thrown = null;
        try {
            long waited = 0;
            long duration = 1000;
            while(t.getStatus().equals(TestService.Status.ALLOWED) && waited<=WAIT) {
                try {
                    Thread.sleep(duration);
                } catch (InterruptedException e) {
                    Thread.interrupted();
                }
                waited += duration;
            }
            Assert.assertTrue("Got "+t.getStatus().name(), t.getStatus().equals(TestService.Status.DISALLOWED));
        } catch (IOException e) {
            thrown = e;
            e.printStackTrace();
        }
        Assert.assertNull(thrown);
View Full Code Here

Examples of org.springframework.issues.service.TestService

  public void javaCentric() {

    GenericApplicationContext appContext = new AnnotationConfigApplicationContext(
        org.springframework.issues.config.java_centric.AppConfig.class);

    TestService service = appContext.getBean(TestService.class);
    assertThat(service.queryDummyValue(), equalTo(12345));
    appContext.close();
  }
View Full Code Here

Examples of org.springframework.issues.service.TestService

  public void xmlCentric() {

    GenericApplicationContext appContext = new GenericXmlApplicationContext(
        "classpath:org/springframework/issues/config/xml_centric/app-config.xml");

    TestService service = appContext.getBean(TestService.class);
    assertThat(service.queryDummyValue(), equalTo(12345));
    appContext.close();
  }
View Full Code Here

Examples of org.springframework.yarn.integration.ip.mind.TestService

    Class<?> clazz = TestUtils.readField("serviceImpl", fb);
    assertThat(clazz.getCanonicalName(), is("org.springframework.yarn.integration.ip.mind.TestService"));
    assertThat(TestUtils.readField("messageChannel", fb), instanceOf(DirectChannel.class));
    assertThat(TestUtils.readField("appmasterService", fb), instanceOf(TestService.class));

    TestService service = (TestService) ctx.getBean("yarnAmservice");
    assertNotNull(service);
    assertThat(TestUtils.readField("messageChannel", service), instanceOf(DirectChannel.class));

    testSocketSupport(service, fb);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.