NewModelSourceModelIdentifier.java revision 8729:0242fce0f717
154359Sroberto/*
254359Sroberto * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
354359Sroberto * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
454359Sroberto *
554359Sroberto * This code is free software; you can redistribute it and/or modify it
654359Sroberto * under the terms of the GNU General Public License version 2 only, as
7290000Sglebius * published by the Free Software Foundation.
8290000Sglebius *
954359Sroberto * This code is distributed in the hope that it will be useful, but WITHOUT
1054359Sroberto * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1154359Sroberto * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1254359Sroberto * version 2 for more details (a copy is included in the LICENSE file that
1354359Sroberto * accompanied this code).
1454359Sroberto *
1554359Sroberto * You should have received a copy of the GNU General Public License version
1654359Sroberto * 2 along with this work; if not, write to the Free Software Foundation,
1754359Sroberto * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1854359Sroberto *
19290000Sglebius * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2082498Sroberto * or visit www.oracle.com if you need additional information or have any
2182498Sroberto * questions.
2254359Sroberto */
2354359Sroberto
2454359Sroberto/* @test
2554359Sroberto   @summary Test ModelSource(ModelIdentifier) constructor */
2654359Sroberto
2754359Srobertoimport java.io.File;
2854359Srobertoimport java.io.FileOutputStream;
2954359Srobertoimport java.io.IOException;
3054359Sroberto
3154359Srobertoimport javax.sound.sampled.*;
3254359Sroberto
3354359Srobertoimport com.sun.media.sound.*;
3454359Sroberto
3554359Srobertopublic class NewModelSourceModelIdentifier {
3654359Sroberto
3754359Sroberto    public static void main(String[] args) throws Exception {
3854359Sroberto        ModelSource src = new ModelSource(ModelSource.SOURCE_NOTEON_KEYNUMBER);
3954359Sroberto        if(src.getIdentifier() != ModelSource.SOURCE_NOTEON_KEYNUMBER)
4054359Sroberto            throw new RuntimeException("src.getIdentifier() doesn't return ModelSource.SOURCE_NOTEON_KEYNUMBER!");
4154359Sroberto        if(!(src.getTransform() instanceof ModelStandardTransform))
4254359Sroberto            throw new RuntimeException("src.getTransform() doesn't return object which is instance of ModelStandardTransform!");
4354359Sroberto    }
44182007Sroberto}
4554359Sroberto