Search in sources :

Example 1 with SubviewDocumentCollectionsView

use of com.blazebit.persistence.view.testsuite.collections.subview.model.SubviewDocumentCollectionsView in project blaze-persistence by Blazebit.

the class NestedCollectionsTest method assertSubviewCollectionEquals.

private void assertSubviewCollectionEquals(Set<DocumentForCollections> ownedDocuments, Set<? extends SubviewDocumentCollectionsView> ownedSubviewDocuments) {
    assertEquals(ownedDocuments.size(), ownedSubviewDocuments.size());
    for (DocumentForCollections doc : ownedDocuments) {
        boolean found = false;
        for (SubviewDocumentCollectionsView docSub : ownedSubviewDocuments) {
            if (doc.getName().equals(docSub.getName())) {
                found = true;
                assertSubviewEquals(doc.getContacts(), docSub.getContacts());
                assertSubviewEquals(doc.getPartners(), docSub.getPartners());
                assertSubviewEquals(doc.getPersonList(), docSub.getPersonList());
                break;
            }
        }
        if (!found) {
            Assert.fail("Could not find a SubviewDocumentCollectionsView with the name: " + doc.getName());
        }
    }
}
Also used : DocumentForCollections(com.blazebit.persistence.view.testsuite.collections.entity.simple.DocumentForCollections) SubviewDocumentCollectionsView(com.blazebit.persistence.view.testsuite.collections.subview.model.SubviewDocumentCollectionsView)

Example 2 with SubviewDocumentCollectionsView

use of com.blazebit.persistence.view.testsuite.collections.subview.model.SubviewDocumentCollectionsView in project blaze-persistence by Blazebit.

the class NestedEmptyCollectionsTest method assertSubviewCollectionEquals.

private void assertSubviewCollectionEquals(Set<DocumentForCollections> ownedDocuments, Set<? extends SubviewDocumentCollectionsView> ownedSubviewDocuments) {
    assertEquals(ownedDocuments.size(), ownedSubviewDocuments.size());
    for (DocumentForCollections doc : ownedDocuments) {
        boolean found = false;
        for (SubviewDocumentCollectionsView docSub : ownedSubviewDocuments) {
            if (doc.getName().equals(docSub.getName())) {
                found = true;
                assertSubviewEquals(doc.getContacts(), docSub.getContacts());
                assertSubviewEquals(doc.getPartners(), docSub.getPartners());
                assertSubviewEquals(doc.getPersonList(), docSub.getPersonList());
                break;
            }
        }
        if (!found) {
            Assert.fail("Could not find a SubviewDocumentCollectionsView with the name: " + doc.getName());
        }
    }
}
Also used : DocumentForCollections(com.blazebit.persistence.view.testsuite.collections.entity.simple.DocumentForCollections) SubviewDocumentCollectionsView(com.blazebit.persistence.view.testsuite.collections.subview.model.SubviewDocumentCollectionsView)

Aggregations

DocumentForCollections (com.blazebit.persistence.view.testsuite.collections.entity.simple.DocumentForCollections)2 SubviewDocumentCollectionsView (com.blazebit.persistence.view.testsuite.collections.subview.model.SubviewDocumentCollectionsView)2