private Path createGoodRecordDefinition() throws IOException { return createRecord( "test", new TemplateFieldConfiguration("field", "Paragraph:nth-of-type(2)")); }
private Path createBadRecordDefinition() throws IOException { return createRecord("test", new TemplateFieldConfiguration("field", "Table")); }
private Path createGoodRecordDefinitionWithRegex() throws IOException { TemplateFieldConfiguration fieldDefinitionConfiguration = new TemplateFieldConfiguration("field", "Paragraph:nth-of-type(2)"); fieldDefinitionConfiguration.setRegex("(?<=brown )(.*)(?= jumped)"); return createRecord("test", fieldDefinitionConfiguration); }
private Path createGoodRecordDefinitionWithRegexRequiredAndMissing() throws IOException { TemplateFieldConfiguration fieldDefinitionConfiguration = new TemplateFieldConfiguration("field", "Paragraph:nth-of-type(3)"); fieldDefinitionConfiguration.setRegex("(?<=white )(.*)(?= jumped)"); fieldDefinitionConfiguration.setRequired(true); return createRecord("test", fieldDefinitionConfiguration); }
private Path createGoodRecordDefinitionWithRegexRequired() throws IOException { TemplateFieldConfiguration fieldDefinitionConfiguration = new TemplateFieldConfiguration("field", "Paragraph:nth-of-type(3)"); fieldDefinitionConfiguration.setRegex("(?<=brown )(.*)(?= jumped)"); fieldDefinitionConfiguration.setRequired(true); return createRecord("test", fieldDefinitionConfiguration); }
private Path createGoodRecordDefinitionWithRegexDefaultNotNeeded() throws IOException { TemplateFieldConfiguration fieldDefinitionConfiguration = new TemplateFieldConfiguration("field", "Paragraph:nth-of-type(4)"); fieldDefinitionConfiguration.setRegex("(?<=ant )(.*)(?= over)"); fieldDefinitionConfiguration.setDefaultValue("crawled"); return createRecord("test", fieldDefinitionConfiguration); }
private Path createGoodRecordDefinitionWithRegexDefaultNeeded() throws IOException { TemplateFieldConfiguration fieldDefinitionConfiguration = new TemplateFieldConfiguration("field", "Paragraph:nth-of-type(4)"); fieldDefinitionConfiguration.setRegex("(?<=white )(.*)(?= jumped)"); fieldDefinitionConfiguration.setDefaultValue("horse"); return createRecord("test", fieldDefinitionConfiguration); }