Solo.java revision 8729:0242fce0f717
1198090Srdivacky/*
2198090Srdivacky * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
3198090Srdivacky * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4198090Srdivacky *
5198090Srdivacky * This code is free software; you can redistribute it and/or modify it
6198090Srdivacky * under the terms of the GNU General Public License version 2 only, as
7198090Srdivacky * published by the Free Software Foundation.
8198090Srdivacky *
9198090Srdivacky * This code is distributed in the hope that it will be useful, but WITHOUT
10198090Srdivacky * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11198090Srdivacky * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12198090Srdivacky * version 2 for more details (a copy is included in the LICENSE file that
13198090Srdivacky * accompanied this code).
14198090Srdivacky *
15198090Srdivacky * You should have received a copy of the GNU General Public License version
16198090Srdivacky * 2 along with this work; if not, write to the Free Software Foundation,
17198090Srdivacky * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18200581Srdivacky *
19198090Srdivacky * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20198090Srdivacky * or visit www.oracle.com if you need additional information or have any
21198090Srdivacky * questions.
22198090Srdivacky */
23198090Srdivacky
24198090Srdivacky/* @test
25198090Srdivacky   @summary Test SoftChannel solo method */
26198090Srdivacky
27198090Srdivackyimport javax.sound.midi.*;
28198090Srdivackyimport javax.sound.sampled.*;
29198090Srdivacky
30198090Srdivackyimport com.sun.media.sound.*;
31198090Srdivacky
32198090Srdivackypublic class Solo {
33198090Srdivacky
34243830Sdim    private static void assertEquals(Object a, Object b) throws Exception
35198090Srdivacky    {
36198090Srdivacky        if(!a.equals(b))
37198090Srdivacky            throw new RuntimeException("assertEquals fails!");
38198090Srdivacky    }
39243830Sdim
40198090Srdivacky    private static void assertTrue(boolean value) throws Exception
41198090Srdivacky    {
42198090Srdivacky        if(!value)
43198090Srdivacky            throw new RuntimeException("assertTrue fails!");
44198090Srdivacky    }
45198090Srdivacky
46198090Srdivacky    public static void main(String[] args) throws Exception {
47198090Srdivacky        SoftTestUtils soft = new SoftTestUtils();
48198090Srdivacky        MidiChannel channel = soft.synth.getChannels()[0];
49198090Srdivacky
50198090Srdivacky        channel.setSolo(true);
51198090Srdivacky        assertEquals(channel.getSolo(), true);
52198090Srdivacky        channel.setSolo(false);
53198090Srdivacky        assertEquals(channel.getSolo(), false);
54226633Sdim
55198090Srdivacky        soft.close();
56198090Srdivacky    }
57198090Srdivacky}
58198090Srdivacky