1 package org.codehaus.plexus.archiver;
2
3 import java.io.File;
4 import java.nio.file.Path;
5 import java.nio.file.Paths;
6
7 import org.eclipse.sisu.launch.InjectedTest;
8 import org.junit.jupiter.api.AfterEach;
9 import org.junit.jupiter.api.BeforeEach;
10
11
12
13
14 public abstract class TestSupport extends InjectedTest {
15 @Override
16 @BeforeEach
17 public void setUp() throws Exception {
18 super.setUp();
19 }
20
21 @Override
22 @AfterEach
23 public void tearDown() throws Exception {
24 super.tearDown();
25 }
26
27 private static Path basedir() {
28 return Paths.get(System.getProperty("basedir", (new File("")).getAbsolutePath()));
29 }
30
31 protected static File getTestFile(final String path) {
32 return basedir().resolve(path).toFile();
33 }
34
35 protected static File getTestFile(final String basedir, final String path) {
36 return basedir().resolve(basedir).resolve(path).toFile();
37 }
38 }