RepositoryLibraryUtilsTest: properly reset path macros and local maven repository path before and after test

GitOrigin-RevId: 8e7430d1597912af3b77749c2a2bf561a8baae75
This commit is contained in:
Vladislav.Yaroshchuk
2023-10-05 11:29:21 +02:00
committed by intellij-monorepo-bot
parent 0c66c4c873
commit ccd91ed6be
21 changed files with 59 additions and 42 deletions

View File

@@ -4,12 +4,12 @@
<remote-repository> <remote-repository>
<option name="id" value="repositoryReleases" /> <option name="id" value="repositoryReleases" />
<option name="name" value="repositoryReleases" /> <option name="name" value="repositoryReleases" />
<option name="url" value="$TEST_REMOTE_REPOSITORIES_ROOT$/repositoryReleases" /> <option name="url" value="$REPOSITORY_LIBRARY_UTILS_TEST_REMOTE_REPOSITORIES_ROOT$/repositoryReleases" />
</remote-repository> </remote-repository>
<remote-repository> <remote-repository>
<option name="id" value="repositorySnapshots" /> <option name="id" value="repositorySnapshots" />
<option name="name" value="repositorySnapshots" /> <option name="name" value="repositorySnapshots" />
<option name="url" value="$TEST_REMOTE_REPOSITORIES_ROOT$/repositorySnapshots" /> <option name="url" value="$REPOSITORY_LIBRARY_UTILS_TEST_REMOTE_REPOSITORIES_ROOT$/repositorySnapshots" />
</remote-repository> </remote-repository>
</component> </component>
</project> </project>

View File

@@ -2,13 +2,13 @@
<library name="smallSampleLibRelease" type="repository"> <library name="smallSampleLibRelease" type="repository">
<properties jar-repository-id="repositoryReleases" maven-id="org.example.repository.library.utils.test:smallSampleLib:1.0"> <properties jar-repository-id="repositoryReleases" maven-id="org.example.repository.library.utils.test:smallSampleLib:1.0">
<verification> <verification>
<artifact url="file://$MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0/smallSampleLib-1.0.jar"> <artifact url="file://$REPOSITORY_LIBRARY_UTILS_TEST_LOCAL_MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0/smallSampleLib-1.0.jar">
<sha256sum>f0aaca850dd5e399541a9614da99dd194c122e9252b35dafeb088b77b8baf6b1</sha256sum> <sha256sum>f0aaca850dd5e399541a9614da99dd194c122e9252b35dafeb088b77b8baf6b1</sha256sum>
</artifact> </artifact>
</verification> </verification>
</properties> </properties>
<CLASSES> <CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0/smallSampleLib-1.0.jar!/" /> <root url="jar://$REPOSITORY_LIBRARY_UTILS_TEST_LOCAL_MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0/smallSampleLib-1.0.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES /> <SOURCES />

View File

@@ -2,7 +2,7 @@
<library name="smallSampleLibSnapshot" type="repository"> <library name="smallSampleLibSnapshot" type="repository">
<properties jar-repository-id="repositorySnapshots" maven-id="org.example.repository.library.utils.test:smallSampleLib:1.0-SNAPSHOT" /> <properties jar-repository-id="repositorySnapshots" maven-id="org.example.repository.library.utils.test:smallSampleLib:1.0-SNAPSHOT" />
<CLASSES> <CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0-SNAPSHOT/smallSampleLib-1.0-SNAPSHOT.jar!/" /> <root url="jar://$REPOSITORY_LIBRARY_UTILS_TEST_LOCAL_MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0-SNAPSHOT/smallSampleLib-1.0-SNAPSHOT.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES /> <SOURCES />

View File

