Skip to content

Commit 8d629f1

Browse files
committed
test: use bin/temp/ftp_test instead of bin/ftp_test so the generated files are not accidentally committed
1 parent be645a2 commit 8d629f1

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

bin/testfiles/FTP_TESTS.jmx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@ import org.apache.commons.io.FileUtils;
8282
import org.apache.ftpserver.DataConnectionConfiguration;
8383
import org.apache.ftpserver.DataConnectionConfigurationFactory;
8484

85-
FileUtils.deleteDirectory(new File(JMeterUtils.getJMeterHome(), "bin/ftp_test"));
86-
new File(JMeterUtils.getJMeterHome(), "bin/ftp_test").mkdir();
85+
FileUtils.deleteDirectory(new File(JMeterUtils.getJMeterHome(), "bin/temp/ftp_test"));
86+
new File(JMeterUtils.getJMeterHome(), "bin/temp/ftp_test").mkdirs();
8787

88-
DataConnectionConfigurationFactory dataConnectionConfigurationFactory =
88+
DataConnectionConfigurationFactory dataConnectionConfigurationFactory =
8989
new DataConnectionConfigurationFactory();
90-
dataConnectionConfigurationFactory.setPassivePorts(vars.get("passivePort"));
90+
dataConnectionConfigurationFactory.setPassivePorts(vars.get("passivePort"));
9191
DataConnectionConfiguration dataConnectionConfiguration = dataConnectionConfigurationFactory.createDataConnectionConfiguration();
9292

9393
PropertiesUserManagerFactory userManagerFactory = new PropertiesUserManagerFactory();
@@ -107,7 +107,7 @@ listenerFactory.setPort(Integer.parseInt(vars.get("port")));
107107
FtpServerFactory factory = new FtpServerFactory();
108108
factory.setUserManager(userManager);
109109
factory.addListener("default", listenerFactory.createListener());
110-
110+
111111
FtpServer server = factory.createServer();
112112
server.start();
113113

@@ -145,7 +145,7 @@ props.put("FTP_SERVER", server);
145145
<stringProp name="FTPSampler.server"></stringProp>
146146
<stringProp name="FTPSampler.port"></stringProp>
147147
<stringProp name="FTPSampler.filename">jmeter.properties</stringProp>
148-
<stringProp name="FTPSampler.localfilename">ftp_test/jmeter-from-ftp-binary.properties</stringProp>
148+
<stringProp name="FTPSampler.localfilename">temp/ftp_test/jmeter-from-ftp-binary.properties</stringProp>
149149
<stringProp name="FTPSampler.inputdata"></stringProp>
150150
<boolProp name="FTPSampler.binarymode">true</boolProp>
151151
<boolProp name="FTPSampler.saveresponse">true</boolProp>
@@ -168,7 +168,7 @@ props.put(&quot;FTP_SERVER&quot;, server);
168168
<stringProp name="FTPSampler.server"></stringProp>
169169
<stringProp name="FTPSampler.port"></stringProp>
170170
<stringProp name="FTPSampler.filename">jmeter.properties</stringProp>
171-
<stringProp name="FTPSampler.localfilename">ftp_test/jmeter-from-ftp-ascii.properties</stringProp>
171+
<stringProp name="FTPSampler.localfilename">temp/ftp_test/jmeter-from-ftp-ascii.properties</stringProp>
172172
<stringProp name="FTPSampler.inputdata"></stringProp>
173173
<boolProp name="FTPSampler.binarymode">false</boolProp>
174174
<boolProp name="FTPSampler.saveresponse">true</boolProp>
@@ -190,8 +190,8 @@ props.put(&quot;FTP_SERVER&quot;, server);
190190
<FTPSampler guiclass="FtpTestSamplerGui" testclass="FTPSampler" testname="FTP Request-put-text" enabled="true">
191191
<stringProp name="FTPSampler.server"></stringProp>
192192
<stringProp name="FTPSampler.port"></stringProp>
193-
<stringProp name="FTPSampler.filename">ftp_test/jmeter-from-ftp-ascii-write.properties</stringProp>
194-
<stringProp name="FTPSampler.localfilename">ftp_test/jmeter-from-ftp-ascii.properties</stringProp>
193+
<stringProp name="FTPSampler.filename">temp/ftp_test/jmeter-from-ftp-ascii-write.properties</stringProp>
194+
<stringProp name="FTPSampler.localfilename">temp/ftp_test/jmeter-from-ftp-ascii.properties</stringProp>
195195
<stringProp name="FTPSampler.inputdata"></stringProp>
196196
<boolProp name="FTPSampler.binarymode">false</boolProp>
197197
<boolProp name="FTPSampler.saveresponse">true</boolProp>
@@ -203,8 +203,8 @@ props.put(&quot;FTP_SERVER&quot;, server);
203203
<FTPSampler guiclass="FtpTestSamplerGui" testclass="FTPSampler" testname="FTP Request-check-upload" enabled="true">
204204
<stringProp name="FTPSampler.server"></stringProp>
205205
<stringProp name="FTPSampler.port"></stringProp>
206-
<stringProp name="FTPSampler.filename">ftp_test/jmeter-from-ftp-ascii-write.properties</stringProp>
207-
<stringProp name="FTPSampler.localfilename">ftp_test/jmeter-from-ftp-ascii-write-tocheck.properties</stringProp>
206+
<stringProp name="FTPSampler.filename">temp/ftp_test/jmeter-from-ftp-ascii-write.properties</stringProp>
207+
<stringProp name="FTPSampler.localfilename">temp/ftp_test/jmeter-from-ftp-ascii-write-tocheck.properties</stringProp>
208208
<stringProp name="FTPSampler.inputdata"></stringProp>
209209
<boolProp name="FTPSampler.binarymode">false</boolProp>
210210
<boolProp name="FTPSampler.saveresponse">true</boolProp>
@@ -248,7 +248,7 @@ import org.apache.commons.io.FileUtils;
248248
import org.apache.commons.io.FileUtils;
249249

250250

251-
FileUtils.deleteDirectory(new File(JMeterUtils.getJMeterHome(), &quot;bin/ftp_test&quot;));
251+
FileUtils.deleteDirectory(new File(JMeterUtils.getJMeterHome(), &quot;bin/temp/ftp_test&quot;));
252252

253253
FtpServer server = (FtpServer) props.get(&quot;FTP_SERVER&quot;);
254254
try {

0 commit comments

Comments
 (0)