Examples of AlbumUni_1_M_1_M


Examples of com.impetus.kundera.entity.album.AlbumUni_1_M_1_M

    public void testPhotographer()
    {
        // Object 1
        PhotographerUni_1_M_1_M a1 = new PhotographerUni_1_M_1_M();
        a1.setPhotographerId(1);
        AlbumUni_1_M_1_M b11 = new AlbumUni_1_M_1_M();
        b11.setAlbumId("b1");
        AlbumUni_1_M_1_M b12 = new AlbumUni_1_M_1_M();
        b12.setAlbumId("b2");

        PhotoUni_1_M_1_M c11 = new PhotoUni_1_M_1_M();
        c11.setPhotoId("c1");
        PhotoUni_1_M_1_M c12 = new PhotoUni_1_M_1_M();
        c12.setPhotoId("c2");
        PhotoUni_1_M_1_M c13 = new PhotoUni_1_M_1_M();
        c13.setPhotoId("c3");
        PhotoUni_1_M_1_M c14 = new PhotoUni_1_M_1_M();
        c14.setPhotoId("c4");

        b11.addPhoto(c11);
        b11.addPhoto(c12);
        b12.addPhoto(c13);
        b12.addPhoto(c14);
        a1.addAlbum(b11);
        a1.addAlbum(b12);

        // Object2
        PhotographerUni_1_M_1_M a2 = new PhotographerUni_1_M_1_M();
        a2.setPhotographerId(1);
        AlbumUni_1_M_1_M b21 = new AlbumUni_1_M_1_M();
        b21.setAlbumId("b1");
        AlbumUni_1_M_1_M b22 = new AlbumUni_1_M_1_M();
        b22.setAlbumId("b2");

        PhotoUni_1_M_1_M c21 = new PhotoUni_1_M_1_M();
        c21.setPhotoId("c1");
        PhotoUni_1_M_1_M c22 = new PhotoUni_1_M_1_M();
        c22.setPhotoId("c2");
        PhotoUni_1_M_1_M c23 = new PhotoUni_1_M_1_M();
        c23.setPhotoId("c3");
        PhotoUni_1_M_1_M c24 = new PhotoUni_1_M_1_M();
        c24.setPhotoId("c4");

        b21.addPhoto(c21);
        b21.addPhoto(c22);
        b22.addPhoto(c23);
        b22.addPhoto(c24);
        a2.addAlbum(b21);
        a2.addAlbum(b22);

        // Equality test
        assertTrue(DeepEquals.deepEquals(a1, a2));

        // Inequality test
        a2.setPhotographerId(2);
        assertFalse(DeepEquals.deepEquals(a1, a2));
        a2.setPhotographerId(1);

        // Case 1: All same
        assertTrue(DeepEquals.deepEquals(a1, a2));
        assertTrue(DeepEquals.deepEquals(b12, b22));
        assertTrue(DeepEquals.deepEquals(c14, c24));

        // Case 2: Change Photo object
        String originalPhotoCaption = c24.getPhotoCaption();
        c24.setPhotoCaption("AAAAAAAAAAAAA");

        assertTrue(DeepEquals.deepEquals(a1, a2));
        assertTrue(DeepEquals.deepEquals(b12, b22));
        assertFalse(DeepEquals.deepEquals(c14, c24));

        c24.setPhotoCaption(originalPhotoCaption);

        // Case 3: Change Album object
        String originalAlbumDiscription = b22.getAlbumDescription();
        b22.setAlbumDescription("Second Album of Second Photographer");

        assertTrue(DeepEquals.deepEquals(a1, a2));
        assertFalse(DeepEquals.deepEquals(b12, b22));
        assertTrue(DeepEquals.deepEquals(c14, c24));

        b22.setAlbumDescription(originalAlbumDiscription);

        // Case 4: Change album and photo object
        c24.setPhotoCaption("AAAAAAAAAAAAA");
        b22.setAlbumDescription("Second Album of Second Photographer");

        assertTrue(DeepEquals.deepEquals(a1, a2));
        assertFalse(DeepEquals.deepEquals(b12, b22));
        assertFalse(DeepEquals.deepEquals(c14, c24));

        b22.setAlbumDescription(originalAlbumDiscription);
        c24.setPhotoCaption(originalPhotoCaption);

        // Case 5: Change Photographer object
        String originalPhotographerName = a2.getPhotographerName();
        a2.setPhotographerName("Kuldeep");

        assertFalse(DeepEquals.deepEquals(a1, a2));
        assertTrue(DeepEquals.deepEquals(b12, b22));
        assertTrue(DeepEquals.deepEquals(c14, c24));

        a2.setPhotographerName(originalPhotographerName);

        // Case 6: Change Photographer and photo object
        c24.setPhotoCaption("AAAAAAAAAAAAA");
        a2.setPhotographerName("Kuldeep");

        assertFalse(DeepEquals.deepEquals(a1, a2));
        assertTrue(DeepEquals.deepEquals(b12, b22));
        assertFalse(DeepEquals.deepEquals(c14, c24));

        a2.setPhotographerName(originalPhotographerName);
        c24.setPhotoCaption(originalPhotoCaption);

        // Case 7: Change Photographer and album object
        b22.setAlbumDescription("Second Album of Second Photographer");
        a2.setPhotographerName("Kuldeep");

        assertFalse(DeepEquals.deepEquals(a1, a2));
        assertFalse(DeepEquals.deepEquals(b12, b22));
        assertTrue(DeepEquals.deepEquals(c14, c24));

        a2.setPhotographerName(originalPhotographerName);
        b22.setAlbumDescription(originalAlbumDiscription);

        // Case 8: Change Photographer, album and photo object
        c24.setPhotoCaption("AAAAAAAAAAAAA");
        b22.setAlbumDescription("Second Album of Second Photographer");
        a2.setPhotographerName("Kuldeep");

        assertFalse(DeepEquals.deepEquals(a1, a2));
        assertFalse(DeepEquals.deepEquals(b12, b22));
        assertFalse(DeepEquals.deepEquals(c14, c24));

        a2.setPhotographerName(originalPhotographerName);
        b22.setAlbumDescription(originalAlbumDiscription);
        c24.setPhotoCaption(originalPhotoCaption);
    }
