Package org.opentides.bean.user

Examples of org.opentides.bean.user.UserCredential


}

    @Test
    public void testRetrieveObjectMap() {
      UserCriteria user = new UserCriteria();
      UserCredential cred = new UserCredential();
      user.setFirstName("Test");
         user.setEmailAddress("admin@ideyatech.com");
        cred.setUsername("testname");
      cred.setPassword("password");
      cred.setId(123l);
      cred.setEnabled(true);
      user.setCredential(cred);
      Map<String, Object> map = new HashMap<String, Object>();
      map.put("user", user);
      map.put("cred", cred);
      Assert.assertEquals("Test", CrudUtil.retrieveObjectValue(map, "user.firstName"));
View Full Code Here


    }
   
    @Test
    public void testRetrieveObjectType() {
      UserCriteria user = new UserCriteria();
      UserCredential cred = new UserCredential();
      user.setFirstName("Test");
         user.setEmailAddress("admin@ideyatech.com");
        cred.setUsername("testname");
      cred.setPassword("password");
      cred.setId(123l);
      cred.setEnabled(true);
      user.setCredential(cred);
      Assert.assertEquals(String.class, CrudUtil.retrieveObjectType(user, "firstName"));
      Assert.assertEquals(String.class, CrudUtil.retrieveObjectType(user, "credential.username"));
      Assert.assertEquals(Long.class, CrudUtil.retrieveObjectType(user, "credential.id"));
      try {
View Full Code Here

    }

    @Test
    public void testReplaceSQLParameters() {
      UserCriteria user = new UserCriteria();
      UserCredential cred = new UserCredential();
      user.setFirstName("Test");
         user.setEmailAddress("admin@ideyatech.com");
        cred.setUsername("testname");
      cred.setPassword("password");
      cred.setId(123l);
      cred.setEnabled(true);
      user.setCredential(cred);
      Assert.assertEquals("firstName='Test' and credential.id=123",
          CrudUtil.replaceSQLParameters("firstName=:firstName and credential.id=:credential.id", user));
    }
View Full Code Here

    }
   
    @Test
    public void testReplaceSQLParametersList() {
      UserCriteria user = new UserCriteria();
      UserCredential cred = new UserCredential();
         List<SystemCodes> favorites = new ArrayList<SystemCodes>();
         List<String> alias = new ArrayList<String>();
         favorites.add(new SystemCodes("FAVORITES","BANANA","Banana"));
         favorites.add(new SystemCodes("FAVORITES","MANGO","Mango"));
         alias.add("name1");
         alias.add("name2");
      user.setFirstName("Test");
         user.setEmailAddress("admin@ideyatech.com");
         user.setFavorites(favorites);
         user.setAlias(alias);
        cred.setUsername("testname");
      cred.setPassword("password");
      cred.setId(123l);
      cred.setEnabled(true);
      user.setCredential(cred);
      Assert.assertEquals("firstName='Test' and credential.id=123 and favorites in ( 'BANANA', 'MANGO' ) and alias in ( 'name1', 'name2' )",
          CrudUtil.replaceSQLParameters("firstName=:firstName and credential.id=:credential.id " +
              "and favorites in ( :favorites ) and alias in ( :alias )", user));
    }
View Full Code Here

TOP

Related Classes of org.opentides.bean.user.UserCredential

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.