Author: vsiveton
Date: Thu Oct 2 04:52:52 2008
New Revision: 701094
URL: http://svn.apache.org/viewvc?rev=701094&view=rev
Log:
o using IOUtil.close()
Modified:
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/module/AbstractIdentityTest.java
Modified:
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/module/AbstractIdentityTest.java
URL:
http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/module/AbstractIdentityTest.java?rev=701094&r1=701093&r2=701094&view=diff
==============================================================================
---
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/module/AbstractIdentityTest.java
(original)
+++
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/module/AbstractIdentityTest.java
Thu Oct 2 04:52:52 2008
@@ -33,14 +33,18 @@
import org.apache.maven.doxia.sink.Sink;
import org.apache.maven.doxia.sink.SinkTestDocument;
import org.apache.maven.doxia.sink.TextSink;
+import org.codehaus.plexus.util.IOUtil;
/**
* If a module provides both Parser and Sink, this class
* can be used to check that chaining them together
* results in the identity transformation, ie the model is still the same
* after being piped through a Parser and the corresponding Sink.
+ *
+ * @version $Id$
*/
-public abstract class AbstractIdentityTest extends AbstractModuleTest
+public abstract class AbstractIdentityTest
+ extends AbstractModuleTest
{
/**
* Set to true if the identity transformation should actually be asserted,
@@ -87,7 +91,7 @@
try
{
// generate the expected model
- writer = new StringWriter();
+ writer = new StringWriter();
SinkTestDocument.generate( new TextSink( writer ) );
String expected = writer.toString();
@@ -96,13 +100,12 @@
fileWriter.write( expected );
fileWriter.flush();
-
// generate the actual model
- writer = new StringWriter();
+ writer = new StringWriter();
SinkTestDocument.generate( createSink( writer ) );
reader = new StringReader( writer.toString() );
- writer = new StringWriter();
+ writer = new StringWriter();
createParser().parse( reader, new TextSink( writer ) );
String actual = writer.toString();
@@ -124,20 +127,11 @@
}
finally
{
- if ( writer != null )
- {
- writer.close();
- }
+ IOUtil.close( writer );
- if ( fileWriter != null )
- {
- fileWriter.close();
- }
+ IOUtil.close( fileWriter );
- if ( reader != null )
- {
- reader.close();
- }
+ IOUtil.close( reader );
}
}
@@ -169,6 +163,4 @@
{
this.assertIdentity = doAssert;
}
-
-
}