KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > google > gwt > junit > viewer > client > Report


1 /*
2  * Copyright 2007 Google Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5  * use this file except in compliance with the License. You may obtain a copy of
6  * the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13  * License for the specific language governing permissions and limitations under
14  * the License.
15  */

16 package com.google.gwt.junit.viewer.client;
17
18 import com.google.gwt.user.client.rpc.IsSerializable;
19
20 import java.util.Date JavaDoc;
21 import java.util.List JavaDoc;
22
23 /**
24  * A data object for Report.
25  */

26 public class Report implements IsSerializable {
27
28   /**
29    * @gwt.typeArgs <com.google.gwt.junit.viewer.client.Category>
30    */

31   private List JavaDoc/* <Category> */categories;
32
33   private Date JavaDoc date;
34
35   private String JavaDoc dateString; // Temporary addition until we get better date
36

37   // formatting in GWT
38
private String JavaDoc gwtVersion;
39
40   private String JavaDoc id;
41
42   public List JavaDoc/* <Category> */getCategories() {
43     return categories;
44   }
45
46   public Date JavaDoc getDate() {
47     return date;
48   }
49
50   public String JavaDoc getDateString() {
51     return dateString;
52   }
53
54   public String JavaDoc getGwtVersion() {
55     return gwtVersion;
56   }
57
58   public String JavaDoc getId() {
59     return id;
60   }
61
62   public ReportSummary getSummary() {
63     int numTests = 0;
64     boolean testsPassed = true;
65
66     for (int i = 0; i < categories.size(); ++i) {
67       Category c = (Category) categories.get(i);
68       List JavaDoc benchmarks = c.getBenchmarks();
69       numTests += benchmarks.size();
70     }
71
72     return new ReportSummary(id, date, dateString, numTests, testsPassed);
73   }
74
75   public void setCategories(List JavaDoc categories) {
76     this.categories = categories;
77   }
78
79   public void setDate(Date JavaDoc date) {
80     this.date = date;
81   }
82
83   public void setDateString(String JavaDoc dateString) {
84     this.dateString = dateString;
85   }
86
87   public void setGwtVersion(String JavaDoc gwtVersion) {
88     this.gwtVersion = gwtVersion;
89   }
90
91   public void setId(String JavaDoc id) {
92     this.id = id;
93   }
94 }
95
Popular Tags