1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package com.octo.captcha.component.sound.wordtosound;
20
21 import com.octo.captcha.component.sound.soundconfigurator.FreeTTSSoundConfigurator;
22 import junit.framework.TestCase;
23
24 /***
25 * <p/>
26 * Description: </p>
27 *
28 * @author Benoit Doumas
29 * @version 1.0
30 */
31 public class SpellingFreeTTSWordToSoundTest extends TestCase {
32
33 private FreeTTSWordToSound cleanFreeTTSwordToSound;
34
35 private String voiceName = "kevin16";
36
37 private String voicePackage = "com.sun.speech.freetts.en.us.cmu_time_awb.AlanVoiceDirectory,com.sun.speech.freetts.en.us.cmu_us_kal.KevinVoiceDirectory";
38
39 /***
40 * Constructor for SimpleWordToImageTest.
41 */
42 public SpellingFreeTTSWordToSoundTest(String name) {
43 super(name);
44 }
45
46 public void setUp() {
47 this.cleanFreeTTSwordToSound = new FreeTTSWordToSound(new FreeTTSSoundConfigurator(voiceName, voicePackage, 1.0f, 100, 100), 3, 6);
48
49 }
50
51 public void testConfiguration() {
52 this.cleanFreeTTSwordToSound.getSound("test");
53 }
54
55
56 public void testGetMaxAcceptedWordLength() {
57 assertEquals(this.cleanFreeTTSwordToSound.getMaxAcceptedWordLength(), 6);
58 }
59
60 public void testGetMinAcceptedWordLength() {
61 assertEquals(this.cleanFreeTTSwordToSound.getMinAcceptedWordLength(), 3);
62 }
63 }