View Javadoc

1   /*
2    * JCaptcha, the open source java framework for captcha definition and integration
3    * Copyright (c)  2007 jcaptcha.net. All Rights Reserved.
4    * See the LICENSE.txt file distributed with this package.
5    */
6   
7   /*
8    * jcaptcha, the open source java framework for captcha definition and integration
9    * copyright (c)  2007 jcaptcha.net. All Rights Reserved.
10   * See the LICENSE.txt file distributed with this package.
11   */
12  
13  /*
14   * jcaptcha, the open source java framework for captcha definition and integration
15   * copyright (c)  2007 jcaptcha.net. All Rights Reserved.
16   * See the LICENSE.txt file distributed with this package.
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  }