@@ -13,13 +13,13 @@
<library name="smallSampleTestLibModuleLevel" type="repository"> <library name="smallSampleTestLibModuleLevel" type="repository">
<properties jar-repository-id="repositoryReleases" maven-id="org.example.repository.library.utils.test:smallSampleLib:1.0"> <properties jar-repository-id="repositoryReleases" maven-id="org.example.repository.library.utils.test:smallSampleLib:1.0">
<verification> <verification>
<artifact url="file://$MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0/smallSampleLib-1.0.jar"> <artifact url="file://$REPOSITORY_LIBRARY_UTILS_TEST_LOCAL_MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0/smallSampleLib-1.0.jar">
<sha256sum>f0aaca850dd5e399541a9614da99dd194c122e9252b35dafeb088b77b8baf6b1</sha256sum> <sha256sum>f0aaca850dd5e399541a9614da99dd194c122e9252b35dafeb088b77b8baf6b1</sha256sum>
</artifact> </artifact>
</verification> </verification>
</properties> </properties>
<CLASSES> <CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0/smallSampleLib-1.0.jar!/" /> <root url="jar://$REPOSITORY_LIBRARY_UTILS_TEST_LOCAL_MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0/smallSampleLib-1.0.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES /> <SOURCES />

View File

@@ -4,12 +4,12 @@
<remote-repository> <remote-repository>
<option name="id" value="repositoryReleases" /> <option name="id" value="repositoryReleases" />
<option name="name" value="repositoryReleases" /> <option name="name" value="repositoryReleases" />
<option name="url" value="$TEST_REMOTE_REPOSITORIES_ROOT$/repositoryReleases" /> <option name="url" value="$REPOSITORY_LIBRARY_UTILS_TEST_REMOTE_REPOSITORIES_ROOT$/repositoryReleases" />
</remote-repository> </remote-repository>
<remote-repository> <remote-repository>
<option name="id" value="repositorySnapshots" /> <option name="id" value="repositorySnapshots" />
<option name="name" value="repositorySnapshots" /> <option name="name" value="repositorySnapshots" />
<option name="url" value="$TEST_REMOTE_REPOSITORIES_ROOT$/repositorySnapshots" /> <option name="url" value="$REPOSITORY_LIBRARY_UTILS_TEST_REMOTE_REPOSITORIES_ROOT$/repositorySnapshots" />
</remote-repository> </remote-repository>
</component> </component>
</project> </project>

View File

@@ -2,13 +2,13 @@
<library name="smallSampleLibRelease" type="repository"> <library name="smallSampleLibRelease" type="repository">
<properties maven-id="org.example.repository.library.utils.test:smallSampleLib:1.0"> <properties maven-id="org.example.repository.library.utils.test:smallSampleLib:1.0">
<verification> <verification>
<artifact url="file://$MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0/smallSampleLib-1.0.jar"> <artifact url="file://$REPOSITORY_LIBRARY_UTILS_TEST_LOCAL_MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0/smallSampleLib-1.0.jar">
<sha256sum>badchecksum</sha256sum> <sha256sum>badchecksum</sha256sum>
</artifact> </artifact>
</verification> </verification>
</properties> </properties>
<CLASSES> <CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0/smallSampleLib-1.0.jar!/" /> <root url="jar://$REPOSITORY_LIBRARY_UTILS_TEST_LOCAL_MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0/smallSampleLib-1.0.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES /> <SOURCES />

View File

@@ -2,7 +2,7 @@
<library name="smallSampleLibSnapshot" type="repository"> <library name="smallSampleLibSnapshot" type="repository">
<properties maven-id="org.example.repository.library.utils.test:smallSampleLib:1.0-SNAPSHOT" /> <properties maven-id="org.example.repository.library.utils.test:smallSampleLib:1.0-SNAPSHOT" />
<CLASSES> <CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0-SNAPSHOT/smallSampleLib-1.0-SNAPSHOT.jar!/" /> <root url="jar://$REPOSITORY_LIBRARY_UTILS_TEST_LOCAL_MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0-SNAPSHOT/smallSampleLib-1.0-SNAPSHOT.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES /> <SOURCES />

