changeset 170:a3a8e9e19967

2008-10-08 Omair Majid <omajid@redhat.com> * unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java (testSynchronizationNotSupported): Checks that synchronization isnt allowed by the mixer.
author Omair Majid <omajid@redhat.com>
date Wed, 08 Oct 2008 10:38:29 -0400
parents 96e885ef985c
children 4260a476a101 0a46fbaa018e
files unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java
diffstat 1 files changed, 37 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java	Wed Oct 08 10:19:48 2008 -0400
+++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java	Wed Oct 08 10:38:29 2008 -0400
@@ -45,6 +45,7 @@
 import javax.sound.sampled.LineUnavailableException;
 import javax.sound.sampled.Mixer;
 import javax.sound.sampled.Port;
+import javax.sound.sampled.SourceDataLine;
 import javax.sound.sampled.TargetDataLine;
 
 import org.junit.After;
@@ -366,6 +367,42 @@
 	}
 
 	@Test
+	public void testSynchronizationNotSupported()
+			throws LineUnavailableException {
+		selectedMixer.open();
+
+		SourceDataLine line1 = (SourceDataLine) selectedMixer
+				.getLine(new Line.Info(SourceDataLine.class));
+		SourceDataLine line2 = (SourceDataLine) selectedMixer
+				.getLine(new Line.Info(SourceDataLine.class));
+		Line[] lines = { line1, line2 };
+
+		Assert.assertFalse(selectedMixer
+				.isSynchronizationSupported(lines, true));
+
+		Assert.assertFalse(selectedMixer.isSynchronizationSupported(lines,
+				false));
+
+		try {
+			selectedMixer.synchronize(lines, true);
+			Assert.fail("mixer shouldnt be able to synchronize lines");
+		} catch (IllegalArgumentException e) {
+
+		}
+
+		try {
+			selectedMixer.synchronize(lines, false);
+			Assert.fail("mixer shouldnt be able to synchronize lines");
+		} catch (IllegalArgumentException e) {
+
+		}
+
+		selectedMixer.close();
+
+	}
+
+	@Ignore
+	@Test
 	public void testLongWait() throws LineUnavailableException {
 		selectedMixer.open();
 		try {