use of org.apache.nifi.util.LogMessage in project kylo by Teradata.
the class TdchUtilsTest method testGetExportHiveToTeradataInputRecordsCount_InvalidRecordCountLong.
@Test
public void testGetExportHiveToTeradataInputRecordsCount_InvalidRecordCountLong() {
TestRunner runner = TestRunners.newTestRunner(TestAbstractTdchProcessor.class);
MockComponentLog componentLog = runner.getLogger();
TdchUtils tdchUtils = new TdchUtils();
long count = tdchUtils.getExportHiveToTeradataInputRecordsCount(getTdchProcessResultWithInvalidInputRecordCountLongLineInfo(), 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 input records processed"));
}
use of org.apache.nifi.util.LogMessage in project kylo by Teradata.
the class TdchUtilsTest method testGetExportHiveToTeradataInputRecordsCount_EmptyRecordCount.
@Test
public void testGetExportHiveToTeradataInputRecordsCount_EmptyRecordCount() {
TestRunner runner = TestRunners.newTestRunner(TestAbstractTdchProcessor.class);
MockComponentLog componentLog = runner.getLogger();
TdchUtils tdchUtils = new TdchUtils();
long count = tdchUtils.getExportHiveToTeradataInputRecordsCount(getTdchProcessResultWithEmptyInputRecordCountInfo(), 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 org.apache.nifi.util.LogMessage in project kylo by Teradata.
the class TdchUtilsTest method testGetExportHiveToTeradataOutputRecordsCount_EmptyRecordCount.
@Test
public void testGetExportHiveToTeradataOutputRecordsCount_EmptyRecordCount() {
TestRunner runner = TestRunners.newTestRunner(TestAbstractTdchProcessor.class);
MockComponentLog componentLog = runner.getLogger();
TdchUtils tdchUtils = new TdchUtils();
long count = tdchUtils.getExportHiveToTeradataOutputRecordsCount(getTdchProcessResultWithEmptyOutputRecordCountInfo(), 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 org.apache.nifi.util.LogMessage in project kylo by Teradata.
the class TdchUtilsTest method testGetExportHiveToTeradataJobTimeTaken_ValidTimeAndSuccessExitCode.
@Test
public void testGetExportHiveToTeradataJobTimeTaken_ValidTimeAndSuccessExitCode() {
TestRunner runner = TestRunners.newTestRunner(TestAbstractTdchProcessor.class);
MockComponentLog componentLog = runner.getLogger();
TdchUtils tdchUtils = new TdchUtils();
String timeTaken = tdchUtils.getExportHiveToTeradataJobTimeTaken(getTdchProcessResultWithTimeTakenAndSuccessExitCode(), componentLog);
Assert.assertEquals("33s", timeTaken);
List<LogMessage> warnMessages = componentLog.getWarnMessages();
Assert.assertEquals(0, warnMessages.size());
}
use of org.apache.nifi.util.LogMessage in project kylo by Teradata.
the class TdchUtilsTest method testGetExportHiveToTeradataInputRecordsCount_NoRecordCount.
@Test
public void testGetExportHiveToTeradataInputRecordsCount_NoRecordCount() {
TestRunner runner = TestRunners.newTestRunner(TestAbstractTdchProcessor.class);
MockComponentLog componentLog = runner.getLogger();
TdchUtils tdchUtils = new TdchUtils();
long count = tdchUtils.getExportHiveToTeradataInputRecordsCount(getTdchProcessResultWithNoInputRecordCountInfo(), 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"));
}
Aggregations