Package org.mongojack.mock

Examples of org.mongojack.mock.MockObject


        cursor.hasNext();
        cursor.in("blah", "blah");
    }

    private MockObject insertMockObject() {
        MockObject mockObject = new MockObject("someid", "hello", 10);
        mockObject.simpleList = Arrays.asList("a", "b", "c");
        coll.insert(mockObject);
        return mockObject;
    }
View Full Code Here


        coll.insert(mockObject);
        return mockObject;
    }

    private MockObject insertMockObjectWithEmbedded() {
        MockObject mockObject = new MockObject("someid", "hello", 10);
        MockEmbeddedObject embeddedObject = new MockEmbeddedObject();
        embeddedObject.value = "hello";
        embeddedObject.list = Arrays.asList("a", "b", "c");
        mockObject.object = embeddedObject;
        coll.insert(mockObject);
View Full Code Here

        coll.insert(mockObject);
        return mockObject;
    }

    private MockObject insertMockObjectWithComplexList() {
        MockObject mockObject = new MockObject("someid", "hello", 10);
        MockEmbeddedObject embeddedObject1 = new MockEmbeddedObject();
        embeddedObject1.value = "foo";
        embeddedObject1.list = Arrays.asList("a", "b", "c");
        MockEmbeddedObject embeddedObject2 = new MockEmbeddedObject();
        embeddedObject2.value = "bar";
View Full Code Here

        simpleMapReduce(MapReduce.OutputType.REPLACE, resultColl.getName());
    }

    private void simpleMapReduce(MapReduce.OutputType outputType,
            String collection) {
        coll.insert(new MockObject("foo", 10));
        coll.insert(new MockObject("foo", 15));
        coll.insert(new MockObject("bar", 5));

        MapReduceOutput<Simple, String> output = coll
                .mapReduce(MapReduce
                        .build("function() {emit(this.string, this.integer);}",
                                "function(k, vals) {var sum=0;for(var i in vals) sum += vals[i];return sum;}",
View Full Code Here

        complexMapReduce(MapReduce.OutputType.REPLACE, resultColl.getName());
    }

    private void complexMapReduce(MapReduce.OutputType outputType,
            String collection) {
        coll.insert(new MockObject("foo", 10));
        coll.insert(new MockObject("foo", 15));
        coll.insert(new MockObject("bar", 5));

        MapReduceOutput<Complex, String> output =
                coll
                        .mapReduce(MapReduce
                                .build("function() {emit(this.string, {sum: this.integer, product: this.integer});}",
View Full Code Here

TOP

Related Classes of org.mongojack.mock.MockObject

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.