Package org.zeroexchange.mcredit

Examples of org.zeroexchange.mcredit.CreditPath


                BigDecimal allowedValue = creditLineReader.getAvailableAmount(line);
                if(allowedValue.compareTo(BigDecimal.ZERO) <= 0) {
                    continue;
                }
                if(intermediateCreditor.equals(creditor)) {
                    CreditPath foundPath = new CreditPath();
                    CreditLine firstLine = path.getFirst();
                    foundPath.setCreditor(creditor);
                    foundPath.setDebtor(firstLine.getDebtor());
                           
                    foundPath.getPath().addAll(path);
                    paths.getPaths().add(foundPath);
                    break;
                }
               
                if(path.size() < maxSearchDepth) {
View Full Code Here


        CreditLine l3 = new CreditLine();
        l3.setMaxCreditValue(BigDecimal.TEN);
        l3.setDebtor(c);
        l3.setCreditor(d);
       
        CreditPath path = new CreditPath();
        Collection<CreditLine> creditLines = path.getPath();
        creditLines.add(l1);
        creditLines.add(l2);
        creditLines.add(l3);
       
        CreditPaths paths = new CreditPaths();
        paths.setPaths(Collections.singletonList(path));
       
        try {
            paths = creditLineWriter.roteDebt(paths, BigDecimal.ONE);
            path = paths.getPaths().iterator().next();
            for(CreditLine nextLine: path.getPath()) {
                Assert.assertTrue(BigDecimal.ONE.equals(nextLine.getCurrentCredit()));
            }
            Assert.assertTrue(new BigDecimal(9).equals(
                    creditLineReader.getAvailableAmount(path.getPath().iterator().next())));
        } catch (DebtRotingException e) {
            Assert.fail();
        }
       
        creditLineWriter.roteDebt(paths, BigDecimal.TEN);
View Full Code Here

TOP

Related Classes of org.zeroexchange.mcredit.CreditPath

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.