Package name.abuchen.portfolio.model

Examples of name.abuchen.portfolio.model.Client


    public void setUpClient()
    {
        // Portfolio A : Security A + Security X
        // Portfolio B : Security B + Security X

        client = new Client();

        securityA = new Security();
        securityA.addPrice(new SecurityPrice(Dates.date(2010, Calendar.JANUARY, 1), 1000));
        client.addSecurity(securityA);
View Full Code Here


{

    @Test
    public void testBuyAndSellLeavesNoEntryInSnapshot()
    {
        Client client = new Client();

        Security a = new SecurityBuilder() //
                        .addPrice("2010-01-01", 1000) //
                        .addTo(client);
View Full Code Here

    private ReportingPeriod.FromXtoY period = new ReportingPeriod.FromXtoY( //
                    new DateMidnight("2011-12-31").toDate(), new DateMidnight("2012-01-08").toDate());

    private Client createClient(int weight)
    {
        Client client = new Client();

        Taxonomy taxonomy = new TaxonomyBuilder() //
                        .addClassification("one") //
                        .addTo(client);
View Full Code Here

    }

    @Test
    public void testThat100PercentAssignmentIsIdenticalToClientPerformance()
    {
        Client client = createClient(Classification.ONE_HUNDRED_PERCENT);

        Classification classification = client.getTaxonomies().get(0).getClassificationById("one");

        ArrayList<Exception> warnings = new ArrayList<Exception>();

        PerformanceIndex iClient = PerformanceIndex.forClient(client, period, warnings);
        PerformanceIndex iClassification = PerformanceIndex.forClassification(client, classification, period, warnings);
View Full Code Here

    }

    @Test
    public void testThatPartialAssignmentIsNOTIdenticalToClientPerformance()
    {
        Client client = createClient(Classification.ONE_HUNDRED_PERCENT);

        Classification classification = client.getTaxonomies().get(0).getClassificationById("one");

        // remove account assignment
        classification.getAssignments().remove(1);

        ArrayList<Exception> warnings = new ArrayList<Exception>();
View Full Code Here

    }

    @Test
    public void testThat50PercentAssignmentHasIdenticalPerformanceButOnly50PercentTotals()
    {
        Client client = createClient(Classification.ONE_HUNDRED_PERCENT / 2);

        Classification classification = client.getTaxonomies().get(0).getClassificationById("one");

        ArrayList<Exception> warnings = new ArrayList<Exception>();

        PerformanceIndex iClient = PerformanceIndex.forClient(client, period, warnings);
        PerformanceIndex iClassification = PerformanceIndex.forClassification(client, classification, period, warnings);
View Full Code Here

    private final Date endDate = Dates.date(2011, Calendar.DECEMBER, 31);

    @Test
    public void testDepositPlusInterest()
    {
        Client client = new Client();

        Account account = new Account();
        account.addTransaction(new AccountTransaction(Dates.date(2010, Calendar.JANUARY, 1), null,
                        AccountTransaction.Type.DEPOSIT, 100000));
        account.addTransaction(new AccountTransaction(Dates.date(2011, Calendar.JUNE, 1), null,
                        AccountTransaction.Type.INTEREST, 5000));
        client.addAccount(account);

        ClientPerformanceSnapshot snapshot = new ClientPerformanceSnapshot(client, startDate, endDate);
        assertNotNull(snapshot);

        assertNotNull(snapshot.getStartClientSnapshot());
View Full Code Here

    }

    @Test
    public void testDepositPlusInterestFirstDay()
    {
        Client client = new Client();

        Account account = new Account();
        account.addTransaction(new AccountTransaction(Dates.date(2010, Calendar.JANUARY, 1), null,
                        AccountTransaction.Type.DEPOSIT, 100000));
        account.addTransaction(new AccountTransaction(Dates.date(2010, Calendar.DECEMBER, 31), null,
                        AccountTransaction.Type.INTEREST, 5000));
        client.addAccount(account);

        ClientPerformanceSnapshot snapshot = new ClientPerformanceSnapshot(client, startDate, endDate);

        EnumMap<CategoryType, Category> result = snapshot.getCategoryMap();
        assertEquals(105000, result.get(CategoryType.INITIAL_VALUE).getValuation());
View Full Code Here

    }

    @Test
    public void testDepositPlusInterestLastDay()
    {
        Client client = new Client();

        Account account = new Account();
        account.addTransaction(new AccountTransaction(Dates.date(2010, Calendar.JANUARY, 1), null,
                        AccountTransaction.Type.DEPOSIT, 100000));
        account.addTransaction(new AccountTransaction(Dates.date(2011, Calendar.DECEMBER, 31), null,
                        AccountTransaction.Type.INTEREST, 5000));
        client.addAccount(account);

        ClientPerformanceSnapshot snapshot = new ClientPerformanceSnapshot(client, startDate, endDate);

        EnumMap<CategoryType, Category> result = snapshot.getCategoryMap();
        assertEquals(100000, result.get(CategoryType.INITIAL_VALUE).getValuation());
View Full Code Here

    }

    @Test
    public void testEarningsFromSecurity()
    {
        Client client = new Client();

        Security security = new Security();
        client.addSecurity(security);

        Portfolio portfolio = new Portfolio();
        portfolio.addTransaction(new PortfolioTransaction(Dates.date(2010, Calendar.JANUARY, 1), security,
                        PortfolioTransaction.Type.BUY, 10, 100, 0, 0));
        client.addPortfolio(portfolio);

        Account account = new Account();
        account.addTransaction(new AccountTransaction(Dates.date(2011, Calendar.JANUARY, 31), security,
                        AccountTransaction.Type.INTEREST, 5000));
        client.addAccount(account);

        ClientPerformanceSnapshot snapshot = new ClientPerformanceSnapshot(client, startDate, endDate);

        EnumMap<CategoryType, Category> result = snapshot.getCategoryMap();
        assertEquals(5000, result.get(CategoryType.EARNINGS).getValuation());
View Full Code Here

TOP

Related Classes of name.abuchen.portfolio.model.Client

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.