GetMaxReceivers.java revision 829:b06c29386f63
151973Smsmith/*
251973Smsmith * Copyright 2007 Sun Microsystems, Inc.  All Rights Reserved.
351973Smsmith * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
451973Smsmith *
551973Smsmith * This code is free software; you can redistribute it and/or modify it
651973Smsmith * under the terms of the GNU General Public License version 2 only, as
751973Smsmith * published by the Free Software Foundation.  Sun designates this
851973Smsmith * particular file as subject to the "Classpath" exception as provided
951973Smsmith * by Sun in the LICENSE file that accompanied this code.
1051973Smsmith *
1151973Smsmith * This code is distributed in the hope that it will be useful, but WITHOUT
1251973Smsmith * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1351973Smsmith * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1451973Smsmith * version 2 for more details (a copy is included in the LICENSE file that
1551973Smsmith * accompanied this code).
1651973Smsmith *
1751973Smsmith * You should have received a copy of the GNU General Public License version
1851973Smsmith * 2 along with this work; if not, write to the Free Software Foundation,
1951973Smsmith * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2051973Smsmith *
2151973Smsmith * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
2251973Smsmith * CA 95054 USA or visit www.sun.com if you need additional information or
2351973Smsmith * have any questions.
2451973Smsmith */
2551973Smsmith
2651973Smsmith/* @test
2751973Smsmith   @summary Test SoftSynthesizer getMaxReceivers method */
2851973Smsmith
2951973Smsmithimport javax.sound.midi.MidiDevice;
3051973Smsmithimport javax.sound.midi.MidiUnavailableException;
3151973Smsmithimport javax.sound.midi.Patch;
3251973Smsmithimport javax.sound.sampled.*;
3351973Smsmithimport javax.sound.midi.MidiDevice.Info;
3451973Smsmith
35240963Sjhbimport com.sun.media.sound.*;
36240608Sjhb
3751973Smsmithpublic class GetMaxReceivers {
38240608Sjhb
3951973Smsmith    private static void assertEquals(Object a, Object b) throws Exception
40240608Sjhb    {
4151973Smsmith        if(!a.equals(b))
4251973Smsmith            throw new RuntimeException("assertEquals fails!");
4351973Smsmith    }
4458188Smsmith
4551973Smsmith    private static void assertTrue(boolean value) throws Exception
4651973Smsmith    {
4751973Smsmith        if(!value)
4851973Smsmith            throw new RuntimeException("assertTrue fails!");
4951973Smsmith    }
5051973Smsmith
51112946Sphk    public static void main(String[] args) throws Exception {
52112946Sphk        AudioSynthesizer synth = new SoftSynthesizer();
5351973Smsmith        assertTrue(synth.getMaxReceivers() == -1);
5451973Smsmith
5551973Smsmith    }
5651973Smsmith}
5751973Smsmith