Lines 381-387
Link Here
|
381 |
FileObject fo = FileUtil.createData(testFolder, "fo1.mime1"); |
381 |
FileObject fo = FileUtil.createData(testFolder, "fo1.mime1"); |
382 |
String[] withinMIMETypes = null; |
382 |
String[] withinMIMETypes = null; |
383 |
try { |
383 |
try { |
384 |
FileUtil.getMIMEType(fo, withinMIMETypes); |
384 |
fo.getMIMEType(withinMIMETypes); |
385 |
fail("FileUtil.getMIMEType(fo, null) should throw IllegalArgumentException."); |
385 |
fail("FileUtil.getMIMEType(fo, null) should throw IllegalArgumentException."); |
386 |
} catch (NullPointerException npe) { |
386 |
} catch (NullPointerException npe) { |
387 |
// exception correctly thrown |
387 |
// exception correctly thrown |
Lines 389-395
Link Here
|
389 |
|
389 |
|
390 |
fo = FileUtil.createData(testFolder, "fo2.mime1"); |
390 |
fo = FileUtil.createData(testFolder, "fo2.mime1"); |
391 |
withinMIMETypes = new String[0]; |
391 |
withinMIMETypes = new String[0]; |
392 |
FileUtil.getMIMEType(fo, withinMIMETypes); |
392 |
fo.getMIMEType(withinMIMETypes); |
393 |
assertTrue("Resolver should be queried if array of desired MIME types is empty.", MyResolver.wasQueried()); |
393 |
assertTrue("Resolver should be queried if array of desired MIME types is empty.", MyResolver.wasQueried()); |
394 |
|
394 |
|
395 |
fo = FileUtil.createData(testFolder, "fo3.mime1"); |
395 |
fo = FileUtil.createData(testFolder, "fo3.mime1"); |
Lines 404-410
Link Here
|
404 |
|
404 |
|
405 |
fo = FileUtil.createData(testFolder, "fo5.mime1"); |
405 |
fo = FileUtil.createData(testFolder, "fo5.mime1"); |
406 |
withinMIMETypes = new String[]{"mime1", "mime2"}; |
406 |
withinMIMETypes = new String[]{"mime1", "mime2"}; |
407 |
FileUtil.getMIMEType(fo, withinMIMETypes); |
407 |
fo.getMIMEType(withinMIMETypes); |
408 |
assertTrue("Resolver should be queried if both items in array of desired MIME types matches MIMEResolver.getMIMETypes.", MyResolver.wasQueried()); |
408 |
assertTrue("Resolver should be queried if both items in array of desired MIME types matches MIMEResolver.getMIMETypes.", MyResolver.wasQueried()); |
409 |
} |
409 |
} |
410 |
|
410 |
|