1 /*
2 * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 import javax.sound.sampled.AudioFormat;
25 import javax.sound.sampled.AudioSystem;
26 import javax.sound.sampled.DataLine;
27 import javax.sound.sampled.LineUnavailableException;
28 import javax.sound.sampled.SourceDataLine;
29 import javax.sound.sampled.TargetDataLine;
30
31 /*
32 * @test
33 * @bug 6372428
34 * @summary playback and capture doesn't interrupt after terminating thread that
35 * calls start()
36 * @run main bug6372428
37 * @key headful
38 */
39 public class bug6372428 {
40 public bug6372428() {
41 }
42
43 public static void main(final String[] args) {
44 bug6372428 pThis = new bug6372428();
45 boolean failed1 = false;
46 boolean failed2 = false;
47 log("");
48 log("****************************************************************");
49 log("*** Playback Test");
50 log("****************************************************************");
51 log("");
52 try {
53 pThis.testPlayback();
54 } catch (IllegalArgumentException | LineUnavailableException e) {
55 System.out.println("Playback test is not applicable. Skipped");
56 } catch (Exception ex) {
57 ex.printStackTrace();
|
1 /*
2 * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 import javax.sound.sampled.AudioFormat;
25 import javax.sound.sampled.AudioSystem;
26 import javax.sound.sampled.DataLine;
27 import javax.sound.sampled.LineUnavailableException;
28 import javax.sound.sampled.SourceDataLine;
29 import javax.sound.sampled.TargetDataLine;
30
31 /*
32 * @test
33 * @bug 6372428
34 * @summary playback and capture doesn't interrupt after terminating thread that
35 * calls start()
36 * @run main bug6372428
37 */
38 public class bug6372428 {
39 public bug6372428() {
40 }
41
42 public static void main(final String[] args) {
43 bug6372428 pThis = new bug6372428();
44 boolean failed1 = false;
45 boolean failed2 = false;
46 log("");
47 log("****************************************************************");
48 log("*** Playback Test");
49 log("****************************************************************");
50 log("");
51 try {
52 pThis.testPlayback();
53 } catch (IllegalArgumentException | LineUnavailableException e) {
54 System.out.println("Playback test is not applicable. Skipped");
55 } catch (Exception ex) {
56 ex.printStackTrace();
|