From c0cbcdd2c93eb5ceca7c24f1475757da0a920360 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Wed, 9 Feb 2011 16:04:16 +0100 Subject: fwk165: #164407# Prevent substitution of abs. path variable in the middle of a path string. --- .../path_substitution/PathSubstitutionTest.java | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'framework/qa') diff --git a/framework/qa/complex/path_substitution/PathSubstitutionTest.java b/framework/qa/complex/path_substitution/PathSubstitutionTest.java index aeea9907e6bc..451b2d3db8ec 100755 --- a/framework/qa/complex/path_substitution/PathSubstitutionTest.java +++ b/framework/qa/complex/path_substitution/PathSubstitutionTest.java @@ -66,17 +66,17 @@ public class PathSubstitutionTest @Before private void initialize() { substVars = new VariableContainer(); - substVars.add("$(prog)", false, true); - substVars.add("$(inst)", false, true); - substVars.add("$(user)", false, true); - substVars.add("$(work)", false, true); - substVars.add("$(home)", false, true); - substVars.add("$(temp)", false, true); + substVars.add("$(prog)", true, true); + substVars.add("$(inst)", true, true); + substVars.add("$(user)", true, true); + substVars.add("$(work)", true, true); + substVars.add("$(home)", true, true); + substVars.add("$(temp)", true, true); substVars.add("$(lang)", false, false); substVars.add("$(langid)", false, false); substVars.add("$(vlang)", false, false); // path won't resubstitute - substVars.add("$(path)", false, false); + substVars.add("$(path)", true, false); } /** @@ -106,8 +106,6 @@ public class PathSubstitutionTest return; } -// initialize(); - for (int i = 0; i < substVars.size(); i++) { String var = substVars.getVariable(i); @@ -148,6 +146,12 @@ public class PathSubstitutionTest //in middle of text works substString = "file:///starting/" + var + "/path"; + String sCanSubstAllPos; + if (substVars.onlySubstituteAtBegin(i)) + sCanSubstAllPos = "NO"; + else + sCanSubstAllPos = "YES"; + System.out.println("Variable can substitute within string: "+sCanSubstAllPos); System.out.println("Substitute '" + substString + "'"); newValue = oObj.substituteVariables(substString, false); System.out.println("Return value '" + newValue + "'"); -- cgit