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

COVERAGE SUMMARY FOR SOURCE FILE [Kitchen.java]

nameclass, %method, %block, %line, %
Kitchen.java100% (1/1)100% (2/2)96%  (79/82)89%  (16/18)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class Kitchen100% (1/1)100% (2/2)96%  (79/82)89%  (16/18)
run (): void 100% (1/1)95%  (60/63)85%  (11/13)
Kitchen (int, LocalEventBus): void 100% (1/1)100% (19/19)100% (5/5)

1package com.hammurapi.eventbus.tests.fastfood;
2 
3import java.util.Random;
4 
5import com.hammurapi.eventbus.local.LocalEventBus;
6 
7/**
8 * Kitchen randomly produces main and side dishes with random interval between productions
9 * @author Pavel Vlasov
10 *
11 */
12public class Kitchen extends Thread {
13        
14        private LocalEventBus<Object, ?, ?> bus;
15        private int numberOfDishes;
16        private Random random;
17 
18        public Kitchen(int numberOfDishes, LocalEventBus<Object, ?, ?> eventBus) {
19                this.bus = eventBus;
20                this.numberOfDishes = numberOfDishes;
21                this.random = new Random(System.currentTimeMillis()+this.hashCode());
22        }
23        
24        @Override
25        public void run() {
26                try {
27                        for (int i=0; i<numberOfDishes; ++i) {
28                                switch (random.nextInt(4)) {
29                                case 0:
30                                        bus.post(new Hamburger());
31                                        break;
32                                case 1:
33                                        bus.post(new Cheeseburger());
34                                        break;
35                                case 2:
36                                        bus.post(new FrenchFries());
37                                        break;
38                                case 3:
39                                        bus.post(new Coleslaw());
40                                        break;
41                                }
42                                Thread.sleep(random.nextInt(50));
43                        }
44                } catch (Exception e) {
45                        e.printStackTrace();
46                }
47        }
48 
49}

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