You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tika.apache.org by ta...@apache.org on 2018/07/13 21:00:42 UTC
[tika] branch master updated: TIKA-2687 -- remove code used to
generate test files
This is an automated email from the ASF dual-hosted git repository.
tallison pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tika.git
The following commit(s) were added to refs/heads/master by this push:
new 9b86c85 TIKA-2687 -- remove code used to generate test files
9b86c85 is described below
commit 9b86c8578c9ab17e94ee080f498a86feaadfe6f1
Author: TALLISON <ta...@apache.org>
AuthorDate: Fri Jul 13 17:00:32 2018 -0400
TIKA-2687 -- remove code used to generate test files
---
.../test/java/org/apache/tika/cli/TikaCLITest.java | 60 ----------------------
1 file changed, 60 deletions(-)
diff --git a/tika-app/src/test/java/org/apache/tika/cli/TikaCLITest.java b/tika-app/src/test/java/org/apache/tika/cli/TikaCLITest.java
index b877edf..3c2baed 100644
--- a/tika-app/src/test/java/org/apache/tika/cli/TikaCLITest.java
+++ b/tika-app/src/test/java/org/apache/tika/cli/TikaCLITest.java
@@ -552,64 +552,4 @@ public class TikaCLITest {
String content = outContent.toString(UTF_8.name());
assertFalse(content.contains("org.apache.tika.parser.executable.Executable"));
}
-
- @Test
- public void testFileNameNormalization() throws Exception {
- File z = new File("C:/data/testZip_zeroByte.zip");
- OutputStream os = new FileOutputStream(z);
- ZipOutputStream outputStream = new ZipOutputStream(os);
- ZipEntry zipEntry = new ZipEntry("dang\u0000erous.pl");
- outputStream.putNextEntry(zipEntry);
- byte[] bytes = "hello world1".getBytes(StandardCharsets.UTF_8);
- outputStream.write(bytes, 0,bytes.length);
- outputStream.closeEntry();
- outputStream.flush();
- outputStream.close();
-
- z = new File("C:/data/testZip_absolutePath.zip");
- os = new FileOutputStream(z);
- outputStream = new ZipOutputStream(os);
- zipEntry = new ZipEntry("C:/dangerous/dont/touch.pl");
- outputStream.putNextEntry(zipEntry);
- bytes = "hello world2".getBytes(StandardCharsets.UTF_8);
- outputStream.write(bytes, 0,bytes.length);
- outputStream.closeEntry();
- zipEntry = new ZipEntry("/dangerous/dont/touch.pl");
- outputStream.putNextEntry(zipEntry);
- bytes = "hello world3".getBytes(StandardCharsets.UTF_8);
- outputStream.write(bytes, 0,bytes.length);
- outputStream.closeEntry();
-
- outputStream.flush();
- outputStream.close();
-
- z = new File("C:/data/testZip_relative.zip");
- os = new FileOutputStream(z);
- outputStream = new ZipOutputStream(os);
- zipEntry = new ZipEntry("../../../dangerous/dont/touch.pl");
- outputStream.putNextEntry(zipEntry);
- bytes = "hello world3".getBytes(StandardCharsets.UTF_8);
- outputStream.write(bytes, 0,bytes.length);
- outputStream.closeEntry();
- outputStream.flush();
- outputStream.close();
-
- z = new File("C:/data/testZip_overlappingNames.zip");
- os = new FileOutputStream(z);
- outputStream = new ZipOutputStream(os);
- zipEntry = new ZipEntry("f1.txt");
- outputStream.putNextEntry(zipEntry);
- bytes = "hello world4".getBytes(StandardCharsets.UTF_8);
- outputStream.write(bytes, 0,bytes.length);
- outputStream.closeEntry();
-
- zipEntry = new ZipEntry("../../../f1.txt");
- outputStream.putNextEntry(zipEntry);
- bytes = "hello world5".getBytes(StandardCharsets.UTF_8);
- outputStream.write(bytes, 0,bytes.length);
- outputStream.closeEntry();
-
- outputStream.flush();
- outputStream.close();
- }
}