[
https://issues.apache.org/jira/browse/BEAM-3606?focusedWorklogId=254002&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-254002
]
ASF GitHub Bot logged work on BEAM-3606:
----------------------------------------
Author: ASF GitHub Bot
Created on: 04/Jun/19 20:13
Start Date: 04/Jun/19 20:13
Worklog Time Spent: 10m
Work Description: lukecwik commented on pull request #8759: [BEAM-3606]
Remove guava-testlib from sdks/java/core main dependency set
URL: https://github.com/apache/beam/pull/8759#discussion_r290477000
##########
File path:
sdks/java/core/src/main/java/org/apache/beam/sdk/io/fs/ResourceIdTester.java
##########
@@ -77,31 +80,58 @@ private static void validateResolvingIds(
allResourceIds.add(dir2);
// ResourceIds in equality groups.
- new EqualsTester()
- .addEqualityGroup(file1)
- .addEqualityGroup(file2, file2a)
- .addEqualityGroup(dir1, dir1.getCurrentDirectory())
- .addEqualityGroup(dir2, dir2a, dir2.getCurrentDirectory())
- .addEqualityGroup(baseDirectory, file1.getCurrentDirectory(),
file2.getCurrentDirectory())
- .testEquals();
+ assertEqualityGroups(
+ Arrays.asList(
+ Arrays.asList(file1),
+ Arrays.asList(file2, file2a),
+ Arrays.asList(dir1, dir1.getCurrentDirectory()),
+ Arrays.asList(dir2, dir2a, dir2.getCurrentDirectory()),
+ Arrays.asList(
+ baseDirectory, file1.getCurrentDirectory(),
file2.getCurrentDirectory())));
// ResourceId toString() in equality groups.
- new EqualsTester()
- .addEqualityGroup(file1.toString())
- .addEqualityGroup(file2.toString(), file2a.toString())
- .addEqualityGroup(dir1.toString(),
dir1.getCurrentDirectory().toString())
- .addEqualityGroup(dir2.toString(), dir2a.toString(),
dir2.getCurrentDirectory().toString())
- .addEqualityGroup(
- baseDirectory.toString(),
- file1.getCurrentDirectory().toString(),
- file2.getCurrentDirectory().toString())
- .testEquals();
+ assertEqualityGroups(
+ Arrays.asList(
+ Arrays.asList(file1.toString()),
+ Arrays.asList(file2.toString(), file2a.toString()),
+ Arrays.asList(dir1.toString(),
dir1.getCurrentDirectory().toString()),
+ Arrays.asList(dir2.toString(), dir2a.toString(),
dir2.getCurrentDirectory().toString()),
+ Arrays.asList(
+ baseDirectory.toString(),
+ file1.getCurrentDirectory().toString(),
+ file2.getCurrentDirectory().toString())));
// TODO: test resolving strings that need to be escaped.
// Possible spec: https://tools.ietf.org/html/rfc3986#section-2
// May need options to be filesystem-independent, e.g., if filesystems
ban certain chars.
}
+ /**
+ * Asserts that all elements in each group are equal to each other but not
equal to any other
+ * element in another group.
+ */
+ private static <T> void assertEqualityGroups(List<List<T>> equalityGroups) {
+ for (int i = 0; i < equalityGroups.size(); ++i) {
+ List<T> current = equalityGroups.get(i);
+ for (int j = 0; j < current.size(); ++j) {
+ for (int k = 0; k < current.size(); ++k) {
Review comment:
Since equals is implemented within the class a.equals(b) is not the same
thing as b.equals(a) if a and b are two different classes, we also test
a.equals(a) for posterity.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 254002)
Time Spent: 1h (was: 50m)
> Improve our relationship, or lack thereof, with Guava
> -----------------------------------------------------
>
> Key: BEAM-3606
> URL: https://issues.apache.org/jira/browse/BEAM-3606
> Project: Beam
> Issue Type: Improvement
> Components: io-java-gcp, runner-core, sdk-java-core
> Reporter: Kenneth Knowles
> Priority: Major
> Time Spent: 1h
> Remaining Estimate: 0h
>
> This is an umbrella task for things that might move us off Guava, such as
> replicating our own little utilities or moving to Java 8 features.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)