use of com.thinkbiganalytics.kylo.nifi.teradata.tdch.core.processor.export.utils.TdchUtils in project kylo by Teradata.
the class TdchUtilsTest method testGetExportHiveToTeradataInputRecordsCount_ValidCountAndSuccessExitCode.
@Test
public void testGetExportHiveToTeradataInputRecordsCount_ValidCountAndSuccessExitCode() {
TestRunner runner = TestRunners.newTestRunner(TestAbstractTdchProcessor.class);
MockComponentLog componentLog = runner.getLogger();
TdchUtils tdchUtils = new TdchUtils();
long count = tdchUtils.getExportHiveToTeradataInputRecordsCount(getTdchProcessResultWithInputRecordCountAndSuccessExitCodeInfo(), componentLog);
Assert.assertEquals(6, 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 testGetExportHiveToTeradataInputRecordsCount_ValidCountAndFailureExitCode.
@Test
public void testGetExportHiveToTeradataInputRecordsCount_ValidCountAndFailureExitCode() {
TestRunner runner = TestRunners.newTestRunner(TestAbstractTdchProcessor.class);
MockComponentLog componentLog = runner.getLogger();
TdchUtils tdchUtils = new TdchUtils();
long count = tdchUtils.getExportHiveToTeradataInputRecordsCount(getTdchProcessResultWithInputRecordCountAndFailureExitCodeInfo(), 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 input records"));
}
use of com.thinkbiganalytics.kylo.nifi.teradata.tdch.core.processor.export.utils.TdchUtils in project kylo by Teradata.
the class TdchUtilsTest method testGetExportHiveToTeradataOutputRecordsCount_InvalidRecordCountShort.
@Test
public void testGetExportHiveToTeradataOutputRecordsCount_InvalidRecordCountShort() {
TestRunner runner = TestRunners.newTestRunner(TestAbstractTdchProcessor.class);
MockComponentLog componentLog = runner.getLogger();
TdchUtils tdchUtils = new TdchUtils();
long count = tdchUtils.getExportHiveToTeradataOutputRecordsCount(getTdchProcessResultWithInvalidOutputRecordCountShortLineInfo(), 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 output records"));
}
use of com.thinkbiganalytics.kylo.nifi.teradata.tdch.core.processor.export.utils.TdchUtils in project kylo by Teradata.
the class TdchUtilsTest method testGetExportHiveToTeradataJobExitCode_SuccessCode.
@Test
public void testGetExportHiveToTeradataJobExitCode_SuccessCode() {
TestRunner runner = TestRunners.newTestRunner(TestAbstractTdchProcessor.class);
MockComponentLog componentLog = runner.getLogger();
TdchUtils tdchUtils = new TdchUtils();
long code = tdchUtils.getExportHiveToTeradataJobExitCode(getTdchProcessResultWithSuccessExitCode(), componentLog);
Assert.assertEquals(0, code);
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 testGetExportHiveToTeradataJobExitCode_EmptyCode.
@Test
public void testGetExportHiveToTeradataJobExitCode_EmptyCode() {
TestRunner runner = TestRunners.newTestRunner(TestAbstractTdchProcessor.class);
MockComponentLog componentLog = runner.getLogger();
TdchUtils tdchUtils = new TdchUtils();
long code = tdchUtils.getExportHiveToTeradataJobExitCode(getTdchProcessResultWithEmptyExitCode(), componentLog);
Assert.assertEquals(-1, code);
List<LogMessage> warnMessages = componentLog.getWarnMessages();
Assert.assertEquals(1, warnMessages.size());
Assert.assertTrue(warnMessages.get(0).getMsg().endsWith("Skipping attempt to retrieve TDCH exit code"));
}
Aggregations