View File

@@ -13,13 +13,13 @@
<library name="smallSampleTestLibModuleLevel" type="repository"> <library name="smallSampleTestLibModuleLevel" type="repository">
<properties maven-id="org.example.repository.library.utils.test:smallSampleLib:1.0"> <properties maven-id="org.example.repository.library.utils.test:smallSampleLib:1.0">
<verification> <verification>
<artifact url="file://$MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0/smallSampleLib-1.0.jar"> <artifact url="file://$REPOSITORY_LIBRARY_UTILS_TEST_LOCAL_MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0/smallSampleLib-1.0.jar">
<sha256sum>badchecksumhere</sha256sum> <sha256sum>badchecksumhere</sha256sum>
</artifact> </artifact>
</verification> </verification>
</properties> </properties>
<CLASSES> <CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0/smallSampleLib-1.0.jar!/" /> <root url="jar://$REPOSITORY_LIBRARY_UTILS_TEST_LOCAL_MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0/smallSampleLib-1.0.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES /> <SOURCES />

View File

@@ -4,12 +4,12 @@
<remote-repository> <remote-repository>
<option name="id" value="repositoryReleases" /> <option name="id" value="repositoryReleases" />
<option name="name" value="repositoryReleases" /> <option name="name" value="repositoryReleases" />
<option name="url" value="$TEST_REMOTE_REPOSITORIES_ROOT$/repositoryReleases" /> <option name="url" value="$REPOSITORY_LIBRARY_UTILS_TEST_REMOTE_REPOSITORIES_ROOT$/repositoryReleases" />
</remote-repository> </remote-repository>
<remote-repository> <remote-repository>
<option name="id" value="repositorySnapshots" /> <option name="id" value="repositorySnapshots" />
<option name="name" value="repositorySnapshots" /> <option name="name" value="repositorySnapshots" />
<option name="url" value="$TEST_REMOTE_REPOSITORIES_ROOT$/repositorySnapshots" /> <option name="url" value="$REPOSITORY_LIBRARY_UTILS_TEST_REMOTE_REPOSITORIES_ROOT$/repositorySnapshots" />
</remote-repository> </remote-repository>
</component> </component>
</project> </project>

View File

@@ -2,7 +2,7 @@
<library name="smallSampleLibRelease" type="repository"> <library name="smallSampleLibRelease" type="repository">
<properties maven-id="org.example.repository.library.utils.test:smallSampleLib:1.0" /> <properties maven-id="org.example.repository.library.utils.test:smallSampleLib:1.0" />
<CLASSES> <CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0/smallSampleLib-1.0.jar!/" /> <root url="jar://$REPOSITORY_LIBRARY_UTILS_TEST_LOCAL_MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0/smallSampleLib-1.0.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES /> <SOURCES />

View File

@@ -2,7 +2,7 @@
<library name="smallSampleLibSnapshot" type="repository"> <library name="smallSampleLibSnapshot" type="repository">
<properties maven-id="org.example.repository.library.utils.test:smallSampleLib:1.0-SNAPSHOT" /> <properties maven-id="org.example.repository.library.utils.test:smallSampleLib:1.0-SNAPSHOT" />
<CLASSES> <CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0-SNAPSHOT/smallSampleLib-1.0-SNAPSHOT.jar!/" /> <root url="jar://$REPOSITORY_LIBRARY_UTILS_TEST_LOCAL_MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0-SNAPSHOT/smallSampleLib-1.0-SNAPSHOT.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES /> <SOURCES />

View File

@@ -13,7 +13,7 @@
<library name="smallSampleTestLibModuleLevel" type="repository"> <library name="smallSampleTestLibModuleLevel" type="repository">
<properties maven-id="org.example.repository.library.utils.test:smallSampleLib:1.0" /> <properties maven-id="org.example.repository.library.utils.test:smallSampleLib:1.0" />
<CLASSES> <CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0/smallSampleLib-1.0.jar!/" /> <root url="jar://$REPOSITORY_LIBRARY_UTILS_TEST_LOCAL_MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0/smallSampleLib-1.0.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES /> <SOURCES />

