Package org.mongojack.mock

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


        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

        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

    }

    @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

        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

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

    @Test
    public void testInsertRetrieveDate() {
        MockObject object = new MockObject();
        object.date = new Date(10000);
        coll.insert(object);
        MockObject result = coll.findOne();
        assertEquals(object.date, result.date);
    }
View Full Code Here

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

    @Test
    public void testDateIsStoredAsBsonDate() {
        MockObject object = new MockObject();
        object.date = new Date(10000);
        coll.insert(object);
        DBObject result = coll.getDbCollection().findOne();
        assertEquals(object.date, result.get("date"));
    }
View Full Code Here

        assertEquals(object.date, result.get("date"));
    }

    @Test
    public void testInsertRetrieveEmptyList() {
        MockObject object = new MockObject();
        object.simpleList = Collections.emptyList();
        coll.insert(object);
        MockObject result = coll.findOne();
        assertEquals(object.simpleList, result.simpleList);
    }
View Full Code Here

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

    @Test
    public void testInsertRetrievePopulatedSimpleList() {
        MockObject object = new MockObject();
        object.simpleList = Arrays.asList("1", "2");
        coll.insert(object);
        MockObject result = coll.findOne();
        assertEquals(object.simpleList, result.simpleList);
    }
View Full Code Here

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

    @Test
    public void testInsertRetrievePopulatedComplexList() {
        MockObject object = new MockObject();
        MockEmbeddedObject o1 = new MockEmbeddedObject();
        o1.value = "o1";
        MockEmbeddedObject o2 = new MockEmbeddedObject();
        o2.value = "o2";
        object.complexList = Arrays.asList(o1, o2);
        coll.insert(object);
        MockObject result = coll.findOne();
        assertEquals(object.complexList, result.complexList);
    }
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.