TestRecoverWriterpublic 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 |
Methods Summary |
---|
protected void | setUp()
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 void | tearDown()
super.tearDown();
| public void | testWriteDelete()
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 void | testWriteEntry()
RecoverWriter wr = new RecoverWriter();
StringWriter writer = new StringWriter();
wr.writeEntry(this.wrapper,writer);
assertEquals(compareEntry,writer.toString());
writer.close();
|
|