1 /* ***************************************************************************
2 * Copyright (c) 2008 Brabenetz Harald, Austria.
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 *****************************************************************************/
17
18 package org.settings4j.config;
19
20 import java.io.File;
21
22 import junit.framework.TestCase;
23
24 import org.apache.commons.io.FileUtils;
25 import org.settings4j.test.TestUtils;
26
27 /**
28 * Abstract Class for TestCases .
29 * <p>
30 * Checkstyle:OFF MagicNumber
31 */
32 public abstract class AbstractTestSettings4jConfig extends TestCase {
33
34 /** General Logger for this Class. */
35 private static final org.slf4j.Logger LOG = org.slf4j.LoggerFactory.getLogger(AbstractTestSettings4jConfig.class);
36
37 /** {@inheritDoc} */
38 @Override
39 protected void setUp() throws Exception {
40 final File tmpFolder = TestUtils.getTmpFolder();
41 LOG.info("Use temporary Folder: {}", tmpFolder.getAbsolutePath());
42 FileUtils.deleteDirectory(tmpFolder);
43
44 final File testFolder = TestUtils.getTestFolder();
45 LOG.info("Use test Folder: {}", testFolder.getAbsolutePath());
46 FileUtils.deleteDirectory(testFolder);
47 super.setUp();
48 }
49
50 /** {@inheritDoc} */
51 @Override
52 protected void tearDown() throws Exception {
53 final File tmpFolder = TestUtils.getTmpFolder();
54 FileUtils.deleteDirectory(tmpFolder);
55 final File testFolder = TestUtils.getTestFolder();
56 FileUtils.deleteDirectory(testFolder);
57 super.tearDown();
58 }
59
60 }