From 07148e781fb5d6d863d46acb38b2dd5dbce453b1 Mon Sep 17 00:00:00 2001 From: Denis Zhdanov Date: Tue, 18 May 2010 10:04:30 +0400 Subject: [PATCH] IDEA-54295 Unify test data path access for all IDEA tests Provided convenient entry point for accessing test data by Class object of target test class --- .../openapi/application/ex/PathManagerEx.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/platform/platform-api/src/com/intellij/openapi/application/ex/PathManagerEx.java b/platform/platform-api/src/com/intellij/openapi/application/ex/PathManagerEx.java index f1bd0cfa1365..25809cf428af 100644 --- a/platform/platform-api/src/com/intellij/openapi/application/ex/PathManagerEx.java +++ b/platform/platform-api/src/com/intellij/openapi/application/ex/PathManagerEx.java @@ -141,6 +141,19 @@ public class PathManagerEx { return getTestDataPath(strategy); } + /** + * Shorthand for calling {@link #getTestDataPath(TestDataLookupStrategy)} with strategy obtained via call to + * {@link #determineLookupStrategy(Class)} with the given class. + * + * @param testClass target test class for which test data should be obtained + * @return base test data directory to use for the given test class + * @throws IllegalStateException as defined by {@link #getTestDataPath(TestDataLookupStrategy)} + */ + public static String getTestDataPath(Class testClass) throws IllegalStateException { + TestDataLookupStrategy strategy = determineLookupStrategy(testClass); + return getTestDataPath(strategy); + } + /** * Tries to return test data path for the given lookup strategy. *