KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > tools > verifier > FrameworkContext


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23 package com.sun.enterprise.tools.verifier;
24
25 import java.io.File JavaDoc;
26 import java.util.List JavaDoc;
27
28 import com.sun.enterprise.deployment.Application;
29 import com.sun.enterprise.deployment.deploy.shared.AbstractArchive;
30 import com.sun.enterprise.server.Constants;
31 import com.sun.enterprise.tools.verifier.util.VerifierConstants;
32
33 /**
34  * This is a data class that contains all the argument specific stuff and
35  * the temporary variables. It is used during the verification process and
36  * during the report generation.
37  *
38  * @author Vikas Awasthi
39  */

40 public class FrameworkContext {
41
42     private boolean app = false;
43     private boolean appClient = false;
44     private boolean connector = false;
45     private boolean ejb = false;
46     private boolean web = false;
47     private boolean webServices = false;
48     private boolean webServicesClient = false;
49     private boolean persistenceUnits = false; // EJB 3.0 persistence entity
50

51     private boolean partition = false;
52     private int reportLevel = VerifierConstants.WARN;
53     private boolean useTimeStamp = false;
54     private boolean usingGui = false;
55     private boolean isBackend = false;
56     private String JavaDoc jarFileName = null;
57     private String JavaDoc outputDirName = null;
58     private String JavaDoc explodedArchivePath = null;
59     private ResultManager resultManager = null;
60     private AbstractArchive abstractArchive = null;
61     private boolean isPortabilityMode = false;
62     private String JavaDoc domainDir = System.getProperty("com.sun.aas.installRoot")+
63                                                     File.separator+"domains"+ // NOI18N
64
File.separator+"domain1"; // NOI18N
65
private String JavaDoc extDir = null;
66     private List JavaDoc<String JavaDoc> classPath = null;
67     private Application application = null;
68     private File JavaDoc jspOutDir = null;
69
70     private String JavaDoc configDirStr = System.getProperty(Constants.INSTALL_ROOT) +
71             File.separator +
72             "lib" + // NOI18N
73
File.separator +
74             "verifier"; // NOI18N
75

76     private String JavaDoc javaEEVersion = SpecVersionMapper.JavaEEVersion_5;
77
78     /**
79      *
80      * @return returns true if application tests are enabled with partioning option.
81      */

82     public boolean isApp() {
83         return app;
84     }
85
86     /**
87      *
88      * @return returns true if application client tests are enabled with
89      * partioning option.
90      */

91     public boolean isAppClient() {
92         return appClient;
93     }
94
95     /**
96      *
97      * @return returns true if connector tests are enabled with
98      * partioning option.
99      */

100     public boolean isConnector() {
101         return connector;
102     }
103
104     /**
105      *
106      * @return returns true if Ejb tests are enabled with
107      * partioning option.
108      */

109     public boolean isEjb() {
110         return ejb;
111     }
112
113     /**
114      *
115      * @return returns true if Web tests are enabled with
116      * partioning option.
117      */

118     public boolean isWeb() {
119         return web;
120     }
121
122     /**
123      *
124      * @return returns true if Webservices tests are enabled with
125      * partioning option.
126      */

127     public boolean isWebServices() {
128         return webServices;
129     }
130
131     /**
132      *
133      * @return returns true if Webservices client tests are enabled with
134      * partioning option.
135      */

136     public boolean isWebServicesClient() {
137         return webServicesClient;
138     }
139
140     public boolean isPersistenceUnits() {
141         return persistenceUnits;
142     }
143
144     /**
145      *
146      * @return returns true if partitioning option is enabled.
147      */

148     public boolean isPartition() {
149         return partition;
150     }
151
152     /**
153      * If -a option is passed to verifier this variable is set for invoking only
154      * application related tests
155      * @param app
156      */

157     public void setApp(boolean app) {
158         this.app = app;
159     }
160
161     /**
162      * If -p option is passed to verifier this variable is set for invoking only
163      * application client related tests
164      * @param appClient
165      */

166     public void setAppClient(boolean appClient) {
167         this.appClient = appClient;
168     }
169
170     /**
171      * If -c option is passed to verifier this variable is set for invoking only
172      * connector related tests
173      * @param connector
174      */

175     public void setConnector(boolean connector) {
176         this.connector = connector;
177     }
178
179     /**
180      * If -e option is passed to verifier this variable is set for invoking only
181      * ejb related tests
182      * @param ejb
183      */

184     public void setEjb(boolean ejb) {
185         this.ejb = ejb;
186     }
187
188     /**
189      * If -w option is passed to verifier this variable is set for invoking only
190      * web related tests
191      * @param web
192      */

193     public void setWeb(boolean web) {
194         this.web = web;
195     }
196
197     /**
198      * If -s option is passed to verifier this variable is set for invoking only
199      * webServices related tests
200      * @param webServices
201      */

202     public void setWebServices(boolean webServices) {
203         this.webServices = webServices;
204     }
205
206     /**
207      * If -l option is passed to verifier this variable is set for invoking only
208      * webservices client related tests
209      * @param webServicesClient
210      */

211     public void setWebServicesClient(boolean webServicesClient) {
212         this.webServicesClient = webServicesClient;
213     }
214
215     /**
216      * If -P option is passed to verifier this variable is set for invoking only
217      * persistence related tests
218      * @param persistenceUnits
219      */

220     public void setPersistenceUnits(boolean persistenceUnits) {
221         this.persistenceUnits = persistenceUnits;
222     }
223
224     /**
225      * if verifier is invoked to run tests for specific component(s) this
226      * variable is set to true
227      * @param partition
228      */

229     public void setPartition(boolean partition) {
230         this.partition = partition;
231     }
232
233     /**
234      *
235      * @return return the reporting level of verifier
236      */

237     public int getReportLevel() {
238         return reportLevel;
239     }
240
241     /**
242      * set the reporting level of verifier
243      * @param reportLevel
244      */

245     public void setReportLevel(int reportLevel) {
246         this.reportLevel = reportLevel;
247     }
248
249     /**
250      *
251      * @return return if timestamp is added to the report files
252      */

253     public boolean isUseTimeStamp() {
254         return useTimeStamp;
255     }
256
257     /**
258      * set option to append timestamp to report files
259      * @param useTimeStamp
260      */

261     public void setUseTimeStamp(boolean useTimeStamp) {
262         this.useTimeStamp = useTimeStamp;
263     }
264
265     /**
266      * get the jar file name to be verifier
267      * @return
268      */

269     public String JavaDoc getJarFileName() {
270         return jarFileName;
271     }
272
273     /**
274      * sets the jar file name to be verified
275      * @param jarFileName
276      */

277     public void setJarFileName(String JavaDoc jarFileName) {
278         this.jarFileName = jarFileName;
279     }
280
281     /**
282      * @return string the output directory where to keep the generated reports
283      */

284     public String JavaDoc getOutputDirName() {
285         return outputDirName;
286     }
287
288     /**
289      * set the output directory where to keep the report files
290      * @param outputDirName
291      */

292     public void setOutputDirName(String JavaDoc outputDirName) {
293         this.outputDirName = outputDirName;
294     }
295
296     /**
297      *
298      * @return the config directory where verifier specific files are kept
299      * like Test-Names.xml and xsl files
300      */

301     public String JavaDoc getConfigDirStr() {
302         return configDirStr;
303     }
304
305
306     /**
307      * set the config dir.
308      * @param configDirStr
309      */

310     public void setConfigDirStr(String JavaDoc configDirStr) {
311         this.configDirStr = configDirStr;
312     }
313
314     /**
315      *
316      * @return The directory where verifier explodes the archive
317      */

318     public String JavaDoc getExplodedArchivePath() {
319         return explodedArchivePath;
320     }
321
322     /**
323      *
324      * @return verifier invokation, in gui mode or command line mode
325      */

326     public boolean isUsingGui() {
327         return usingGui;
328     }
329
330     /**
331      * @param usingGui set the value to true if verifier is invoked in GUI mode.
332      */

333     public void setUsingGui(boolean usingGui) {
334         this.usingGui = usingGui;
335     }
336
337     public boolean isBackend() {
338         return isBackend;
339     }
340
341     public void setIsBackend(boolean b) {
342         this.isBackend = b;
343     }
344     
345     /**
346      *
347      * @param explodedArchivePath directory path where verifier explodes the archive
348      */

349     public void setExplodedArchivePath(String JavaDoc explodedArchivePath) {
350         this.explodedArchivePath = explodedArchivePath;
351     }
352
353     public AbstractArchive getAbstractArchive() {
354         return abstractArchive;
355     }
356
357     public void setAbstractArchive(AbstractArchive abstractArchive) {
358         this.abstractArchive = abstractArchive;
359     }
360
361     public ResultManager getResultManager() {
362         return resultManager;
363     }
364
365     public void setResultManager(ResultManager resultManager) {
366         this.resultManager = resultManager;
367     }
368
369     public boolean isPortabilityMode() {
370         return isPortabilityMode;
371     }
372
373     public void setPortabilityMode(boolean portabilityMode) {
374         isPortabilityMode = portabilityMode;
375     }
376
377     public String JavaDoc getDomainDir() {
378         return domainDir;
379     }
380
381     public void setDomainDir(String JavaDoc domainDir) {
382         this.domainDir = domainDir;
383     }
384
385     public String JavaDoc getExtDir() {
386         return extDir;
387     }
388
389     public void setExtDir(String JavaDoc extDir) {
390         this.extDir = extDir;
391     }
392
393     public List JavaDoc<String JavaDoc> getClassPath() {
394         return classPath;
395     }
396
397     public void setClassPath(List JavaDoc<String JavaDoc> classPath) {
398         this.classPath = classPath;
399     }
400
401     public Application getApplication() {
402         return application;
403     }
404
405     public void setApplication(Application application) {
406         this.application = application;
407     }
408
409     public File JavaDoc getJspOutDir() {
410         return jspOutDir;
411     }
412
413     public void setJspOutDir(File JavaDoc jspOutDir) {
414         this.jspOutDir = jspOutDir;
415     }
416
417     public String JavaDoc getJavaEEVersion() {
418         return javaEEVersion;
419     }
420
421     public void setJavaEEVersion(String JavaDoc javaEEVersion) {
422         this.javaEEVersion = javaEEVersion;
423     }
424
425 }
426
Popular Tags