You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by gs...@apache.org on 2009/01/22 21:21:10 UTC
svn commit: r736776 -
/ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/AntUnit.java
Author: gscokart
Date: Thu Jan 22 12:21:10 2009
New Revision: 736776
URL: http://svn.apache.org/viewvc?rev=736776&view=rev
Log:
indent the code
Modified:
ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/AntUnit.java
Modified: ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/AntUnit.java
URL: http://svn.apache.org/viewvc/ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/AntUnit.java?rev=736776&r1=736775&r2=736776&view=diff
==============================================================================
--- ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/AntUnit.java (original)
+++ ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/AntUnit.java Thu Jan 22 12:21:10 2009
@@ -250,73 +250,73 @@
return testTargets;
}
- public boolean startSuite() {
- newProject.fireBuildStarted();
- if (suiteSetUp) {
- try {
- newProject.executeTarget(SUITESETUP);
- } catch (AssertionFailedException e) {
- fireStartTest(SUITESETUP);
- fireFail(SUITESETUP, e);
- return false;
- } catch (BuildException e) {
- fireStartTest(SUITESETUP);
- fireFailOrError(SUITESETUP, e);
- return false;
- }
- }
- return true;
- }
-
- public void runTarget(String name) {
- Vector v = new Vector();
- if (setUp) {
- v.add(SETUP);
- }
- v.add(name);
- // create and register a logcapturer on the newProject
- LogCapturer lc = new LogCapturer(newProject);
- try {
- fireStartTest(name);
- newProject.executeTargets(v);
- } catch (AssertionFailedException e) {
- fireFail(name, e);
- } catch (BuildException e) {
- fireFailOrError(name, e);
- } finally {
- // fire endTest here instead of the endTarget
- // event, otherwise an error would be
- // registered after the endTest event -
- // endTarget is called before this method's catch block
- // is reached.
- fireEndTest(name);
- // clean up
- if (tearDown) {
+ public boolean startSuite() {
+ newProject.fireBuildStarted();
+ if (suiteSetUp) {
try {
- newProject.executeTarget(TEARDOWN);
- } catch (final AssertionFailedException e) {
- fireFail(name, e);
- } catch (final BuildException e) {
- fireFailOrError(name, e);
+ newProject.executeTarget(SUITESETUP);
+ } catch (AssertionFailedException e) {
+ fireStartTest(SUITESETUP);
+ fireFail(SUITESETUP, e);
+ return false;
+ } catch (BuildException e) {
+ fireStartTest(SUITESETUP);
+ fireFailOrError(SUITESETUP, e);
+ return false;
}
}
+ return true;
}
- }
- public void endSuite(Throwable caught) {
- if (suiteTearDown) {
+ public void runTarget(String name) {
+ Vector v = new Vector();
+ if (setUp) {
+ v.add(SETUP);
+ }
+ v.add(name);
+ // create and register a logcapturer on the newProject
+ LogCapturer lc = new LogCapturer(newProject);
try {
- newProject.executeTarget(SUITETEARDOWN);
+ fireStartTest(name);
+ newProject.executeTargets(v);
} catch (AssertionFailedException e) {
- fireStartTest(SUITETEARDOWN);
- fireFail(SUITETEARDOWN, e);
+ fireFail(name, e);
} catch (BuildException e) {
- fireStartTest(SUITETEARDOWN);
- fireFailOrError(SUITETEARDOWN, e);
+ fireFailOrError(name, e);
+ } finally {
+ // fire endTest here instead of the endTarget
+ // event, otherwise an error would be
+ // registered after the endTest event -
+ // endTarget is called before this method's catch block
+ // is reached.
+ fireEndTest(name);
+ // clean up
+ if (tearDown) {
+ try {
+ newProject.executeTarget(TEARDOWN);
+ } catch (final AssertionFailedException e) {
+ fireFail(name, e);
+ } catch (final BuildException e) {
+ fireFailOrError(name, e);
+ }
+ }
}
}
- newProject.fireBuildFinished(caught);
- }
+
+ public void endSuite(Throwable caught) {
+ if (suiteTearDown) {
+ try {
+ newProject.executeTarget(SUITETEARDOWN);
+ } catch (AssertionFailedException e) {
+ fireStartTest(SUITETEARDOWN);
+ fireFail(SUITETEARDOWN, e);
+ } catch (BuildException e) {
+ fireStartTest(SUITETEARDOWN);
+ fireFailOrError(SUITETEARDOWN, e);
+ }
+ }
+ newProject.fireBuildFinished(caught);
+ }
}
/**