Skip to content

Commit

Permalink
[Misc] Improve environment handling during tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tmortagne committed Jul 17, 2024
1 parent a1f9346 commit fbeac77
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import java.io.InputStream;
import java.net.URL;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Pattern;
Expand Down Expand Up @@ -68,15 +67,14 @@ public class RepositoryUtils
*/
protected void initializeDirectories(Environment environment)
{
File testDirectory = new File("target/test-" + new Date().getTime()).getAbsoluteFile();

this.extensionDirectory = new File(environment.getPermanentDirectory(), "extension/");
this.localRepositoryRoot = new File(this.extensionDirectory, "repository/");

this.mavenRepositoryRoot = new File(testDirectory, "maven/");
this.maven2RepositoryRoot = new File(testDirectory, "maven2/");
this.mavenUnknownRepositoryRoot = new File(testDirectory, "mavenunknown/");
this.remoteRepositoryRoot = new File(testDirectory, "remote/");
File repositoriesRootFile = new File(environment.getPermanentDirectory(), "repositories/");
this.mavenRepositoryRoot = new File(repositoriesRootFile, "maven/");
this.maven2RepositoryRoot = new File(repositoriesRootFile, "maven2/");
this.mavenUnknownRepositoryRoot = new File(repositoriesRootFile, "mavenunknown/");
this.remoteRepositoryRoot = new File(repositoriesRootFile, "remote/");

Map<String, RepositorySerializer> repositories = new HashMap<>();
repositories.put(null, new DefaultRepositorySerializer(getRemoteRepository()));
Expand Down

0 comments on commit fbeac77

Please sign in to comment.