diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/indices/MavenIndex.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/indices/MavenIndex.java index 610522ec592f..fdb24a97580b 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/indices/MavenIndex.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/indices/MavenIndex.java @@ -421,7 +421,7 @@ public class MavenIndex { } @TestOnly - protected File getDir() { + public File getDir() { return myDir; } @@ -491,6 +491,17 @@ public class MavenIndex { }, Collections.emptySet()); } + @TestOnly + public void printInfo() { + doIndexTask(new IndexTask>() { + public Set doTask() throws Exception { + System.out.println("BaseFile: " + myData.groupToArtifactMap.getBaseFile()); + System.out.println("All data objects: " + myData.groupToArtifactMap.getAllDataObjects(null)); + return Collections.emptySet(); + } + }, Collections.emptySet()); + } + public synchronized Set getVersions(final String groupId, final String artifactId) { return doIndexTask(new IndexTask>() { public Set doTask() throws Exception { diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/dom/MavenExtensionCompletionAndResolutionTest.java b/plugins/maven/src/test/java/org/jetbrains/idea/maven/dom/MavenExtensionCompletionAndResolutionTest.java index 211cf736ca95..58800d25137b 100644 --- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/dom/MavenExtensionCompletionAndResolutionTest.java +++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/dom/MavenExtensionCompletionAndResolutionTest.java @@ -18,6 +18,7 @@ package org.jetbrains.idea.maven.dom; import com.intellij.openapi.vfs.LocalFileSystem; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiReference; +import org.jetbrains.idea.maven.indices.MavenIndex; import org.jetbrains.idea.maven.indices.MavenIndicesTestFixture; import org.jetbrains.idea.maven.indices.MavenProjectIndicesManager; @@ -74,9 +75,16 @@ public class MavenExtensionCompletionAndResolutionTest extends MavenDomWithIndic if (!new HashSet(actual).equals(new HashSet(Arrays.asList("maven-compiler-plugin", "maven-war-plugin", "maven-eclipse-plugin", "maven-surefire-plugin")))) { MavenProjectIndicesManager instance = MavenProjectIndicesManager.getInstance(myProject); - System.out.println("GetArtifacts: " + instance.getArtifactIds("org.apache.maven.plugins")); + System.out.println("GetArtifacts: " + new HashSet(instance.getArtifactIds("org.apache.maven.plugins"))); System.out.println("Indexes: " + instance.getIndices()); - throw new AssertionError("GetArtifacts: " + instance.getArtifactIds("org.apache.maven.plugins") + "Indexes: " + instance.getIndices()); + + for (MavenIndex index : instance.getIndices()) { + System.out.println("Index: repositoryId=" + index.getRepositoryId() + " repositoryUrl=" + index.getRepositoryUrl() + " repositoryPathOrUrl" + index.getRepositoryPathOrUrl()); + System.out.println("Dir: " + index.getDir()); + index.printInfo(); + } + + throw new AssertionError("GetArtifacts: " + instance.getArtifactIds("org.apache.maven.plugins") + " Indexes: " + instance.getIndices()); } assertUnorderedElementsAreEqual(actual, "maven-compiler-plugin", "maven-war-plugin", "maven-eclipse-plugin", "maven-surefire-plugin");