Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <plugins>
- [...]
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.12.3</version>
- <configuration>
- <workingDirectory>${project.build.directory}</workingDirectory>
- </configuration>
- </plugin>
- [...]
- </plugins>
- File tmpFile = ...
- try {
- // deal with tempFile
- } finally {
- tempFile.delete();
- }
- public class MyTestCase {
- private File tmpFile = null;
- @Before
- public void setUp() {
- tmpFile = ...;
- }
- @Test
- public void setUp() {
- // deal with tmpFile
- }
- @After
- public void setUp() {
- tmpFile.delete();
- }
- }
- File file = File.createTempFile( "some-prefix", "some-ext");
- file.deleteOnExit();
- File file = File.createTempFile( "prefix", "ext", new File("/some/dir/path"));
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.6</version>
- <configuration>
- <systemPropertyVariables>
- <myOutDir>${project.build.outputDirectory}</myOutDir>
- </systemPropertyVariables>
- </configuration>
- </plugin>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement