Examples of StopCondition


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

        assertNotNull(foo);
        // Conversation scope is not active during EJB timeout method
        foo.createTimer();

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

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

                resp.sendError(500, "No long running conversation");
            } else {
                long start = System.currentTimeMillis();
                try {
                    // The concurrent access timeout is not defined by the spec
                    new Timer().setSleepInterval(100l).setDelay(10, TimeUnit.SECONDS).addStopCondition(new StopCondition() {
                        @Override
                        public boolean isSatisfied() {
                            return state.isBusyAttemptMade();
                        }
                    }).start();
View Full Code Here

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

    @SpecAssertion(section = "2.2.1", id = "b")
    public void testSameThread(Bar bar) throws InterruptedException {
        assertEquals(bar.ping(), 2);

        bar.createTimer();
        new Timer().setDelay(5, TimeUnit.SECONDS).addStopCondition(new StopCondition() {
            @Override
            public boolean isSatisfied() {
                return Bar.timeoutAt != null;
            }
        }).start();
View Full Code Here

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

    @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER, groups = JAVAEE_FULL)
    @SpecAssertions({ @SpecAssertion(section = "2.7", id = "f"), @SpecAssertion(section = "2.7", id = "ea") })
    public void testInvocationContextGetTimer(TimingBean timingBean) throws Exception {
        timingBean.createTimer();
        new Timer().setDelay(5, TimeUnit.SECONDS).addStopCondition(new StopCondition() {
            @Override
            public boolean isSatisfied() {
                return TimingBean.timeoutAt != null;
            }
        }).start();
View Full Code Here

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

    @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER, groups = JAVAEE_FULL)
    @SpecAssertions({ @SpecAssertion(section = "2.7", id = "d"), @SpecAssertion(section = "2.7", id = "eb") })
    public void testSecurityContext(Student student) throws Exception {
        student.sleep();
        new Timer().setDelay(5, TimeUnit.SECONDS).addStopCondition(new StopCondition() {
            @Override
            public boolean isSatisfied() {
                return Alarm.timeoutAt != null;
            }
        }).start();
View Full Code Here

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

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

        producer.sendTopicMessage();

        new Timer().setDelay(5, TimeUnit.SECONDS).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(5, TimeUnit.SECONDS).addStopCondition(new StopCondition() {
            public boolean isSatisfied() {
                return observer.isDestroyedCalled();
            }
        }).start();
View Full Code Here

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

            @SpecAssertion(section = "5.2.1", id = "ab"), @SpecAssertion(section = "5.2.2", id = "a") })
    public void testTimeoutMethodIntercepted(TimingBean timing) throws Exception {
        ActionSequence.reset();

        timing.createTimer();
        new Timer().setDelay(5, TimeUnit.SECONDS).addStopCondition(new StopCondition() {
            @Override
            public boolean isSatisfied() {
                return TimingBean.timeoutAt != null;
            }
        }).start();
View Full Code Here

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

        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(5, TimeUnit.SECONDS).addStopCondition(new StopCondition() {
                public boolean isSatisfied() {
                    return observingBean.isDestroyedCalled();
                }
            }).start();
        } catch (InterruptedException e) {
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

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