View Full Code Here

Examples of com.impetus.kundera.entity.album.AlbumUni_1_M_1_M

        a1.addComment(111, "What a post!");
        a1.addComment(222, "I am getting NPE on line no. 145");
        a1.addComment(333, "My hobby is to spam blogs");

        AlbumUni_1_M_1_M b11 = new AlbumUni_1_M_1_M("b1", "Album 1", "This is album 1");
        AlbumUni_1_M_1_M b12 = new AlbumUni_1_M_1_M("b2", "Album 2", "This is album 2");

        PhotoUni_1_M_1_M c11 = new PhotoUni_1_M_1_M("c1", "Photo 1", "This is Photo 1");
        PhotoUni_1_M_1_M c12 = new PhotoUni_1_M_1_M("c2", "Photo 2", "This is Photo 2");
        PhotoUni_1_M_1_M c13 = new PhotoUni_1_M_1_M("c3", "Photo 3", "This is Photo 3");
        PhotoUni_1_M_1_M c14 = new PhotoUni_1_M_1_M("c4", "Photo 4", "This is Photo 4");

        b11.addPhoto(c11);
        b11.addPhoto(c12);
        b12.addPhoto(c13);
        b12.addPhoto(c14);
        a1.addAlbum(b11);
        a1.addAlbum(b12);
        return a1;
    }
View Full Code Here

