use of com.thinkbiganalytics.kylo.nifi.teradata.tdch.core.processor.export.utils.TdchUtils 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"));
}
use of com.thinkbiganalytics.kylo.nifi.teradata.tdch.core.processor.export.utils.TdchUtils in project kylo by Teradata.
the class TdchUtilsTest method testGetExportHiveToTeradataJobExitCode_InvalidCodeShort.
@Test
public void testGetExportHiveToTeradataJobExitCode_InvalidCodeShort() {
TestRunner runner = TestRunners.newTestRunner(TestAbstractTdchProcessor.class);
MockComponentLog componentLog = runner.getLogger();
TdchUtils tdchUtils = new TdchUtils();
long code = tdchUtils.getExportHiveToTeradataJobExitCode(getTdchProcessResultWithShortInvalidExitCode(), 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"));
}
use of com.thinkbiganalytics.kylo.nifi.teradata.tdch.core.processor.export.utils.TdchUtils in project kylo by Teradata.
the class TdchUtilsTest method testGetExportHiveToTeradataJobExitCode_InvalidCodeLong.
@Test
public void testGetExportHiveToTeradataJobExitCode_InvalidCodeLong() {
TestRunner runner = TestRunners.newTestRunner(TestAbstractTdchProcessor.class);
MockComponentLog componentLog = runner.getLogger();
TdchUtils tdchUtils = new TdchUtils();
long code = tdchUtils.getExportHiveToTeradataJobExitCode(getTdchProcessResultWithLongInvalidExitCode(), componentLog);
Assert.assertEquals(-1, code);
List<LogMessage> warnMessages = componentLog.getWarnMessages();
Assert.assertEquals(1, warnMessages.size());
Assert.assertTrue(warnMessages.get(0).getMsg().contains("Unable to parse TDCH exit code"));
}
use of com.thinkbiganalytics.kylo.nifi.teradata.tdch.core.processor.export.utils.TdchUtils in project kylo by Teradata.
the class TdchUtilsTest method testGetExportHiveToTeradataJobTimeTaken_InvalidTimeTakenShort.
@Test
public void testGetExportHiveToTeradataJobTimeTaken_InvalidTimeTakenShort() {
TestRunner runner = TestRunners.newTestRunner(TestAbstractTdchProcessor.class);
MockComponentLog componentLog = runner.getLogger();
TdchUtils tdchUtils = new TdchUtils();
String timeTaken = tdchUtils.getExportHiveToTeradataJobTimeTaken(getTdchProcessResultWithShortInvalidTimeTaken(), 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 testMaskTdchCredentials_MaskPassword.
@Test
public void testMaskTdchCredentials_MaskPassword() {
TdchUtils tdchUtils = new TdchUtils();
String tdchCommand = "This is a command -password password_value remaining parameters";
String maskedTdchCommand = tdchUtils.maskTdchCredentials(tdchCommand);
Assert.assertEquals("This is a command -password ***** remaining parameters", maskedTdchCommand);
}
Aggregations