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

COVERAGE SUMMARY FOR SOURCE FILE [TestNameFactory.java]

nameclass, %method, %block, %line, %
TestNameFactory.java100% (2/2)100% (4/4)100% (40/40)100% (14/14)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class TestNameFactory100% (1/1)100% (2/2)100% (7/7)100% (3/3)
TestNameFactory (): void 100% (1/1)100% (3/3)100% (2/2)
newTestName (): TestName 100% (1/1)100% (4/4)100% (1/1)
     
class TestNameFactory$TestNameImpl100% (1/1)100% (2/2)100% (33/33)100% (11/11)
TestNameFactory$TestNameImpl (): void 100% (1/1)100% (3/3)100% (2/2)
getTestName (Method): String 100% (1/1)100% (30/30)100% (9/9)

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 java.lang.reflect.Method;
14 
15final class TestNameFactory
16{
17    private TestNameFactory()
18    {
19 
20    }
21 
22    static TestName newTestName()
23    {
24        return new TestNameImpl();
25    }
26    
27    private static final class TestNameImpl implements TestName
28    {
29        TestNameImpl()
30        {
31 
32        }
33 
34        public String getTestName(final Method m) throws NullPointerException
35        {
36            if(m == null)
37            {
38                throw new NullPointerException();
39            }
40 
41            final Test t = m.getAnnotation(Test.class);
42 
43            if(t == null)
44            {
45                return m.getName();
46            }
47 
48            final String value = t.value();
49 
50            if(value == null || value.length() == 0)
51            {
52                return m.getName();
53            }
54            else
55            {
56                return t.value();
57            }
58        }
59    }
60}

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