You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by pm...@apache.org on 2017/03/04 15:23:48 UTC

svn commit: r1785502 - /jmeter/trunk/test/src/org/apache/jmeter/functions/TestFileToString.java

Author: pmouawad
Date: Sat Mar  4 15:23:47 2017
New Revision: 1785502

URL: http://svn.apache.org/viewvc?rev=1785502&view=rev
Log:
Fix test failure

Modified:
    jmeter/trunk/test/src/org/apache/jmeter/functions/TestFileToString.java

Modified: jmeter/trunk/test/src/org/apache/jmeter/functions/TestFileToString.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/functions/TestFileToString.java?rev=1785502&r1=1785501&r2=1785502&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/functions/TestFileToString.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/functions/TestFileToString.java Sat Mar  4 15:23:47 2017
@@ -20,6 +20,7 @@ package org.apache.jmeter.functions;
 
 import static org.junit.Assert.assertEquals;
 
+import java.io.File;
 import java.util.Collection;
 import java.util.LinkedList;
 
@@ -29,6 +30,7 @@ import org.apache.jmeter.samplers.Sample
 import org.apache.jmeter.threads.JMeterContext;
 import org.apache.jmeter.threads.JMeterContextService;
 import org.apache.jmeter.threads.JMeterVariables;
+import org.apache.jmeter.util.JMeterUtils;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -72,7 +74,8 @@ public class TestFileToString extends JM
     
     @Test
     public void testRead() throws Exception {
-        params.add(new CompoundVariable("bin/jmeter.properties"));
+        File file = new File(JMeterUtils.getJMeterBinDir(), "jmeter.properties");
+        params.add(new CompoundVariable(file.getAbsolutePath()));
         function.setParameters(params);
         String returnValue = function.execute(result, null);
         Assert.assertTrue(returnValue.indexOf("language=")>0);
@@ -80,7 +83,8 @@ public class TestFileToString extends JM
     
     @Test
     public void testReadWithEncoding() throws Exception {
-        params.add(new CompoundVariable("bin/jmeter.properties"));
+        File file = new File(JMeterUtils.getJMeterBinDir(), "jmeter.properties");
+        params.add(new CompoundVariable(file.getAbsolutePath()));
         params.add(new CompoundVariable("UTF-8"));
         function.setParameters(params);
         String returnValue = function.execute(result, null);
@@ -89,7 +93,8 @@ public class TestFileToString extends JM
     
     @Test
     public void testReadWithEncodingAndVar() throws Exception {
-        params.add(new CompoundVariable("bin/jmeter.properties"));
+        File file = new File(JMeterUtils.getJMeterBinDir(), "jmeter.properties");
+        params.add(new CompoundVariable(file.getAbsolutePath()));
         params.add(new CompoundVariable("UTF-8"));
         params.add(new CompoundVariable("MY_FILE_AS_TEXT"));
         function.setParameters(params);