01: /*
02: * Copyright 2007 Google Inc.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
05: * use this file except in compliance with the License. You may obtain a copy of
06: * the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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.benchmarks;
17:
18: /**
19: * The benchmark metadata for a single benchmark method.
20: */
21: class MetaData {
22:
23: private CategoryImpl category;
24:
25: private String className;
26:
27: private String methodName;
28:
29: private String sourceCode;
30:
31: private String testDescription;
32:
33: private String testName;
34:
35: public MetaData(String className, String methodName,
36: String sourceCode, CategoryImpl category, String testName,
37: String testDescription) {
38: this .className = className;
39: this .methodName = methodName;
40: this .sourceCode = sourceCode;
41: this .category = category;
42: this .testName = testName;
43: this .testDescription = testDescription;
44: }
45:
46: @Override
47: public boolean equals(Object obj) {
48: if (!(obj instanceof MetaData)) {
49: return false;
50: }
51:
52: MetaData md = (MetaData) obj;
53:
54: return md.className.equals(className)
55: && md.methodName.equals(methodName);
56: }
57:
58: public CategoryImpl getCategory() {
59: return category;
60: }
61:
62: public String getClassName() {
63: return className;
64: }
65:
66: public String getMethodName() {
67: return methodName;
68: }
69:
70: public String getSourceCode() {
71: return sourceCode;
72: }
73:
74: public String getTestDescription() {
75: return testDescription;
76: }
77:
78: public String getTestName() {
79: return testName;
80: }
81:
82: @Override
83: public int hashCode() {
84: int result;
85: result = (className != null ? className.hashCode() : 0);
86: result = 29 * result
87: + (methodName != null ? methodName.hashCode() : 0);
88: return result;
89: }
90: }
|