EMMA Coverage Report (generated Fri Jul 28 01:51:09 CEST 2006)
[all classes][org.jtiger.framework]

COVERAGE SUMMARY FOR SOURCE FILE [TestMethodCategoriesFactory.java]

nameclass, %method, %block, %line, %
TestMethodCategoriesFactory.java100% (2/2)100% (4/4)100% (54/54)100% (15/15)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class TestMethodCategoriesFactory100% (1/1)100% (2/2)100% (7/7)100% (3/3)
TestMethodCategoriesFactory (): void 100% (1/1)100% (3/3)100% (2/2)
newTestMethodCategories (): TestMethodCategories 100% (1/1)100% (4/4)100% (1/1)
     
class TestMethodCategoriesFactory$TestMethodCategoriesImpl100% (1/1)100% (2/2)100% (47/47)100% (12/12)
TestMethodCategoriesFactory$TestMethodCategoriesImpl (): void 100% (1/1)100% (3/3)100% (2/2)
getTestMethodCategories (Method): ReadOnlyArray 100% (1/1)100% (44/44)100% (10/10)

1/*
2 * JTiger Unit Testing Framework for J2SE 1.5
3 * Copyright (C) 2005 Tony Morris
4 *
5 * This software is licenced under the
6 * Common Public Licence version 1.0
7 * http://www.opensource.org/licenses/cpl1.0.php
8 *
9 * You received a copy of this licence with this software.
10 */
11package org.jtiger.framework;
12 
13import static org.jtiger.framework.SequenceFactory.newSequence;
14import java.lang.reflect.Method;
15import java.util.Arrays;
16import java.util.LinkedHashSet;
17import java.util.Set;
18 
19final class TestMethodCategoriesFactory
20{
21    private TestMethodCategoriesFactory()
22    {
23 
24    }
25 
26    static TestMethodCategories newTestMethodCategories()
27    {
28        return new TestMethodCategoriesImpl();
29    }
30 
31    private static final class TestMethodCategoriesImpl implements TestMethodCategories
32    {
33        TestMethodCategoriesImpl()
34        {
35 
36        }
37 
38        public ReadOnlyArray<String> getTestMethodCategories(final Method m) throws NullPointerException
39        {
40            if(m == null)
41            {
42                throw new NullPointerException();
43            }
44 
45            final Category mc = m.getAnnotation(Category.class);
46            final Category cc = m.getDeclaringClass().getAnnotation(Category.class);
47 
48            final Set<String> categories = new LinkedHashSet<String>();
49 
50            if(mc != null)
51            {
52                categories.addAll(Arrays.asList(mc.value()));
53            }
54 
55            if(cc != null)
56            {
57                categories.addAll(Arrays.asList(cc.value()));
58            }
59 
60            return newSequence(categories.toArray(new String[categories.size()]));
61        }
62    }
63}

[all classes][org.jtiger.framework]
EMMA 2.0.5312 (C) Vladimir Roubtsov