CreateFunction implements IFunction { File getBptsFile(File bpelFile, String testSuiteDir) { File bptsFile; if (testSuiteDir == null) { bptsFile = new File(FileUtil.getFileNameWithoutSuffix(bpelFile .getAbsolutePath()) + ".bpts"); } else { bptsFile = new File(testSuiteDir); if (bptsFile.isAbsolute()) { bptsFile = new File(bptsFile, FileUtil.getFileNameWithoutSuffix(bpelFile.getName()) + ".bpts"); } else { bptsFile = new File(new File(bpelFile.getParentFile(), testSuiteDir), FileUtil.getFileNameWithoutSuffix(bpelFile.getName()) + ".bpts"); } bptsFile.getParentFile().mkdirs(); } try { return bptsFile.getCanonicalFile(); } catch (IOException e) { e.printStackTrace(); return bptsFile; } } CreateFunction(); String getName(); String getDescription(); String getHelp(); void execute(String[] params);  }
@Test public void testGetBptsFile() throws Exception { File bpelFile = new File("src/test/resources/bpel/test/Test.bpel"); File expectedBptsFile = new File("src/test/resources/bpel/test/Test.bpts"); assertEquals(expectedBptsFile.getAbsoluteFile(), createFunction.getBptsFile(bpelFile, null)); expectedBptsFile = new File("target/test/Test.bpts"); assertEquals(expectedBptsFile.getAbsoluteFile(), createFunction.getBptsFile(bpelFile, "../../../../../target/test")); expectedBptsFile = new File("C:/test/Test.bpts"); if(expectedBptsFile.isAbsolute()) { assertEquals(expectedBptsFile.getAbsoluteFile(), createFunction.getBptsFile(bpelFile, "C:/test")); } expectedBptsFile = new File("/test/Test.bpts"); if(expectedBptsFile.isAbsolute()) { assertEquals(expectedBptsFile.getAbsoluteFile(), createFunction.getBptsFile(bpelFile, "/test")); } }