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

COVERAGE SUMMARY FOR SOURCE FILE [RemoveHandler2.java]

nameclass, %method, %block, %line, %
RemoveHandler2.java100% (1/1)100% (8/8)98%  (47/48)99%  (12.9/13)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class RemoveHandler2100% (1/1)100% (8/8)98%  (47/48)99%  (12.9/13)
handleWorld (AtomicReference): void 100% (1/1)94%  (15/16)98%  (2.9/3)
RemoveHandler2 (): void 100% (1/1)100% (3/3)100% (1/1)
getEmCounter (): int 100% (1/1)100% (3/3)100% (1/1)
getWorldCounter (): int 100% (1/1)100% (3/3)100% (1/1)
handleEm (LocalEventDispatchContext, AtomicReference): void 100% (1/1)100% (13/13)100% (3/3)
isEmOk (): boolean 100% (1/1)100% (3/3)100% (1/1)
isWorldOk (): boolean 100% (1/1)100% (3/3)100% (1/1)
setExpectedWorld (Object): void 100% (1/1)100% (4/4)100% (2/2)

1package com.hammurapi.eventbus.tests;
2 
3import java.util.concurrent.atomic.AtomicReference;
4 
5import com.hammurapi.common.Condition;
6import com.hammurapi.eventbus.EventHandlerBase.Mode;
7import com.hammurapi.eventbus.local.LocalEventDispatchContext;
8import com.hammurapi.eventbus.Handler;
9 
10public class RemoveHandler2 {
11        
12        private Object expectedWorld;
13        
14        public void setExpectedWorld(Object expectedWorld) {
15                this.expectedWorld = expectedWorld;
16        }
17        
18        private int worldCounter;
19        private boolean worldOk;
20        
21        public int getWorldCounter() {
22                return worldCounter;
23        }
24 
25        public boolean isWorldOk() {
26                return worldOk;
27        }
28 
29        @Handler(value="java(*)://strRef.get().equals(\"World\")", mode=Mode.REMOVE)
30        public void handleWorld(AtomicReference<String> strRef) {
31                ++worldCounter;
32                worldOk = expectedWorld == strRef;
33        }
34        
35        private int emCounter;
36        private boolean emOk;
37        
38        public int getEmCounter() {
39                return emCounter;
40        }
41 
42        public boolean isEmOk() {
43                return emOk;
44        }
45 
46        @Handler(mode=Mode.REMOVE)
47        public void handleEm(
48                        LocalEventDispatchContext<Object, Integer, Object> context, @Condition("\"!\".equals(strRef.get())") AtomicReference<String> strRef) {
49                ++emCounter;
50                emOk = "!".equals(strRef.get());
51        }
52        
53        
54}

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