diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/execution/MavenClasspathsAndSearchScopesTest.java b/plugins/maven/src/test/java/org/jetbrains/idea/maven/execution/MavenClasspathsAndSearchScopesTest.java index 5704f3aea793..3e9c33ffacd3 100644 --- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/execution/MavenClasspathsAndSearchScopesTest.java +++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/execution/MavenClasspathsAndSearchScopesTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2013 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,6 +34,7 @@ import com.intellij.testFramework.PsiTestUtil; import com.intellij.util.PathsList; import org.jetbrains.annotations.Nullable; import org.jetbrains.idea.maven.MavenImportingTestCase; +import org.jetbrains.idea.maven.importing.ArtifactsDownloadingTestCase; import org.jetbrains.idea.maven.importing.MavenModuleImporter; import java.io.File; @@ -1123,7 +1124,10 @@ public class MavenClasspathsAndSearchScopesTest extends MavenImportingTestCase { } private void createRepositoryFile(String filePath) throws IOException { - createProjectSubFile("repo/" + filePath); + File f = new File(getProjectPath(), "repo/" + filePath); + f.getParentFile().mkdirs(); + + ArtifactsDownloadingTestCase.createEmptyJar(f.getParent(), f.getName()); setRepositoryPath(createProjectSubDir("repo").getPath()); } diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/importing/ArtifactsDownloadingTestCase.java b/plugins/maven/src/test/java/org/jetbrains/idea/maven/importing/ArtifactsDownloadingTestCase.java index f5ef0ff52b2d..79878b1245ac 100644 --- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/importing/ArtifactsDownloadingTestCase.java +++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/importing/ArtifactsDownloadingTestCase.java @@ -18,6 +18,7 @@ package org.jetbrains.idea.maven.importing; import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.vfs.CharsetToolkit; import com.intellij.testFramework.PlatformTestUtil; +import org.jetbrains.annotations.NotNull; import org.jetbrains.idea.maven.MavenCustomRepositoryHelper; import org.jetbrains.idea.maven.MavenImportingTestCase; @@ -34,8 +35,12 @@ public abstract class ArtifactsDownloadingTestCase extends MavenImportingTestCas } protected void createDummyArtifact(String remoteRepo, String name) throws IOException { - FileUtil.writeToFile(new File(remoteRepo, name), PlatformTestUtil.EMPTY_JAR_BYTES); + createEmptyJar(remoteRepo, name); + } - FileUtil.writeToFile(new File(remoteRepo, name + ".sha1"), ("b04f3ee8f5e43fa3b162981b50bb72fe1acabb33 " + name).getBytes(CharsetToolkit.UTF8_CHARSET)); + public static void createEmptyJar(@NotNull String dir, @NotNull String name) throws IOException { + FileUtil.writeToFile(new File(dir, name), PlatformTestUtil.EMPTY_JAR_BYTES); + + FileUtil.writeToFile(new File(dir, name + ".sha1"), ("b04f3ee8f5e43fa3b162981b50bb72fe1acabb33 " + name).getBytes(CharsetToolkit.UTF8_CHARSET)); } }