| 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 | */ |
| 11 | package org.jtiger.ant; |
| 12 | |
| 13 | import java.util.List; |
| 14 | import java.util.LinkedList; |
| 15 | |
| 16 | /** |
| 17 | * An element used in {@link JTigerTask the Ant task} to specify how the test result is handled. The name attribute |
| 18 | * must be a class name that implements the {@link org.jtiger.framework.FixtureResultsHandler} interface. There are |
| 19 | * four (4) special, case-insensitive values for the name attribute, "~html", "~xml", "~text" and "~failure". These four |
| 20 | * values are aliases for {@link org.jtiger.report.html.HtmlFixtureResultsHandler}, |
| 21 | * {@link org.jtiger.report.xml.XmlFixtureResultsHandler} and {@link org.jtiger.report.text.TextFixtureResultsHandler} |
| 22 | * respectively. Each of these four special values require at least one {@link Param} be specified. |
| 23 | * |
| 24 | * @see org.jtiger.framework.FixtureResultsHandler |
| 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 | */ |
| 31 | public final class Result |
| 32 | { |
| 33 | private String name; |
| 34 | private final List<Param> params; |
| 35 | |
| 36 | /** |
| 37 | * Create a default <tt>Result</tt>. |
| 38 | */ |
| 39 | public Result() |
| 40 | { |
| 41 | params = new LinkedList<Param>(); |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * Returns the name for this result. |
| 46 | * |
| 47 | * @return The name for this result. |
| 48 | */ |
| 49 | public String getName() |
| 50 | { |
| 51 | return name; |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * Sets the name for this result. |
| 56 | * |
| 57 | * @param name The name for this result. |
| 58 | */ |
| 59 | public void setName(final String name) |
| 60 | { |
| 61 | this.name = name; |
| 62 | } |
| 63 | |
| 64 | /** |
| 65 | * Creates a param for this result.. |
| 66 | * |
| 67 | * @return A param for this result. |
| 68 | */ |
| 69 | public Param createParam() |
| 70 | { |
| 71 | final Param p = new Param(); |
| 72 | params.add(p); |
| 73 | return p; |
| 74 | } |
| 75 | |
| 76 | List<Param> getParams() |
| 77 | { |
| 78 | return params; |
| 79 | } |
| 80 | } |