Examples of com.impetus.kundera.entity.album.AlbumUni_1_M_1_M

        tweets.add(tweet1);
        tweets.add(tweet2);
        tweets.add(tweet3);
        p.setTweets(tweets);

        AlbumUni_1_M_1_M b11 = new AlbumUni_1_M_1_M("Xb1", "XAlbum 1", "XThis is album 1");
        AlbumUni_1_M_1_M b12 = new AlbumUni_1_M_1_M("Xb2", "XAlbum 2", "XThis is album 2");

        PhotoUni_1_M_1_M c11 = new PhotoUni_1_M_1_M("Xc1", "XPhoto 1", "XThis is Photo 1");
        PhotoUni_1_M_1_M c12 = new PhotoUni_1_M_1_M("Xc2", "Photo 2", "XThis is Photo 2");
        PhotoUni_1_M_1_M c13 = new PhotoUni_1_M_1_M("Xc3", "XPhoto 3", "XThis is Photo 3");
        PhotoUni_1_M_1_M c14 = new PhotoUni_1_M_1_M("Xc4", "XPhoto 4", "XThis is Photo 4");

        b11.addPhoto(c11);
        b11.addPhoto(c12);
        b12.addPhoto(c13);
        b12.addPhoto(c14);

        List<AlbumUni_1_M_1_M> albums = new ArrayList<AlbumUni_1_M_1_M>();
        albums.add(b11);
        albums.add(b12);
        p.setAlbums(albums);
View Full Code Here

