Menu

OpendesktopMimeDetectorTest fails in Linux

Help
2010-01-05
2013-04-11
  • Stian Soiland-Reyes

    Hi!

    I've found that the test case *eu.medsea.mimeutil.detector.OpendesktopMimeDetectorTest* might fail on Linux because it picks up additional mime types from the operating systems mime.cache file.

    I've patched our branch of mime-utils - see  for a version that instead of *assertEquals(mimeTypes.toString(), "text/plain")*  uses *assertContains(mimeTypes, "text/plain")* - where:

    public static void assertContains(Object expected, `Collection collection) {
    assertTrue("Did not contain " + expected + ", but: " + collection,
    collection.contains(expected));
    }

    Note that this file is per mime-utils 2.1.2 as we've not yet merged in the changes from 2.1.3, I can see from the source of 2.1.3 that your current code also tests a few additional mime types like *text/x-readme*.

    I also had to change *testGetDescription()* to not test the version number as I got back 1.2 instead of 1.1 on Ubuntu 9.10 x64.

    Anyway, thanks for a great project.  is a proud user of mime-utils.

      : http://code.google.com/p/taverna/source/browse/taverna/utils/eu.medsea.mimeutil.mime-util/trunk/src/test/java/eu/medsea/mimeutil/detector/OpendesktopMimeDetectorTest.java
      : http://www.taverna.org.uk/

     
  • Steven McArdle

    Steven McArdle - 2010-01-06

    Thanks very much for the comments. I will take a look at these issues and possibly change the test cases and or code for the future version 3.0 in accordance with your findings.

    If it's OK with you, we would also like to put a link to your project from the mime-util site.

    Regards

    Steven McArdle

     
  • Stian Soiland-Reyes

    Feel free to link! :)

     

Log in to post a comment.