Package org.jboss.cdi.tck.util

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


        MissileInterceptor.reset();

        producer.sendQueueMessage();

        // Wait for async processing
        new Timer().setDelay(5, TimeUnit.SECONDS).addStopCondition(new StopCondition() {
            @Override
            public boolean isSatisfied() {
                return MessageDrivenMissile.messageAccepted;
            }
        }).start();
View Full Code Here


        AbstractMessageListener.reset();
        observer.reset();

        producer.sendTopicMessage();

        new Timer().setDelay(2000l).addStopCondition(new StopCondition() {
            public boolean isSatisfied() {
                return AbstractMessageListener.getProcessedMessages() >= 1;
            }
        }).start();

        assertEquals(1, AbstractMessageListener.getProcessedMessages());
        assertTrue(AbstractMessageListener.isInitializedEventObserver());

        // wait for the request scope for the message delivery to be destroyed and verify that the event was delivered
        new Timer().setDelay(2000l).addStopCondition(new StopCondition() {
            public boolean isSatisfied() {
                return observer.isDestroyedCalled();
            }
        }).start();
View Full Code Here

    @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

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

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

    public void testRequestScopeActiveDuringCallToEjbTimeoutMethod() throws Exception {
        FMSModelIII.reset();
        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

        SimpleRequestBean.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

        AbstractMessageListener.reset();
        observer.reset();

        producer.sendTopicMessage();

        new Timer().setDelay(2000l).addStopCondition(new StopCondition() {
            public boolean isSatisfied() {
                return AbstractMessageListener.getProcessedMessages() >= 1;
            }
        }).start();

        assertEquals(1, AbstractMessageListener.getProcessedMessages());
        assertTrue(AbstractMessageListener.isInitializedEventObserver());

        // wait for the request scope for the message delivery to be destroyed and verify that the event was delivered
        new Timer().setDelay(2000l).addStopCondition(new StopCondition() {
            public boolean isSatisfied() {
                return observer.isDestroyedCalled();
            }
        }).start();
View Full Code Here

        resp.getWriter().append("Initialized:" + initializedResult);
        resp.getWriter().append("\n");

        // wait for the request scope created for the async method invocation to be destroyed
        try {
            new Timer().setDelay(2000l).addStopCondition(new StopCondition() {
                public boolean isSatisfied() {
                    return observingBean.isDestroyedCalled();
                }
            }).start();
        } catch (InterruptedException e) {
View Full Code Here

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

        timing.createTimer();

        new Timer().setDelay(10000l).addStopCondition(new StopCondition() {
            public boolean isSatisfied() {
                return Timing.timeoutAt != null;
            }
        }).start();
View Full Code Here

            @Override
            public boolean isSatisfied() {
                return bar.isContextNotActiveExceptionThrown();
            }
        };
        Timer timer = new Timer().addStopCondition(condition).start();
        assertTrue(timer.isStopConditionsSatisfiedBeforeTimeout() || condition.isSatisfied());
    }
View Full Code Here

TOP

Related Classes of org.jboss.cdi.tck.util.Timer

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.