Package co.paralleluniverse.strands

Examples of co.paralleluniverse.strands.SuspendableRunnable


        }).start().join();
    }

    @Test
    public void testDeleteQueryDurableFuture() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                try {
                    long deleted = addListenerCalledFlagSetter(mongoColl.deleteAsync(DELETE_DOCUMENT, Durability.ACK)).get();
                    assertEquals(DELETE_SIZE, deleted);
View Full Code Here


    private static final Distinct.Builder DISTINCT_QUERY = Distinct.builder().key(FIELD_INT_NAME);
       
    @Test
    public void testDistinctQuery() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                MongoIterator<Element> distinct = mongoColl.distinct(DISTINCT_QUERY.build());
                assertEquals((long) TEST_SET_SIZE, getDistinctSize(distinct));
            }
View Full Code Here

        }).start().join();
    }

    @Test
    public void testDistinctBuilder() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                MongoIterator<Element> distinct = mongoColl.distinct(DISTINCT_QUERY);
                assertEquals((long) TEST_SET_SIZE, getDistinctSize(distinct));
            }
View Full Code Here

        }).start().join();
    }

    @Test
    public void testDistinctQueryFuture() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                try {
                    MongoIterator<Element> distinct = addListenerCalledFlagSetter(mongoColl.distinctAsync(DISTINCT_QUERY.build())).get();
                    assertEquals((long) TEST_SET_SIZE, getDistinctSize(distinct));
View Full Code Here

        }).start().join();
    }

    @Test
    public void testDistinctBuilderFuture() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                try {
                    MongoIterator<Element> distinct = addListenerCalledFlagSetter(mongoColl.distinctAsync(DISTINCT_QUERY)).get();
                    assertEquals((long) TEST_SET_SIZE, getDistinctSize(distinct));
View Full Code Here

    private static final String FIELD_AGGREGATE_RESULT_STAGES_NAME = "stages";
    private static final String FIELD_AGGREGATE_RESULT_CURSOR_NAME = "cursor";

    @Test
    public void testExplainAggregateQuery() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                Document explain = mongoColl.explain(AGGREGATE_QUERY.build());
                assertNotNull(explain.get(FIELD_AGGREGATE_RESULT_STAGES_NAME));
            }
View Full Code Here

        }).start().join();
    }

    @Test
    public void testExplainAggregateBuilder() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                Document explain = mongoColl.explain(AGGREGATE_QUERY);
                assertNotNull(explain.get(FIELD_AGGREGATE_RESULT_STAGES_NAME));
            }
View Full Code Here

    private static final DocumentAssignable FIND_DOCUMENT = d(e(FIELD_INT_NAME, FIELD_INT_FIRST_VALUE));
   
    @Test
    public void testExplainFindQueryDocument() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                Document explain = mongoColl.explain(FIND_DOCUMENT);
                assertNotNull(explain.get(FIELD_AGGREGATE_RESULT_CURSOR_NAME));
            }
View Full Code Here

        }).start().join();
    }

    @Test
    public void testExplainFindQuery() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                Document explain = mongoColl.explain(Find.builder().query(FIND_DOCUMENT).build());
                assertNotNull(explain.get(FIELD_AGGREGATE_RESULT_CURSOR_NAME));
            }
View Full Code Here

        }).start().join();
    }

    @Test
    public void testExplainFindBuilder() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                Document explain = mongoColl.explain(Find.builder().query(FIND_DOCUMENT));
                assertNotNull(explain.get(FIELD_AGGREGATE_RESULT_CURSOR_NAME));
            }
View Full Code Here

TOP

Related Classes of co.paralleluniverse.strands.SuspendableRunnable

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.