Package com.allanbank.mongodb.bson

Examples of com.allanbank.mongodb.bson.Document


    @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));
            }
        }).start().join();
    }
View Full Code Here


    @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));
            }
        }).start().join();
    }
View Full Code Here

    public void testExplainAggregateQueryFuture() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                try {
                    Document explain = addListenerCalledFlagSetter(mongoColl.explainAsync(AGGREGATE_QUERY.build())).get();
                    assertNotNull(explain.get(FIELD_AGGREGATE_RESULT_STAGES_NAME));
                    assertListenerCalled();
                } catch (ExecutionException ex) {
                    fail(ex.getLocalizedMessage());
                }
            }
View Full Code Here

    public void testExplainAggregateBuilderFuture() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                try {
                    Document explain = addListenerCalledFlagSetter(mongoColl.explainAsync(AGGREGATE_QUERY)).get();
                    assertNotNull(explain.get(FIELD_AGGREGATE_RESULT_STAGES_NAME));
                    assertListenerCalled();
                } catch (ExecutionException ex) {
                    fail(ex.getLocalizedMessage());
                }
            }
View Full Code Here

    public void testExplainFindQueryFuture() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                try {
                    Document explain = addListenerCalledFlagSetter(mongoColl.explainAsync(Find.builder().query(FIND_DOCUMENT).build())).get();
                    assertNotNull(explain.get(FIELD_AGGREGATE_RESULT_CURSOR_NAME));
                    assertListenerCalled();
                } catch (ExecutionException ex) {
                    fail(ex.getLocalizedMessage());
                }
            }
View Full Code Here

    public void testExplainFindBuilderFuture() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                try {
                    Document explain = addListenerCalledFlagSetter(mongoColl.explainAsync(Find.builder().query(FIND_DOCUMENT))).get();
                    assertNotNull(explain.get(FIELD_AGGREGATE_RESULT_CURSOR_NAME));
                    assertListenerCalled();
                } catch (ExecutionException ex) {
                    fail(ex.getLocalizedMessage());
                }
            }
View Full Code Here

    @Test
    public void testFindAndModifyQuery() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                Document findAndModify = mongoColl.findAndModify(FIND_AND_MODIFY_BUILDER.build());
                assertEquals(UPDATE_VALUE.toString(), findAndModify.get(FIELD_INT_NAME).getValueAsString());
            }
        }).start().join();
    }
View Full Code Here

    @Test
    public void testFindAndModifyBuilder() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                Document findAndModify = mongoColl.findAndModify(FIND_AND_MODIFY_BUILDER);
                assertEquals(UPDATE_VALUE.toString(), findAndModify.get(FIELD_INT_NAME).getValueAsString());
            }
        }).start().join();
    }
View Full Code Here

    public void testFindAndModifyQueryFuture() throws ExecutionException, InterruptedException {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                try {
                    Document findAndModify = addListenerCalledFlagSetter(mongoColl.findAndModifyAsync(FIND_AND_MODIFY_BUILDER.build())).get();
                    assertEquals(UPDATE_VALUE.toString(), findAndModify.get(FIELD_INT_NAME).getValueAsString());
                    assertListenerCalled();
                } catch (ExecutionException ex) {
                    fail(ex.getLocalizedMessage());
                }
            }
View Full Code Here

TOP

Related Classes of com.allanbank.mongodb.bson.Document

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.