Package ru.dreamteam.couch

Examples of ru.dreamteam.couch.CouchEntity


    private CouchEntity couchEntity1;

    @Before
    public void setUp() {
        comparator = HasIdComparator.INSTANCE;
        couchEntity1 = new CouchEntity();
        couchEntity1.setId("1");
    }
View Full Code Here


        Assert.assertEquals(0, comparator.compare(couchEntity1, couchEntity1));
    }

    @Test
    public void testDiff() throws Exception {
        CouchEntity couchEntity2 = new CouchEntity();
        couchEntity2.setId("2");
        Assert.assertTrue(comparator.compare(couchEntity1, couchEntity2) < 0);
        Assert.assertTrue(comparator.compare(couchEntity2, couchEntity1) > 0);
    }
View Full Code Here

        Assert.assertTrue(comparator.compare(couchEntity2, couchEntity1) > 0);
    }

    @Test
    public void testOneIdNull() throws Exception {
        CouchEntity couchEntity2 = new CouchEntity();
        Assert.assertTrue(comparator.compare(couchEntity1, couchEntity2) > 0);
        Assert.assertTrue(comparator.compare(couchEntity2, couchEntity1) < 0);
    }
View Full Code Here

        assertNotNull(changes);
    }

    @Test
    public void testDocChanges() throws Exception {
        CouchEntity entity = new CouchEntity();
        db.save(entity);

        List<Change> changes = query.limit(1).descending(true).list();
        assertEquals(1, changes.size());
        assertEquals(entity.getId(), changes.get(0).getId());
        assertEquals(entity.getRevision(), changes.get(0).getRev());
    }
View Full Code Here

TOP

Related Classes of ru.dreamteam.couch.CouchEntity

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.