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  package com.octo.captcha.engine.bufferedengine.buffer;
13  
14  import java.util.NoSuchElementException;
15  
16  import org.apache.commons.collections.buffer.UnboundedFifoBuffer;
17  
18  
19  public class MemoryCaptchaBufferTest extends CaptchaBufferTestAbstract {
20  
21      /***
22       * @see com.octo.captcha.engine.bufferedengine.buffer.CaptchaBufferTestAbstract#getBuffer()
23       */
24      public CaptchaBuffer getBuffer() {
25          return new MemoryCaptchaBuffer();
26      }
27  
28      public void testRemoveEmptyBuffer() {
29      	UnboundedFifoBuffer fifoBuffer = new UnboundedFifoBuffer();
30      	try {
31  			fifoBuffer.remove();
32  			fail("should throw an Exception");
33  		} catch (NoSuchElementException e) {
34  		}
35      }
36  }