Skip to content

Commit c969cb7

Browse files
author
John Keyes
committed
- added more tests
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/cli/trunk@191228 13f79535-47bb-0310-9956-ffa450edef68
1 parent 823dfdd commit c969cb7

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/**
2+
* Copyright 2005 The Apache Software Foundation
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of 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,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.apache.commons.cli2.validation;
17+
18+
import java.util.TimeZone;
19+
20+
import junit.extensions.TestDecorator;
21+
22+
import junit.framework.Test;
23+
import junit.framework.TestResult;
24+
25+
public class TimeZoneTestSuite
26+
extends TestDecorator {
27+
private final TimeZone timeZone;
28+
private final TimeZone originalTimeZone;
29+
30+
public TimeZoneTestSuite(String timeZone,
31+
Test test) {
32+
super(test);
33+
this.timeZone = TimeZone.getTimeZone(timeZone);
34+
this.originalTimeZone = TimeZone.getDefault();
35+
}
36+
37+
public void run(TestResult testResult) {
38+
try {
39+
TimeZone.setDefault(timeZone);
40+
super.run(testResult);
41+
} finally {
42+
TimeZone.setDefault(originalTimeZone); // cleanup
43+
}
44+
}
45+
}

0 commit comments

Comments
 (0)