KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > clif > scenario > util > isac > plugin > TestDescription


1 /*
2 * CLIF is a Load Injection Framework
3 * Copyright (C) 2004 France Telecom R&D
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * CLIF
20 *
21 * Contact: clif@objectweb.org
22 */

23 package org.objectweb.clif.scenario.util.isac.plugin;
24
25 import org.apache.log4j.Category;
26 import org.objectweb.clif.scenario.util.isac.util.tree.NodeDescription;
27
28 import java.util.*;
29 /**
30  * This class store a test description
31  *
32  * @author JC Meillaud
33  * @author A Peyrard
34  */

35 public class TestDescription implements ActionDescription {
36     static Category cat = Category.getInstance(TestDescription.class.getName());
37     private String JavaDoc name;
38     private String JavaDoc number;
39     private Vector params;
40     private Vector help;
41     private String JavaDoc guiKey;
42
43     /**
44      * Build a new test description object, used to store information about a test action
45      * @param n The name of the action
46      * @param nb The number of the test in the object test table
47      * @param p The parameters definitions
48      * @param h The help for this action
49      */

50     public TestDescription(String JavaDoc n, String JavaDoc nb, Vector p, Vector h) {
51         cat.debug("-> constructor") ;
52         this.name = n;
53         this.number = nb;
54         this.params = p;
55         this.help = h;
56         this.guiKey = null;
57     }
58
59     /**
60      * @see org.objectweb.clif.scenario.util.isac.plugin.ActionDescription#createNodeDescription(org.objectweb.clif.scenario.util.isac.util.tree.NodeDescription)
61      */

62     public void createNodeDescription(NodeDescription desc) {
63         cat.debug("-> createNodeDescription") ;
64         desc.setActionName(this.name);
65         Hashtable paramsValues = new Hashtable();
66         for (int i = 0; i < this.params.size(); i++)
67             paramsValues.put(
68                 ((ParameterDescription) this.params.elementAt(i)).getName(),
69                 "");
70         desc.setParams(paramsValues);
71     }
72
73     /**
74      * @see org.objectweb.clif.scenario.util.isac.plugin.ActionDescription#getGUIKey()
75      */

76     public String JavaDoc getGUIKey() {
77         cat.debug("-> getGUIKey") ;
78         return guiKey;
79     }
80
81     /**
82      * @see org.objectweb.clif.scenario.util.isac.plugin.ActionDescription#setGUIKey(java.lang.String)
83      */

84     public void setGUIKey(String JavaDoc key) {
85         cat.debug("-> setGUIKey") ;
86         this.guiKey = key ;
87     }
88     /**
89      * Attribute help getter
90      * @return The help of the action
91      */

92     public Vector getHelp() {
93         cat.debug("-> getHelp") ;
94         return help;
95     }
96
97     /**
98      * Attribute name getter
99      * @return The name of the action
100      */

101     public String JavaDoc getName() {
102         cat.debug("-> getName") ;
103         return name;
104     }
105
106     /**
107      * Attribute number getter
108      * @return The number of the test, in the object tests table
109      */

110     public String JavaDoc getNumber() {
111         cat.debug("-> getNumber") ;
112         return number;
113     }
114
115     /**
116      * Attribute params getter
117      * @return The parameters descriptions
118      */

119     public Vector getParams() {
120         cat.debug("-> getParams") ;
121         return params;
122     }
123 }
124
Popular Tags