aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-base/archiva-proxy
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-09-15 21:38:31 +0000
committerOlivier Lamy <olamy@apache.org>2012-09-15 21:38:31 +0000
commit73509cab5c05663ca330ec4ea9b6f508c2921521 (patch)
treec8fad2eaa4ab9798ad5bac4104baae00b5da76f5 /archiva-modules/archiva-base/archiva-proxy
parent833d272ab4200f032d456a72e1e316ed64acd304 (diff)
downloadarchiva-73509cab5c05663ca330ec4ea9b6f508c2921521.tar.gz
archiva-73509cab5c05663ca330ec4ea9b6f508c2921521.zip
prefer Charset.defaultCharset() over a hardcoded charset
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1385188 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-base/archiva-proxy')
-rw-r--r--archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/AbstractProxyTestCase.java4
-rw-r--r--archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/HttpProxyTransferTest.java4
-rw-r--r--archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/ManagedDefaultTransferTest.java4
-rw-r--r--archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/WagonDelegate.java2
4 files changed, 7 insertions, 7 deletions
diff --git a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/AbstractProxyTestCase.java b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/AbstractProxyTestCase.java
index c0762767f..fb2ec922b 100644
--- a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/AbstractProxyTestCase.java
+++ b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/AbstractProxyTestCase.java
@@ -330,9 +330,9 @@ public abstract class AbstractProxyTestCase
assertEquals( "Check file path matches.", expectedFile.getAbsolutePath(), actualFile.getAbsolutePath() );
String expectedContents =
- org.apache.commons.io.FileUtils.readFileToString( sourceFile, Charset.forName( "UTF-8" ) );
+ org.apache.commons.io.FileUtils.readFileToString( sourceFile, Charset.defaultCharset() );
String actualContents =
- org.apache.commons.io.FileUtils.readFileToString( actualFile, Charset.forName( "UTF-8" ) );
+ org.apache.commons.io.FileUtils.readFileToString( actualFile, Charset.defaultCharset() );
assertEquals( "Check file contents.", expectedContents, actualContents );
}
diff --git a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/HttpProxyTransferTest.java b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/HttpProxyTransferTest.java
index 37673bd72..f3264febe 100644
--- a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/HttpProxyTransferTest.java
+++ b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/HttpProxyTransferTest.java
@@ -208,8 +208,8 @@ public class HttpProxyTransferTest
downloadedFile.getCanonicalPath() );
assertEquals( "Check file path matches.", expectedFile.getAbsolutePath(), downloadedFile.getAbsolutePath() );
- String expectedContents = FileUtils.readFileToString( sourceFile, Charset.forName( "UTF-8" ) );
- String actualContents = FileUtils.readFileToString( downloadedFile, Charset.forName( "UTF-8") );
+ String expectedContents = FileUtils.readFileToString( sourceFile, Charset.defaultCharset() );
+ String actualContents = FileUtils.readFileToString( downloadedFile, Charset.defaultCharset() );
assertEquals( "Check file contents.", expectedContents, actualContents );
assertNull( System.getProperty( "http.proxyHost" ) );
diff --git a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/ManagedDefaultTransferTest.java b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/ManagedDefaultTransferTest.java
index 84bce0d07..ed739f186 100644
--- a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/ManagedDefaultTransferTest.java
+++ b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/ManagedDefaultTransferTest.java
@@ -328,8 +328,8 @@ public class ManagedDefaultTransferTest
assertNoTempFiles( expectedFile );
// TODO: is this check even needed if it passes above?
- String actualContents = FileUtils.readFileToString( downloadedFile, Charset.forName( "UTF-8" ) );
- String badContents = FileUtils.readFileToString( proxied2File, Charset.forName( "UTF-8" ) );
+ String actualContents = FileUtils.readFileToString( downloadedFile, Charset.defaultCharset() );
+ String badContents = FileUtils.readFileToString( proxied2File, Charset.defaultCharset() );
assertFalse( "Downloaded file contents should not be that of proxy 2",
StringUtils.equals( actualContents, badContents ) );
}
diff --git a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/WagonDelegate.java b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/WagonDelegate.java
index 60b64c541..dea5ad5b3 100644
--- a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/WagonDelegate.java
+++ b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/WagonDelegate.java
@@ -247,7 +247,7 @@ public class WagonDelegate
else
{
FileUtils.writeStringToFile( new File( destination.getAbsolutePath() ), contentToGet,
- Charset.forName( "UTF-8" ) );
+ Charset.defaultCharset() );
}
}
catch ( IOException e )