EMMA Coverage Report (generated Mon Nov 29 14:43:38 PST 2010)
[all classes][com.jeantessier.classreader]

COVERAGE SUMMARY FOR SOURCE FILE [TestFinalMethodOrClassSymbolGathererStrategy.java]

nameclass, %method, %block, %line, %
TestFinalMethodOrClassSymbolGathererStrategy.java100% (7/7)100% (16/16)100% (327/327)100% (62/62)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class TestFinalMethodOrClassSymbolGathererStrategy100% (1/1)100% (10/10)100% (141/141)100% (34/34)
TestFinalMethodOrClassSymbolGathererStrategy (): void 100% (1/1)100% (3/3)100% (1/1)
setUp (): void 100% (1/1)100% (8/8)100% (3/3)
testIsMatching_class_anonymous (): void 100% (1/1)100% (18/18)100% (4/4)
testIsMatching_class_enum (): void 100% (1/1)100% (18/18)100% (4/4)
testIsMatching_class_final (): void 100% (1/1)100% (18/18)100% (4/4)
testIsMatching_class_notfinal (): void 100% (1/1)100% (18/18)100% (4/4)
testIsMatching_field (): void 100% (1/1)100% (11/11)100% (3/3)
testIsMatching_local (): void 100% (1/1)100% (11/11)100% (3/3)
testIsMatching_method_final (): void 100% (1/1)100% (18/18)100% (4/4)
testIsMatching_method_notfinal (): void 100% (1/1)100% (18/18)100% (4/4)
     
class TestFinalMethodOrClassSymbolGathererStrategy$1100% (1/1)100% (1/1)100% (21/21)100% (4/4)
TestFinalMethodOrClassSymbolGathererStrategy$1 (TestFinalMethodOrClassSymbolG... 100% (1/1)100% (21/21)100% (4/4)
     
class TestFinalMethodOrClassSymbolGathererStrategy$2100% (1/1)100% (1/1)100% (45/45)100% (8/8)
TestFinalMethodOrClassSymbolGathererStrategy$2 (TestFinalMethodOrClassSymbolG... 100% (1/1)100% (45/45)100% (8/8)
     
class TestFinalMethodOrClassSymbolGathererStrategy$3100% (1/1)100% (1/1)100% (33/33)100% (6/6)
TestFinalMethodOrClassSymbolGathererStrategy$3 (TestFinalMethodOrClassSymbolG... 100% (1/1)100% (33/33)100% (6/6)
     
class TestFinalMethodOrClassSymbolGathererStrategy$4100% (1/1)100% (1/1)100% (45/45)100% (8/8)
TestFinalMethodOrClassSymbolGathererStrategy$4 (TestFinalMethodOrClassSymbolG... 100% (1/1)100% (45/45)100% (8/8)
     
class TestFinalMethodOrClassSymbolGathererStrategy$5100% (1/1)100% (1/1)100% (21/21)100% (4/4)
TestFinalMethodOrClassSymbolGathererStrategy$5 (TestFinalMethodOrClassSymbolG... 100% (1/1)100% (21/21)100% (4/4)
     
class TestFinalMethodOrClassSymbolGathererStrategy$6100% (1/1)100% (1/1)100% (21/21)100% (4/4)
TestFinalMethodOrClassSymbolGathererStrategy$6 (TestFinalMethodOrClassSymbolG... 100% (1/1)100% (21/21)100% (4/4)

1/*
2 *  Copyright (c) 2001-2009, Jean Tessier
3 *  All rights reserved.
4 *
5 *  Redistribution and use in source and binary forms, with or without
6 *  modification, are permitted provided that the following conditions
7 *  are met:
8 *
9 *      * Redistributions of source code must retain the above copyright
10 *        notice, this list of conditions and the following disclaimer.
11 *
12 *      * Redistributions in binary form must reproduce the above copyright
13 *        notice, this list of conditions and the following disclaimer in the
14 *        documentation and/or other materials provided with the distribution.
15 *
16 *      * Neither the name of Jean Tessier nor the names of his contributors
17 *        may be used to endorse or promote products derived from this software
18 *        without specific prior written permission.
19 *
20 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 *  A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR
24 *  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 *  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27 *  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28 *  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32 
33package com.jeantessier.classreader;
34 
35import org.jmock.integration.junit3.*;
36import org.jmock.*;
37 
38public class TestFinalMethodOrClassSymbolGathererStrategy extends MockObjectTestCase {
39    private FinalMethodOrClassSymbolGathererStrategy sut;
40 
41    protected void setUp() throws Exception {
42        super.setUp();
43 
44        sut = new FinalMethodOrClassSymbolGathererStrategy();
45    }
46 
47    public void testIsMatching_class_notfinal() {
48        final Classfile mockClassfile = mock(Classfile.class);
49 
50        checking(new Expectations() {{
51            one (mockClassfile).isFinal();
52            will(returnValue(false));
53        }});
54 
55        assertFalse(sut.isMatching(mockClassfile));
56    }
57 
58    public void testIsMatching_class_final() {
59        final Classfile mockClassfile = mock(Classfile.class);
60 
61        checking(new Expectations() {{
62            one (mockClassfile).isFinal();
63            will(returnValue(true));
64            one (mockClassfile).isEnum();
65            will(returnValue(false));
66            one (mockClassfile).isAnonymousClass();
67            will(returnValue(false));
68        }});
69 
70        assertTrue(sut.isMatching(mockClassfile));
71    }
72 
73    public void testIsMatching_class_enum() {
74        final Classfile mockClassfile = mock(Classfile.class);
75 
76        checking(new Expectations() {{
77            one (mockClassfile).isFinal();
78            will(returnValue(true));
79            one (mockClassfile).isEnum();
80            will(returnValue(true));
81        }});
82 
83        assertFalse(sut.isMatching(mockClassfile));
84    }
85 
86    public void testIsMatching_class_anonymous() {
87        final Classfile mockClassfile = mock(Classfile.class);
88 
89        checking(new Expectations() {{
90            one (mockClassfile).isFinal();
91            will(returnValue(true));
92            one (mockClassfile).isEnum();
93            will(returnValue(false));
94            one (mockClassfile).isAnonymousClass();
95            will(returnValue(true));
96        }});
97 
98        assertFalse(sut.isMatching(mockClassfile));
99    }
100 
101    public void testIsMatching_field() {
102        final Field_info mockField = mock(Field_info.class);
103        assertFalse(sut.isMatching(mockField));
104    }
105 
106    public void testIsMatching_method_notfinal() {
107        final Method_info mockMethod = mock(Method_info.class);
108 
109        checking(new Expectations() {{
110            one (mockMethod).isFinal();
111            will(returnValue(false));
112        }});
113 
114        assertFalse(sut.isMatching(mockMethod));
115    }
116 
117    public void testIsMatching_method_final() {
118        final Method_info mockMethod = mock(Method_info.class);
119 
120        checking(new Expectations() {{
121            one (mockMethod).isFinal();
122            will(returnValue(true));
123        }});
124 
125        assertTrue(sut.isMatching(mockMethod));
126    }
127 
128    public void testIsMatching_local() {
129        final LocalVariable mockLocalVariable = mock(LocalVariable.class);
130        assertFalse(sut.isMatching(mockLocalVariable));
131    }
132}

[all classes][com.jeantessier.classreader]
EMMA 2.0.5312 (C) Vladimir Roubtsov