OozieJobExecutorJobEntry extends AbstractJobEntry<OozieJobExecutorConfig> implements Cloneable,
  JobEntryInterface { public Properties getProperties( OozieJobExecutorConfig config ) throws KettleFileException, IOException { return getProperties( config, getVariableSpace() ); } 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 testGetProperties() throws Exception { OozieJobExecutorConfig config = new OozieJobExecutorConfig(); config.setOozieWorkflowConfig( "src/test/resources/job.properties" ); Properties props = OozieJobExecutorJobEntry.getProperties( config, new Variables() ); assertEquals( 6, props.size() ); }
@Test public void testGetProperties_VariableizedWorkflowPath() throws Exception { OozieJobExecutorConfig config = new OozieJobExecutorConfig(); config.setOozieWorkflowConfig( "${propertiesFile}" ); OozieJobExecutorJobEntry je = new OozieJobExecutorJobEntry(); je.setVariable( "propertiesFile", "src/test/resources/job.properties" ); Properties props = je.getProperties( config ); assertEquals( 6, props.size() ); }
@Test public void testGetProperties_fromAdvancedProperties() throws Exception { OozieJobExecutorConfig config = new OozieJobExecutorConfig(); ArrayList<PropertyEntry> advancedProps = new ArrayList<>(); advancedProps.add( new PropertyEntry( "prop1", "value1" ) ); advancedProps.add( new PropertyEntry( "prop2", "value2" ) ); advancedProps.add( new PropertyEntry( "prop3", "value3" ) ); config.setOozieWorkflowConfig( "src/test/resources/job.properties" ); config.setWorkflowProperties( advancedProps ); config.setMode( JobEntryMode.ADVANCED_LIST ); Properties props = OozieJobExecutorJobEntry.getProperties( config, new Variables() ); assertTrue( "Advanced properties were not used", props.containsKey( "prop1" ) ); assertEquals( 3, props.size() ); }