EMMA Coverage Report (generated Thu Jan 20 11:39:44 EST 2011)
[all classes][com.hammurapi.common.extract.tests]

COVERAGE SUMMARY FOR SOURCE FILE [Account.java]

nameclass, %method, %block, %line, %
Account.java100% (1/1)83%  (10/12)63%  (72/114)71%  (22/31)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class Account100% (1/1)83%  (10/12)63%  (72/114)71%  (22/31)
setCustomer (String): void 0%   (0/1)0%   (0/4)0%   (0/2)
toString (): String 0%   (0/1)0%   (0/26)0%   (0/3)
getTransactions (): List 100% (1/1)50%  (6/12)50%  (2/4)
getBalance (): BigDecimal 100% (1/1)62%  (10/16)60%  (3/5)
Account (): void 100% (1/1)100% (13/13)100% (4/4)
Account (String, int, BigDecimal): void 100% (1/1)100% (22/22)100% (7/7)
getCustomer (): String 100% (1/1)100% (3/3)100% (1/1)
getNumber (): int 100% (1/1)100% (3/3)100% (1/1)
getNumberOfBalanceInquiries (): int 100% (1/1)100% (4/4)100% (1/1)
getTransactionsImmediately (): List 100% (1/1)100% (3/3)100% (1/1)
setBalance (BigDecimal): void 100% (1/1)100% (4/4)100% (2/2)
setNumber (int): void 100% (1/1)100% (4/4)100% (2/2)

1package com.hammurapi.common.extract.tests;
2 
3import java.math.BigDecimal;
4import java.util.ArrayList;
5import java.util.List;
6import java.util.concurrent.atomic.AtomicInteger;
7 
8import com.hammurapi.store.StoreException;
9 
10/**
11 * A class to test object store.
12 * @author Pavel Vlasov
13 *
14 */
15public class Account {
16        
17        public Account() {
18                
19        }
20        
21        public Account(String customer, int number, BigDecimal balance) {
22                super();
23                this.number = number;
24                this.balance = balance;
25                this.customer = customer;
26        }
27 
28        private int number;
29        private String customer;
30        private List<Transaction> transactions = new ArrayList<Transaction>();
31        private BigDecimal balance;
32        private AtomicInteger balanceInquiries = new AtomicInteger();
33        
34        public String getCustomer() {
35                return customer;
36        }
37        
38        public void setCustomer(String customer) {
39                this.customer = customer;
40        }
41        
42        public int getNumber() {
43                return number;
44        }
45        public void setNumber(int number) {
46                this.number = number;
47        }
48        public BigDecimal getBalance() {
49                // Artificial delay to test parallel processing.
50                try {
51                        Thread.sleep(100);
52                } catch (InterruptedException e) {
53                        throw new StoreException(e);
54                }
55                balanceInquiries.incrementAndGet();
56                return balance;
57        }
58        public void setBalance(BigDecimal balance) {
59                this.balance = balance;
60        }
61        public List<Transaction> getTransactions() {
62                // Artificial delay to test parallel processing.
63                try {
64                        Thread.sleep(150);
65                } catch (InterruptedException e) {
66                        throw new StoreException(e);
67                }
68                return transactions;
69        }
70        
71        public List<Transaction> getTransactionsImmediately() {
72                return transactions;
73        }
74        
75        /**        
76         * @return Number of times getBalance() was invoked.
77         */
78        public int getNumberOfBalanceInquiries() {
79                return balanceInquiries.get();
80        }
81 
82        @Override
83        public String toString() {
84                return "Account [number=" + number + ", customer=" + customer
85                                + ", balance=" + balance + ", balanceInquiries="
86                                + balanceInquiries + "]";
87        }
88        
89 
90}

[all classes][com.hammurapi.common.extract.tests]
EMMA 2.0.5312 EclEmma Fix 2 (C) Vladimir Roubtsov