[maven] [IDEA-356247] move maven validation test into maven plugin, to allow downloading maven distribution in setup

GitOrigin-RevId: b695fb60e73fdc2fbaa73a32ba5150ffa9fe632e
This commit is contained in:
Alexander Bubenchikov
2024-07-23 11:11:38 +02:00
committed by intellij-monorepo-bot
parent e1b136bbf9
commit afdcd606e9
5 changed files with 23 additions and 6 deletions

View File

@@ -45,7 +45,7 @@ public class MavenCustomRepositoryHelper {
LocalFileSystem.getInstance().refreshIoFiles(Collections.singleton(to)); LocalFileSystem.getInstance().refreshIoFiles(Collections.singleton(to));
} }
private static String getOriginalTestDataPath() { public static String getOriginalTestDataPath() {
String sourcesDir = System.getProperty("maven.sources.dir", PluginPathManager.getPluginHomePath("maven")); String sourcesDir = System.getProperty("maven.sources.dir", PluginPathManager.getPluginHomePath("maven"));
return FileUtil.toSystemIndependentName(sourcesDir + "/src/test/data"); return FileUtil.toSystemIndependentName(sourcesDir + "/src/test/data");
} }

View File

@@ -0,0 +1,22 @@
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.idea.maven.dom
import com.intellij.codeInsight.daemon.DaemonAnalyzerTestCase
import com.intellij.openapi.vfs.LocalFileSystem
import org.jetbrains.idea.maven.MavenCustomRepositoryHelper
import org.jetbrains.idea.maven.server.MavenDistributionsCache
import java.io.File
class MavenXmlHighlightingTest : DaemonAnalyzerTestCase() {
override fun setUp() {
super.setUp()
MavenDistributionsCache.resolveEmbeddedMavenHome()
}
@Throws(Exception::class)
fun testMavenValidation() {
val file = File(MavenCustomRepositoryHelper.getOriginalTestDataPath()).resolve("MavenValidation.xml")
doTest(LocalFileSystem.getInstance().findFileByIoFile(file)!!, false, false)
}
}

View File

@@ -791,11 +791,6 @@ public class XmlHighlightingTest extends DaemonAnalyzerTestCase {
doTest(new VirtualFile[]{findVirtualFile(getFullRelativeTestName()), findVirtualFile(BASE_PATH + location)}, false, false); doTest(new VirtualFile[]{findVirtualFile(getFullRelativeTestName()), findVirtualFile(BASE_PATH + location)}, false, false);
} }
@IJIgnore(issue = "IDEA-356247")
public void testMavenValidation() throws Exception {
doTest(getFullRelativeTestName(), false, false);
}
public void testResolveEntityUrl() throws Throwable { public void testResolveEntityUrl() throws Throwable {
doTest(new VirtualFile[] { doTest(new VirtualFile[] {
findVirtualFile(getFullRelativeTestName()), findVirtualFile(getFullRelativeTestName()),