You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2019/10/30 15:24:05 UTC
[commons-collections] branch master updated: the before testcase of
testTransformedBag_decorateTransform is test for
TransformeddBag.transformedBag not for SortedBag (#98)
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-collections.git
The following commit(s) were added to refs/heads/master by this push:
new 448c99e the before testcase of testTransformedBag_decorateTransform is test for TransformeddBag.transformedBag not for SortedBag (#98)
448c99e is described below
commit 448c99e35e438ef0b38e544b293b59d3174d185f
Author: dota17 <50...@users.noreply.github.com>
AuthorDate: Wed Oct 30 23:23:56 2019 +0800
the before testcase of testTransformedBag_decorateTransform is test for TransformeddBag.transformedBag not for SortedBag (#98)
just fix it to test SortedBag
---
.../apache/commons/collections4/bag/TransformedSortedBagTest.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/test/java/org/apache/commons/collections4/bag/TransformedSortedBagTest.java b/src/test/java/org/apache/commons/collections4/bag/TransformedSortedBagTest.java
index 7aa065d..a3949ef 100644
--- a/src/test/java/org/apache/commons/collections4/bag/TransformedSortedBagTest.java
+++ b/src/test/java/org/apache/commons/collections4/bag/TransformedSortedBagTest.java
@@ -64,12 +64,12 @@ public class TransformedSortedBagTest<T> extends AbstractSortedBagTest<T> {
}
public void testTransformedBag_decorateTransform() {
- final Bag<Object> originalBag = new TreeBag<>();
+ final TreeBag<T> originalBag = new TreeBag<T>();
final Object[] els = new Object[] {"1", "3", "5", "7", "2", "4", "6"};
for (final Object el : els) {
- originalBag.add(el);
+ originalBag.add((T) el);
}
- final Bag<?> bag = TransformedBag.transformedBag(originalBag, TransformedCollectionTest.STRING_TO_INTEGER_TRANSFORMER);
+ final SortedBag<T> bag = TransformedSortedBag.transformedSortedBag(originalBag, (Transformer<T, T>) TransformedCollectionTest.STRING_TO_INTEGER_TRANSFORMER);
assertEquals(els.length, bag.size());
for (final Object el : els) {
assertEquals(true, bag.contains(Integer.valueOf((String) el)));