From b85845f9dab6f72bfbbd2713cb79118e48d8ebf9 Mon Sep 17 00:00:00 2001 From: Alex Menkov Date: Mon, 4 Apr 2011 13:22:40 +0400 Subject: [PATCH] 7026275: TEST_BUG: test/javax/sound/sampled/Clip/ClipSetPos.java throws uncatched IllegalArgumentException Reviewed-by: dav --- jdk/test/javax/sound/sampled/Clip/ClipSetPos.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/jdk/test/javax/sound/sampled/Clip/ClipSetPos.java b/jdk/test/javax/sound/sampled/Clip/ClipSetPos.java index 2968c9b735f..715274fe65f 100644 --- a/jdk/test/javax/sound/sampled/Clip/ClipSetPos.java +++ b/jdk/test/javax/sound/sampled/Clip/ClipSetPos.java @@ -33,6 +33,7 @@ import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.Clip; +import javax.sound.sampled.DataLine; import javax.sound.sampled.LineUnavailableException; public class ClipSetPos { @@ -48,12 +49,16 @@ public class ClipSetPos { boolean testPassed = true; Clip clip = null; try { - clip = AudioSystem.getClip(); + clip = (Clip)AudioSystem.getLine(new DataLine.Info(Clip.class, audioFormat)); clip.open(audioFormat, dataBuffer, 0, dataBuffer.length); } catch (LineUnavailableException ex) { log(ex); log("Cannot test (this is not failure)"); return; + } catch (IllegalArgumentException ex) { + log(ex); + log("Cannot test (this is not failure)"); + return; } log("clip: " + clip.getClass().getName());