Package org.openengsb.core.persistence.test.objects

Examples of org.openengsb.core.persistence.test.objects.B


            new DefaultPersistenceService(tmpDir, new DefaultObjectPersistenceBackend(), persistenceIndex);
    }

    @Test
    public void testPersistingAndLoadingObject_shouldWork() throws Exception {
        persistenceService.create(new B());
        List<B> query = persistenceService.query(new B());
        assertEquals(1, query.size());
    }
View Full Code Here


        assertEquals(1, query.size());
    }

    @Test
    public void testPersistingAndLoadingVariousObject_shouldWork() throws Exception {
        persistenceService.create(new B());
        persistenceService.create(new A());
        List<A> query = persistenceService.query(new A());
        assertEquals(2, query.size());
    }
View Full Code Here

        assertEquals(2, query.size());
    }

    @Test
    public void testQueryBySample_shouldReturnCorrectObject() throws Exception {
        persistenceService.create(new B("other"));
        persistenceService.create(new A("blub"));
        List<A> query = persistenceService.query(new A("blub"));
        assertEquals(1, query.size());
    }
View Full Code Here

        assertEquals(1, query.size());
    }

    @Test
    public void testPersistingAndLoadingVariousMultibleObjects() throws Exception {
        persistenceService.create(Lists.newArrayList(new B(), new A()));
        List<B> query = persistenceService.query(new B());
        assertEquals(1, query.size());
    }
View Full Code Here

        assertEquals(1, query.size());
    }

    @Test
    public void testUpdatingAndRetrievingUpdatedObjects_shouldReturnUpdatedObjects() throws Exception {
        persistenceService.create(Lists.newArrayList(new B(), new A()));
        List<B> query = persistenceService.query(new B("blub"));
        assertEquals(0, query.size());
        persistenceService.update(new B(), new B("blub"));
        query = persistenceService.query(new B("blub"));
        assertEquals(1, query.size());
    }
View Full Code Here

        assertEquals(1, query.size());
    }

    @Test
    public void testDeleteObject_shouldRemoveItFromDatabase() throws Exception {
        persistenceService.create(Lists.newArrayList(new B("blub"), new A()));
        List<B> query = persistenceService.query(new B("blub"));
        assertEquals(1, query.size());
        persistenceService.delete(new B("blub"));
        query = persistenceService.query(new B("blub"));
        assertEquals(0, query.size());
    }
View Full Code Here

TOP

Related Classes of org.openengsb.core.persistence.test.objects.B

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.