Skip to content

Commit

Permalink
TIKA-1817 Test DXF ASCII file, and detection unit test
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/tika/trunk@1721576 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Gagravarr committed Dec 23, 2015
1 parent efaf482 commit e9718f9
Show file tree
Hide file tree
Showing 3 changed files with 37,369 additions and 1 deletion.
8 changes: 8 additions & 0 deletions LICENSE.txt
Expand Up @@ -370,3 +370,11 @@ JUnRAR (https://github.com/edmund-wagner/junrar/)
Sqlite (bundled in org.xerial's sqlite-jdbc)
This product bundles Sqlite, which is in the Public Domain. For details
see: https://www.sqlite.org/copyright.html

Sample DXF file testDXF.dxf (in tika-parsers/src/test/resources/test-documents)
Copyright 2012 Ho Thanh Tam, www.cadkit.net

Permission to use, copy, modify, and distribute this software and its
documentation for any purpose is hereby granted without fee, provided
that the above copyright notice, author statement appear in all copies
of this software and related documentation.
Expand Up @@ -531,11 +531,17 @@ public void testSwfDetection() throws Exception {
}

@Test
public void testDwgDetection() throws Exception {
public void testAutoCADDetection() throws Exception {
assertTypeByName("image/vnd.dwg", "x.dwg");
assertTypeByData("image/vnd.dwg", "testDWG2004.dwg");
assertTypeByData("image/vnd.dwg", "testDWG2007.dwg");
assertTypeByData("image/vnd.dwg", "testDWG2010.dwg");

// From name, gets the common parent type
assertTypeByName("image/vnd.dxf", "x.dxf");
// With the data, can work out it's the ASCII flavour
assertTypeByData("image/vnd.dxf; format=ascii", "testDXF_ascii.dxf");
// TODO Get a sample Binary DXF file and test
}

@Test
Expand Down

0 comments on commit e9718f9

Please sign in to comment.