Package com.cubusmail.common.model

Examples of com.cubusmail.common.model.UserAccount


  public void testUserAccountPerformance() {

    IUserAccountDao userAccountDao = (IUserAccountDao) this.applicationContext.getBean( "userAccountDao" );

    for (int i = 0; i < 1000000; i++) {
      UserAccount testAccount = (UserAccount) this.applicationContext.getBean( "testUserAccount" );
      testAccount.setUsername( "testuser" + i );
      userAccountDao.saveUserAccount( testAccount );
    }
  }
View Full Code Here


  @Test
  public void createTestData() {

    try {
      UserAccount account = this.userAccountDao.getUserAccountByUsername( "schlierf" );
      List<AddressFolder> folderList = this.userAccountDao.retrieveAddressFolders( account );
      AddressFolder addressFolder = folderList.get( 0 );
      for (int i = 0; i < alpha.length(); i++) {
        char begin = alpha.charAt( i );
        for (int j = 1; j < 2; j++) {
View Full Code Here

  @Test
  public void testCreateUpdateUserAccount() {

    try {
      UserAccount userAccount = this.userAccountDao.getUserAccountByUsername( "testuser" );
      Assert.assertNotNull( userAccount );

      userAccount.getPreferences().setTheme( "Testtheme" );
      this.userAccountDao.saveUserAccount( userAccount );

      UserAccount userAccount2 = this.userAccountDao.getUserAccountByUsername( "testuser" );
      Assert.assertEquals( "Testtheme", userAccount2.getPreferences().getTheme() );
    }
    catch (Exception e) {
      log.error( e.getMessage(), e );
      Assert.fail( e.getMessage() );
    }
View Full Code Here

  public void testInsertIdentities() {

    try {
      this.userAccountDao.saveIdentities( this.testUserAccount );

      UserAccount userAccount = userAccountDao.getUserAccountByUsername( "testuser" );
      Assert.assertNotNull( userAccount.getIdentities() );
      Assert.assertTrue( "identities not loaded!", userAccount.getIdentities().size() >= 4 );
      Assert.assertEquals( userAccount, userAccount.getIdentities().get( 0 ).getUserAccount() );
    }
    catch (Exception e) {
      log.error( e.getMessage(), e );
      Assert.fail( e.getMessage() );
    }
View Full Code Here

      List<Long> ids = new ArrayList<Long>();
      ids.add( this.testUserAccount.getIdentities().get( 0 ).getId() );
      ids.add( this.testUserAccount.getIdentities().get( 1 ).getId() );
      this.userAccountDao.deleteIdentities( ids );

      UserAccount testUserAccount2 = this.userAccountDao.getUserAccountByUsername( "testuser" );
      Assert.assertEquals( testUserAccount2.getIdentities().size(), identityCount - 2 );
    }
    catch (Exception e) {
      log.error( e.getMessage(), e );
      Assert.fail( e.getMessage() );
    }
View Full Code Here

   * com.cubusmail.gwtui.client.services.IUserAccountService#saveUserAccount
   * (com.cubusmail.gwtui.domain.UserAccount)
   */
  public UserAccount saveUserAccount( UserAccount account ) {

    UserAccount origin = SessionManager.get().getUserAccount();

    List<Identity> identitiesToDelete = new ArrayList<Identity>();
    for (Identity identity : origin.getIdentities()) {
      if ( !account.getIdentities().contains( identity ) ) {
        identitiesToDelete.add( identity );
        account.removeIdentity( identity );
      }
    }
View Full Code Here

   * @seecom.cubusmail.gwtui.client.services.IUserAccountService#
   * retrieveContactFolders()
   */
  public List<AddressFolder> retrieveAddressFolders() {

    UserAccount account = SessionManager.get().getUserAccount();
    return this.userAccountDao.retrieveAddressFolders( account );
  }
View Full Code Here

  public AddressFolder createAddressFolder( String folderName ) {

    AddressFolder folder = new AddressFolder();
    folder.setName( folderName );

    UserAccount account = SessionManager.get().getUserAccount();
    folder.setUserAccount( account );
    this.userAccountDao.saveAddressFolder( folder );

    return folder;
  }
View Full Code Here

   * com.cubusmail.gwtui.client.services.IUserAccountService#saveContactFolder
   * (com.cubusmail.gwtui.domain.ContactFolder)
   */
  public void saveAddressFolder( AddressFolder folder ) {

    UserAccount account = SessionManager.get().getUserAccount();
    folder.setUserAccount( account );
    this.userAccountDao.saveAddressFolder( folder );
  }
View Full Code Here

   * @seecom.cubusmail.gwtui.client.services.IUserAccountService#
   * retrieveRecipientsArray()
   */
  public String[][] retrieveRecipientsArray( String addressLine ) {

    UserAccount account = SessionManager.get().getUserAccount();

    String[] addressStrings = parsePreviousAndLastAddress( addressLine );

    String searchString = addressStrings[1];
    List<Address> contacts = this.userAccountDao.retrieveRecipients( account, searchString );
View Full Code Here

TOP

Related Classes of com.cubusmail.common.model.UserAccount

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.