diff --git a/Java/fakeit/src/test/java/kata/fakeit/TestCounter.java b/Java/fakeit/src/test/java/kata/fakeit/TestCounter.java index c10cffc..898ced6 100644 --- a/Java/fakeit/src/test/java/kata/fakeit/TestCounter.java +++ b/Java/fakeit/src/test/java/kata/fakeit/TestCounter.java @@ -1,10 +1,14 @@ package kata.fakeit; import com.spun.util.LambdaThreadLauncher; +import com.spun.util.ThreadUtils; import com.spun.util.io.FileUtils; +import com.spun.util.tests.TestUtils; import org.lambda.actions.Action0; +import javax.sound.sampled.*; import java.io.File; +import java.io.IOException; public class TestCounter { @@ -13,10 +17,25 @@ public class TestCounter { public static final File failFile = new File("fakeit.counter.fail.txt"); public static void IncrementSuccess() { + playSound("..\\..\\sounds\\SwordIn-001.wav"); Increment(passFile); } + private static void playSound(String wavFile) { + try { + File file = new File(wavFile).getCanonicalFile(); + AudioInputStream input = AudioSystem.getAudioInputStream(file); + Clip clip = AudioSystem.getClip(); + clip.open(input); + clip.start(); + ThreadUtils.sleep(600); + } catch (Exception e) { + e.printStackTrace(); + } + } + public static void IncrementFailure() { + playSound("..\\..\\sounds\\Crickets-000.wav"); Increment(failFile); } diff --git a/sounds/Crickets-000.wav b/sounds/Crickets-000.wav new file mode 100644 index 0000000..be9c61c Binary files /dev/null and b/sounds/Crickets-000.wav differ diff --git a/sounds/SwordIn-001.wav b/sounds/SwordIn-001.wav new file mode 100644 index 0000000..03f8281 Binary files /dev/null and b/sounds/SwordIn-001.wav differ