Package co.paralleluniverse.strands

Examples of co.paralleluniverse.strands.SuspendableRunnable


        }).start().join();
    }
   
    @After
    public void tearDownTest() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                deleteTestSet();

                if (mongoColl != null) {
View Full Code Here


                .match(d(e(FIELD_INT_NAME, d(e("$gt", 0), e("$lt", 3)))))
                .group(d(e("_id", (String) null), e(FIELD_COUNT_NAME, d(e("$sum", 1)))));
       
    @Test
    public void testAggregateQuery() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                MongoIterator<Document> aggregate = mongoColl.aggregate(AGGREGATE_QUERY.build());
                assertEquals(TEST_SET_SIZE.toString(), getAggregateSizeAsString(aggregate));
            }
View Full Code Here

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

    @Test
    public void testAggregateBuilder() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                MongoIterator<Document> aggregate = mongoColl.aggregate(AGGREGATE_QUERY);
                assertEquals(TEST_SET_SIZE.toString(), getAggregateSizeAsString(aggregate));
            }
View Full Code Here

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

    @Test
    public void testAggregateQueryFuture() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                try {
                    MongoIterator<Document> aggregate = addListenerCalledFlagSetter(mongoColl.aggregateAsync(AGGREGATE_QUERY)).get();
                    assertEquals(TEST_SET_SIZE.toString(), getAggregateSizeAsString(aggregate));
View Full Code Here

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

    @Test
    public void testAggregateBuilderFuture() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                try {
                    MongoIterator<Document> aggregate = addListenerCalledFlagSetter(mongoColl.aggregateAsync(AGGREGATE_QUERY)).get();
                    assertEquals(TEST_SET_SIZE.toString(), getAggregateSizeAsString(aggregate));
View Full Code Here

        }).start().join();
    }
   
    @Test
    public void testCount() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                long res = mongoColl.count();
                assertEquals((int) TEST_SET_SIZE, res);
            }
View Full Code Here

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

    @Test
    public void testCountBuilder() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                long res = mongoColl.count(Count.builder());
                assertEquals((int) TEST_SET_SIZE, res);
            }
View Full Code Here

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

    @Test
    public void testCountQuery() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                long res = mongoColl.count(Count.builder().build());
                assertEquals((int) TEST_SET_SIZE, res);
            }
View Full Code Here

        }).start().join();
    }
   
    @Test
    public void testCountQueryDocument() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                long res = mongoColl.count();
                assertEquals((int) TEST_SET_SIZE, res);
            }
View Full Code Here

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

    @Test
    public void testCountFuture() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                try {
                    long res = addListenerCalledFlagSetter(mongoColl.countAsync()).get();
                    assertEquals((int) TEST_SET_SIZE, res);
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.