#260 ProviderInfo fix

This commit is contained in:
Harald Kuhr
2016-06-02 11:24:57 +02:00
parent 8dd84930be
commit e9388e55ec
26 changed files with 652 additions and 10 deletions

View File

@@ -41,9 +41,9 @@ final class ThumbsDBProviderInfo extends ReaderWriterProviderInfo {
protected ThumbsDBProviderInfo() {
super(
ThumbsDBProviderInfo.class,
new String[]{"thumbs", "THUMBS", "Thumbs DB"},
new String[]{"db"},
new String[]{"image/x-thumbs-db", "application/octet-stream"}, // TODO: Check IANA et al...
new String[] {"thumbs", "THUMBS", "Thumbs DB"},
new String[] {"db"},
new String[] {"image/x-thumbs-db", "application/octet-stream"}, // TODO: Check IANA et al...
"com.twelvemonkeys.imageio.plugins.thumbsdb.ThumbsDBImageReader",
new String[] {"com.twelvemonkeys.imageio.plugins.thumbsdb.ThumbsDBImageReaderSpi"},
null,

View File

@@ -0,0 +1,43 @@
package com.twelvemonkeys.imageio.plugins.thumbsdb;
import com.twelvemonkeys.imageio.spi.ReaderWriterProviderInfo;
import com.twelvemonkeys.imageio.spi.ReaderWriterProviderInfoTest;
import java.util.ArrayList;
import java.util.List;
import static java.util.Arrays.asList;
import static org.junit.Assert.*;
/**
* ThumbsDBProviderInfoTest.
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @author last modified by $Author: harald.kuhr$
* @version $Id: ThumbsDBProviderInfoTest.java,v 1.0 02/06/16 harald.kuhr Exp$
*/
public class ThumbsDBProviderInfoTest extends ReaderWriterProviderInfoTest {
@Override
protected ReaderWriterProviderInfo createProviderInfo() {
return new ThumbsDBProviderInfo();
}
@Override
public void formatNames() {
String[] names = getProviderInfo().formatNames();
assertNotNull(names);
assertFalse(names.length == 0);
List<String> list = new ArrayList<>(asList(names));
assertTrue(list.remove("Thumbs DB")); // No dupes of this name
for (String name : list) {
assertNotNull(name);
assertFalse(name.isEmpty());
assertTrue(list.contains(name.toLowerCase()));
assertTrue(list.contains(name.toUpperCase()));
}
}
}