Skip to content

Commit e9718f9

Browse files
committed
TIKA-1817 Test DXF ASCII file, and detection unit test
git-svn-id: https://svn.apache.org/repos/asf/tika/trunk@1721576 13f79535-47bb-0310-9956-ffa450edef68
1 parent efaf482 commit e9718f9

File tree

3 files changed

+37369
-1
lines changed

3 files changed

+37369
-1
lines changed

LICENSE.txt

+8
Original file line numberDiff line numberDiff line change
@@ -370,3 +370,11 @@ JUnRAR (https://github.com/edmund-wagner/junrar/)
370370
Sqlite (bundled in org.xerial's sqlite-jdbc)
371371
This product bundles Sqlite, which is in the Public Domain. For details
372372
see: https://www.sqlite.org/copyright.html
373+
374+
Sample DXF file testDXF.dxf (in tika-parsers/src/test/resources/test-documents)
375+
Copyright 2012 Ho Thanh Tam, www.cadkit.net
376+
377+
Permission to use, copy, modify, and distribute this software and its
378+
documentation for any purpose is hereby granted without fee, provided
379+
that the above copyright notice, author statement appear in all copies
380+
of this software and related documentation.

tika-parsers/src/test/java/org/apache/tika/mime/TestMimeTypes.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -531,11 +531,17 @@ public void testSwfDetection() throws Exception {
531531
}
532532

533533
@Test
534-
public void testDwgDetection() throws Exception {
534+
public void testAutoCADDetection() throws Exception {
535535
assertTypeByName("image/vnd.dwg", "x.dwg");
536536
assertTypeByData("image/vnd.dwg", "testDWG2004.dwg");
537537
assertTypeByData("image/vnd.dwg", "testDWG2007.dwg");
538538
assertTypeByData("image/vnd.dwg", "testDWG2010.dwg");
539+
540+
// From name, gets the common parent type
541+
assertTypeByName("image/vnd.dxf", "x.dxf");
542+
// With the data, can work out it's the ASCII flavour
543+
assertTypeByData("image/vnd.dxf; format=ascii", "testDXF_ascii.dxf");
544+
// TODO Get a sample Binary DXF file and test
539545
}
540546

541547
@Test

0 commit comments

Comments
 (0)