Package co.paralleluniverse.strands

Examples of co.paralleluniverse.strands.SuspendableRunnable


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

    @Test
    public void testInsertFuture() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                try {
                    deleteTestSet();
                    int inserted = addListenerCalledFlagSetter(mongoColl.insertAsync(FIRST_TEST_ELEM, SECOND_TEST_ELEM)).get();
View Full Code Here


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

    @Test
    public void testInsertContinueOnErrorFuture() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                try {
                    deleteTestSet();
                    int inserted = addListenerCalledFlagSetter(mongoColl.insertAsync(true, FIRST_TEST_ELEM, SECOND_TEST_ELEM)).get();
View Full Code Here

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

    @Test
    public void testInsertContinueOnErrorDurableFuture() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                try {
                    deleteTestSet();
                    int inserted = addListenerCalledFlagSetter(mongoColl.insertAsync(true, Durability.ACK, FIRST_TEST_ELEM, SECOND_TEST_ELEM)).get();
View Full Code Here

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

    @Test
    public void testInsertDurableFuture() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                try {
                    deleteTestSet();
                    int inserted = addListenerCalledFlagSetter(mongoColl.insertAsync(Durability.ACK, FIRST_TEST_ELEM, SECOND_TEST_ELEM)).get();
View Full Code Here

                     "}"
            );
       
    @Test
    public void testMapReduceQuery() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                MongoIterator<Document> mapReduce = mongoColl.mapReduce(MAP_REDUCE_QUERY.build());
                assertEquals(FIELD_INT_SUM, getMapReduceSizeAsString(mapReduce));
            }
View Full Code Here

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

    @Test
    public void testMapReduceBuilder() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                MongoIterator<Document> mapReduce = mongoColl.mapReduce(MAP_REDUCE_QUERY);
                assertEquals(FIELD_INT_SUM, getMapReduceSizeAsString(mapReduce));
            }
View Full Code Here

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

    @Test
    public void testMapReduceQueryFuture() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                try {
                    MongoIterator<Document> mapReduce = addListenerCalledFlagSetter(mongoColl.mapReduceAsync(MAP_REDUCE_QUERY)).get();
                    assertEquals(FIELD_INT_SUM, getMapReduceSizeAsString(mapReduce));
View Full Code Here

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

    @Test
    public void testMapReduceBuilderFuture() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                try {
                    MongoIterator<Document> mapReduce = addListenerCalledFlagSetter(mongoColl.mapReduceAsync(MAP_REDUCE_QUERY)).get();
                    assertEquals(FIELD_INT_SUM, getMapReduceSizeAsString(mapReduce));
View Full Code Here

    private static final int PARALLEL_SCAN_CONCURRENT_ITERATORS = 2;
    private static final ParallelScan.Builder PARALLEL_SCAN_QUERY = ParallelScan.builder().setRequestedIteratorCount(PARALLEL_SCAN_CONCURRENT_ITERATORS);
       
    @Test
    public void testParallelScanQuery() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                Collection<MongoIterator<Document>> parallelScan = mongoColl.parallelScan(PARALLEL_SCAN_QUERY.build());
                assertEquals(1, parallelScan.size());
            }
View Full Code Here

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

    @Test
    public void testParallelScanBuilder() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                Collection<MongoIterator<Document>> parallelScan = mongoColl.parallelScan(PARALLEL_SCAN_QUERY);
                assertEquals(1, parallelScan.size());
            }
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.