1 | package com.hammurapi.common.extract.tests; |
2 | |
3 | import java.math.BigDecimal; |
4 | import java.util.Date; |
5 | |
6 | import com.hammurapi.store.StoreException; |
7 | |
8 | /** |
9 | * Test class |
10 | * @author Pavel Vlasov |
11 | * |
12 | */ |
13 | public class Transaction { |
14 | |
15 | private boolean delayed; |
16 | |
17 | public Transaction(boolean delayed) { |
18 | this.delayed = delayed; |
19 | } |
20 | |
21 | private BigDecimal amount; |
22 | private Date date; |
23 | |
24 | public BigDecimal getAmount() { |
25 | if (delayed) { |
26 | // Artificial delay to test parallel processing. |
27 | try { |
28 | Thread.sleep(100); |
29 | } catch (InterruptedException e) { |
30 | throw new StoreException(e); |
31 | } |
32 | } |
33 | return amount; |
34 | } |
35 | public void setAmount(BigDecimal amount) { |
36 | this.amount = amount; |
37 | } |
38 | public Date getDate() { |
39 | return date; |
40 | } |
41 | public void setDate(Date date) { |
42 | this.date = date; |
43 | } |
44 | |
45 | |
46 | } |