diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2013-02-03 21:50:16 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2013-02-03 21:57:31 +0100 |
commit | bb0bcf4dfb1eef2ff42655d5e00b5d62c7bc4a6e (patch) | |
tree | 169215a45203a91ac63222278c3064d1307cfd75 /sonar-plugin-api/src/test/java/org/sonar | |
parent | ee051c0da6dbc967b50eee86bd906f372ad4e8bf (diff) | |
download | sonarqube-bb0bcf4dfb1eef2ff42655d5e00b5d62c7bc4a6e.tar.gz sonarqube-bb0bcf4dfb1eef2ff42655d5e00b5d62c7bc4a6e.zip |
Remove some calls to commons-collections
Diffstat (limited to 'sonar-plugin-api/src/test/java/org/sonar')
-rw-r--r-- | sonar-plugin-api/src/test/java/org/sonar/api/utils/ZipUtilsTest.java | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/utils/ZipUtilsTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/utils/ZipUtilsTest.java index 33f840dce9f..a53c20cafba 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/utils/ZipUtilsTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/utils/ZipUtilsTest.java @@ -19,17 +19,18 @@ */ package org.sonar.api.utils; -import org.apache.commons.collections.CollectionUtils; +import com.google.common.collect.Iterators; import org.apache.commons.io.FileUtils; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.Matchers.greaterThan; -import static org.junit.Assert.assertThat; import org.junit.Test; import java.io.File; import java.io.IOException; +import java.util.Iterator; +import java.util.zip.ZipEntry; import java.util.zip.ZipFile; +import static org.fest.assertions.Assertions.assertThat; + public class ZipUtilsTest { @Test @@ -40,9 +41,10 @@ public class ZipUtilsTest { ZipUtils.zipDir(dir, zip); - assertThat(zip.exists(), is(true)); - assertThat(zip.length(), greaterThan(1l)); - assertThat(CollectionUtils.size(new ZipFile(zip).entries()), is(4)); + assertThat(zip).exists(); + assertThat(zip.length()).isGreaterThan(1L); + Iterator<? extends ZipEntry> zipEntries = Iterators.forEnumeration(new ZipFile(zip).entries()); + assertThat(zipEntries).hasSize(4); } @Test @@ -50,7 +52,7 @@ public class ZipUtilsTest { File zip = FileUtils.toFile(getClass().getResource("/org/sonar/api/utils/ZipUtilsTest/shouldUnzipFile.zip")); File toDir = new File("target/tmp/shouldUnzipFile/"); ZipUtils.unzip(zip, toDir); - assertThat(toDir.list().length, is(3)); + assertThat(toDir.list()).hasSize(3); } } |