Package com.impetus.client.crud.entities

Examples of com.impetus.client.crud.entities.AppUser


    }

    @Test
    public void test()
    {
        AppUser user = new AppUser();
        user.setId("id");
        PhoneDirectory properties = new PhoneDirectory();
        user.setPropertyContainer(properties);
        em.persist(user);

        em.clear();

        AppUser result = em.find(AppUser.class, "id");

        Assert.assertNotNull(result);
        Assert.assertNotNull(result.getId());
        Assert.assertNotNull(result.getPropertyKeys());
        Assert.assertFalse(result.getPropertyKeys().isEmpty());
        Assert.assertEquals(1, result.getPropertyKeys().size());
        Assert.assertNotNull(result.getNickName());
        Assert.assertFalse(result.getNickName().isEmpty());
        Assert.assertEquals(1, result.getNickName().size());
        Assert.assertTrue(result.getNickName().contains("kk"));
        Assert.assertNotNull(result.getFriendList());
        Assert.assertFalse(result.getFriendList().isEmpty());
        Assert.assertEquals(2, result.getFriendList().size());
        Assert.assertNotNull(result.getTags());
        Assert.assertFalse(result.getTags().isEmpty());
        Assert.assertEquals(1, result.getTags().size());
        Assert.assertEquals("yo", result.getTags().get(0));

        PhoneDirectory propertyContainer = result.getPhoneDirectory();
        Assert.assertNotNull(propertyContainer);
        Assert.assertEquals("MyPhoneDirectory", propertyContainer.getPhoneDirectoryName());
        Assert.assertNotNull(propertyContainer.getContactMap());
        Assert.assertFalse(propertyContainer.getContactMap().isEmpty());
        Assert.assertEquals(1, propertyContainer.getContactMap().size());
View Full Code Here


    @Test
    public void testConstraints()
    {
        try
        {
            AppUser user = new AppUser();
            user.setId("id");
            List<String> contactName = new LinkedList<String>();
            Map<String, String> contactMap = new HashMap<String, String>();
            Set<String> contactNumber = new HashSet<String>();
            contactName.add("xamry");
            contactMap.put("xamry", "9891991919");
            contactMap.put("xamry1", "98919919129");
            contactMap.put("xamry2", "98919919319");
            contactNumber.add("9891991919");
            String phoneDirectoryName = "MyPhoneDirectory";
            PhoneDirectory properties = new PhoneDirectory(phoneDirectoryName, contactName, contactMap, contactNumber);
            user.setPropertyContainer(properties);
            em.persist(user);

            em.clear();

        }
View Full Code Here

TOP

Related Classes of com.impetus.client.crud.entities.AppUser

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.