use of com.thinkbiganalytics.kylo.nifi.teradata.tdch.core.processor.export.utils.TdchUtils in project kylo by Teradata.
the class TdchUtilsTest method testGetExportHiveToTeradataOutputRecordsCount_ValidCountAndFailureExitCode.
@Test
public void testGetExportHiveToTeradataOutputRecordsCount_ValidCountAndFailureExitCode() {
TestRunner runner = TestRunners.newTestRunner(TestAbstractTdchProcessor.class);
MockComponentLog componentLog = runner.getLogger();
TdchUtils tdchUtils = new TdchUtils();
long count = tdchUtils.getExportHiveToTeradataOutputRecordsCount(getTdchProcessResultWithOutputRecordCountAndFailureExitCodeInfo(), 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"));
}
use of com.thinkbiganalytics.kylo.nifi.teradata.tdch.core.processor.export.utils.TdchUtils in project kylo by Teradata.
the class TdchUtilsTest method testGetExportHiveToTeradataOutputRecordsCount_InvalidRecordCountLong.
@Test
public void testGetExportHiveToTeradataOutputRecordsCount_InvalidRecordCountLong() {
TestRunner runner = TestRunners.newTestRunner(TestAbstractTdchProcessor.class);
MockComponentLog componentLog = runner.getLogger();
TdchUtils tdchUtils = new TdchUtils();
long count = tdchUtils.getExportHiveToTeradataOutputRecordsCount(getTdchProcessResultWithInvalidOutputRecordCountLongLineInfo(), componentLog);
Assert.assertEquals(-1, count);
List<LogMessage> warnMessages = componentLog.getWarnMessages();
Assert.assertEquals(1, warnMessages.size());
Assert.assertTrue(warnMessages.get(0).getMsg().contains("Unable to parse number of output records processed"));
}
use of com.thinkbiganalytics.kylo.nifi.teradata.tdch.core.processor.export.utils.TdchUtils in project kylo by Teradata.
the class TdchUtilsTest method testGetExportHiveToTeradataInputRecordsCount_InvalidRecordCountShort.
@Test
public void testGetExportHiveToTeradataInputRecordsCount_InvalidRecordCountShort() {
TestRunner runner = TestRunners.newTestRunner(TestAbstractTdchProcessor.class);
MockComponentLog componentLog = runner.getLogger();
TdchUtils tdchUtils = new TdchUtils();
long count = tdchUtils.getExportHiveToTeradataInputRecordsCount(getTdchProcessResultWithInvalidInputRecordCountShortLineInfo(), componentLog);
Assert.assertEquals(-1, count);
List<LogMessage> warnMessages = componentLog.getWarnMessages();
Assert.assertEquals(1, warnMessages.size());
Assert.assertTrue(warnMessages.get(0).getMsg().contains("Skipping attempt to retrieve number of input records"));
}
use of com.thinkbiganalytics.kylo.nifi.teradata.tdch.core.processor.export.utils.TdchUtils in project kylo by Teradata.
the class TdchUtilsTest method testGetExportHiveToTeradataJobTimeTaken_ValidTimeAndFailureExitCode.
@Test
public void testGetExportHiveToTeradataJobTimeTaken_ValidTimeAndFailureExitCode() {
TestRunner runner = TestRunners.newTestRunner(TestAbstractTdchProcessor.class);
MockComponentLog componentLog = runner.getLogger();
TdchUtils tdchUtils = new TdchUtils();
String timeTaken = tdchUtils.getExportHiveToTeradataJobTimeTaken(getTdchProcessResultWithTimeTakenAndFailureExitCode(), componentLog);
Assert.assertEquals("Unable to determine time taken", timeTaken);
List<LogMessage> warnMessages = componentLog.getWarnMessages();
Assert.assertEquals(1, warnMessages.size());
Assert.assertTrue(warnMessages.get(0).getMsg().endsWith("Skipping attempt to retrieve time taken by TDCH job"));
}
use of com.thinkbiganalytics.kylo.nifi.teradata.tdch.core.processor.export.utils.TdchUtils in project kylo by Teradata.
the class TdchUtilsTest method testGetExportHiveToTeradataJobTimeTaken_EmptyTimeTaken.
@Test
public void testGetExportHiveToTeradataJobTimeTaken_EmptyTimeTaken() {
TestRunner runner = TestRunners.newTestRunner(TestAbstractTdchProcessor.class);
MockComponentLog componentLog = runner.getLogger();
TdchUtils tdchUtils = new TdchUtils();
String timeTaken = tdchUtils.getExportHiveToTeradataJobTimeTaken(getTdchProcessResultWithEmptyTimeTaken(), componentLog);
Assert.assertEquals("Unable to determine time taken", timeTaken);
List<LogMessage> warnMessages = componentLog.getWarnMessages();
Assert.assertEquals(1, warnMessages.size());
Assert.assertTrue(warnMessages.get(0).getMsg().endsWith("Skipping attempt to retrieve time taken by TDCH job"));
}
Aggregations