Package org.springframework.nanotrader.data.domain

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


  }
 

  @Bean
  public Account account() {
    Account account = new Account();
    account.setAccountid(ACCOUNT_ID);
    account.setBalance(ACCOUNT_BALANCE);
    account.setOpenbalance(ACCOUNT_OPEN_BALANCE);
    account.setLogincount(LOGIN_COUNT);
    account.setLogoutcount(LOGOUT_COUNT);
    account.setCreationdate(new Date(1329759342904l));
    account.setLastlogin(new Date(1329759342904l));
    return account;
  }
View Full Code Here


  }
 
  @Bean
  public Order order() {
    Order order = new Order();
    Account account = new Account();
    account.setAccountid(ACCOUNT_ID);
    order.setAccountAccountid(account);
    order.setOrderid(ORDER_ID);
    order.setPrice(ORDER_PRICE);
    order.setOrderstatus(ORDER_STATUS_CLOSED);
    order.setOrdertype(ORDER_TYPE_BUY);
View Full Code Here

      }
      else {
        userid = "user" + i;
      }
      BigDecimal balance = BigDecimal.valueOf(1000000.00);
      Account ac = new Account();
      ac.setBalance(balance);
      Date creationdate = new Date();
      ac.setCreationdate(creationdate);
      ac.setLastlogin(creationdate);
      ac.setLogincount(0);
      ac.setLogoutcount(0);
      ac.setOpenbalance(balance);
      Accountprofile ap = new Accountprofile();
      ap.setUserid(userid);
      // Password is same as that of the userid
      ap.setPasswd(userid);
      ap.setAddress(userid + " address");
View Full Code Here

        Assert.assertTrue("Counter for 'Account' incorrectly reported there were no entries", count > 0);
    }

  @Test
    public void testFindAccount() {
        Account obj = dod.getRandomAccount();
        Assert.assertNotNull("Data on demand for 'Account' failed to initialize correctly", obj);
        Integer id = obj.getAccountid();
        Assert.assertNotNull("Data on demand for 'Account' failed to provide an identifier", id);
        obj = accountService.findAccount(id);
        Assert.assertNotNull("Find method for 'Account' illegally returned null for id '" + id + "'", obj);
        Assert.assertEquals("Find method for 'Account' returned the incorrect identifier", id, obj.getAccountid());
    }
View Full Code Here

    }

  @Test
    public void testSaveAccount() {
        Assert.assertNotNull("Data on demand for 'Account' failed to initialize correctly", dod.getRandomAccount());
        Account obj = dod.getNewTransientAccount(Integer.MAX_VALUE);
        Assert.assertNotNull("Data on demand for 'Account' failed to provide a new transient entity", obj);
        Assert.assertNull("Expected 'Account' identifier to be null", obj.getAccountid());
        accountService.saveAccount(obj);
        accountRepository.flush();
        Assert.assertNotNull("Expected 'Account' identifier to no longer be null", obj.getAccountid());
    }
View Full Code Here

        Assert.assertNotNull("Expected 'Account' identifier to no longer be null", obj.getAccountid());
    }

  @Test
    public void testDeleteAccount() {
        Account obj = dod.getRandomAccount();
        Assert.assertNotNull("Data on demand for 'Account' failed to initialize correctly", obj);
        Integer id = obj.getAccountid();
        Assert.assertNotNull("Data on demand for 'Account' failed to provide an identifier", id);
        obj = accountService.findAccount(id);
        accountService.deleteAccount(obj);
        accountRepository.flush();
        Assert.assertNull("Failed to remove 'Account' with identifier '" + id + "'", accountService.findAccount(id));
View Full Code Here

        Assert.assertNull("Failed to remove 'Account' with identifier '" + id + "'", accountService.findAccount(id));
    }

  @Test
    public void testUpdateAccount() {
        Account obj = dod.getRandomAccount();
        Assert.assertNotNull("Data on demand for 'Account' failed to initialize correctly", obj);
        Integer id = obj.getAccountid();
        Assert.assertNotNull("Data on demand for 'Account' failed to provide an identifier", id);
        obj = accountService.findAccount(id);
        obj.setOpenbalance(new BigDecimal("1.1"));
        accountService.updateAccount(obj);
        accountRepository.flush();
        Account updated = accountService.findAccount(id);
        Assert.assertEquals("Update failed", new BigDecimal("1.1"), updated.getOpenbalance());
    }
View Full Code Here

        setQuote(obj, index);
        return obj;
    }

  public void setAccountAccountid(Order obj, int index) {
        Account accountAccountid = accountDataOnDemand.getRandomAccount();
        obj.setAccountAccountid(accountAccountid);
    }
View Full Code Here

  @Autowired
    AccountRepository accountRepository;

  public Account getNewTransientAccount(int index) {
        Account obj = new Account();
        setBalance(obj, index);
        setCreationdate(obj, index);
        setLastlogin(obj, index);
        setLogincount(obj, index);
        setLogoutcount(obj, index);
View Full Code Here

            index = 0;
        }
        if (index > (data.size() - 1)) {
            index = data.size() - 1;
        }
        Account obj = data.get(index);
        Integer id = obj.getAccountid();
        return accountService.findAccount(id);
    }
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.