From 3b608e17afde39359bed6d81785602086870f25f Mon Sep 17 00:00:00 2001 From: Anton Lobov Date: Thu, 12 Sep 2019 13:42:23 +0200 Subject: [PATCH] json: fix tests on agents GitOrigin-RevId: a613e720caaf761505ed1b91223bff47fb4430b7 --- json/tests/test/com/intellij/json/JsonTestCase.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/json/tests/test/com/intellij/json/JsonTestCase.java b/json/tests/test/com/intellij/json/JsonTestCase.java index 60f5f9e7c074..b1637b344bcb 100644 --- a/json/tests/test/com/intellij/json/JsonTestCase.java +++ b/json/tests/test/com/intellij/json/JsonTestCase.java @@ -5,8 +5,10 @@ import com.intellij.json.formatter.JsonCodeStyleSettings; import com.intellij.psi.codeStyle.CodeStyleSettings; import com.intellij.psi.codeStyle.CodeStyleSettingsManager; import com.intellij.psi.codeStyle.CommonCodeStyleSettings; +import com.intellij.testFramework.PlatformTestUtil; import com.intellij.testFramework.TestDataPath; import com.intellij.testFramework.fixtures.BasePlatformTestCase; +import com.intellij.testFramework.fixtures.IdeaTestExecutionPolicy; import org.jetbrains.annotations.NotNull; /** @@ -40,6 +42,11 @@ public abstract class JsonTestCase extends BasePlatformTestCase { @Override @NotNull public String getBasePath() { - return "/community/json/tests/testData"; + String communityPath = PlatformTestUtil.getCommunityPath(); + String homePath = IdeaTestExecutionPolicy.getHomePathWithPolicy(); + if (communityPath.startsWith(homePath)) { + return communityPath.substring(homePath.length()) + "/json/tests/testData"; + } + return "/json/tests/testData"; } } \ No newline at end of file