diff options
author | Carsten Driesner <cd@openoffice.org> | 2011-02-09 16:04:16 +0100 |
---|---|---|
committer | Carsten Driesner <cd@openoffice.org> | 2011-02-09 16:04:16 +0100 |
commit | c0cbcdd2c93eb5ceca7c24f1475757da0a920360 (patch) | |
tree | 81122313a641bd1d5bb2532bf67e42029075f863 /framework/qa | |
parent | fb9f0268794bc2f0966c595c5003b19697af5aae (diff) |
fwk165: #164407# Prevent substitution of abs. path variable in the middle of a path string.
Diffstat (limited to 'framework/qa')
-rwxr-xr-x | framework/qa/complex/path_substitution/PathSubstitutionTest.java | 22 |
1 files changed, 13 insertions, 9 deletions
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 + "'"); |