entry.setVersionId("1");
entry.setFeedId("myFeed");
entry.setId(ID);
entry.setContent(new PlainTextConstruct(CONTENT));
entry.setServiceConfig(new ProvidedServiceStub());
IndexSchema schema = new IndexSchema();
schema.setName("mySchema");
IndexSchemaField field = new IndexSchemaField();
field.setName(CONTENT_FIELD);
field.setPath("/entry/content");
field.setContentType(ContentType.TEXT);
schema.addSchemaField(field);
this.fineBuilder = new IndexDocumentBuilderTask(entry,schema,IndexAction.INSERT,true,true);
/*
* two fields, one will fail due to broken xpath.
* One will remain.
*/
schema = new IndexSchema();
schema.setName("mySchema");
field = new IndexSchemaField();
field.setName("someContent");
//broken xpath
field.setPath("/entry///wrongXPath");
field.setContentType(ContentType.TEXT);
schema.addSchemaField(field);
field = new IndexSchemaField();
field.setName(CONTENT_FIELD);
field.setPath("/entry/content");
field.setContentType(ContentType.TEXT);
schema.addSchemaField(field);
this.failInStrategyBuilder = new IndexDocumentBuilderTask(entry,schema,IndexAction.INSERT,false,false);
//fail with no fields
schema = new IndexSchema();
schema.setName("mySchema");
this.zeroFields = new IndexDocumentBuilderTask(entry,schema,IndexAction.INSERT,false,false);
}