本文整理汇总了Java中dk.statsbiblioteket.medieplatform.autonomous.ResultCollector.toReport方法的典型用法代码示例。如果您正苦于以下问题:Java ResultCollector.toReport方法的具体用法?Java ResultCollector.toReport怎么用?Java ResultCollector.toReport使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dk.statsbiblioteket.medieplatform.autonomous.ResultCollector
的用法示例。
在下文中一共展示了ResultCollector.toReport方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testPageModsBad1Sch
import dk.statsbiblioteket.medieplatform.autonomous.ResultCollector; //导入方法依赖的package包/类
/**
* Test that we test an invalid page mods file.
*/
@Test
public void testPageModsBad1Sch() {
DocumentCache documentCache = new DocumentCache();
ResultCollector resultCollector = new ResultCollector("foo", "bar");
SchematronValidatorEventHandler handler = new SchematronValidatorEventHandler(resultCollector, documentCache,attributeConfigs);
AttributeParsingEvent modsEvent = new AttributeParsingEvent("AdresseContoirsEfterretninger-1795-06-15-01-0010B.mods.xml") {
@Override
public InputStream getData() throws IOException {
return Thread.currentThread().getContextClassLoader().getResourceAsStream("badData/bad1.mods.xml");
}
@Override
public String getChecksum() throws IOException {
return null;
}
};
handler.handleAttribute(modsEvent);
String report = resultCollector.toReport();
assertTrue(report.contains("2C-3:"),report);
assertTrue(report.contains("2C-4:"),report);
assertTrue(report.contains("2C-6:"),report);
assertTrue(report.contains("2C-9:"),report);
assertTrue(report.contains("2C-10:"), report);
}
示例2: testPageModsBad2Sch
import dk.statsbiblioteket.medieplatform.autonomous.ResultCollector; //导入方法依赖的package包/类
/**
* Test that we test an invalid page mods file.
*/
@Test
public void testPageModsBad2Sch() {
DocumentCache documentCache = new DocumentCache();
ResultCollector resultCollector = new ResultCollector("foo", "bar");
SchematronValidatorEventHandler handler = new SchematronValidatorEventHandler(resultCollector, documentCache,attributeConfigs);
AttributeParsingEvent modsEvent = new AttributeParsingEvent("AdresseContoirsEfterretninger-1795-06-15-01-0003B.mods.xml") {
@Override
public InputStream getData() throws IOException {
return Thread.currentThread().getContextClassLoader().getResourceAsStream("badData/bad2.mods.xml");
}
@Override
public String getChecksum() throws IOException {
return null;
}
};
handler.handleAttribute(modsEvent);
String report = resultCollector.toReport();
assertTrue(report.contains("2C-4:"), report);
assertTrue(report.contains("2C-6:"), report);
assertTrue(report.contains("2C-9:"), report);
assertTrue(report.contains("2C-10:"), report);
}
示例3: badTest
import dk.statsbiblioteket.medieplatform.autonomous.ResultCollector; //导入方法依赖的package包/类
@Test
public void badTest() {
ResultCollector resultCollector = new ResultCollector("imp", "bat");
// Make event with bad checksum
AttributeParsingEvent attributeEvent = new AttributeParsingEventMocker("8a6503");
ChecksumCheckEventHandler handler = new ChecksumCheckEventHandler(resultCollector);
handler.handleAttribute(attributeEvent);
assertFalse(resultCollector.isSuccess());
String report = resultCollector.toReport();
assertTrue(report.contains("2F-O1:"));
}
开发者ID:statsbiblioteket,项目名称:newspaper-batch-metadata-checker,代码行数:15,代码来源:ChecksumCheckEventHandlerTest.java
示例4: badMixResolutionTest
import dk.statsbiblioteket.medieplatform.autonomous.ResultCollector; //导入方法依赖的package包/类
@Test
public void badMixResolutionTest() {
ResultCollector resultCollector = new ResultCollector("foo", "bar");
DocumentCache documentCache = new DocumentCache();
final String batchId = "400022028241";
final String film = "1";
final String avisID = "adresseavisen1759";
final String publishDate = "1795-06";
final String pictureNumber = "0006";
final Batch batch = new Batch();
batch.setBatchID(batchId);
batch.setRoundTripNumber(1);
AttributeParsingEvent mixBadResEvent = MixerMockup.getMixPageAttributeParsingEvent(
film, avisID, publishDate, pictureNumber, batch, 2286, 2864, 300, "",15, "microfilm");
AttributeParsingEvent filmEvent = FilmMocker.getFilmXmlAttributeParsingEvent(film, avisID, "Adresse Contoirs Efterretninger",
"1980-11-01", "1978-10-10", "1978-12-30", batch, 400);
MixFilmCrossCheckEventHandler handler = new MixFilmCrossCheckEventHandler(resultCollector, documentCache);
String goodPath = "B" + batchId + "-RT1/" + batchId + "-" + film;
handler.handleNodeBegin(new NodeBeginsParsingEvent(goodPath));
handler.handleAttribute(filmEvent);
handler.handleAttribute(mixBadResEvent);
handler.handleNodeEnd(new NodeEndParsingEvent(goodPath));
assertFalse(resultCollector.isSuccess());
String report = resultCollector.toReport();
assertTrue(report.contains("2K-5:"));
assertTrue(report.contains("2K-6:"));
}
开发者ID:statsbiblioteket,项目名称:newspaper-batch-metadata-checker,代码行数:32,代码来源:MixFilmCrossCheckEventHandlerTest.java
示例5: testPageModsGoodXpath
import dk.statsbiblioteket.medieplatform.autonomous.ResultCollector; //导入方法依赖的package包/类
/**
* Test that we can validate a valid page mods file.
* @throws SQLException
* @throws InconsistentDatabaseException
*/
@Test
public void testPageModsGoodXpath() throws InconsistentDatabaseException, SQLException {
ResultCollector resultCollector = new ResultCollector("foo", "bar");
DocumentCache documentCache = new DocumentCache();
Batch batch = new Batch();
batch.setBatchID("400022028241");
batch.setRoundTripNumber(10);
MfPakDAO dao = getMockMfPakDAO(batch, true);
BatchContext context = BatchContextUtils.buildBatchContext(dao, batch);
ModsXPathEventHandler handler = new ModsXPathEventHandler(resultCollector, context, goodBatchXmlStructure, documentCache);
String editionNodeName = "B400022028240-RT1/400022028240-14/1795-06-15-01";
handler.handleNodeBegin(new NodeBeginsParsingEvent(editionNodeName));
AttributeParsingEvent modsEvent = new AttributeParsingEvent("AdresseContoirsEfterretninger-1795-06-15-01-0003B.mods.xml") {
@Override
public InputStream getData() throws IOException {
return Thread.currentThread().getContextClassLoader().getResourceAsStream("goodData/goodpagemods.mods.xml");
}
@Override
public String getChecksum() throws IOException {
return null;
}
};
handler.handleAttribute(modsEvent);
String report = resultCollector.toReport();
assertTrue(resultCollector.isSuccess(), report);
}
示例6: testPageModsGoodXpathBadOptionB7
import dk.statsbiblioteket.medieplatform.autonomous.ResultCollector; //导入方法依赖的package包/类
/**
* Test that a mods file with section title is identified as invalid when Option B7 has not been chosen.
* @throws SQLException
* @throws InconsistentDatabaseException
*/
@Test
public void testPageModsGoodXpathBadOptionB7() throws InconsistentDatabaseException, SQLException {
ResultCollector resultCollector = new ResultCollector("foo", "bar");
DocumentCache documentCache = new DocumentCache();
Batch batch = new Batch();
batch.setBatchID("400022028241");
batch.setRoundTripNumber(10);
MfPakDAO dao = getMockMfPakDAO(batch, false);
BatchContext context = BatchContextUtils.buildBatchContext(dao, batch);
ModsXPathEventHandler handler = new ModsXPathEventHandler(resultCollector, context, goodBatchXmlStructure,
documentCache);
String editionNodeName = "B400022028240-RT1/400022028240-14/1795-06-15-01";
handler.handleNodeBegin(new NodeBeginsParsingEvent(editionNodeName));
AttributeParsingEvent modsEvent = new AttributeParsingEvent("AdresseContoirsEfterretninger-1795-06-15-01-0003B.mods.xml") {
@Override
public InputStream getData() throws IOException {
return Thread.currentThread().getContextClassLoader().getResourceAsStream("goodData/goodpagemods.mods.xml");
}
@Override
public String getChecksum() throws IOException {
return null;
}
};
handler.handleAttribute(modsEvent);
String report = resultCollector.toReport();
assertFalse(resultCollector.isSuccess(), report);
assertTrue(report.contains("2C-1:"), report);
}
示例7: testPageModsBad1Xpath
import dk.statsbiblioteket.medieplatform.autonomous.ResultCollector; //导入方法依赖的package包/类
/**
* Test that we can test an invalid mods file.
* @throws SQLException
* @throws InconsistentDatabaseException
*/
@Test
public void testPageModsBad1Xpath() throws InconsistentDatabaseException, SQLException {
ResultCollector resultCollector = new ResultCollector("foo", "bar");
DocumentCache documentCache = new DocumentCache();
Batch batch = new Batch();
batch.setBatchID("400022028241");
batch.setRoundTripNumber(10);
MfPakDAO dao = getMockMfPakDAO(batch, true);
BatchContext context = BatchContextUtils.buildBatchContext(dao, batch);
ModsXPathEventHandler handler = new ModsXPathEventHandler(resultCollector, context, goodBatchXmlStructure, documentCache);
AttributeParsingEvent modsEvent = new AttributeParsingEvent("AdresseContoirsEfterretninger-1795-06-15-01-0010B.mods.xml") {
@Override
public InputStream getData() throws IOException {
return Thread.currentThread().getContextClassLoader().getResourceAsStream("badData/bad1.mods.xml");
}
@Override
public String getChecksum() throws IOException {
return null;
}
};
handler.handleAttribute(modsEvent);
String report = resultCollector.toReport();
assertTrue(report.contains("2C-4:"),report);
assertTrue(report.contains("2C-5:"),report);
assertTrue(report.contains("2C-11:"), report);
}
示例8: testWithPartialBrikData
import dk.statsbiblioteket.medieplatform.autonomous.ResultCollector; //导入方法依赖的package包/类
/**
* Test with good data where the brik file is referred to in one mods file but not the other for the same
* scan.
*/
@Test
public void testWithPartialBrikData() throws SQLException, FileNotFoundException {
String dataDirS = "goodData/editionDirsWithBadBrik/brikWithPartialReferent";
ResultCollector resultCollector = new ResultCollector("foo", "bar");
iterateDataDir(dataDirS, resultCollector);
final String message = resultCollector.toReport();
assertTrue(resultCollector.isSuccess(), message);
}
示例9: testWithBadBrikData1
import dk.statsbiblioteket.medieplatform.autonomous.ResultCollector; //导入方法依赖的package包/类
/**
* Test with bad data where the brik file is not referred to in any mods file.
*/
@Test
public void testWithBadBrikData1() throws SQLException, FileNotFoundException {
String dataDirS = "badData/editionDirsWithBadBrik/brikWithNoReferent";
ResultCollector resultCollector = new ResultCollector("foo", "bar");
iterateDataDir(dataDirS, resultCollector);
final String message = resultCollector.toReport();
assertFalse(resultCollector.isSuccess(), message);
assertTrue(message.contains("2C-10"), message);
}
示例10: testWithBadBrikData2
import dk.statsbiblioteket.medieplatform.autonomous.ResultCollector; //导入方法依赖的package包/类
/**
* Test with bad data where the brik file is missing.
*/
@Test
public void testWithBadBrikData2() throws SQLException, FileNotFoundException {
String dataDirS = "badData/editionDirsWithBadBrik/modsWithNoBrik";
ResultCollector resultCollector = new ResultCollector("foo", "bar");
iterateDataDir(dataDirS, resultCollector);
final String message = resultCollector.toReport();
assertFalse(resultCollector.isSuccess(), message);
assertTrue(message.contains("2C-10"), message);
}
示例11: testWithPageNumberDoesNotStartFromOne
import dk.statsbiblioteket.medieplatform.autonomous.ResultCollector; //导入方法依赖的package包/类
/**
* Test with bad data where a page sequence number does not start from 1
*/
@Test
public void testWithPageNumberDoesNotStartFromOne() throws SQLException, FileNotFoundException {
String dataDirS = "badData/pageSequenceNumber/DoesNotStartFrom1";
ResultCollector resultCollector = new ResultCollector("foo", "bar");
iterateDataDir(dataDirS, resultCollector);
final String message = resultCollector.toReport();
assertFalse(resultCollector.isSuccess(), message);
assertTrue(message.contains("2C-2"), message);
}
示例12: testWithDuplicatePageNumber
import dk.statsbiblioteket.medieplatform.autonomous.ResultCollector; //导入方法依赖的package包/类
/**
* Test with duplicate sequence numbers
*/
@Test
public void testWithDuplicatePageNumber() throws SQLException, FileNotFoundException {
String dataDirS = "badData/pageSequenceNumber/DuplicatePageNumber";
ResultCollector resultCollector = new ResultCollector("foo", "bar");
iterateDataDir(dataDirS, resultCollector);
final String message = resultCollector.toReport();
assertFalse(resultCollector.isSuccess(), message);
assertTrue(message.contains("2C-2"), message);
}
示例13: testWithMissingPageNumber
import dk.statsbiblioteket.medieplatform.autonomous.ResultCollector; //导入方法依赖的package包/类
/**
* Test with missing sequence numbers
*/
@Test
public void testWithMissingPageNumber() throws SQLException, FileNotFoundException {
String dataDirS = "badData/pageSequenceNumber/MissingPageNumber";
ResultCollector resultCollector = new ResultCollector("foo", "bar");
iterateDataDir(dataDirS, resultCollector);
final String message = resultCollector.toReport();
assertFalse(resultCollector.isSuccess(), message);
assertTrue(message.contains("2C-2"), message);
}
示例14: testWithPageNumberInMultipleSections
import dk.statsbiblioteket.medieplatform.autonomous.ResultCollector; //导入方法依赖的package包/类
/**
* Test that page numbers can span two different sections
*/
@Test
public void testWithPageNumberInMultipleSections() throws SQLException, FileNotFoundException {
String dataDirS = "goodData/pageSequenceNumber/MultipleSections";
ResultCollector resultCollector = new ResultCollector("foo", "bar");
iterateDataDir(dataDirS, resultCollector);
final String message = resultCollector.toReport();
assertTrue(resultCollector.isSuccess(), message);
}
示例15: testEditionModsBad
import dk.statsbiblioteket.medieplatform.autonomous.ResultCollector; //导入方法依赖的package包/类
/** Test that we can validate a valid edition xml (mods) file. */
@Test
public void testEditionModsBad() throws SQLException, ParseException {
DocumentCache documentCache = new DocumentCache();
ResultCollector resultCollector = new ResultCollector("foo", "bar");
Batch batch = getBatch();
DefaultTreeEventHandler schematronValidatorEventHandler = new SchematronValidatorEventHandler(resultCollector,
documentCache,attributeConfigs);
BatchContext context = BatchContextUtils.buildBatchContext(getMFPak(), batch);
DefaultTreeEventHandler editionModsEventHandler = new EditionModsEventHandler(resultCollector, context, documentCache);
AttributeParsingEvent editionEvent = new AttributeParsingEvent(
"B400022028241-RT1/400022028241-14/1795-06-01/adresseavisen1759-1795-06-01.edition.xml") {
@Override
public InputStream getData() throws IOException {
return Thread.currentThread()
.getContextClassLoader()
.getResourceAsStream(
"badData/adresseavisen1759-1795-06-01.edition.xml");
}
@Override
public String getChecksum() throws IOException {
return null;
}
};
schematronValidatorEventHandler.handleAttribute(editionEvent);
editionModsEventHandler.handleAttribute(editionEvent);
String report = resultCollector.toReport();
AssertJUnit.assertTrue(report,report.contains("<description>2D-1: avisID adressecontoirsefterretninger does not match avisID in MFPak 'adresseavisen1759'</description>"));
AssertJUnit.assertTrue(report,report.contains("<description>2D-1: avisID adressecontoirsefterretninger does not match avisID in file structure 'adresseavisen1759'</description>"));
AssertJUnit.assertTrue(report,report.contains("<description>2D-2: title Adresse Contoirs Efterretninger does not match title in MFPak 'Kiøbenhavns Kongelig alene priviligerede Adresse-Contoirs Efterretninger'</description>"));
AssertJUnit.assertTrue(report,report.contains("<description>2D-3: Publication location 'Kobenhavn' does not match value 'København' from MFPak</description>"));
AssertJUnit.assertTrue(report,report.contains("<description>2D-4: Date issued from file does not correspond to date in filename</description>"));
AssertJUnit.assertTrue(report,report.contains("<description>2D-9: Edition number (2) in edition xml doesn't correspond to node edition number: 1795-06-01</description>"));
assertFalse(resultCollector.isSuccess(),resultCollector.toReport());
}