use of com.google.refine.model.recon.ReconJob in project OpenRefine by OpenRefine.
the class ReconOperationTests method testFailingRecon.
@Test
public void testFailingRecon() throws Exception {
Project project = createCSVProject("my recon test project", "column\n" + "valueA\n" + "valueB\n" + "valueC");
StandardReconConfig reconConfig = mock(StandardReconConfig.class);
List<Recon> reconList = Arrays.asList((Recon) null, (Recon) null, (Recon) null);
ReconJob reconJob = mock(ReconJob.class);
when(reconConfig.batchRecon(Mockito.any(), Mockito.anyLong())).thenReturn(reconList);
when(reconConfig.getBatchSize()).thenReturn(10);
when(reconConfig.createJob(Mockito.eq(project), Mockito.anyInt(), Mockito.any(), Mockito.any(), Mockito.any())).thenReturn(reconJob);
ReconOperation op = new ReconOperation(EngineConfig.reconstruct("{}"), "column", reconConfig);
Process process = op.createProcess(project, new Properties());
runAndWait(project.getProcessManager(), process, 1000);
Column column = project.columnModel.columns.get(0);
Assert.assertNotNull(column.getReconStats());
Assert.assertEquals(column.getReconStats().matchedTopics, 0);
Assert.assertNull(project.rows.get(0).getCell(0).recon);
Assert.assertNull(project.rows.get(1).getCell(0).recon);
Assert.assertNull(project.rows.get(2).getCell(0).recon);
}
Aggregations