001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041:
042: /*
043: * XTestTestRun.java
044: *
045: * Created on November 1, 2001, 6:09 PM
046: */
047:
048: package org.netbeans.xtest.pe.xmlbeans;
049:
050: import java.io.*;
051: import org.netbeans.xtest.pe.xmlbeans.ModuleError;
052:
053: /**
054: *
055: * @author mb115822
056: */
057: public class TestRun extends XMLBean {
058:
059: /** Creates new XTestTestRun */
060: public TestRun() {
061: }
062:
063: /** Getter for property timeStamp.
064: * @return Value of property timeStamp.
065: */
066: public java.sql.Timestamp getTimeStamp() {
067: return xmlat_timeStamp;
068: }
069:
070: /** Setter for property timeStamp.
071: * @param timeStamp New value of property timeStamp.
072: */
073: public void setTimeStamp(java.sql.Timestamp timeStamp) {
074: xmlat_timeStamp = timeStamp;
075: }
076:
077: /** Getter for property time.
078: * @return Value of property time.
079: */
080: public long getTime() {
081: return xmlat_time;
082: }
083:
084: /** Setter for property time.
085: * @param time New value of property time.
086: */
087: public void setTime(long time) {
088: xmlat_time = time;
089: }
090:
091: /** Getter for property config.
092: * @return Value of property config.
093: */
094: public String getConfig() {
095: return xmlat_config;
096: }
097:
098: /** Setter for property config.
099: * @param config New value of property config.
100: */
101: public void setConfig(String config) {
102: xmlat_config = config;
103: }
104:
105: /** Getter for property name.
106: * @return Value of property name.
107: */
108: public String getName() {
109: return xmlat_name;
110: }
111:
112: /** Setter for property name.
113: * @param name New value of property name.
114: */
115: public void setName(String name) {
116: xmlat_name = name;
117: }
118:
119: /** Getter for property attributes.
120: * @return Value of property attributes.
121: */
122: public String getAttributes() {
123: return xmlat_attributes;
124: }
125:
126: /** Setter for property attributes.
127: * @param attributes New value of property attributes.
128: */
129: public void setAttributes(String attributes) {
130: xmlat_attributes = attributes;
131: }
132:
133: /** Getter for property testsError.
134: * @return Value of property testsError.
135: */
136: public long getTestsError() {
137: return xmlat_testsError;
138: }
139:
140: /** Setter for property testsError.
141: * @param testsError New value of property testsError.
142: */
143: public void setTestsError(long testsError) {
144: xmlat_testsError = testsError;
145: }
146:
147: /** Getter for property testsFail.
148: * @return Value of property testsFail.
149: */
150: public long getTestsFail() {
151: return xmlat_testsFail;
152: }
153:
154: /** Setter for property testsFail.
155: * @param testsFail New value of property testsFail.
156: */
157: public void setTestsFail(long testsFail) {
158: xmlat_testsFail = testsFail;
159: }
160:
161: /** Getter for property testsPass.
162: * @return Value of property testsPass.
163: */
164: public long getTestsPass() {
165: return xmlat_testsPass;
166: }
167:
168: /** Setter for property testsPass.
169: * @param testsPass New value of property testsPass.
170: */
171: public void setTestsPass(long testsPass) {
172: xmlat_testsPass = testsPass;
173: }
174:
175: /** Getter for property testsUnexpectedPass.
176: * @return Value of property testsUnexpectedPass.
177: */
178: public long getTestsUnexpectedPass() {
179: return xmlat_testsUnexpectedPass;
180: }
181:
182: /** Setter for property testsUnexpectedPass.
183: * @param testsPass New value of property testsUnexpectedPass.
184: */
185: public void setTestsUnexpectedPass(long testsUnexpectedPass) {
186: xmlat_testsUnexpectedPass = testsUnexpectedPass;
187: }
188:
189: /** Getter for property testsExpectedFail.
190: * @return Value of property testsExpectedFail.
191: */
192: public long getTestsExpectedFail() {
193: return xmlat_testsExpectedFail;
194: }
195:
196: /** Setter for property testsExpectedFail.
197: * @param testsExpectedFail New value of property testsExpectedFail.
198: */
199: public void setTestsExpectedFail(long testsExpectedFail) {
200: xmlat_testsExpectedFail = testsExpectedFail;
201: }
202:
203: /** Getter for property testsTotal.
204: * @return Value of property testsTotal.
205: */
206: public long getTestsTotal() {
207: return xmlat_testsTotal;
208: }
209:
210: /** Setter for property testsTotal.
211: * @param testsTotal New value of property testsTotal.
212: */
213: public void setTestsTotal(long testsTotal) {
214: xmlat_testsTotal = testsTotal;
215: }
216:
217: /** Getter for property runID.
218: * @return Value of property runID.
219: */
220: public String getRunID() {
221: return xmlat_runID;
222: }
223:
224: /** Setter for property runID.
225: * @param runID New value of property runID.
226: */
227: public void setRunID(String runID) {
228: xmlat_runID = runID;
229: }
230:
231: /** Getter for property XTestResultsReport_id.
232: * @return Value of property XTestResultsReport_id.
233: */
234: public long getXTestResultsReport_id() {
235: return this .XTestResultsReport_id;
236: }
237:
238: /** Setter for property XTestResultsReport_id.
239: * @param XTestResultsReport_id New value of property XTestResultsReport_id.
240: */
241: public void setXTestResultsReport_id(long XTestResultsReport_id) {
242: this .XTestResultsReport_id = XTestResultsReport_id;
243: }
244:
245: /** Setter for property moduleErrors.
246: * @param moduleErrors New value of property moduleErrors.
247: */
248: public void addModuleError(ModuleError moduleError) {
249: //xml_cdata = moduleErrors;
250: if (xmlel_ModuleError == null) {
251: xmlel_ModuleError = new ModuleError[] { moduleError };
252: } else {
253: ModuleError new_ModuleError[] = new ModuleError[xmlel_ModuleError.length + 1];
254: for (int i = 0; i < xmlel_ModuleError.length; i++)
255: new_ModuleError[i] = xmlel_ModuleError[i];
256: new_ModuleError[xmlel_ModuleError.length] = moduleError;
257: xmlel_ModuleError = new_ModuleError;
258: }
259: }
260:
261: // XML attributes
262: public java.sql.Timestamp xmlat_timeStamp;
263: public long xmlat_time;
264: public String xmlat_config;
265: public String xmlat_name;
266: public String xmlat_attributes;
267: public long xmlat_testsTotal;
268: public long xmlat_testsPass;
269: public long xmlat_testsFail;
270: public long xmlat_testsUnexpectedPass;
271: public long xmlat_testsExpectedFail;
272: public long xmlat_testsError;
273: public String xmlat_runID;
274:
275: // flag indicating whether this testreport includes
276: // logs from ant running tests
277: public boolean xmlat_antLogs = false;
278:
279: // child elements
280: public TestBag[] xmlel_TestBag;
281: public ModuleError[] xmlel_ModuleError;
282:
283: /** Holds value of property XTestResultsReport_id. */
284: private long XTestResultsReport_id;
285:
286: // load TestRun from a file
287: public static TestRun loadFromFile(File aFile) throws IOException,
288: ClassNotFoundException {
289: XMLBean xmlBean = XMLBean.loadXMLBean(aFile);
290: if (!(xmlBean instanceof TestRun)) {
291: throw new ClassNotFoundException("Loaded file " + aFile
292: + " does not contain TestRun");
293: }
294: return (TestRun) xmlBean;
295: }
296:
297: }
|