Revision: 871 http://jwebunit.svn.sourceforge.net/jwebunit/?rev=871&view=rev Author: henryju Date: 2010-10-20 12:04:14 +0000 (Wed, 20 Oct 2010)
Log Message: ----------- JUnit 4 migration part 4: transform JUnit 4 exceptions to JUnit 3 exceptions in WebTestCase. Modified Paths: -------------- trunk/jwebunit-webtestcase-generator/src/main/javacc/WebTestCase.jj Modified: trunk/jwebunit-webtestcase-generator/src/main/javacc/WebTestCase.jj =================================================================== --- trunk/jwebunit-webtestcase-generator/src/main/javacc/WebTestCase.jj 2010-10-20 12:03:13 UTC (rev 870) +++ trunk/jwebunit-webtestcase-generator/src/main/javacc/WebTestCase.jj 2010-10-20 12:04:14 UTC (rev 871) @@ -817,7 +817,8 @@ ( Block() | ";" ) {if (append) { sb.append(" {\n"); - sb.append(" "); + sb.append(" try {\n"); + sb.append(" "); if (!isVoid) sb.append("return "); sb.append("tester.").append(params.remove(0)).append("("); for (Iterator i = params.iterator(); i.hasNext();) { @@ -826,6 +827,11 @@ if (i.hasNext()) sb.append(", "); } sb.append(");\n"); + sb.append(" } catch (org.junit.ComparisonFailure e) {\n"); + sb.append(" throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());\n"); + sb.append(" } catch (java.lang.AssertionError e) {\n"); + sb.append(" throw new junit.framework.AssertionFailedError(e.getMessage());\n"); + sb.append(" }\n"); sb.append(" }\n\n"); }} } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Download new Adobe(R) Flash(R) Builder(TM) 4 The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly Flex(R) Builder(TM)) enable the development of rich applications that run across multiple browsers and platforms. Download your free trials today! http://p.sf.net/sfu/adobe-dev2dev _______________________________________________ JWebUnit-development mailing list JWebUnit-development@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jwebunit-development