OozieJobExecutorJobEntry extends AbstractJobEntry<OozieJobExecutorConfig> implements Cloneable,
  JobEntryInterface { public List<String> getValidationWarnings( OozieJobExecutorConfig config, boolean checkOozieConnection ) { List<String> messages = new ArrayList<>(); if ( StringUtil.isEmpty( config.getJobEntryName() ) ) { messages.add( BaseMessages.getString( OozieJobExecutorJobEntry.class, "ValidationMessages.Missing.JobName" ) ); } NamedCluster nc = null; try { nc = getNamedCluster( config ); } catch ( MetaStoreException e ) { messages .add( BaseMessages.getString( OozieJobExecutorJobEntry.class, VALIDATION_MESSAGES_MISSING_CONFIGURATION ) ); } if ( null == nc || nc.getName().equals( "" ) || nc.getShimIdentifier().equals( "" ) ) { messages.add( BaseMessages.getString( OozieJobExecutorJobEntry.class, "ValidationMessages.Missing.NamedCluster", config.getClusterName() ) ); return messages; } verifyOozieUrl( config, checkOozieConnection, messages, nc ); checkOozieConnection( config, checkOozieConnection, messages ); verifyJobConfiguration( config, checkOozieConnection, messages ); boolean pollingIntervalValid = false; try { long pollingInterval = JobEntryUtils.asLong( config.getBlockingPollingInterval(), variables ); pollingIntervalValid = pollingInterval > 0; } catch ( Exception ex ) { } if ( !pollingIntervalValid ) { messages.add( BaseMessages.getString( OozieJobExecutorJobEntry.class, "ValidationMessages.Invalid.PollingInterval" ) ); } return messages; } OozieJobExecutorJobEntry(
    NamedClusterService namedClusterService,
    RuntimeTestActionService runtimeTestActionService, RuntimeTester runtimeTester,
    NamedClusterServiceLocator namedClusterServiceLocator ); @VisibleForTesting  OozieJobExecutorJobEntry(); List<String> getValidationWarnings( OozieJobExecutorConfig config, boolean checkOozieConnection ); @Override List<String> getValidationWarnings( OozieJobExecutorConfig config ); Properties getPropertiesFromFile( OozieJobExecutorConfig config ); static Properties getPropertiesFromFile( OozieJobExecutorConfig config, VariableSpace variableSpace ); Properties getProperties( OozieJobExecutorConfig config ); static Properties getProperties( OozieJobExecutorConfig config, VariableSpace variableSpace ); HadoopClientServices getHadoopClientServices(); HadoopClientServices getHadoopClientServices( OozieJobExecutorConfig config ); RuntimeTestActionService getRuntimeTestActionService(); RuntimeTester getRuntimeTester(); NamedClusterService getNamedClusterService(); static final String HTTP_ERROR_CODE_404; static final String HTTP_ERROR_CODE_401; static final String HTTP_ERROR_CODE_403; static final String USER_NAME; static final String VALIDATION_MESSAGES_MISSING_CONFIGURATION; }
@Test public void testGetValidationWarnings_emptyConfig() throws Exception { OozieJobExecutorConfig config = new OozieJobExecutorConfig(); OozieJobExecutorJobEntry je = new OozieJobExecutorJobEntry(); List<String> warnings = je.getValidationWarnings( config ); assertEquals( 2, warnings.size() ); }