Examples of PhotographerUni_1_M_1_M


Examples of com.impetus.kundera.entity.photographer.PhotographerUni_1_M_1_M

    @Test
    public void testPhotographer()
    {
        // Construct photographer object
        PhotographerUni_1_M_1_M a1 = constructPhotographer(1);

        // Create a deep copy using Kundera
        long t1 = System.currentTimeMillis();
        PhotographerUni_1_M_1_M a2 = (PhotographerUni_1_M_1_M) ObjectUtils.deepCopy(a1,
                emf.getKunderaMetadataInstance());
        long t2 = System.currentTimeMillis();
        log.info("Time taken by Kundera:" + (t2 - t1));

        // Check for reference inequality
View Full Code Here

Examples of com.impetus.kundera.entity.photographer.PhotographerUni_1_M_1_M

    {
        int n = 100000;
        long t1 = System.currentTimeMillis();
        for (int i = 0; i < n; i++)
        {
            PhotographerUni_1_M_1_M a1 = constructPhotographer(i + 1);
            PhotographerUni_1_M_1_M a2 = (PhotographerUni_1_M_1_M) ObjectUtils.deepCopy(a1, emf.getKunderaMetadataInstance());
        }
        long t2 = System.currentTimeMillis();
        log.info("Time taken by Kundera Cloner for " + n + " records:" + (t2 - t1));
    }
View Full Code Here

Examples of com.impetus.kundera.entity.photographer.PhotographerUni_1_M_1_M

    /**
     * @return
     */
    private PhotographerUni_1_M_1_M constructPhotographer(int photographerId)
    {
        PhotographerUni_1_M_1_M a1 = new PhotographerUni_1_M_1_M();
        a1.setPhotographerId(photographerId);
        a1.setPhotographerName("Amresh");

        a1.setPersonalDetail(new PersonalDetail("xamry", "password1", "Single"));

        a1.addTweet(new Tweet("My First Tweet", "Web"));
        a1.addTweet(new Tweet("My Second Tweet", "Android"));
        a1.addTweet(new Tweet("My Third Tweet", "iPad"));

        a1.addTag("nosql");
        a1.addTag("kundera");
        a1.addTag("mongo");

        a1.addLikedBy(111);
        a1.addLikedBy(222);

        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.photographer.PhotographerUni_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.photographer.PhotographerUni_1_M_1_M

    @Test
    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);

        markAllNodeAsDirty();
View Full Code Here

Examples of com.impetus.kundera.tests.crossdatastore.pickr.entities.photographer.PhotographerUni_1_M_1_M

    }

    @Override
    public void addPhotographer()
    {
        PhotographerUni_1_M_1_M p = preparePhotographer();

        pickr.addPhotographer(p);
    }
View Full Code Here

Examples of com.impetus.kundera.tests.crossdatastore.pickr.entities.photographer.PhotographerUni_1_M_1_M

    }

    @Override
    public void updatePhotographer()
    {
        PhotographerUni_1_M_1_M p = (PhotographerUni_1_M_1_M) pickr.getPhotographer(PhotographerUni_1_M_1_M.class,
                photographerId);
        assertPhotographer(p);

        p.setPhotographerName("Vivek");

        pickr.mergePhotographer(p);

        PhotographerUni_1_M_1_M p2 = (PhotographerUni_1_M_1_M) pickr.getPhotographer(PhotographerUni_1_M_1_M.class,
                photographerId);

        assertModifiedPhotographer(p2);
    }
View Full Code Here

Examples of com.impetus.kundera.tests.crossdatastore.pickr.entities.photographer.PhotographerUni_1_M_1_M

    }

    @Override
    public void getPhotographer()
    {
        PhotographerUni_1_M_1_M p = (PhotographerUni_1_M_1_M) pickr.getPhotographer(PhotographerUni_1_M_1_M.class,
                photographerId);
        assertPhotographer(p);
    }
View Full Code Here

Examples of com.impetus.kundera.tests.crossdatastore.pickr.entities.photographer.PhotographerUni_1_M_1_M

    @Override
    public void getAllPhotographers()
    {
        List<Object> ps = pickr.getAllPhotographers(PhotographerUni_1_M_1_M.class.getSimpleName());
        PhotographerUni_1_M_1_M p = (PhotographerUni_1_M_1_M) ps.get(0);

        assertModifiedPhotographer(p);

    }
View Full Code Here

Examples of com.impetus.kundera.tests.crossdatastore.pickr.entities.photographer.PhotographerUni_1_M_1_M

    }

    @Override
    public void deletePhotographer()
    {
        PhotographerUni_1_M_1_M p = (PhotographerUni_1_M_1_M) pickr.getPhotographer(PhotographerUni_1_M_1_M.class,
                photographerId);
        assertModifiedPhotographer(p);
        pickr.deletePhotographer(p);
        PhotographerUni_1_M_1_M p2 = (PhotographerUni_1_M_1_M) pickr.getPhotographer(PhotographerUni_1_M_1_M.class,
                photographerId);
        Assert.assertNull(p2);

    }
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.