Package org.springframework.nanotrader.data.domain

Examples of org.springframework.nanotrader.data.domain.Account


        return accountService.findAccount(id);
    }

  public Account getRandomAccount() {
        init();
        Account obj = data.get(rnd.nextInt(data.size()));
        Integer id = obj.getAccountid();
        return accountService.findAccount(id);
    }
View Full Code Here


            return;
        }
       
        data = new ArrayList<Account>();
        for (int i = 0; i < 10; i++) {
            Account obj = getNewTransientAccount(i);
            try {
                accountService.saveAccount(obj);
            } catch (ConstraintViolationException e) {
                StringBuilder msg = new StringBuilder();
                for (Iterator<ConstraintViolation<?>> iter = e.getConstraintViolations().iterator(); iter.hasNext();) {
View Full Code Here

  @PersistenceContext
  EntityManager entityManager;

  @Test
  public void testfindAccountProfile() {
    Account account = accountDataOnDemand.getRandomAccount();
    entityManager.clear(); // force reload
   
    account = accountRepository.findOne(account.getAccountid());
    Accountprofile profile = tradingService.findAccountProfile(account.getProfileProfileid().getProfileid());
    assertEquals(account.getProfileProfileid().toString(), profile.toString());
    assertTrue(profile.getAccounts().contains(account));
  }
View Full Code Here

  }

  @Test
  public void testsaveNewAccountProfile() {
    Accountprofile profile = accountprofileDataOnDemand.getNewTransientAccountprofile(100);
    Account account = accountDataOnDemand.getNewTransientAccount(100);
    profile.setAccounts(Collections.singleton(account));
    tradingService.saveAccountProfile(profile);
    entityManager.flush();
    entityManager.clear(); // force reload

    Accountprofile newProfile = tradingService.findAccountProfile(profile.getProfileid());
    account = newProfile.getAccounts().iterator().next();
    assertEquals(account.getProfileProfileid().toString(), newProfile.toString());
  }
View Full Code Here

    assertEquals(account.getProfileProfileid().toString(), newProfile.toString());
  }

  @Test
  public void testUpdateAccountProfile() {
    Account account = accountDataOnDemand.getRandomAccount();
    Accountprofile profile = account.getProfileProfileid();
    profile.setAddress("changed");
    tradingService.updateAccountProfile(profile, profile.getUserid() );
    entityManager.flush();
    entityManager.clear(); // force reload
View Full Code Here

TOP

Related Classes of org.springframework.nanotrader.data.domain.Account

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.