/**
* @tests javax.sound.midi.sampled.AudioFileWriter#isFileTypeSupported(AudioFileFormat.Type,AudioInputStream)
*/
public void testIsFileTypeSupported2() {
AudioFileWriter writer = new AudioFileWriter() {
@Override
public AudioFileFormat.Type[] getAudioFileTypes() {
fail("what are doing here?");
return null;
}
@Override
public AudioFileFormat.Type[] getAudioFileTypes(
AudioInputStream stream) {
return recorded;
}
@Override
public int write(AudioInputStream stream,
AudioFileFormat.Type fileType, File out) {
fail("what are doing here?");
return 0;
}
@Override
public int write(AudioInputStream stream,
AudioFileFormat.Type fileType, OutputStream out) {
fail("what are doing here?");
return 0;
}
};
recorded = new AudioFileFormat.Type[] { new AudioFileFormat.Type("1",
"2") };
assertTrue(writer.isFileTypeSupported(recorded[0], null));
AudioFileFormat.Type similar = new AudioFileFormat.Type("1", "2");
assertTrue(writer.isFileTypeSupported(similar, null));
try {
writer.isFileTypeSupported(null, null);
fail("NPE expected");
} catch (NullPointerException e) {}
recorded = null;
try {
writer.isFileTypeSupported(similar, null);
fail("NPE expected");
} catch (NullPointerException e) {}
}