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

COVERAGE SUMMARY FOR SOURCE FILE [Fixtures.java]

nameclass, %method, %block, %line, %
Fixtures.java100% (1/1)100% (6/6)100% (116/116)100% (26/26)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class Fixtures100% (1/1)100% (6/6)100% (116/116)100% (26/26)
Fixtures (): void 100% (1/1)100% (13/13)100% (4/4)
createFileSet (): FileSet 100% (1/1)100% (11/11)100% (3/3)
createFixture (): Fixture 100% (1/1)100% (11/11)100% (3/3)
getFileSets (): List 100% (1/1)100% (3/3)100% (1/1)
getFixtures (): List 100% (1/1)100% (3/3)100% (1/1)
toStringArray (Project): String [] 100% (1/1)100% (75/75)100% (14/14)

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.ant;
12 
13import java.util.LinkedList;
14import java.util.List;
15import org.apache.tools.ant.DirectoryScanner;
16import org.apache.tools.ant.Project;
17import org.apache.tools.ant.types.FileSet;
18 
19/**
20 * An element used in {@link JTigerTask the Ant task} to specify zero or more {@link Fixture fixtures} and/or zero or
21 * more <a href="%ant.url%/manual/CoreTypes/fileset.html" target="_blank">file sets</a>. These subelements provide the
22 * ability to specify which test fixture classes are to be executed during the test run.
23 *
24 * @see Fixture
25 * @see JTigerTask
26 * @author %javadoc.author.tag%
27 * @version %version%<br/>
28 *          <i>Build Number %build.number%</i><br/>
29 *          <i>Build Time %build.time% CET (GMT + 1)</i>
30 */
31public final class Fixtures
32{
33    private final List<Fixture> fixtures;
34    private final List<FileSet> filesets;
35 
36    /**
37     * Create a default <tt>Fixtures</tt>.
38     */
39    public Fixtures()
40    {
41        fixtures = new LinkedList<Fixture>();
42        filesets = new LinkedList<FileSet>();
43    }
44 
45    /**
46     * {@link Fixture#Fixture() Creates a <tt>Fixture</tt>}, adds it to the list of instances, and returns the instance.
47     *
48     * @return A created {@link Fixture#Fixture() <tt>Fixture</tt>}.
49     */
50    public Fixture createFixture()
51    {
52        final Fixture f = new Fixture();
53        fixtures.add(f);
54        return f;
55    }
56 
57    /**
58     * Creates a <tt>FileSet</tt>, adds it to the list of instances, and returns the instance.
59     *
60     * @return A created <tt>FileSet</tt>.
61     */
62    public FileSet createFileSet()
63    {
64        final FileSet fs = new FileSet();
65        filesets.add(fs);
66        return fs;
67    }
68 
69    List<Fixture> getFixtures()
70    {
71        return fixtures;
72    }
73 
74    List<FileSet> getFileSets()
75    {
76        return filesets;
77    }
78 
79    String[] toStringArray(final Project project)
80    {
81        final List<String> names = new LinkedList<String>();
82 
83        for(Fixture f : fixtures)
84        {
85            names.add(f.getClassname());
86        }
87 
88        for(FileSet f : filesets)
89        {
90            final DirectoryScanner ds = f.getDirectoryScanner(project);
91 
92            final String[] files = ds.getIncludedFiles();
93 
94            for(String file : files)
95            {
96                final FileNameToClassName ftc = FileNameToClassNameFactory.newFileNameToClassName();
97                final String className = ftc.toClassName(file);
98                if(className != null)
99                {
100                    names.add(className);
101                }
102            }
103        }
104 
105        return names.toArray(new String[names.size()]);
106    }
107}

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