[ 
https://issues.apache.org/jira/browse/TIKA-309?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12782663#action_12782663
 ] 

Chris A. Mattmann commented on TIKA-309:
----------------------------------------

Yuang-Fang:

I've confirmed what you mentioned. When the XML header first-line is taken out 
of the test-difficult-rdf2.xml (as the remote URL exists), I get this:

[chipotle:~/src/tika/trunk] mattmann% mvn -Dtest=MimeDetectionTest clean test
[INFO] Scanning for projects...
[INFO] Reactor build order: 
[INFO]   Apache Tika parent
[INFO]   Apache Tika core
[INFO]   Apache Tika parsers
[INFO]   Apache Tika application
[INFO]   Apache Tika
[INFO] ------------------------------------------------------------------------
[INFO] Building Apache Tika parent
[INFO]    task-segment: [clean, test]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Setting property: classpath.resource.loader.class => 
'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO] [remote-resources:process {execution: default}]
[INFO] ------------------------------------------------------------------------
[INFO] Building Apache Tika core
[INFO]    task-segment: [clean, test]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] [remote-resources:process {execution: default}]
[INFO] [resources:resources]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 20 resources
[INFO] Copying 3 resources
[INFO] [compiler:compile]
[INFO] Compiling 86 source files to 
/Users/mattmann/src/tika/trunk/tika-core/target/classes
[INFO] [resources:testResources]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 24 resources
[INFO] Copying 3 resources
[INFO] [compiler:testCompile]
[INFO] Compiling 19 source files to 
/Users/mattmann/src/tika/trunk/tika-core/target/test-classes
[INFO] [surefire:test]
[INFO] Surefire report directory: 
/Users/mattmann/src/tika/trunk/tika-core/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.apache.tika.mime.MimeDetectionTest
Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.568 sec <<< 
FAILURE!

Results :

Failed tests: 
  testDetection(org.apache.tika.mime.MimeDetectionTest)

Tests run: 2, Failures: 1, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] There are test failures.

Please refer to 
/Users/mattmann/src/tika/trunk/tika-core/target/surefire-reports for the 
individual test results.
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8 seconds
[INFO] Finished at: Wed Nov 25 14:45:52 PST 2009
[INFO] Final Memory: 15M/31M
[INFO] ------------------------------------------------------------------------
[chipotle:~/src/tika/trunk] mattmann% 

[chipotle:~/src/tika/trunk] mattmann% more 
tika-core/target/surefire-reports/org.apache.tika.mime.MimeDetectionTest.txt 
-------------------------------------------------------------------------------
Test set: org.apache.tika.mime.MimeDetectionTest
-------------------------------------------------------------------------------
Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.573 sec <<< 
FAILURE!
testDetection(org.apache.tika.mime.MimeDetectionTest)  Time elapsed: 0.44 sec  
<<< FAILURE!
junit.framework.ComparisonFailure: http://www.w3.org/2002/07/owl# is not 
properly detected. expected:<application/rdf+xml> but w
as:<text/plain>
        at junit.framework.Assert.assertEquals(Assert.java:81)
        at 
org.apache.tika.mime.MimeDetectionTest.testStream(MimeDetectionTest.java:87)
        at 
org.apache.tika.mime.MimeDetectionTest.testUrl(MimeDetectionTest.java:71)
        at 
org.apache.tika.mime.MimeDetectionTest.testDetection(MimeDetectionTest.java:54)

I'm looking into this right now...I'll file another issue for this..
I'm looking into this now:

> Mime type application/rdf+xml not correctly detected
> ----------------------------------------------------
>
>                 Key: TIKA-309
>                 URL: https://issues.apache.org/jira/browse/TIKA-309
>             Project: Tika
>          Issue Type: Bug
>          Components: mime
>    Affects Versions: 0.5
>            Reporter: Yuan-Fang Li
>            Assignee: Chris A. Mattmann
>            Priority: Minor
>             Fix For: 0.5
>
>
> Mime type detector using AutoDetectParser and Metadata returns 
> "application/xml" for the URL http://www.w3.org/2002/07/owl#, where it should 
> be "application/rdf+xml". The correct mime type is also suggested here: 
> http://www.w3.org/TR/owl-ref/#MIMEType.
> P.S., Tika was downloaded from svn and built with Maven last week.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to