View File

@@ -4,12 +4,12 @@
<remote-repository> <remote-repository>
<option name="id" value="repositoryReleases" /> <option name="id" value="repositoryReleases" />
<option name="name" value="repositoryReleases" /> <option name="name" value="repositoryReleases" />
<option name="url" value="$TEST_REMOTE_REPOSITORIES_ROOT$/repositoryReleases" /> <option name="url" value="$REPOSITORY_LIBRARY_UTILS_TEST_REMOTE_REPOSITORIES_ROOT$/repositoryReleases" />
</remote-repository> </remote-repository>
<remote-repository> <remote-repository>
<option name="id" value="repositorySnapshots" /> <option name="id" value="repositorySnapshots" />
<option name="name" value="repositorySnapshots" /> <option name="name" value="repositorySnapshots" />
<option name="url" value="$TEST_REMOTE_REPOSITORIES_ROOT$/repositorySnapshots" /> <option name="url" value="$REPOSITORY_LIBRARY_UTILS_TEST_REMOTE_REPOSITORIES_ROOT$/repositorySnapshots" />
</remote-repository> </remote-repository>
</component> </component>
</project> </project>

View File

@@ -2,13 +2,13 @@
<library name="smallSampleLibRelease" type="repository"> <library name="smallSampleLibRelease" type="repository">
<properties maven-id="org.example.repository.library.utils.test:smallSampleLib:1.0"> <properties maven-id="org.example.repository.library.utils.test:smallSampleLib:1.0">
<verification> <verification>
<artifact url="file://$MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0/smallSampleLib-1.0.jar"> <artifact url="file://$REPOSITORY_LIBRARY_UTILS_TEST_LOCAL_MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0/smallSampleLib-1.0.jar">
<sha256sum>f0aaca850dd5e399541a9614da99dd194c122e9252b35dafeb088b77b8baf6b1</sha256sum> <sha256sum>f0aaca850dd5e399541a9614da99dd194c122e9252b35dafeb088b77b8baf6b1</sha256sum>
</artifact> </artifact>
</verification> </verification>
</properties> </properties>
<CLASSES> <CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0/smallSampleLib-1.0.jar!/" /> <root url="jar://$REPOSITORY_LIBRARY_UTILS_TEST_LOCAL_MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0/smallSampleLib-1.0.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES /> <SOURCES />

View File

@@ -2,7 +2,7 @@
<library name="smallSampleLibSnapshot" type="repository"> <library name="smallSampleLibSnapshot" type="repository">
<properties maven-id="org.example.repository.library.utils.test:smallSampleLib:1.0-SNAPSHOT" /> <properties maven-id="org.example.repository.library.utils.test:smallSampleLib:1.0-SNAPSHOT" />
<CLASSES> <CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0-SNAPSHOT/smallSampleLib-1.0-SNAPSHOT.jar!/" /> <root url="jar://$REPOSITORY_LIBRARY_UTILS_TEST_LOCAL_MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0-SNAPSHOT/smallSampleLib-1.0-SNAPSHOT.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES /> <SOURCES />

View File

