use of com.thinkbiganalytics.kylo.nifi.teradata.tdch.core.processor.export.utils.TdchUtils in project kylo by Teradata.
the class TdchUtilsTest method testGetExportHiveToTeradataOutputRecordsCount_ValidCountAndSuccessExitCode.
@Test
public void testGetExportHiveToTeradataOutputRecordsCount_ValidCountAndSuccessExitCode() {
TestRunner runner = TestRunners.newTestRunner(TestAbstractTdchProcessor.class);
MockComponentLog componentLog = runner.getLogger();
TdchUtils tdchUtils = new TdchUtils();
long count = tdchUtils.getExportHiveToTeradataOutputRecordsCount(getTdchProcessResultWithOutputRecordCountAndSuccessExitCodeInfo(), componentLog);
Assert.assertEquals(5, count);
List<LogMessage> warnMessages = componentLog.getWarnMessages();
Assert.assertEquals(0, warnMessages.size());
}
use of com.thinkbiganalytics.kylo.nifi.teradata.tdch.core.processor.export.utils.TdchUtils in project kylo by Teradata.
the class TdchUtilsTest method testGetExportHiveToTeradataOutputRecordsCount_NoRecordCount.
@Test
public void testGetExportHiveToTeradataOutputRecordsCount_NoRecordCount() {
TestRunner runner = TestRunners.newTestRunner(TestAbstractTdchProcessor.class);
MockComponentLog componentLog = runner.getLogger();
TdchUtils tdchUtils = new TdchUtils();
long count = tdchUtils.getExportHiveToTeradataOutputRecordsCount(getTdchProcessResultWithNoOutputRecordCountInfo(), componentLog);
Assert.assertEquals(-1, count);
List<LogMessage> warnMessages = componentLog.getWarnMessages();
Assert.assertEquals(1, warnMessages.size());
Assert.assertTrue(warnMessages.get(0).getMsg().endsWith("Skipping attempt to retrieve number of output records"));
}
Aggregations