Examples of com.impetus.kundera.entity.album.AlbumUni_1_M_1_M

        }

        Assert.assertFalse(p1.getAlbums() == p2.getAlbums());
        for (int i = 0; i < p1.getAlbums().size(); i++)
        {
            AlbumUni_1_M_1_M p1Album = p1.getAlbums().get(i);
            AlbumUni_1_M_1_M p2Album = p2.getAlbums().get(i);
            Assert.assertFalse(p1Album == p2Album);
            Assert.assertFalse(p1Album.getAlbumId() == p2Album.getAlbumId());
            Assert.assertFalse(p1Album.getAlbumName() == p2Album.getAlbumName());
            Assert.assertFalse(p1Album.getAlbumDescription() == p2Album.getAlbumDescription());

            Assert.assertFalse(p1.getAlbums().get(i).getPhotos() == p2.getAlbums().get(i).getPhotos());

            for (int j = 0; j < p1.getAlbums().get(i).getPhotos().size(); j++)
            {
View Full Code Here

Examples of com.impetus.kundera.entity.album.AlbumUni_1_M_1_M

    public void test_1_M_1_M()
    {
        FlushManager flushManager = new FlushManager();
        PhotographerUni_1_M_1_M a = new PhotographerUni_1_M_1_M();
        a.setPhotographerId(1);
        AlbumUni_1_M_1_M b1 = new AlbumUni_1_M_1_M();
        b1.setAlbumId("b1");
        AlbumUni_1_M_1_M b2 = new AlbumUni_1_M_1_M();
        b2.setAlbumId("b2");

        PhotoUni_1_M_1_M c1 = new PhotoUni_1_M_1_M();
        c1.setPhotoId("c1");
        PhotoUni_1_M_1_M c2 = new PhotoUni_1_M_1_M();
        c2.setPhotoId("c2");
        PhotoUni_1_M_1_M c3 = new PhotoUni_1_M_1_M();
        c3.setPhotoId("c3");
        PhotoUni_1_M_1_M c4 = new PhotoUni_1_M_1_M();
        c4.setPhotoId("c4");

        b1.addPhoto(c1);
        b1.addPhoto(c2);
        b2.addPhoto(c3);
        b2.addPhoto(c4);
        a.addAlbum(b1);
        a.addAlbum(b2);

        ObjectGraph graph = graphBuilder.getObjectGraph(a, null);
        pc.getMainCache().addGraphToCache(graph, pc);
View Full Code Here

Examples of com.impetus.kundera.tests.crossdatastore.pickr.entities.album.AlbumUni_1_M_1_M

    {
        PhotographerUni_1_M_1_M p = new PhotographerUni_1_M_1_M();
        p.setPhotographerId(photographerId);
        p.setPhotographerName("Amresh");

        AlbumUni_1_M_1_M album1 = new AlbumUni_1_M_1_M("album_1", "My Phuket Vacation", "Went Phuket with friends");
        album1.addPhoto(new PhotoUni_1_M_1_M("photo_1", "One beach", "On beach with friends"));
        album1.addPhoto(new PhotoUni_1_M_1_M("photo_2", "In Hotel", "Chilling out in room"));
        album1.addPhoto(new PhotoUni_1_M_1_M("photo_3", "At Airport", "So tired"));

        AlbumUni_1_M_1_M album2 = new AlbumUni_1_M_1_M("album_2", "Office Pics", "Annual office party photos");
        album2.addPhoto(new PhotoUni_1_M_1_M("photo_4", "Office Team event", "Shot at Fun park"));
        album2.addPhoto(new PhotoUni_1_M_1_M("photo_5", "My Team", "My team is the best"));

        p.addAlbum(album1);
        p.addAlbum(album2);
        return p;
View Full Code Here

Examples of com.impetus.kundera.tests.crossdatastore.pickr.entities.album.AlbumUni_1_M_1_M

        Assert.assertNotNull(p.getAlbums());
        Assert.assertFalse(p.getAlbums().isEmpty());
        Assert.assertEquals(2, p.getAlbums().size());

        AlbumUni_1_M_1_M album1 = p.getAlbums().get(0);
        Assert.assertNotNull(album1);
        Assert.assertTrue(album1.getAlbumId().equals("album_1") || album1.getAlbumId().equals("album_2"));

        Assert.assertFalse(album1.getAlbumName().length() == 0);
        Assert.assertFalse(album1.getAlbumDescription().length() == 0);

        List<PhotoUni_1_M_1_M> album1Photos = album1.getPhotos();
        Assert.assertNotNull(album1Photos);
        Assert.assertFalse(album1Photos.isEmpty());
        Assert.assertFalse(album1Photos.size() < 2);

        PhotoUni_1_M_1_M album1Photo1 = album1Photos.get(0);
        Assert.assertNotNull(album1Photo1);
        Assert.assertEquals(7, album1Photo1.getPhotoId().length());

        AlbumUni_1_M_1_M album2 = p.getAlbums().get(1);
        Assert.assertNotNull(album2);
        Assert.assertTrue(album2.getAlbumId().equals("album_1") || album2.getAlbumId().equals("album_2"));

        Assert.assertFalse(album2.getAlbumName().length() == 0);
        Assert.assertFalse(album2.getAlbumDescription().length() == 0);

        List<PhotoUni_1_M_1_M> album2Photos = album2.getPhotos();
        Assert.assertNotNull(album2Photos);
        Assert.assertFalse(album2Photos.isEmpty());
        Assert.assertFalse(album2Photos.size() < 2);

        PhotoUni_1_M_1_M album2Photo1 = album2Photos.get(0);
View Full Code Here

Examples of com.impetus.kundera.tests.crossdatastore.pickr.entities.album.AlbumUni_1_M_1_M

        Assert.assertNotNull(p.getAlbums());
        Assert.assertFalse(p.getAlbums().isEmpty());
        Assert.assertEquals(2, p.getAlbums().size());

        AlbumUni_1_M_1_M album1 = p.getAlbums().get(0);
        Assert.assertNotNull(album1);
        Assert.assertTrue(album1.getAlbumId().equals("album_1") || album1.getAlbumId().equals("album_2"));

        Assert.assertFalse(album1.getAlbumName().length() == 0);
        Assert.assertFalse(album1.getAlbumDescription().length() == 0);

        List<PhotoUni_1_M_1_M> album1Photos = album1.getPhotos();
        Assert.assertNotNull(album1Photos);
        Assert.assertFalse(album1Photos.isEmpty());
        Assert.assertFalse(album1Photos.size() < 2);

        PhotoUni_1_M_1_M album1Photo1 = album1Photos.get(0);
        Assert.assertNotNull(album1Photo1);
        Assert.assertEquals(7, album1Photo1.getPhotoId().length());

        AlbumUni_1_M_1_M album2 = p.getAlbums().get(1);
        Assert.assertNotNull(album2);
        Assert.assertTrue(album2.getAlbumId().equals("album_1") || album2.getAlbumId().equals("album_2"));

        Assert.assertFalse(album2.getAlbumName().length() == 0);
        Assert.assertFalse(album2.getAlbumDescription().length() == 0);

        List<PhotoUni_1_M_1_M> album2Photos = album2.getPhotos();
        Assert.assertNotNull(album2Photos);
        Assert.assertFalse(album2Photos.isEmpty());
        Assert.assertFalse(album2Photos.size() < 2);

        PhotoUni_1_M_1_M album2Photo1 = album2Photos.get(0);
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.