@@ -13,13 +13,13 @@
<library name="smallSampleTestLibModuleLevel" type="repository"> <library name="smallSampleTestLibModuleLevel" type="repository">
<properties maven-id="org.example.repository.library.utils.test:smallSampleLib:1.0"> <properties maven-id="org.example.repository.library.utils.test:smallSampleLib:1.0">
<verification> <verification>
<artifact url="file://$MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0/smallSampleLib-1.0.jar"> <artifact url="file://$REPOSITORY_LIBRARY_UTILS_TEST_LOCAL_MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0/smallSampleLib-1.0.jar">
<sha256sum>f0aaca850dd5e399541a9614da99dd194c122e9252b35dafeb088b77b8baf6b1</sha256sum> <sha256sum>f0aaca850dd5e399541a9614da99dd194c122e9252b35dafeb088b77b8baf6b1</sha256sum>
</artifact> </artifact>
</verification> </verification>
</properties> </properties>
<CLASSES> <CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0/smallSampleLib-1.0.jar!/" /> <root url="jar://$REPOSITORY_LIBRARY_UTILS_TEST_LOCAL_MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0/smallSampleLib-1.0.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES /> <SOURCES />

View File

@@ -4,12 +4,12 @@
<remote-repository> <remote-repository>
<option name="id" value="repositoryReleases" /> <option name="id" value="repositoryReleases" />
<option name="name" value="repositoryReleases" /> <option name="name" value="repositoryReleases" />
<option name="url" value="$TEST_REMOTE_REPOSITORIES_ROOT$/repositoryReleases" /> <option name="url" value="$REPOSITORY_LIBRARY_UTILS_TEST_REMOTE_REPOSITORIES_ROOT$/repositoryReleases" />
</remote-repository> </remote-repository>
<remote-repository> <remote-repository>
<option name="id" value="repositorySnapshots" /> <option name="id" value="repositorySnapshots" />
<option name="name" value="repositorySnapshots" /> <option name="name" value="repositorySnapshots" />
<option name="url" value="$TEST_REMOTE_REPOSITORIES_ROOT$/repositorySnapshots" /> <option name="url" value="$REPOSITORY_LIBRARY_UTILS_TEST_REMOTE_REPOSITORIES_ROOT$/repositorySnapshots" />
</remote-repository> </remote-repository>
</component> </component>
</project> </project>

View File

@@ -2,7 +2,7 @@
<library name="smallSampleLibRelease" type="repository"> <library name="smallSampleLibRelease" type="repository">
<properties jar-repository-id="repositoryReleases" maven-id="org.example.repository.library.utils.test:smallSampleLib:1.0" /> <properties jar-repository-id="repositoryReleases" maven-id="org.example.repository.library.utils.test:smallSampleLib:1.0" />
<CLASSES> <CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0/smallSampleLib-1.0.jar!/" /> <root url="jar://$REPOSITORY_LIBRARY_UTILS_TEST_LOCAL_MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0/smallSampleLib-1.0.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES /> <SOURCES />

View File

@@ -2,7 +2,7 @@
<library name="smallSampleLibSnapshot" type="repository"> <library name="smallSampleLibSnapshot" type="repository">
<properties jar-repository-id="repositorySnapshots" maven-id="org.example.repository.library.utils.test:smallSampleLib:1.0-SNAPSHOT" /> <properties jar-repository-id="repositorySnapshots" maven-id="org.example.repository.library.utils.test:smallSampleLib:1.0-SNAPSHOT" />
<CLASSES> <CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0-SNAPSHOT/smallSampleLib-1.0-SNAPSHOT.jar!/" /> <root url="jar://$REPOSITORY_LIBRARY_UTILS_TEST_LOCAL_MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0-SNAPSHOT/smallSampleLib-1.0-SNAPSHOT.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES /> <SOURCES />

View File

@@ -13,7 +13,7 @@
<library name="smallSampleTestLibModuleLevel" type="repository"> <library name="smallSampleTestLibModuleLevel" type="repository">
<properties jar-repository-id="repositoryReleases" maven-id="org.example.repository.library.utils.test:smallSampleLib:1.0" /> <properties jar-repository-id="repositoryReleases" maven-id="org.example.repository.library.utils.test:smallSampleLib:1.0" />
<CLASSES> <CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0/smallSampleLib-1.0.jar!/" /> <root url="jar://$REPOSITORY_LIBRARY_UTILS_TEST_LOCAL_MAVEN_REPOSITORY$/org/example/repository/library/utils/test/smallSampleLib/1.0/smallSampleLib-1.0.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES /> <SOURCES />

