public void testBackwardsCompatibility() {
// This test is only useful if the MediaInfo library is available
assumeTrue(mediaInfoParserIsValid);
// Testing ps3compatible(), so use renderer Playstation 3
RendererConfiguration conf = RendererConfiguration.getRendererConfigurationByName("Playstation 3");
assertNotNull("Renderer named \"Playstation 3\" found.", conf);
// DVRMS: false
DLNAMediaInfo info = new DLNAMediaInfo();
info.setContainer("dvr");
Format format = new DVRMS();
format.match("test.dvr");
assertEquals("isCompatible() gives same outcome as ps3compatible() for DVRMS",
format.ps3compatible(), conf.isCompatible(info, format));
// ISO: false
info = new DLNAMediaInfo();
info.setContainer("iso");
format = new ISO();
format.match("test.iso");
assertEquals("isCompatible() gives same outcome as ps3compatible() for ISO",
format.ps3compatible(), conf.isCompatible(info, format));
// JPG: true
info = new DLNAMediaInfo();
info.setContainer("jpg");
format = new JPG();
format.match("test.jpeg");
assertEquals("isCompatible() gives same outcome as ps3compatible() for JPG",
format.ps3compatible(), conf.isCompatible(info, format));
// M4A: false
info = new DLNAMediaInfo();
info.setContainer("m4a");
format = new M4A();
format.match("test.m4a");
assertEquals("isCompatible() gives same outcome as ps3compatible() for M4A",
format.ps3compatible(), conf.isCompatible(info, format));
// MKV: false
info = new DLNAMediaInfo();
info.setContainer("mkv");
format = new MKV();
format.match("test.mkv");
assertEquals("isCompatible() gives same outcome as ps3compatible() for MKV",
format.ps3compatible(), conf.isCompatible(info, format));
// MP3: true
info = new DLNAMediaInfo();
info.setContainer("mp3");
format = new MP3();
format.match("test.mp3");
assertEquals("isCompatible() gives same outcome as ps3compatible() for MP3",
format.ps3compatible(), conf.isCompatible(info, format));
// MPG: true
info = new DLNAMediaInfo();
info.setContainer("avi");
format = new MPG();
format.match("test.mpg");
assertEquals("isCompatible() gives same outcome as ps3compatible() for MPG",
format.ps3compatible(), conf.isCompatible(info, format));
// OGG: false
info = new DLNAMediaInfo();
info.setContainer("ogg");
format = new OGG();
format.match("test.ogg");
assertEquals("isCompatible() gives same outcome as ps3compatible() for OGG",
format.ps3compatible(), conf.isCompatible(info, format));
// RAW: false
info = new DLNAMediaInfo();
info.setContainer("raw");
format = new RAW();
format.match("test.arw");
assertEquals("isCompatible() gives same outcome as ps3compatible() for RAW",
format.ps3compatible(), conf.isCompatible(info, format));
// WAV: true
info = new DLNAMediaInfo();
info.setContainer("wav");
format = new WAV();
format.match("test.wav");
assertEquals("isCompatible() gives same outcome as ps3compatible() for WAV",
format.ps3compatible(), conf.isCompatible(info, format));
// WEB: type=IMAGE
info = new DLNAMediaInfo();
info.setContainer("jpg");
format = new WEB();
format.match("http://test.org/");
format.setType(Format.IMAGE);
assertEquals("isCompatible() give same outcome as ps3compatible() for WEB image",
format.ps3compatible(), conf.isCompatible(info, format));
// WEB: type=VIDEO
info = new DLNAMediaInfo();
info.setContainer("avi");
format.setType(Format.VIDEO);
assertEquals("isCompatible() gives same outcome as ps3compatible() for WEB video",
format.ps3compatible(), conf.isCompatible(info, format));
}