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

COVERAGE SUMMARY FOR SOURCE FILE [DefaultFixtureResultsHandlerFactory.java]

nameclass, %method, %block, %line, %
DefaultFixtureResultsHandlerFactory.java100% (2/2)100% (4/4)100% (64/64)100% (22/22)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class DefaultFixtureResultsHandlerFactory100% (1/1)100% (2/2)100% (7/7)100% (3/3)
DefaultFixtureResultsHandlerFactory (): void 100% (1/1)100% (3/3)100% (2/2)
newDefaultFixtureResultsHandler (): FixtureResultsHandler 100% (1/1)100% (4/4)100% (1/1)
     
class DefaultFixtureResultsHandlerFactory$DefaultFixtureResultsHandlerImpl100% (1/1)100% (2/2)100% (57/57)100% (19/19)
DefaultFixtureResultsHandlerFactory$DefaultFixtureResultsHandlerImpl (): void 100% (1/1)100% (3/3)100% (2/2)
handleResult (FixtureResults, ReadOnlyArray): void 100% (1/1)100% (54/54)100% (17/17)

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.TestResultType.SUCCESS;
14import static org.jtiger.framework.TestFailureFactory.newTestFailure;
15import static org.jtiger.framework.TestIgnoredFactory.newTestIgnored;
16 
17/**
18 * The default implementation to handle fixture results sends output to
19 * <a href="%j2se.api.spec%/java/lang/System.html#out">the standard output stream</a> with a summary of the result.
20 * The summary contains the number of test case results of success, failure and ignored.
21 *
22 * @author %javadoc.author.tag%
23 * @version %version%<br/>
24 *          <i>Build Number %build.number%</i><br/>
25 *          <i>Build Time %build.time% CET (GMT + 1)</i>
26 */
27public final class DefaultFixtureResultsHandlerFactory
28{
29    private DefaultFixtureResultsHandlerFactory()
30    {
31 
32    }
33 
34    /**
35     * Returns a new instance of the default implementation to handle fixture results.
36     *
37     * @return A new instance of the default implementation to handle fixture results.
38     */
39    public static FixtureResultsHandler newDefaultFixtureResultsHandler()
40    {
41        return new DefaultFixtureResultsHandlerImpl();
42    }
43 
44    private static final class DefaultFixtureResultsHandlerImpl implements FixtureResultsHandler
45    {
46        DefaultFixtureResultsHandlerImpl()
47        {
48 
49        }
50 
51        public void handleResult(final FixtureResults results, final ReadOnlyArray<String> params)
52        {
53            int failures = 0;
54            int successes = 0;
55            int ignored = 0;
56 
57            for(FixtureResult result : results)
58            {
59                for(TestResult tr : result)
60                {
61                    if(tr.getTestResultType() == SUCCESS)
62                    {
63                        successes++;
64                    }
65                    else if(newTestFailure().isFailure(tr.getTestResultType()))
66                    {
67                        failures++;
68                    }
69                    else if(newTestIgnored().isIgnored(tr.getTestResultType()))
70                    {
71                        ignored++;
72                    }
73                }
74            }
75 
76            System.out.println(DefaultFixtureResultsHandlerMessage.message(successes, failures, ignored));
77        }
78    }
79}

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