Skip to content

Commit fa09d91

Browse files
committed
Remove duplicate path constant to test files directory. Update all test cases
to use this new constant name. Update test case headers to point to new OWASP Benchmark project page on new OWASP site. Clean up a few code constructs in test cases that generated compiler code quality warnings.
1 parent 58baeca commit fa09d91

File tree

2,023 files changed

+4537
-4907
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,023 files changed

+4537
-4907
lines changed

src/main/java/org/owasp/benchmark/helpers/Utils.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,6 @@ public class Utils {
8989

9090
// A 'test' directory that target test files are created in so test cases can use them
9191
public static final String TESTFILES_DIR = USERDIR + File.separator + "testfiles" + File.separator;
92-
public static final String testfileDir = USERDIR + File.separator + "testfiles" + File.separator;
93-
// Note: The above constant was renamed to be all CAPs, but generated test cases use old name. Remove
94-
// after regenerating with new constant name.
9592

9693
public static final String DATA_DIR = USERDIR + File.separator + "data" + File.separator;
9794

src/main/java/org/owasp/benchmark/testcode/BenchmarkTest00001.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public void doPost(HttpServletRequest request, HttpServletResponse response) thr
6767
java.io.FileInputStream fis = null;
6868

6969
try {
70-
fileName = org.owasp.benchmark.helpers.Utils.testfileDir + param;
70+
fileName = org.owasp.benchmark.helpers.Utils.TESTFILES_DIR + param;
7171
fis = new java.io.FileInputStream(new java.io.File(fileName));
7272
byte[] b = new byte[1000];
7373
int size = fis.read(b);

src/main/java/org/owasp/benchmark/testcode/BenchmarkTest00002.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public void doPost(HttpServletRequest request, HttpServletResponse response) thr
6767
java.io.FileOutputStream fos = null;
6868

6969
try {
70-
fileName = org.owasp.benchmark.helpers.Utils.testfileDir + param;
70+
fileName = org.owasp.benchmark.helpers.Utils.TESTFILES_DIR + param;
7171

7272
fos = new java.io.FileOutputStream(fileName, false);
7373
response.getWriter().println(

src/main/java/org/owasp/benchmark/testcode/BenchmarkTest00003.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public void doPost(HttpServletRequest request, HttpServletResponse response) thr
8686

8787
byte[] result = md.digest();
8888
java.io.File fileTarget = new java.io.File(
89-
new java.io.File(org.owasp.benchmark.helpers.Utils.testfileDir),"passwordFile.txt");
89+
new java.io.File(org.owasp.benchmark.helpers.Utils.TESTFILES_DIR),"passwordFile.txt");
9090
java.io.FileWriter fw = new java.io.FileWriter(fileTarget,true); //the true will append the new data
9191
fw.write("hash_value=" + org.owasp.esapi.ESAPI.encoder().encodeForBase64(result, true) + "\n");
9292
fw.close();

src/main/java/org/owasp/benchmark/testcode/BenchmarkTest00005.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* This file is part of the Open Web Application Security Project (OWASP)
55
* Benchmark Project. For details, please see
6-
* <a href="https://www.owasp.org/index.php/Benchmark">https://www.owasp.org/index.php/Benchmark</a>.
6+
* <a href="https://owasp.org/www-project-benchmark/">https://owasp.org/www-project-benchmark/</a>.
77
*
88
* The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
99
* of the GNU General Public License as published by the Free Software Foundation, version 2.
@@ -12,7 +12,7 @@
1212
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1313
* GNU General Public License for more details.
1414
*
15-
* @author Dave Wichers <a href="https://www.aspectsecurity.com">Aspect Security</a>
15+
* @author Dave Wichers
1616
* @created 2015
1717
*/
1818

@@ -87,7 +87,7 @@ public void doPost(HttpServletRequest request, HttpServletResponse response) thr
8787
byte[] result = c.doFinal(input);
8888

8989
java.io.File fileTarget = new java.io.File(
90-
new java.io.File(org.owasp.benchmark.helpers.Utils.testfileDir),"passwordFile.txt");
90+
new java.io.File(org.owasp.benchmark.helpers.Utils.TESTFILES_DIR),"passwordFile.txt");
9191
java.io.FileWriter fw = new java.io.FileWriter(fileTarget,true); //the true will append the new data
9292
fw.write("secret_value=" + org.owasp.esapi.ESAPI.encoder().encodeForBase64(result, true) + "\n");
9393
fw.close();

src/main/java/org/owasp/benchmark/testcode/BenchmarkTest00006.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* This file is part of the Open Web Application Security Project (OWASP)
55
* Benchmark Project. For details, please see
6-
* <a href="https://www.owasp.org/index.php/Benchmark">https://www.owasp.org/index.php/Benchmark</a>.
6+
* <a href="https://owasp.org/www-project-benchmark/">https://owasp.org/www-project-benchmark/</a>.
77
*
88
* The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
99
* of the GNU General Public License as published by the Free Software Foundation, version 2.
@@ -12,7 +12,7 @@
1212
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1313
* GNU General Public License for more details.
1414
*
15-
* @author Dave Wichers <a href="https://www.aspectsecurity.com">Aspect Security</a>
15+
* @author Dave Wichers
1616
* @created 2015
1717
*/
1818

src/main/java/org/owasp/benchmark/testcode/BenchmarkTest00007.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* This file is part of the Open Web Application Security Project (OWASP)
55
* Benchmark Project. For details, please see
6-
* <a href="https://www.owasp.org/index.php/Benchmark">https://www.owasp.org/index.php/Benchmark</a>.
6+
* <a href="https://owasp.org/www-project-benchmark/">https://owasp.org/www-project-benchmark/</a>.
77
*
88
* The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
99
* of the GNU General Public License as published by the Free Software Foundation, version 2.
@@ -12,7 +12,7 @@
1212
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1313
* GNU General Public License for more details.
1414
*
15-
* @author Dave Wichers <a href="https://www.aspectsecurity.com">Aspect Security</a>
15+
* @author Dave Wichers
1616
* @created 2015
1717
*/
1818

src/main/java/org/owasp/benchmark/testcode/BenchmarkTest00008.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* This file is part of the Open Web Application Security Project (OWASP)
55
* Benchmark Project. For details, please see
6-
* <a href="https://www.owasp.org/index.php/Benchmark">https://www.owasp.org/index.php/Benchmark</a>.
6+
* <a href="https://owasp.org/www-project-benchmark/">https://owasp.org/www-project-benchmark/</a>.
77
*
88
* The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
99
* of the GNU General Public License as published by the Free Software Foundation, version 2.
@@ -12,7 +12,7 @@
1212
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1313
* GNU General Public License for more details.
1414
*
15-
* @author Dave Wichers <a href="https://www.aspectsecurity.com">Aspect Security</a>
15+
* @author Dave Wichers
1616
* @created 2015
1717
*/
1818

src/main/java/org/owasp/benchmark/testcode/BenchmarkTest00009.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* This file is part of the Open Web Application Security Project (OWASP)
55
* Benchmark Project. For details, please see
6-
* <a href="https://www.owasp.org/index.php/Benchmark">https://www.owasp.org/index.php/Benchmark</a>.
6+
* <a href="https://owasp.org/www-project-benchmark/">https://owasp.org/www-project-benchmark/</a>.
77
*
88
* The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
99
* of the GNU General Public License as published by the Free Software Foundation, version 2.
@@ -12,7 +12,7 @@
1212
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1313
* GNU General Public License for more details.
1414
*
15-
* @author Dave Wichers <a href="https://www.aspectsecurity.com">Aspect Security</a>
15+
* @author Dave Wichers
1616
* @created 2015
1717
*/
1818

@@ -88,7 +88,7 @@ public void doPost(HttpServletRequest request, HttpServletResponse response) thr
8888

8989
byte[] result = md.digest();
9090
java.io.File fileTarget = new java.io.File(
91-
new java.io.File(org.owasp.benchmark.helpers.Utils.testfileDir),"passwordFile.txt");
91+
new java.io.File(org.owasp.benchmark.helpers.Utils.TESTFILES_DIR),"passwordFile.txt");
9292
java.io.FileWriter fw = new java.io.FileWriter(fileTarget,true); //the true will append the new data
9393
fw.write("hash_value=" + org.owasp.esapi.ESAPI.encoder().encodeForBase64(result, true) + "\n");
9494
fw.close();

src/main/java/org/owasp/benchmark/testcode/BenchmarkTest00011.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* This file is part of the Open Web Application Security Project (OWASP)
55
* Benchmark Project. For details, please see
6-
* <a href="https://www.owasp.org/index.php/Benchmark">https://www.owasp.org/index.php/Benchmark</a>.
6+
* <a href="https://owasp.org/www-project-benchmark/">https://owasp.org/www-project-benchmark/</a>.
77
*
88
* The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
99
* of the GNU General Public License as published by the Free Software Foundation, version 2.
@@ -12,7 +12,7 @@
1212
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1313
* GNU General Public License for more details.
1414
*
15-
* @author Dave Wichers <a href="https://www.aspectsecurity.com">Aspect Security</a>
15+
* @author Dave Wichers
1616
* @created 2015
1717
*/
1818

0 commit comments

Comments
 (0)