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

COVERAGE SUMMARY FOR SOURCE FILE [Dish.java]

nameclass, %method, %block, %line, %
Dish.java100% (1/1)60%  (3/5)39%  (25/64)55%  (6/11)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class Dish100% (1/1)60%  (3/5)39%  (25/64)55%  (6/11)
isConsumed (): boolean 0%   (0/1)0%   (0/4)0%   (0/1)
toString (): String 0%   (0/1)0%   (0/26)0%   (0/3)
consume (): boolean 100% (1/1)44%  (7/16)67%  (2/3)
<static initializer> 100% (1/1)100% (5/5)100% (2/2)
Dish (): void 100% (1/1)100% (13/13)100% (3/3)

1package com.hammurapi.eventbus.tests.fastfood;
2 
3import java.util.concurrent.atomic.AtomicBoolean;
4import java.util.concurrent.atomic.AtomicInteger;
5 
6public class Dish {
7        
8        private static AtomicInteger INSTANCE_COUNTER = new AtomicInteger();
9        
10        private AtomicBoolean consumed = new AtomicBoolean(false);
11        
12        private final int instanceId = INSTANCE_COUNTER.incrementAndGet();
13        
14        /**
15         * Consumes dish
16         * @return true if dish successfully consumed. Dish can be consumed only once.
17         */
18        public boolean consume() {
19                if (consumed.getAndSet(true)) {
20                        System.err.println("Already consumed: "+this);
21                }
22                return true;
23        }
24        
25        public boolean isConsumed() {
26                return consumed.get();
27        }
28        
29        @Override
30        public String toString() {
31                String cName = getClass().getName();
32                int idx = cName.lastIndexOf('.');
33                return cName.substring(idx+1)+" ("+instanceId+")";
34        }
35 
36}

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