Examples of StopCondition


Examples of org.jboss.cdi.tck.util.Timer.StopCondition

    public void testApplicationContextShared() throws Exception {
        FMSModelIII.reset();
        FMS flightManagementSystem = getContextualReference(FMS.class);
        flightManagementSystem.climb();

        Timer timer = new Timer().setDelay(20000l).addStopCondition(new StopCondition() {
            public boolean isSatisfied() {
                return FMSModelIII.isClimbed();
            }
        }).start();

        flightManagementSystem.descend();

        timer.addStopCondition(new StopCondition() {
            public boolean isSatisfied() {
                return FMSModelIII.isDescended();
            }
        }, true).start();
View Full Code Here

Examples of org.jboss.cdi.tck.util.Timer.StopCondition

    @SpecAssertion(section = APPLICATION_CONTEXT, id = "dc")
    public void testApplicationScopeActiveDuringCallToEjbTimeoutMethod() throws Exception {
        FMS flightManagementSystem = getContextualReference(FMS.class);
        flightManagementSystem.climb();

        new Timer().setDelay(20000l).addStopCondition(new StopCondition() {
            public boolean isSatisfied() {
                return FMSModelIII.isClimbed();
            }
        }).start();
View Full Code Here

Examples of org.jboss.cdi.tck.util.Timer.StopCondition

        assertNotNull(messageService);
        ComplicatedInterceptor.reset();
        messageService.start();
        // Timeout is async
        StopCondition condition = new StopCondition() {
            public boolean isSatisfied() {
                return ComplicatedInterceptor.intercepted;
            }
        };
        Timer timer = new Timer().addStopCondition(condition).start();
        assertTrue(timer.isStopConditionsSatisfiedBeforeTimeout() || condition.isSatisfied());
    }
View Full Code Here

Examples of org.jboss.cdi.tck.util.Timer.StopCondition

    @SpecAssertion(section = BIZ_METHOD, id = "ig")
    public void testTimeoutMethodIntercepted(Timing timing) throws Exception {

        timing.createTimer();

        new Timer().addStopCondition(new StopCondition() {
            public boolean isSatisfied() {
                return AlmightyInterceptor.timeoutIntercepted;
            }
        }).start();
View Full Code Here

Examples of org.jboss.cdi.tck.util.Timer.StopCondition

    public void testApplicationContextShared() throws Exception {
        FMSModelIII.reset();
        FMS flightManagementSystem = getContextualReference(FMS.class);
        flightManagementSystem.climb();

        Timer timer = new Timer().setDelay(20, TimeUnit.SECONDS).addStopCondition(new StopCondition() {
            public boolean isSatisfied() {
                return FMSModelIII.isClimbed();
            }
        }).start();

        flightManagementSystem.descend();

        timer.addStopCondition(new StopCondition() {
            public boolean isSatisfied() {
                return FMSModelIII.isDescended();
            }
        }, true).start();
View Full Code Here

Examples of org.jboss.cdi.tck.util.Timer.StopCondition

    @SpecAssertion(section = APPLICATION_CONTEXT, id = "dc")
    public void testApplicationScopeActiveDuringCallToEjbTimeoutMethod() throws Exception {
        FMS flightManagementSystem = getContextualReference(FMS.class);
        flightManagementSystem.climb();

        new Timer().setDelay(20, TimeUnit.SECONDS).addStopCondition(new StopCondition() {
            public boolean isSatisfied() {
                return FMSModelIII.isClimbed();
            }
        }).start();
View Full Code Here

Examples of org.jboss.cdi.tck.util.Timer.StopCondition

        WebRequest busyRequest = new WebRequest(IntrospectServlet.MODE_BUSY_REQUEST, contextPath, cid, jsessionid);

        final Future<String> longTaskFuture = executorService.submit(longTask);
        Timer timer = Timer.startNew(100l);
        final Future<String> busyRequestFuture = executorService.submit(busyRequest);
        timer.setSleepInterval(100l).setDelay(10, TimeUnit.SECONDS).addStopCondition(new StopCondition() {
            @Override
            public boolean isSatisfied() {
                return longTaskFuture.isDone() || busyRequestFuture.isDone();
            }
        }).start();
View Full Code Here

Examples of org.jboss.cdi.tck.util.Timer.StopCondition

        producer.sendQueueMessage();
        producer.sendTopicMessage();

        // Wait for async processing
        new Timer().setDelay(5, TimeUnit.SECONDS).addStopCondition(new StopCondition() {
            public boolean isSatisfied() {
                return AbstractMessageListener.processedMessages.get() >= 2;
            }
        }).start();
View Full Code Here

Examples of org.jboss.cdi.tck.util.Timer.StopCondition

    public void testRequestScopeActiveDuringCallToEjbTimeoutMethod() throws Exception {
        FMSModelIII.reset();
        FMS flightManagementSystem = getContextualReference(FMS.class);
        flightManagementSystem.climb();

        new Timer().setDelay(20, TimeUnit.SECONDS).addStopCondition(new StopCondition() {
            public boolean isSatisfied() {
                return FMSModelIII.isClimbed();
            }
        }).start();
View Full Code Here

Examples of org.jboss.cdi.tck.util.Timer.StopCondition

        SimpleRequestBean.reset();
        FMS flightManagementSystem = getContextualReference(FMS.class);

        flightManagementSystem.climb();

        Timer timer = new Timer().setDelay(20, TimeUnit.SECONDS).addStopCondition(new StopCondition() {
            public boolean isSatisfied() {
                return FMSModelIII.isClimbed();
            }
        }).start();

        flightManagementSystem.descend();

        timer.addStopCondition(new StopCondition() {
            public boolean isSatisfied() {
                return FMSModelIII.isDescended();
            }
        }, true).start();
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.