Source Code Cross Referenced for SamplePackage.java in  » Testing » jakarta-jmeter » org » apache » jmeter » threads » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Testing » jakarta jmeter » org.apache.jmeter.threads 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         *
009:         *   http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         * 
017:         */
018:
019:        package org.apache.jmeter.threads;
020:
021:        import java.util.Iterator;
022:        import java.util.LinkedList;
023:        import java.util.List;
024:
025:        import org.apache.jmeter.assertions.Assertion;
026:        import org.apache.jmeter.processor.PostProcessor;
027:        import org.apache.jmeter.processor.PreProcessor;
028:        import org.apache.jmeter.samplers.SampleListener;
029:        import org.apache.jmeter.samplers.Sampler;
030:        import org.apache.jmeter.testelement.TestElement;
031:        import org.apache.jmeter.timers.Timer;
032:        import org.apache.jorphan.logging.LoggingManager;
033:        import org.apache.log.Logger;
034:
035:        /**
036:         * @author Michael Stover
037:         * @version $Revision: 493779 $
038:         */
039:        public class SamplePackage {
040:            private static Logger log = LoggingManager.getLoggerForClass();
041:
042:            List sampleListeners = new LinkedList();
043:
044:            List timers = new LinkedList();
045:
046:            List assertions = new LinkedList();
047:
048:            List postProcessors = new LinkedList();
049:
050:            List preProcessors = new LinkedList();
051:
052:            List responseModifiers;
053:
054:            List configs;
055:
056:            List modifiers;
057:
058:            List controllers;
059:
060:            Sampler sampler;
061:
062:            public SamplePackage() {
063:            }
064:
065:            public SamplePackage(List configs, List modifiers,
066:                    List responseModifiers, List listeners, List timers,
067:                    List assertions, List extractors, List pres,
068:                    List controllers) {
069:                log.debug("configs is null: " + (configs == null));
070:                this .configs = configs;
071:                this .modifiers = modifiers;
072:                this .responseModifiers = responseModifiers;
073:                this .sampleListeners = listeners;
074:                this .timers = timers;
075:                this .assertions = assertions;
076:                this .postProcessors = extractors;
077:                this .preProcessors = pres;
078:                this .controllers = controllers;
079:            }
080:
081:            public void setRunningVersion(boolean running) {
082:                setRunningVersion(configs, running);
083:                setRunningVersion(modifiers, running);
084:                setRunningVersion(sampleListeners, running);
085:                setRunningVersion(assertions, running);
086:                setRunningVersion(timers, running);
087:                setRunningVersion(responseModifiers, running);
088:                setRunningVersion(postProcessors, running);
089:                setRunningVersion(preProcessors, running);
090:                setRunningVersion(controllers, running);
091:                sampler.setRunningVersion(running);
092:            }
093:
094:            private void setRunningVersion(List list, boolean running) {
095:                Iterator iter = list.iterator();
096:                while (iter.hasNext()) {
097:                    ((TestElement) iter.next()).setRunningVersion(running);
098:                }
099:            }
100:
101:            private void recoverRunningVersion(List list) {
102:                Iterator iter = list.iterator();
103:                while (iter.hasNext()) {
104:                    ((TestElement) iter.next()).recoverRunningVersion();
105:                }
106:            }
107:
108:            public void recoverRunningVersion() {
109:                recoverRunningVersion(configs);
110:                recoverRunningVersion(modifiers);
111:                recoverRunningVersion(sampleListeners);
112:                recoverRunningVersion(assertions);
113:                recoverRunningVersion(timers);
114:                recoverRunningVersion(responseModifiers);
115:                recoverRunningVersion(postProcessors);
116:                recoverRunningVersion(preProcessors);
117:                recoverRunningVersion(controllers);
118:                sampler.recoverRunningVersion();
119:            }
120:
121:            public List getSampleListeners() {
122:                return sampleListeners;
123:            }
124:
125:            public void addSampleListener(SampleListener listener) {
126:                sampleListeners.add(listener);
127:            }
128:
129:            public List getTimers() {
130:                return timers;
131:            }
132:
133:            public void addPostProcessor(PostProcessor ex) {
134:                postProcessors.add(ex);
135:            }
136:
137:            public void addPreProcessor(PreProcessor pre) {
138:                preProcessors.add(pre);
139:            }
140:
141:            public void addTimer(Timer timer) {
142:                timers.add(timer);
143:            }
144:
145:            public void addAssertion(Assertion asser) {
146:                assertions.add(asser);
147:            }
148:
149:            public List getAssertions() {
150:                return assertions;
151:            }
152:
153:            public List getPostProcessors() {
154:                return postProcessors;
155:            }
156:
157:            public Sampler getSampler() {
158:                return sampler;
159:            }
160:
161:            public void setSampler(Sampler s) {
162:                sampler = s;
163:            }
164:
165:            /**
166:             * Returns the preProcessors.
167:             */
168:            public List getPreProcessors() {
169:                return preProcessors;
170:            }
171:
172:            /**
173:             * Sets the preProcessors.
174:             * 
175:             * @param preProcessors
176:             *            the preProcessors to set
177:             */
178:            public void setPreProcessors(List preProcessors) {
179:                this .preProcessors = preProcessors;
180:            }
181:
182:            /**
183:             * Returns the configs.
184:             * 
185:             * @return List
186:             */
187:            public List getConfigs() {
188:                return configs;
189:            }
190:
191:            /**
192:             * Returns the modifiers.
193:             */
194:            public List getModifiers() {
195:                return modifiers;
196:            }
197:
198:            /**
199:             * Returns the responseModifiers.
200:             */
201:            public List getResponseModifiers() {
202:                return responseModifiers;
203:            }
204:
205:            /**
206:             * Sets the assertions.
207:             * 
208:             * @param assertions
209:             *            the assertions to set
210:             */
211:            public void setAssertions(List assertions) {
212:                this .assertions = assertions;
213:            }
214:
215:            /**
216:             * Sets the configs.
217:             * 
218:             * @param configs
219:             *            the configs to set
220:             */
221:            public void setConfigs(List configs) {
222:                this .configs = configs;
223:            }
224:
225:            /**
226:             * Sets the modifiers.
227:             * 
228:             * @param modifiers
229:             *            the modifiers to set
230:             */
231:            public void setModifiers(List modifiers) {
232:                this .modifiers = modifiers;
233:            }
234:
235:            /**
236:             * Sets the postProcessors.
237:             * 
238:             * @param postProcessors
239:             *            the postProcessors to set
240:             */
241:            public void setPostProcessors(List postProcessors) {
242:                this .postProcessors = postProcessors;
243:            }
244:
245:            /**
246:             * Sets the responseModifiers.
247:             * 
248:             * @param responseModifiers
249:             *            the responseModifiers to set
250:             */
251:            public void setResponseModifiers(List responseModifiers) {
252:                this .responseModifiers = responseModifiers;
253:            }
254:
255:            /**
256:             * Sets the sampleListeners.
257:             * 
258:             * @param sampleListeners
259:             *            the sampleListeners to set
260:             */
261:            public void setSampleListeners(List sampleListeners) {
262:                this .sampleListeners = sampleListeners;
263:            }
264:
265:            /**
266:             * Sets the timers.
267:             * 
268:             * @param timers
269:             *            the timers to set
270:             */
271:            public void setTimers(List timers) {
272:                this.timers = timers;
273:            }
274:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.