changeset 4033:3549cec980ff

7026275: TEST_BUG: test/javax/sound/sampled/Clip/ClipSetPos.java throws uncatched IllegalArgumentException Reviewed-by: dav
author amenkov
date Mon, 04 Apr 2011 13:22:40 +0400
parents 8093f407d57d
children 8e21bec188ae
files test/javax/sound/sampled/Clip/ClipSetPos.java
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/test/javax/sound/sampled/Clip/ClipSetPos.java	Mon Apr 04 15:24:05 2011 +0900
+++ b/test/javax/sound/sampled/Clip/ClipSetPos.java	Mon Apr 04 13:22:40 2011 +0400
@@ -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 @@
         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());