FileDocCategorySizeDatePackage
TestIDGenerator.javaAPI DocApache Lucene 2.1.01852Wed Feb 14 10:46:02 GMT 2007org.apache.lucene.gdata.storage

TestIDGenerator

public class TestIDGenerator extends TestCase
author
Simon Willnauer

Fields Summary
private org.apache.lucene.gdata.storage.IDGenerator
idgen
private int
initialCap
Constructors Summary
Methods Summary
protected voidsetUp()

 
 
     
          
        this.idgen = new IDGenerator(this.initialCap); 
         
         
    
protected voidtearDown()

        
        this.idgen.stopIDGenerator();
       
    
public voidtestGetUID()
Test method for 'org.apache.lucene.gdata.storage.IDGenerator.getUID()'

throws
InterruptedException

 
         
        List<String> idlist = new ArrayList<String>(); 
        //TODO think about a better way to test this 
        for (int i = 0; i < 1000; i++) { 
            String id = this.idgen.getUID(); 
            assertNotNull(id); 
            assertFalse(idlist.contains(id)); 
            idlist.add(id); 
             
                         
             
        }