|
From: Teiniker E. <tei...@us...> - 2007-04-12 15:09:33
|
Update of /cvsroot/ccmtools/ccmtools/src-test/ccmtools/test In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv32248/src-test/ccmtools/test Modified Files: CcmtoolsTestCase.java Log Message: Refactored JUnit test to support execution on Windows platforms. Index: CcmtoolsTestCase.java =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/src-test/ccmtools/test/CcmtoolsTestCase.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CcmtoolsTestCase.java 30 Nov 2006 18:49:37 -0000 1.1 --- CcmtoolsTestCase.java 12 Apr 2007 15:09:27 -0000 1.2 *************** *** 47,50 **** --- 47,73 ---- } + + /** + * Run the ant build tool with the given command line. + * Note that Windows needs the '.bat' suffix to be happy. + * + * @param cmdline A String containing all options and parameters used for the ant call. + * @throws CcmtoolsTestCaseException + */ + protected void runAnt(String cmdline) + throws CcmtoolsTestCaseException + { + String os = System.getProperty("os.name"); + if(os.startsWith("Windows")) + { + executeCommandLine("ant.bat " + cmdline); + } + else + { + executeCommandLine("ant " + cmdline); + } + } + + /** * Run the ccmtools generator by calling ccmtools.UI.ConsoleCodeGenerator's *************** *** 174,178 **** } catch(Exception e) { ! throw new CcmtoolsTestCaseException("exec error"); } --- 197,201 ---- } catch(Exception e) { ! throw new CcmtoolsTestCaseException("exec error:" + e.getMessage()); } |