Package net.sf.fmj.media.protocol.javasound

Source Code of net.sf.fmj.media.protocol.javasound.JavaSoundUrlParserTest

package net.sf.fmj.media.protocol.javasound;

import javax.media.format.AudioFormat;

import junit.framework.TestCase;

/**
*
* @author Ken Larson
*
*/
public class JavaSoundUrlParserTest extends TestCase
{

  public void test1() throws JavaSoundUrlParserException
  {
   
    test("javasound://", new AudioFormat(AudioFormat.LINEAR));
   
    test("javasound://44100", new AudioFormat(AudioFormat.LINEAR, 44100.0, AudioFormat.NOT_SPECIFIED, AudioFormat.NOT_SPECIFIED));
    test("javasound://44100/16", new AudioFormat(AudioFormat.LINEAR, 44100.0, 16, AudioFormat.NOT_SPECIFIED));
    test("javasound://44100/16/2", new AudioFormat(AudioFormat.LINEAR, 44100.0, 16, 2));
    test("javasound://44100/16/2/big", new AudioFormat(AudioFormat.LINEAR, 44100.0, 16, 2, AudioFormat.BIG_ENDIAN, AudioFormat.NOT_SPECIFIED));
    test("javasound://44100/16/2/big/signed", new AudioFormat(AudioFormat.LINEAR, 44100.0, 16, 2, AudioFormat.BIG_ENDIAN, AudioFormat.SIGNED));
  }
 
  public void test(String str, AudioFormat format) throws JavaSoundUrlParserException
  {
    AudioFormat f = JavaSoundUrlParser.parse(str);
    assertEquals(f, format);
  }
}
TOP

Related Classes of net.sf.fmj.media.protocol.javasound.JavaSoundUrlParserTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.