From e008f1d68411777e774db3c8dca7dfa3e21cb4d3 Mon Sep 17 00:00:00 2001 From: Matt Nash Date: Thu, 9 May 2013 11:48:23 -0500 Subject: [PATCH] Issue #1990 allow work assignments to work with TestPathManager, if they set the baseline_repo variable to point to the location of the git repo for AWIPS2_baseline Change-Id: Iad2e6bc92e20d4135837fa1dd3a7521fa1dbb751 Former-commit-id: 3aa8e33e77aa22b882487b96014dabb5360be7b7 [formerly a9801dd87f8f86ea7f842b4584f4f5b373503a4c] [formerly 5a4bd2894eea4267fe3d69e0fa84d6399e2b9fd8] [formerly 3aa8e33e77aa22b882487b96014dabb5360be7b7 [formerly a9801dd87f8f86ea7f842b4584f4f5b373503a4c] [formerly 5a4bd2894eea4267fe3d69e0fa84d6399e2b9fd8] [formerly 6ae260f4e7c5107834fbe4e588e13ffda492c265 [formerly 5a4bd2894eea4267fe3d69e0fa84d6399e2b9fd8 [formerly 2d26f8f1eac681586684680a84c41d06437dead5]]]] Former-commit-id: 6ae260f4e7c5107834fbe4e588e13ffda492c265 Former-commit-id: 91ae94f0c368418129353e9ba839c58f22bb814d [formerly 34be2d04c9d81cca1dd8fae3ee5b979f47bb2460] [formerly 13718a3671328ceb77dc06ba716871cb6e8d7f6e [formerly bdbc49fe3475ab1b740e2997ac0bc463dcf97d0b]] Former-commit-id: af533a7e2aa842db3199db9b0ffdcd4563b2017f [formerly 870ac9d14d632442ff00553c92ab2397dc4d3390] Former-commit-id: ad5d586e5eafa8e0bf5a70247822b821ddce2e42 --- .../common/localization/TestPathManager.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/tests/unit/com/raytheon/uf/common/localization/TestPathManager.java b/tests/unit/com/raytheon/uf/common/localization/TestPathManager.java index dbd105ca8e..1965f4dba5 100644 --- a/tests/unit/com/raytheon/uf/common/localization/TestPathManager.java +++ b/tests/unit/com/raytheon/uf/common/localization/TestPathManager.java @@ -156,7 +156,8 @@ public class TestPathManager extends PathManager { * @return */ private File createTestIsolatedVersionOfLocalizationFile( - LocalizationContext context, String fileName, File baselinedVersion) { + LocalizationContext context, String fileName, + File baselinedVersion) { File savedFileBaseDir = new File(savedLocalizationFileDir, context.toPath()); File savedFile = new File(savedFileBaseDir, fileName); @@ -205,8 +206,19 @@ public class TestPathManager extends PathManager { } if (buildEdexDir == null) { - throw new RuntimeException( - "Unable to find the build.edex directory!"); + // work assignment workaround to for tests since we don't + // know where the baseline repo is and we can't necessarily + // find files if we don't know the baseline repo's location + // THIS MEANS THAT FOR WORK ASSIGNMENTS WE MUST HAVE + // BASELINE_DIR SET + buildEdexDir = new File(System.getenv("baseline_dir") + .replace("\n", ""), "edexOsgi" + File.separator + + "build.edex"); + if (buildEdexDir.exists() == false + || buildEdexDir.isDirectory() == false) { + throw new RuntimeException( + "Unable to find the build.edex directory!"); + } } utilityDirs.add(new File(buildEdexDir, "esb/data/utility"));