restore 1.5 compat

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1330322 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-04-25 14:51:59 +00:00
parent c9a9ea93ae
commit 434be19963
1 changed files with 32 additions and 31 deletions

View File

@ -19,6 +19,10 @@ package org.apache.archiva.xml;
* under the License.
*/
import junit.framework.Assert;
import org.dom4j.DocumentException;
import org.dom4j.io.SAXReader;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
@ -29,12 +33,6 @@ import java.io.Reader;
import java.io.StringWriter;
import java.net.URL;
import junit.framework.Assert;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.io.SAXReader;
/**
* LatinEntityResolutionReaderTest
*
@ -46,7 +44,7 @@ public class LatinEntityResolutionReaderTest
/**
* A method to obtain the content of a reader as a String,
* while allowing for specifing the buffer size of the operation.
*
* <p/>
* This method is only really useful for testing a Reader implementation.
*
* @param input the reader to get the input from.
@ -203,7 +201,6 @@ public class LatinEntityResolutionReaderTest
}
public void testReaderLeftOver()
throws IOException
{
@ -215,16 +212,20 @@ public class LatinEntityResolutionReaderTest
in = url.openStream();
InputStreamReader inReader = new InputStreamReader( in, "UTF-8" );
LatinEntityResolutionReader latinReader = new LatinEntityResolutionReader( inReader );
try {
try
{
reader.read( latinReader );
} catch (DocumentException e) {
Assert.fail("Should not have failed here." + e);
throw new IOException(e);
}
catch ( DocumentException e )
{
Assert.fail( "Should not have failed here." + e );
IOException ioe = new IOException();
ioe.initCause( e );
throw ioe;
}
}
public void testNoLatinEntitiesHugeLine()
{
assertProperRead( "commons-codec-1.2.pom", "commons-codec-1.2.pom", 4096 );