View File

@@ -1,7 +1,6 @@
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.jarRepository package com.intellij.jarRepository
import com.intellij.application.options.PathMacrosImpl
import com.intellij.openapi.application.PathMacros import com.intellij.openapi.application.PathMacros
import com.intellij.openapi.application.ex.PathManagerEx import com.intellij.openapi.application.ex.PathManagerEx
import com.intellij.openapi.project.Project import com.intellij.openapi.project.Project
@@ -22,14 +21,20 @@ import com.intellij.util.io.directoryContentOf
import junit.framework.TestCase.assertFalse import junit.framework.TestCase.assertFalse
import junit.framework.TestCase.assertTrue import junit.framework.TestCase.assertTrue
import kotlinx.coroutines.runBlocking import kotlinx.coroutines.runBlocking
import org.junit.Before import org.junit.*
import org.junit.ClassRule
import org.junit.Rule
import org.junit.Test
import java.nio.file.Path import java.nio.file.Path
class RepositoryLibraryUtilsTest { class RepositoryLibraryUtilsTest {
companion object { companion object {
/**
* See .idea/libraries/ in testData
*/
private const val TEST_MAVEN_LOCAL_REPOSITORY_MACRO = "REPOSITORY_LIBRARY_UTILS_TEST_LOCAL_MAVEN_REPOSITORY"
/**
* See .idea/jarRepositories.xml in testData
*/
private const val TEST_REMOTE_REPOSITORIES_ROOT_MACRO = "REPOSITORY_LIBRARY_UTILS_TEST_REMOTE_REPOSITORIES_ROOT"
@JvmField @JvmField
@ClassRule @ClassRule
val applicationRule = ApplicationRule() val applicationRule = ApplicationRule()
@@ -39,6 +44,23 @@ class RepositoryLibraryUtilsTest {
val m2Directory = TemporaryDirectory() val m2Directory = TemporaryDirectory()
private val m2DirectoryPath by lazy { m2Directory.createDir() } private val m2DirectoryPath by lazy { m2Directory.createDir() }
@BeforeClass
@JvmStatic
fun beforeAll() {
val pathMacros: PathMacros = PathMacros.getInstance()
pathMacros.setMacro(TEST_MAVEN_LOCAL_REPOSITORY_MACRO, m2DirectoryPath.toString())
JarRepositoryManager.setLocalRepositoryPath(m2DirectoryPath.toFile())
}
@AfterClass
@JvmStatic
fun afterAll() {
val pathMacros: PathMacros = PathMacros.getInstance()
pathMacros.setMacro(TEST_MAVEN_LOCAL_REPOSITORY_MACRO, null)
pathMacros.setMacro(TEST_REMOTE_REPOSITORIES_ROOT_MACRO, null)
JarRepositoryManager.setLocalRepositoryPath(null)
}
} }
@JvmField @JvmField
@@ -61,12 +83,7 @@ class RepositoryLibraryUtilsTest {
m2DirectoryPath.createDirectory() m2DirectoryPath.createDirectory()
val pathMacros: PathMacros = PathMacros.getInstance() val pathMacros: PathMacros = PathMacros.getInstance()
pathMacros.setMacro(TEST_REMOTE_REPOSITORIES_ROOT_MACRO, "file://$testRemoteRepositoriesRoot")
/* tip: MAVEN_REPOSITORY macro is cached in JarRepositoryManager isn't updated each time */
pathMacros.setMacro(PathMacrosImpl.MAVEN_REPOSITORY, m2DirectoryPath.toString())
/* See .idea/jarRepositories.xml in testData */
pathMacros.setMacro("TEST_REMOTE_REPOSITORIES_ROOT", "file://$testRemoteRepositoriesRoot")
} }
@Test @Test