Package org.springframework.nanotrader.data.domain

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


  }
 

  @Bean
  public Accountprofile accountProfile() {
    Accountprofile accountProfile = new Accountprofile();
    accountProfile.setProfileid(PROFILE_ID);
    accountProfile.setUserid(USER_ID);
    accountProfile.setPasswd(PASSWORD);
    accountProfile.setAddress(ADDRESS);
    accountProfile.setEmail(EMAIL);
    accountProfile.setFullname(FULL_NAME);
    accountProfile.setCreditcard(CC_NUMBER);
    accountProfile.setAuthtoken(AUTH_TOKEN);
    Set<Account> accounts = new HashSet<Account>();
    accounts.add(account());
    accountProfile.setAccounts(accounts);
    return accountProfile;
  }
View Full Code Here


      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");
      ap.setEmail(userid + "@nanotrader.com");
      ap.setFullname("first_" + userid + " " + "last " + userid);
      ap.setCreditcard("1111222233334444");
      Set<Account> accounts = new HashSet<Account>();
      accounts.add(ac);
      ap.setAccounts(accounts);
      tradingService.saveAccountProfile(ap);
      Order o = new Order();
      o.setAccountid((tradingService.findAccountByProfile(ap)).getAccountid());
      o.setCompletiondate(creationdate);
      o.setQuantity(new BigDecimal(1000));
View Full Code Here

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

  @Test
    public void testFind() {
        Accountprofile obj = dod.getRandomAccountprofile();
        Assert.assertNotNull("Data on demand for 'Accountprofile' failed to initialize correctly", obj);
        Integer id = obj.getProfileid();
        Assert.assertNotNull("Data on demand for 'Accountprofile' failed to provide an identifier", id);
        obj = accountProfileRepository.findOne(id);
        Assert.assertNotNull("Find method for 'Accountprofile' illegally returned null for id '" + id + "'", obj);
        Assert.assertEquals("Find method for 'Accountprofile' returned the incorrect identifier", id, obj.getProfileid());
    }
View Full Code Here

    }

  @Test
    public void testSave() {
        Assert.assertNotNull("Data on demand for 'Accountprofile' failed to initialize correctly", dod.getRandomAccountprofile());
        Accountprofile obj = dod.getNewTransientAccountprofile(Integer.MAX_VALUE);
        Assert.assertNotNull("Data on demand for 'Accountprofile' failed to provide a new transient entity", obj);
        Assert.assertNull("Expected 'Accountprofile' identifier to be null", obj.getProfileid());
        accountProfileRepository.save(obj);
        accountProfileRepository.flush();
        Assert.assertNotNull("Expected 'Accountprofile' identifier to no longer be null", obj.getProfileid());
    }
View Full Code Here

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

  @Test
    public void testDelete() {
        Accountprofile obj = dod.getNewTransientAccountprofile(100);
        accountProfileRepository.save(obj);
        entityManager.flush();
        entityManager.clear();

        Assert.assertNotNull("Data on demand for 'Accountprofile' failed to initialize correctly", obj);
        Integer id = obj.getProfileid();
        Assert.assertNotNull("Data on demand for 'Accountprofile' failed to provide an identifier", id);
        obj = accountProfileRepository.findOne(id);
        accountProfileRepository.delete(obj);
        accountProfileRepository.flush();
        Assert.assertNull("Failed to remove 'Accountprofile' with identifier '" + id + "'", accountProfileRepository.findOne(id));
View Full Code Here

 
  @Autowired
    AccountProfileRepository accountProfileRepository;

  public Accountprofile getNewTransientAccountprofile(int index) {
        Accountprofile obj = new Accountprofile();
        setAddress(obj, index);
        setCreditcard(obj, index);
        setEmail(obj, index);
        setFullname(obj, index);
        setPasswd(obj, index);
View Full Code Here

            index = 0;
        }
        if (index > (data.size() - 1)) {
            index = data.size() - 1;
        }
        Accountprofile obj = data.get(index);
        Integer id = obj.getProfileid();
        return accountProfileRepository.findOne(id);
    }
View Full Code Here

        return accountProfileRepository.findOne(id);
    }

  public Accountprofile getRandomAccountprofile() {
        init();
        Accountprofile obj = data.get(rnd.nextInt(data.size()));
        Integer id = obj.getProfileid();
        return accountProfileRepository.findOne(id);
    }
View Full Code Here

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

        }
        obj.setOpenbalance(openbalance);
    }

  public void setProfileProfileid(Account obj, int index) {
        Accountprofile profileProfileid = accountprofileDataOnDemand.getRandomAccountprofile();
        obj.setProfileProfileid(profileProfileid);
    }
View Full Code Here

TOP

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

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.