Skip to content

Commit

Permalink
Remove unused import, rename variables, move test code around
Browse files Browse the repository at this point in the history
  • Loading branch information
jean-philippe-martin committed Jan 13, 2017
1 parent 10aa070 commit 64ca46e
Showing 1 changed file with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import static java.nio.charset.StandardCharsets.UTF_8;

import com.google.cloud.storage.StorageOptions;
import com.google.common.collect.ImmutableList;
import com.google.common.testing.EqualsTester;
import com.google.common.testing.NullPointerTester;

Expand Down Expand Up @@ -166,18 +165,18 @@ public void testListFiles() throws IOException {
public void testMatcher() throws IOException {
try (FileSystem fs = CloudStorageFileSystem.forBucket("bucket")) {
String pattern1 = "glob:*.java";
PathMatcher matcher1 = fs.getPathMatcher(pattern1);
PathMatcher javaFileMatcher = fs.getPathMatcher(pattern1);
assertMatches(fs, javaFileMatcher, "a.java", true);
assertMatches(fs, javaFileMatcher, "a.text", false);
assertMatches(fs, javaFileMatcher, "folder/c.java", true);
assertMatches(fs, javaFileMatcher, "d", false);

String pattern2 = "glob:*.{java,text}";
PathMatcher matcher2 = fs.getPathMatcher(pattern2);

assertMatches(fs, matcher1, "a.java", true);
assertMatches(fs, matcher1, "a.text", false);
assertMatches(fs, matcher1, "folder/c.java", true);
assertMatches(fs, matcher1, "d", false);
assertMatches(fs, matcher2, "a.java", true);
assertMatches(fs, matcher2, "a.text", true);
assertMatches(fs, matcher2, "folder/c.java", true);
assertMatches(fs, matcher2, "d", false);
PathMatcher javaAndTextFileMatcher = fs.getPathMatcher(pattern2);
assertMatches(fs, javaAndTextFileMatcher, "a.java", true);
assertMatches(fs, javaAndTextFileMatcher, "a.text", true);
assertMatches(fs, javaAndTextFileMatcher, "folder/c.java", true);
assertMatches(fs, javaAndTextFileMatcher, "d", false);
}
}

Expand Down

0 comments on commit 64ca46e

Please sign in to comment.