Coverage details for com.topcoder.testframework.AntTaskInfo

LineHitsSource
1 /*
2  * Copyright (C) 2006 TopCoder Inc., All Rights Reserved.
3  */
4 package com.topcoder.testframework;
5  
6 import org.apache.tools.ant.Location;
7 import org.apache.tools.ant.Project;
8 import org.apache.tools.ant.Target;
9  
10  
11 /**
12  * This class simply stores some data about the Ant project. It is passed with current data to ServerElement class
13  * instance and then to AbstractServer derived classes instances. It is currently used to provide information to the
14  * Cactus testing back-end.
15  * <p/>
16  * This class is immutable, i.e. thread-safe.
17  *
18  * @author real_vg, TCSDEVELOPER
19  * @version 1.0
20  */
21 public class AntTaskInfo {
22  
23     /**
24      * This field represents the current Ant project. It is initialized in constructor.
25      */
26     private final Project project;
27  
28     /**
29      * This field represents the current Ant task name. It is initialized in constructor.
30      */
31     private final String taskName;
32  
33     /**
34      * This field represents the current Ant task location. It is initialized in constructor.
35      */
36     private final Location location;
37  
38     /**
39      * This field represents the current Ant target being executed. It is initialized in constructor and then never
40      * changed.
41      */
42     private final Target target;
43  
44     /**
45      * Creates an AntTaskInfo instance and initializes its fields with the values of like-named parameters.
46      *
47      * @param project the current Ant project
48      * @param taskName the current Ant task name
49      * @param location the current Ant task location
50      * @param target the current Ant target being executed
51      *
52      * @throws IllegalArgumentException if any arg is <tt>null</tt> or taskName is an empty (trim'd) String
53      */
54118    public AntTaskInfo(final Project project, final String taskName, final Location location, final Target target) {
55118        if (project == null) {
561            throw new IllegalArgumentException("The parameter named [project] was null.");
57         }
58117        if (taskName == null) {
591            throw new IllegalArgumentException("The parameter named [taskName] was null.");
60         }
61116        if (taskName.trim().length() == 0) {
621            throw new IllegalArgumentException("The parameter named [taskName] was an empty String.");
63         }
64115        if (location == null) {
651            throw new IllegalArgumentException("The parameter named [location] was null.");
66         }
67114        if (target == null) {
681            throw new IllegalArgumentException("The parameter named [target] was null.");
69         }
70         // argument checking added as of
71         // https://software.topcoder.com/forum/c_forum_message.jsp?f=20015788&r=21551214
72  
73113        this.project = project;
74113        this.taskName = taskName;
75113        this.location = location;
76113        this.target = target;
77113    }
78  
79     /**
80      * This method returns the current Ant project.
81      *
82      * @return the project of this AntTaskInfo
83      */
84     public Project getProject() {
856        return project;
86     }
87  
88     /**
89      * This method returns the Ant task name.
90      *
91      * @return the ant task name of this AntTaskInfo
92      */
93     public String getTaskName() {
946        return taskName;
95     }
96  
97     /**
98      * This method returns the Ant task location.
99      *
100      * @return the location of this AntTaskInfo
101      */
102     public Location getLocation() {
1036        return location;
104     }
105  
106     /**
107      * This method returns the Ant target being executed.
108      *
109      * @return the target of this AntTaskInfo
110      */
111     public Target getTarget() {
1126        return target;
113     }
114 }

this report was generated by version 1.0.5 of jcoverage.
visit www.jcoverage.com for updates.

copyright © 2003, jcoverage ltd. all rights reserved.
Java is a trademark of Sun Microsystems, Inc. in the United States and other countries.