Source:
<code>public void testConfigurePythonExecution() throws IllegalAccessException, NoSuchFieldException, CliArgsException, ProgramInvocationException, IOException { <START> String[] args = { <END> "--python", "xxx.py", "--pyModule", "xxx", "--pyFiles", "/absolute/a.py,relative/b.py,relative/c.py", "--pyRequirements", "d.txt#e_dir", "--pyExecutable", "/usr/bin/python", "--pyArchives", "g.zip,h.zip#data,h.zip#data2", "userarg1", "userarg2" }; final File[] dummyJobJar = {null}; Files.walkFileTree(FileSystems.getDefault().getPath("target/dummy-job-jar"), new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { FileVisitResult result = super.visitFile(file, attrs); if (file.getFileName().toString().startsWith("flink-python")) { dummyJobJar[0] = file.toFile(); } return result; } }); PackagedProgram packagedProgram = PackagedProgram.newBuilder() .setArguments(args).setJarFile(dummyJobJar[0]) .build(); Configuration configuration = new Configuration(); ProgramOptionsUtils.configurePythonExecution(configuration, packagedProgram); assertEquals("/absolute/a.py,relative/b.py,relative/c.py", configuration.get(PythonOptions.PYTHON_FILES)); assertEquals("d.txt#e_dir", configuration.get(PYTHON_REQUIREMENTS)); assertEquals("g.zip,h.zip#data,h.zip#data2", configuration.get(PythonOptions.PYTHON_ARCHIVES)); assertEquals("/usr/bin/python", configuration.get(PYTHON_EXECUTABLE)); assertArrayEquals( new String[] {"--python", "xxx.py", "--pyModule", "xxx", "userarg1", "userarg2"}, packagedProgram.getArguments()); }</code><technical_language>nit: final here. variables</technical_language>

Target:
public void testConfigurePythonExecution() throws IllegalAccessException, NoSuchFieldException, CliArgsException, ProgramInvocationException, IOException { final String[] args = { "--python", "xxx.py", "--pyModule", "xxx", "--pyFiles", "/absolute/a.py,relative/b.py,relative/c.py", "--pyRequirements", "d.txt#e_dir", "--pyExecutable", "/usr/bin/python", "--pyArchives", "g.zip,h.zip#data,h.zip#data2", "userarg1", "userarg2" }; final File[] dummyJobJar = {null}; Files.walkFileTree(FileSystems.getDefault().getPath("target/dummy-job-jar"), new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { FileVisitResult result = super.visitFile(file, attrs); if (file.getFileName().toString().startsWith("flink-python")) { dummyJobJar[0] = file.toFile(); } return result; } }); PackagedProgram packagedProgram = PackagedProgram.newBuilder() .setArguments(args).setJarFile(dummyJobJar[0]) .build(); Configuration configuration = new Configuration(); ProgramOptionsUtils.configurePythonExecution(configuration, packagedProgram); assertEquals("/absolute/a.py,relative/b.py,relative/c.py", configuration.get(PythonOptions.PYTHON_FILES)); assertEquals("d.txt#e_dir", configuration.get(PYTHON_REQUIREMENTS)); assertEquals("g.zip,h.zip#data,h.zip#data2", configuration.get(PythonOptions.PYTHON_ARCHIVES)); assertEquals("/usr/bin/python", configuration.get(PYTHON_EXECUTABLE)); assertArrayEquals( new String[] {"--python", "xxx.py", "--pyModule", "xxx", "userarg1", "userarg2"}, packagedProgram.getArguments()); }