diff options
author | Joakim Erdfelt <joakime@apache.org> | 2008-02-24 04:41:38 +0000 |
---|---|---|
committer | Joakim Erdfelt <joakime@apache.org> | 2008-02-24 04:41:38 +0000 |
commit | ad39008ac5154e57190ea021dbdae8e8a84e3cee (patch) | |
tree | 825904c052560b9299c0e298a432fba3bb9b2e71 | |
parent | 7151c6cada4f48376e0a93aa96c7b6c66c4711cd (diff) | |
download | archiva-ad39008ac5154e57190ea021dbdae8e8a84e3cee.tar.gz archiva-ad39008ac5154e57190ea021dbdae8e8a84e3cee.zip |
MRM-709: Use commons-io instead of Plexus Utils
* migrating FileUtils from plexus-utils to commons-io
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@630586 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/ArchivaConfigurationTest.java | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/ArchivaConfigurationTest.java b/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/ArchivaConfigurationTest.java index 03fd89498..631e455e9 100644 --- a/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/ArchivaConfigurationTest.java +++ b/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/ArchivaConfigurationTest.java @@ -19,9 +19,9 @@ package org.apache.maven.archiva.configuration; * under the License. */ +import org.apache.commons.io.FileUtils; import org.codehaus.plexus.PlexusTestCase; import org.codehaus.plexus.registry.RegistryException; -import org.codehaus.plexus.util.FileUtils; import org.custommonkey.xmlunit.XMLAssert; import org.easymock.MockControl; @@ -169,7 +169,7 @@ public class ArchivaConfigurationTest // TODO: remove with commons-configuration 1.4 file.getParentFile().mkdirs(); - FileUtils.fileWrite( file.getAbsolutePath(), "<configuration/>" ); + FileUtils.writeStringToFile( file, "<configuration/>", null ); DefaultArchivaConfiguration archivaConfiguration = (DefaultArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-save" ); @@ -224,7 +224,7 @@ public class ArchivaConfigurationTest assertFalse( userFile.exists() ); userFile.getParentFile().mkdirs(); - FileUtils.fileWrite( userFile.getAbsolutePath(), "<configuration/>" ); + FileUtils.writeStringToFile( userFile, "<configuration/>", null ); ArchivaConfiguration archivaConfiguration = (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-save-user" ); @@ -310,7 +310,7 @@ public class ArchivaConfigurationTest assertFalse( userFile.exists() ); baseFile.getParentFile().mkdirs(); - FileUtils.fileWrite( baseFile.getAbsolutePath(), "<configuration/>" ); + FileUtils.writeStringToFile( baseFile, "<configuration/>", null ); ArchivaConfiguration archivaConfiguration = (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-save-user" ); @@ -342,10 +342,10 @@ public class ArchivaConfigurationTest assertFalse( userFile.exists() ); baseFile.getParentFile().mkdirs(); - FileUtils.fileWrite( baseFile.getAbsolutePath(), "<configuration/>" ); + FileUtils.writeStringToFile( baseFile, "<configuration/>", null ); userFile.getParentFile().mkdirs(); - FileUtils.fileWrite( userFile.getAbsolutePath(), "<configuration/>" ); + FileUtils.writeStringToFile( userFile, "<configuration/>", null ); ArchivaConfiguration archivaConfiguration = (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-save-user" ); @@ -359,10 +359,10 @@ public class ArchivaConfigurationTest assertTrue( "Check file exists", baseFile.exists() ); assertEquals( "Check base file is unchanged", "<configuration/>", - FileUtils.fileRead( baseFile.getAbsolutePath() ) ); + FileUtils.readFileToString( baseFile, null ) ); assertTrue( "Check file exists", userFile.exists() ); assertFalse( "Check base file is changed", - "<configuration/>".equals( FileUtils.fileRead( userFile.getAbsolutePath() ) ) ); + "<configuration/>".equals( FileUtils.readFileToString( userFile, null ) ) ); // check it configuration = archivaConfiguration.getConfiguration(); @@ -384,7 +384,7 @@ public class ArchivaConfigurationTest FileUtils.copyFile( getTestFile( "src/test/conf/conf-user.xml" ), userFile ); baseFile.getParentFile().mkdirs(); - FileUtils.fileWrite( baseFile.getAbsolutePath(), "<configuration/>" ); + FileUtils.writeStringToFile( baseFile, "<configuration/>", null ); ArchivaConfiguration archivaConfiguration = (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-save-user" ); @@ -398,10 +398,10 @@ public class ArchivaConfigurationTest assertTrue( "Check file exists", baseFile.exists() ); assertEquals( "Check base file is unchanged", "<configuration/>", - FileUtils.fileRead( baseFile.getAbsolutePath() ) ); + FileUtils.readFileToString( baseFile, null ) ); assertTrue( "Check file exists", userFile.exists() ); assertFalse( "Check base file is changed", - "<configuration/>".equals( FileUtils.fileRead( userFile.getAbsolutePath() ) ) ); + "<configuration/>".equals( FileUtils.readFileToString( userFile, null ) ) ); // check it configuration = archivaConfiguration.getConfiguration(); @@ -423,7 +423,7 @@ public class ArchivaConfigurationTest FileUtils.copyFile( getTestFile( "src/test/conf/conf-base.xml" ), baseFile ); userFile.getParentFile().mkdirs(); - FileUtils.fileWrite( userFile.getAbsolutePath(), "<configuration/>" ); + FileUtils.writeStringToFile( userFile, "<configuration/>", null ); ArchivaConfiguration archivaConfiguration = (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-save-user" ); @@ -552,7 +552,7 @@ public class ArchivaConfigurationTest assertEquals( "check remote repositories size.", 2, configuration.getRemoteRepositoriesAsMap().size() ); assertEquals( "check v1 repositories size.", 0, configuration.getRepositories().size() ); - String actualXML = FileUtils.fileRead( userFile ); + String actualXML = FileUtils.readFileToString( userFile, null ); XMLAssert.assertXpathNotExists( "//configuration/repositories/repository", actualXML ); XMLAssert.assertXpathNotExists( "//configuration/repositories", actualXML ); } @@ -606,7 +606,7 @@ public class ArchivaConfigurationTest FileUtils.copyFile( getTestFile( "src/test/conf/escape-cron-expressions.xml" ), baseFile ); userFile.getParentFile().mkdirs(); - FileUtils.fileWrite( userFile.getAbsolutePath(), "<configuration/>" ); + FileUtils.writeStringToFile( userFile, "<configuration/>", null ); ArchivaConfiguration archivaConfiguration = (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-cron-expressions" ); |