FileDocCategorySizeDatePackage
TestRecoverWriter.javaAPI DocApache Lucene 2.1.03916Wed Feb 14 10:46:02 GMT 2007org.apache.lucene.gdata.storage.lucenestorage.recover

TestRecoverWriter

public class TestRecoverWriter extends TestCase
Copyright 2004 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Fields Summary
private static final String
ENTRYID
private static final String
TITLE
private static final String
FEEDID
private static final Long
TIMESTAMP
private com.google.gdata.data.DateTime
dateTime
String
compareEntry
String
compareDelete
org.apache.lucene.gdata.storage.lucenestorage.StorageEntryWrapper
wrapper
org.apache.lucene.gdata.storage.lucenestorage.StorageEntryWrapper
deleteWrapper
Constructors Summary
Methods Summary
protected voidsetUp()


         
        ServerBaseEntry entry = new ServerBaseEntry(new Entry());
        entry.setId(ENTRYID);
        
        entry.setUpdated(new DateTime(TIMESTAMP,0));
        entry.setTitle(new PlainTextConstruct(TITLE));
        ProvidedService config = new ProvidedServiceStub();
        entry.setFeedId(FEEDID);
        entry.setServiceConfig(config);
        this.wrapper = new StorageEntryWrapper(entry,StorageOperation.INSERT);
        this.deleteWrapper = new StorageEntryWrapper(entry,StorageOperation.DELETE);
        
        
    
protected voidtearDown()

        super.tearDown();
        
    
public voidtestWriteDelete()

        RecoverWriter wr = new RecoverWriter();
        StringWriter writer = new StringWriter();
        wr.writeEntry(this.deleteWrapper,writer);
        System.out.println(writer.toString());
        assertEquals(compareDelete,writer.toString());
        writer.close();
    
public voidtestWriteEntry()

        RecoverWriter wr = new RecoverWriter();
        StringWriter writer = new StringWriter();
        wr.writeEntry(this.wrapper,writer);
        assertEquals(compareEntry,writer.toString());
        writer.close();