01: /*
02: *
03: * Derby - Class org.apache.derbyTesting.junit.ChangeConfigurationSetup
04: *
05: * Licensed to the Apache Software Foundation (ASF) under one or more
06: * contributor license agreements. See the NOTICE file distributed with
07: * this work for additional information regarding copyright ownership.
08: * The ASF licenses this file to You under the Apache License, Version 2.0
09: * (the "License"); you may not use this file except in compliance with
10: * the License. You may obtain a copy of the License at
11: *
12: * http://www.apache.org/licenses/LICENSE-2.0
13: *
14: * Unless required by applicable law or agreed to in writing,
15: * software distributed under the License is distributed on an
16: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
17: * either express or implied. See the License for the specific
18: * language governing permissions and limitations under the License.
19: */
20: package org.apache.derbyTesting.junit;
21:
22: import junit.extensions.TestSetup;
23: import junit.framework.Test;
24:
25: final class ChangeConfigurationSetup extends TestSetup {
26:
27: private final TestConfiguration config;
28: private TestConfiguration old;
29:
30: ChangeConfigurationSetup(TestConfiguration config, Test test) {
31: super (test);
32: this .config = config;
33: }
34:
35: protected void setUp() {
36: old = TestConfiguration.getCurrent();
37: TestConfiguration.setCurrent(config);
38: }
39:
40: protected void tearDown() {
41: TestConfiguration.setCurrent(old);
42: }
43: }
|