01: /* TestCaseInfo.java
02: *
03: * DDSteps - Data Driven JUnit Test Steps
04: * Copyright (C) 2005 Jayway AB
05: * www.ddsteps.org
06: *
07: * This library is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU Lesser General Public
09: * License version 2.1 as published by the Free Software Foundation.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this library; if not, visit
18: * http://www.opensource.org/licenses/lgpl-license.php
19: */
20: package org.ddsteps.util;
21:
22: import org.apache.commons.lang.builder.EqualsBuilder;
23: import org.apache.commons.lang.builder.ToStringBuilder;
24:
25: /**
26: * @author adam
27: * @version $Id: TestCaseInfo.java,v 1.1 2005/12/03 12:51:41 adamskogman Exp $
28: */
29: public class TestCaseInfo {
30:
31: final private String methodName;
32:
33: final private String rowId;
34:
35: /**
36: * Info about a row instance.
37: *
38: * @param methodName
39: * @param rowId
40: */
41: public TestCaseInfo(String methodName, String rowId) {
42: this .methodName = methodName;
43: this .rowId = rowId;
44: }
45:
46: /**
47: * Info about a method instance.
48: *
49: * @param methodName
50: */
51: public TestCaseInfo(String methodName) {
52: this .methodName = methodName;
53: this .rowId = null;
54: }
55:
56: /**
57: * @return True if the info is about a method instance.
58: */
59: public boolean isMethodInstance() {
60: return this .rowId == null;
61: }
62:
63: /**
64: * @return True if the info is about a row instance.
65: */
66: public boolean isRowInstance() {
67: return this .rowId != null;
68: }
69:
70: /**
71: * @see java.lang.Object#toString()
72: */
73: public String toString() {
74: return new ToStringBuilder(this ).append("methodName",
75: methodName).append("rowId", rowId).toString();
76: }
77:
78: /**
79: * @see java.lang.Object#equals(java.lang.Object)
80: */
81: public boolean equals(Object obj) {
82: return EqualsBuilder.reflectionEquals(this , obj);
83: }
84:
85: /**
86: * @return Returns the methodName.
87: */
88: public String getMethodName() {
89: return methodName;
90: }
91:
92: /**
93: * @return Returns the rowId.
94: */
95: public String getRowId() {
96: return rowId;
97: }
98:
99: }
|