Examples of MockObject


Examples of org.mongojack.mock.MockObject

        coll = getCollection(MockObject.class, String.class);
    }

    @Test
    public void testInsertNoId() {
        MockObject object = new MockObject();
        coll.insert(object);
        assertNotNull(coll.findOne()._id);
    }
View Full Code Here

Examples of org.mongojack.mock.MockObject

        assertNotNull(coll.findOne()._id);
    }

    @Test
    public void testInsertRetrieveAllEmpty() {
        MockObject object = new MockObject();
        object._id = "1";
        coll.insert(object);
        MockObject result = coll.findOne();
        assertEquals(object, result);
    }
View Full Code Here

Examples of org.mongojack.mock.MockObject

        assertEquals(object, result);
    }

    @Test
    public void testInsertRetrieveString() {
        MockObject object = new MockObject();
        object.string = "a string";
        coll.insert(object);
        MockObject result = coll.findOne();
        assertEquals(object.string, result.string);
    }
View Full Code Here

Examples of org.mongojack.mock.MockObject

        assertEquals(object.string, result.string);
    }

    @Test
    public void testInsertRetrieveInteger() {
        MockObject object = new MockObject();
        object.integer = 10;
        coll.insert(object);
        MockObject result = coll.findOne();
        assertEquals(object.integer, result.integer);
    }
View Full Code Here

Examples of org.mongojack.mock.MockObject

        assertEquals(object.integer, result.integer);
    }

    @Test
    public void testInsertRetrieveLong() {
        MockObject object = new MockObject();
        object.longs = 10L;
        coll.insert(object);
        MockObject result = coll.findOne();
        assertEquals(object.longs, result.longs);
    }
View Full Code Here

Examples of org.mongojack.mock.MockObject

    }

    @Test
    @Ignore("BSON doesn't yet know how to handle BigInteger")
    public void testInsertRetrieveBigInteger() {
        MockObject object = new MockObject();
        object.bigInteger = BigInteger.valueOf(100);
        coll.insert(object);
        MockObject result = coll.findOne();
        assertEquals(object.bigInteger, result.bigInteger);
    }
View Full Code Here

Examples of org.mongojack.mock.MockObject

        assertEquals(object.bigInteger, result.bigInteger);
    }

    @Test
    public void testInsertRetrieveFloat() {
        MockObject object = new MockObject();
        object.floats = 3.0f;
        coll.insert(object);
        MockObject result = coll.findOne();
        assertEquals(object.floats, result.floats);
    }
View Full Code Here

Examples of org.mongojack.mock.MockObject

        assertEquals(object.floats, result.floats);
    }

    @Test
    public void testInsertRetrieveDouble() {
        MockObject object = new MockObject();
        object.doubles = 4.65;
        coll.insert(object);
        MockObject result = coll.findOne();
        assertEquals(object.doubles, result.doubles);
    }
View Full Code Here

Examples of org.mongojack.mock.MockObject

    }

    @Test
    @Ignore("BSON doesn't yet know how to handle BigDecimal")
    public void testInsertRetrieveBigDecimal() {
        MockObject object = new MockObject();
        object.bigDecimal = BigDecimal.valueOf(4, 6);
        coll.insert(object);
        MockObject result = coll.findOne();
        assertEquals(object.bigDecimal, result.bigDecimal);
    }
View Full Code Here

Examples of org.mongojack.mock.MockObject

        assertEquals(object.bigDecimal, result.bigDecimal);
    }

    @Test
    public void testInsertRetrieveBoolean() {
        MockObject object = new MockObject();
        object.booleans = true;
        coll.insert(object);
        MockObject result = coll.findOne();
        assertEquals(object.booleans, result.booleans);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.