FileDocCategorySizeDatePackage
TestGDataEntityBuilder.javaAPI DocApache Lucene 2.2.03867Sat Jun 16 22:20:52 BST 2007org.apache.lucene.gdata.server.registry

TestGDataEntityBuilder

public class TestGDataEntityBuilder extends TestCase
author
Simon Willnauer

Fields Summary
private static String
fileDir
private static File
incomingFeed
private static File
incomingEntry
private static String
feedTitleFromXML
private static String
entrySummaryFromXML
private static GDataServerRegistry
reg
private Reader
reader
private static String
feedID
private ProvidedServiceConfig
config
private static Class
feedType
private static Class
entryType
Constructors Summary
Methods Summary
protected voidsetUp()

see
junit.framework.TestCase#setUp()

     
     
              
     
          
        this.config = new ProvidedServiceConfig(); 
        
        this.config.setFeedType(feedType); 
        this.config.setEntryType(entryType);
        this.config.setExtensionProfile(new ExtensionProfile()); 
        reg.registerService(this.config); 
    
protected voidtearDown()

see
junit.framework.TestCase#tearDown()

 
        reg.flushRegistry(); 
        this.reader = null; 
    
public voidtestBuildEntryStringReader()
Test method for 'org.apache.lucene.gdata.data.GDataEntityBuilder.buildEntry(String, Reader)'

 
        this.reader = new FileReader(incomingEntry); 
        BaseEntry entry = GDataEntityBuilder.buildEntry(this.reader,this.config); 
        assertNotNull(entry); 
        assertEquals("entry summary",entry.getSummary().getPlainText(),entrySummaryFromXML); 
        
        

         
    
public voidtestBuildFeedStringReader()
Test method for 'org.apache.lucene.gdata.data.GDataEntityBuilder.buildFeed(String, Reader)'

 
        this.reader = new FileReader(incomingFeed); 
        BaseFeed feed = GDataEntityBuilder.buildFeed(this.reader,this.config); 
        assertNotNull(feed); 
        assertEquals("feed title",feed.getTitle().getPlainText(), feedTitleFromXML);