[jira] [Work logged] (COLLECTIONS-811) Consider integration Guava testlib tests
[ https://issues.apache.org/jira/browse/COLLECTIONS-811?focusedWorklogId=778762&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-778762 ] ASF GitHub Bot logged work on COLLECTIONS-811: -- Author: ASF GitHub Bot Created on: 06/Jun/22 21:14 Start Date: 06/Jun/22 21:14 Worklog Time Spent: 10m Work Description: garydgregory merged PR #301: URL: https://github.com/apache/commons-collections/pull/301 Issue Time Tracking --- Worklog Id: (was: 778762) Time Spent: 2h 50m (was: 2h 40m) > Consider integration Guava testlib tests > > > Key: COLLECTIONS-811 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-811 > Project: Commons Collections > Issue Type: Test >Affects Versions: 4.4 >Reporter: Bruno P. Kinoshita >Assignee: Bruno P. Kinoshita >Priority: Minor > Fix For: 4.5 > > Time Spent: 2h 50m > Remaining Estimate: 0h > > In COLLECTIONS-802 an issue reported was found with the help of Google Guava > testlib tests. > Maybe we could either have something similar (i.e. build ourselves?), use > Google Guava's testlib, or find another similar solution. From what I > understood, it uses a factory function to create an implementation of a > collection interface (e.g. Map) and then runs a series of functional tests > over the created object, failing tests if a contract is broken (e.g. > iterating a map doesn't leave the next-object as null, as it was the case of > the 802 issue). -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Work logged] (COLLECTIONS-811) Consider integration Guava testlib tests
[ https://issues.apache.org/jira/browse/COLLECTIONS-811?focusedWorklogId=778759&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-778759 ] ASF GitHub Bot logged work on COLLECTIONS-811: -- Author: ASF GitHub Bot Created on: 06/Jun/22 21:05 Start Date: 06/Jun/22 21:05 Worklog Time Spent: 10m Work Description: kinow commented on code in PR #301: URL: https://github.com/apache/commons-collections/pull/301#discussion_r890569602 ## src/test/java/org/apache/commons/collections4/GuavaTestlibTest.java: ## @@ -0,0 +1,126 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.collections4; + +import java.util.List; +import java.util.Map; +import java.util.function.Supplier; + +import org.apache.commons.collections4.list.TreeList; +import org.apache.commons.collections4.map.HashedMap; +import org.apache.commons.collections4.map.LRUMap; +import org.apache.commons.collections4.map.LinkedMap; +import org.apache.commons.collections4.map.ReferenceMap; + +import com.google.common.collect.testing.ListTestSuiteBuilder; +import com.google.common.collect.testing.MapTestSuiteBuilder; +import com.google.common.collect.testing.TestStringListGenerator; +import com.google.common.collect.testing.TestStringMapGenerator; +import com.google.common.collect.testing.features.CollectionFeature; +import com.google.common.collect.testing.features.CollectionSize; +import com.google.common.collect.testing.features.Feature; +import com.google.common.collect.testing.features.ListFeature; +import com.google.common.collect.testing.features.MapFeature; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * This test uses Google's Guava Testlib testing libraries to validate the + * contract of collection classes in Commons Collections. This was introduced + * after COLLECTIONS-802, where the issue reported was found with Testlib, + * with thanks to Ben Manes. Review Comment: Done @garydgregory ! Thanks ## src/test/java/org/apache/commons/collections4/GuavaTestlibTest.java: ## @@ -0,0 +1,126 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.collections4; + +import java.util.List; +import java.util.Map; +import java.util.function.Supplier; + +import org.apache.commons.collections4.list.TreeList; +import org.apache.commons.collections4.map.HashedMap; +import org.apache.commons.collections4.map.LRUMap; +import org.apache.commons.collections4.map.LinkedMap; +import org.apache.commons.collections4.map.ReferenceMap; + +import com.google.common.collect.testing.ListTestSuiteBuilder; +import com.google.common.collect.testing.MapTestSuiteBuilder; +import com.google.common.collect.testing.TestStringListGenerator; +import com.google.common.collect.testing.TestStringMapGenerator; +import com.google.common.collect.testing.features.CollectionFeature; +import com.google.common.collect.testing.features.CollectionSize; +import com.google.common.collect.testing.features.Feature; +import com.google.common.collect.testing.features.ListFeature; +import com.google.common.collect.testing.features.MapFeature; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * This test uses Google's Guava Testlib testing libraries to v
[jira] [Work logged] (COLLECTIONS-811) Consider integration Guava testlib tests
[ https://issues.apache.org/jira/browse/COLLECTIONS-811?focusedWorklogId=778692&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-778692 ] ASF GitHub Bot logged work on COLLECTIONS-811: -- Author: ASF GitHub Bot Created on: 06/Jun/22 16:45 Start Date: 06/Jun/22 16:45 Worklog Time Spent: 10m Work Description: ben-manes commented on code in PR #301: URL: https://github.com/apache/commons-collections/pull/301#discussion_r890338589 ## src/test/java/org/apache/commons/collections4/GuavaTestlibTest.java: ## @@ -0,0 +1,126 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.collections4; + +import java.util.List; +import java.util.Map; +import java.util.function.Supplier; + +import org.apache.commons.collections4.list.TreeList; +import org.apache.commons.collections4.map.HashedMap; +import org.apache.commons.collections4.map.LRUMap; +import org.apache.commons.collections4.map.LinkedMap; +import org.apache.commons.collections4.map.ReferenceMap; + +import com.google.common.collect.testing.ListTestSuiteBuilder; +import com.google.common.collect.testing.MapTestSuiteBuilder; +import com.google.common.collect.testing.TestStringListGenerator; +import com.google.common.collect.testing.TestStringMapGenerator; +import com.google.common.collect.testing.features.CollectionFeature; +import com.google.common.collect.testing.features.CollectionSize; +import com.google.common.collect.testing.features.Feature; +import com.google.common.collect.testing.features.ListFeature; +import com.google.common.collect.testing.features.MapFeature; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * This test uses Google's Guava Testlib testing libraries to validate the + * contract of collection classes in Commons Collections. This was introduced + * after COLLECTIONS-802, where the issue reported was found with Testlib, + * with thanks to Ben Manes. Review Comment: I am fine having it removed and appreciate the thanks. Issue Time Tracking --- Worklog Id: (was: 778692) Time Spent: 2.5h (was: 2h 20m) > Consider integration Guava testlib tests > > > Key: COLLECTIONS-811 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-811 > Project: Commons Collections > Issue Type: Test >Affects Versions: 4.4 >Reporter: Bruno P. Kinoshita >Assignee: Bruno P. Kinoshita >Priority: Minor > Fix For: 4.5 > > Time Spent: 2.5h > Remaining Estimate: 0h > > In COLLECTIONS-802 an issue reported was found with the help of Google Guava > testlib tests. > Maybe we could either have something similar (i.e. build ourselves?), use > Google Guava's testlib, or find another similar solution. From what I > understood, it uses a factory function to create an implementation of a > collection interface (e.g. Map) and then runs a series of functional tests > over the created object, failing tests if a contract is broken (e.g. > iterating a map doesn't leave the next-object as null, as it was the case of > the 802 issue). -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Work logged] (COLLECTIONS-811) Consider integration Guava testlib tests
[ https://issues.apache.org/jira/browse/COLLECTIONS-811?focusedWorklogId=778646&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-778646 ] ASF GitHub Bot logged work on COLLECTIONS-811: -- Author: ASF GitHub Bot Created on: 06/Jun/22 14:29 Start Date: 06/Jun/22 14:29 Worklog Time Spent: 10m Work Description: garydgregory commented on code in PR #301: URL: https://github.com/apache/commons-collections/pull/301#discussion_r890210693 ## src/test/java/org/apache/commons/collections4/GuavaTestlibTest.java: ## @@ -0,0 +1,126 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.collections4; + +import java.util.List; +import java.util.Map; +import java.util.function.Supplier; + +import org.apache.commons.collections4.list.TreeList; +import org.apache.commons.collections4.map.HashedMap; +import org.apache.commons.collections4.map.LRUMap; +import org.apache.commons.collections4.map.LinkedMap; +import org.apache.commons.collections4.map.ReferenceMap; + +import com.google.common.collect.testing.ListTestSuiteBuilder; +import com.google.common.collect.testing.MapTestSuiteBuilder; +import com.google.common.collect.testing.TestStringListGenerator; +import com.google.common.collect.testing.TestStringMapGenerator; +import com.google.common.collect.testing.features.CollectionFeature; +import com.google.common.collect.testing.features.CollectionSize; +import com.google.common.collect.testing.features.Feature; +import com.google.common.collect.testing.features.ListFeature; +import com.google.common.collect.testing.features.MapFeature; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * This test uses Google's Guava Testlib testing libraries to validate the + * contract of collection classes in Commons Collections. This was introduced + * after COLLECTIONS-802, where the issue reported was found with Testlib, + * with thanks to Ben Manes. Review Comment: We don't use `@author` tags, so would you please move attribution to `changes.xml` and/or `pom.xml`? Issue Time Tracking --- Worklog Id: (was: 778646) Time Spent: 2h 20m (was: 2h 10m) > Consider integration Guava testlib tests > > > Key: COLLECTIONS-811 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-811 > Project: Commons Collections > Issue Type: Test >Affects Versions: 4.4 >Reporter: Bruno P. Kinoshita >Assignee: Bruno P. Kinoshita >Priority: Minor > Fix For: 4.5 > > Time Spent: 2h 20m > Remaining Estimate: 0h > > In COLLECTIONS-802 an issue reported was found with the help of Google Guava > testlib tests. > Maybe we could either have something similar (i.e. build ourselves?), use > Google Guava's testlib, or find another similar solution. From what I > understood, it uses a factory function to create an implementation of a > collection interface (e.g. Map) and then runs a series of functional tests > over the created object, failing tests if a contract is broken (e.g. > iterating a map doesn't leave the next-object as null, as it was the case of > the 802 issue). -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Work logged] (COLLECTIONS-811) Consider integration Guava testlib tests
[ https://issues.apache.org/jira/browse/COLLECTIONS-811?focusedWorklogId=764804&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-764804 ] ASF GitHub Bot logged work on COLLECTIONS-811: -- Author: ASF GitHub Bot Created on: 01/May/22 21:04 Start Date: 01/May/22 21:04 Worklog Time Spent: 10m Work Description: ben-manes commented on code in PR #301: URL: https://github.com/apache/commons-collections/pull/301#discussion_r862521177 ## src/test/java/org/apache/commons/collections4/GuavaTestlibTest.java: ## @@ -0,0 +1,76 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.collections4; + +import java.util.Map; +import java.util.function.Supplier; + +import org.apache.commons.collections4.map.HashedMap; +import org.apache.commons.collections4.map.LRUMap; +import org.apache.commons.collections4.map.LinkedMap; +import org.apache.commons.collections4.map.ReferenceMap; + +import com.google.common.collect.testing.MapTestSuiteBuilder; +import com.google.common.collect.testing.TestStringMapGenerator; +import com.google.common.collect.testing.features.CollectionFeature; +import com.google.common.collect.testing.features.CollectionSize; +import com.google.common.collect.testing.features.MapFeature; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * This test uses Google's Guava Testlib testing libraries to validate the + * contract of collection classes in Commons Collections. This was introduced + * after COLLECTIONS-802, where the issue reported was found with Testlib, + * with thanks to Ben Manes. + * + * @since 4.5.0 + * @see https://github.com/google/guava/tree/master/guava-testlib";>https://github.com/google/guava/tree/master/guava-testlib + * @see https://issues.apache.org/jira/browse/COLLECTIONS-802";>https://issues.apache.org/jira/browse/COLLECTIONS-802 + */ +public final class GuavaTestlibTest extends TestCase { + +public static Test suite() { Review Comment: At least in the case of `GrowthList` some of the failures are expected since it modified the `List` contract, ```java * Decorates another List to make it seamlessly grow when * indices larger than the list size are used on add and set, * avoiding most IndexOutOfBoundsExceptions. ``` Technically a violation of the contract, but expected. ```java * @throws IndexOutOfBoundsException if the index is out of range * ({@code index < 0 || index > size()}) */ void add(int index, E element); ``` You can use `.suppressing(Method...)` to disable those cases. Issue Time Tracking --- Worklog Id: (was: 764804) Time Spent: 2h 10m (was: 2h) > Consider integration Guava testlib tests > > > Key: COLLECTIONS-811 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-811 > Project: Commons Collections > Issue Type: Test >Affects Versions: 4.4 >Reporter: Bruno P. Kinoshita >Assignee: Bruno P. Kinoshita >Priority: Minor > Fix For: 4.5 > > Time Spent: 2h 10m > Remaining Estimate: 0h > > In COLLECTIONS-802 an issue reported was found with the help of Google Guava > testlib tests. > Maybe we could either have something similar (i.e. build ourselves?), use > Google Guava's testlib, or find another similar solution. From what I > understood, it uses a factory function to create an implementation of a > collection interface (e.g. Map) and then runs a series of functional tests > over the created object, failing tests if a contract is broken (e.g. > iterating a map doesn't leave the next-object as null, as it was the case of > the 802 issue). -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Work logged] (COLLECTIONS-811) Consider integration Guava testlib tests
[ https://issues.apache.org/jira/browse/COLLECTIONS-811?focusedWorklogId=764732&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-764732 ] ASF GitHub Bot logged work on COLLECTIONS-811: -- Author: ASF GitHub Bot Created on: 01/May/22 06:13 Start Date: 01/May/22 06:13 Worklog Time Spent: 10m Work Description: codecov-commenter commented on PR #301: URL: https://github.com/apache/commons-collections/pull/301#issuecomment-1114144824 # [Codecov](https://codecov.io/gh/apache/commons-collections/pull/301?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report > Merging [#301](https://codecov.io/gh/apache/commons-collections/pull/301?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (919b449) into [master](https://codecov.io/gh/apache/commons-collections/commit/1677daceab74895fdf5056c9a48aa94f9e709fb9?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (1677dac) will **increase** coverage by `0.10%`. > The diff coverage is `n/a`. ```diff @@ Coverage Diff @@ ## master #301 +/- ## + Coverage 85.87% 85.97% +0.10% - Complexity 4676 4678 +2 Files 292 292 Lines 1346913469 Branches 1955 1955 + Hits 1156611580 +14 + Misses 1326 1321 -5 + Partials577 568 -9 ``` | [Impacted Files](https://codecov.io/gh/apache/commons-collections/pull/301?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | | |---|---|---| | [...he/commons/collections4/map/AbstractHashedMap.java](https://codecov.io/gh/apache/commons-collections/pull/301/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2NvbW1vbnMvY29sbGVjdGlvbnM0L21hcC9BYnN0cmFjdEhhc2hlZE1hcC5qYXZh) | `93.82% <0.00%> (+0.98%)` | :arrow_up: | | [...commons/collections4/map/AbstractReferenceMap.java](https://codecov.io/gh/apache/commons-collections/pull/301/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2NvbW1vbnMvY29sbGVjdGlvbnM0L21hcC9BYnN0cmFjdFJlZmVyZW5jZU1hcC5qYXZh) | `91.48% <0.00%> (+1.11%)` | :arrow_up: | | [...org/apache/commons/collections4/list/TreeList.java](https://codecov.io/gh/apache/commons-collections/pull/301/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2NvbW1vbnMvY29sbGVjdGlvbnM0L2xpc3QvVHJlZUxpc3QuamF2YQ==) | `93.56% <0.00%> (+1.87%)` | :arrow_up: | -- [Continue to review full report at Codecov](https://codecov.io/gh/apache/commons-collections/pull/301?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://codecov.io/gh/apache/commons-collections/pull/301?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [1677dac...919b449](https://codecov.io/gh/apache/commons-collections/pull/301?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Issue Time Tracking --- Worklog Id: (was: 764732) Time Spent: 2h (was: 1h 50m) > Consider integration Guava testlib tests > > > Key: COLLECTIONS-811 > URL: https://issues.apache.org/jira/b
[jira] [Work logged] (COLLECTIONS-811) Consider integration Guava testlib tests
[ https://issues.apache.org/jira/browse/COLLECTIONS-811?focusedWorklogId=764731&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-764731 ] ASF GitHub Bot logged work on COLLECTIONS-811: -- Author: ASF GitHub Bot Created on: 01/May/22 06:09 Start Date: 01/May/22 06:09 Worklog Time Spent: 10m Work Description: kinow commented on code in PR #301: URL: https://github.com/apache/commons-collections/pull/301#discussion_r862427902 ## src/test/java/org/apache/commons/collections4/GuavaTestlibTest.java: ## @@ -0,0 +1,76 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.collections4; + +import java.util.Map; +import java.util.function.Supplier; + +import org.apache.commons.collections4.map.HashedMap; +import org.apache.commons.collections4.map.LRUMap; +import org.apache.commons.collections4.map.LinkedMap; +import org.apache.commons.collections4.map.ReferenceMap; + +import com.google.common.collect.testing.MapTestSuiteBuilder; +import com.google.common.collect.testing.TestStringMapGenerator; +import com.google.common.collect.testing.features.CollectionFeature; +import com.google.common.collect.testing.features.CollectionSize; +import com.google.common.collect.testing.features.MapFeature; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * This test uses Google's Guava Testlib testing libraries to validate the + * contract of collection classes in Commons Collections. This was introduced + * after COLLECTIONS-802, where the issue reported was found with Testlib, + * with thanks to Ben Manes. + * + * @since 4.5.0 + * @see https://github.com/google/guava/tree/master/guava-testlib";>https://github.com/google/guava/tree/master/guava-testlib + * @see https://issues.apache.org/jira/browse/COLLECTIONS-802";>https://issues.apache.org/jira/browse/COLLECTIONS-802 + */ +public final class GuavaTestlibTest extends TestCase { + +public static Test suite() { Review Comment: Yeah, same for me with your code. I'm updating the PR now with the `suiteMap` and `suiteTest` methods, but leaving only `TreeList` tests enabled for now. I left a `TODO` marker so we can revisit it later. Thanks! Issue Time Tracking --- Worklog Id: (was: 764731) Time Spent: 1h 50m (was: 1h 40m) > Consider integration Guava testlib tests > > > Key: COLLECTIONS-811 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-811 > Project: Commons Collections > Issue Type: Test >Affects Versions: 4.4 >Reporter: Bruno P. Kinoshita >Assignee: Bruno P. Kinoshita >Priority: Minor > Fix For: 4.5 > > Time Spent: 1h 50m > Remaining Estimate: 0h > > In COLLECTIONS-802 an issue reported was found with the help of Google Guava > testlib tests. > Maybe we could either have something similar (i.e. build ourselves?), use > Google Guava's testlib, or find another similar solution. From what I > understood, it uses a factory function to create an implementation of a > collection interface (e.g. Map) and then runs a series of functional tests > over the created object, failing tests if a contract is broken (e.g. > iterating a map doesn't leave the next-object as null, as it was the case of > the 802 issue). -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Work logged] (COLLECTIONS-811) Consider integration Guava testlib tests
[ https://issues.apache.org/jira/browse/COLLECTIONS-811?focusedWorklogId=764727&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-764727 ] ASF GitHub Bot logged work on COLLECTIONS-811: -- Author: ASF GitHub Bot Created on: 01/May/22 05:06 Start Date: 01/May/22 05:06 Worklog Time Spent: 10m Work Description: ben-manes commented on code in PR #301: URL: https://github.com/apache/commons-collections/pull/301#discussion_r862423560 ## src/test/java/org/apache/commons/collections4/GuavaTestlibTest.java: ## @@ -0,0 +1,76 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.collections4; + +import java.util.Map; +import java.util.function.Supplier; + +import org.apache.commons.collections4.map.HashedMap; +import org.apache.commons.collections4.map.LRUMap; +import org.apache.commons.collections4.map.LinkedMap; +import org.apache.commons.collections4.map.ReferenceMap; + +import com.google.common.collect.testing.MapTestSuiteBuilder; +import com.google.common.collect.testing.TestStringMapGenerator; +import com.google.common.collect.testing.features.CollectionFeature; +import com.google.common.collect.testing.features.CollectionSize; +import com.google.common.collect.testing.features.MapFeature; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * This test uses Google's Guava Testlib testing libraries to validate the + * contract of collection classes in Commons Collections. This was introduced + * after COLLECTIONS-802, where the issue reported was found with Testlib, + * with thanks to Ben Manes. + * + * @since 4.5.0 + * @see https://github.com/google/guava/tree/master/guava-testlib";>https://github.com/google/guava/tree/master/guava-testlib + * @see https://issues.apache.org/jira/browse/COLLECTIONS-802";>https://issues.apache.org/jira/browse/COLLECTIONS-802 + */ +public final class GuavaTestlibTest extends TestCase { + +public static Test suite() { Review Comment: I can get a little further using the following, where `TreeList` passes but the others don't. The remaining failures look like actual mistakes. ```java public static Test suite() { TestSuite test = new TestSuite(); test.addTest(suiteList("TreeList", TreeList::new)); test.addTest(suiteList("GrowthList", GrowthList::new, CollectionFeature.SERIALIZABLE)); test.addTest(suiteList("CursorableLinkedList", CursorableLinkedList::new, CollectionFeature.SERIALIZABLE)); return test; } public static Test suiteList(String name, Supplier> factory, Feature... features) { var suite = ListTestSuiteBuilder.using(new TestStringListGenerator() { @Override protected List create(String[] elements) { List list = factory.get(); for (String element : elements) { list.add(element); } return list; } }).named(name) .withFeatures(CollectionSize.ANY, ListFeature.GENERAL_PURPOSE, ListFeature.REMOVE_OPERATIONS, CollectionFeature.ALLOWS_NULL_VALUES, CollectionFeature.DESCENDING_VIEW, CollectionFeature.SUBSET_VIEW); suite.withFeatures(features); return suite.createTestSuite(); } ``` Issue Time Tracking --- Worklog Id: (was: 764727) Time Spent: 1h 40m (was: 1.5h) > Consider integration Guava testlib tests > > > Key: COLLECTIONS-811 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-811 > Project: Commons Collections > Issue Type: Test >Affects Versions: 4.4 >Reporter: Bruno P. Kinoshita >Assignee: Bruno P. Kinoshita >Priority: Minor > Fix For: 4.5 > > Time Spent: 1h 40m > Remaining Estimate: 0h > > In COLLECTIONS-802 an issue reported was found with the help of Google Guava > testlib tests. > Maybe we could either have something similar (i.e. build ourselves?), use > Google Guava's
[jira] [Work logged] (COLLECTIONS-811) Consider integration Guava testlib tests
[ https://issues.apache.org/jira/browse/COLLECTIONS-811?focusedWorklogId=764713&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-764713 ] ASF GitHub Bot logged work on COLLECTIONS-811: -- Author: ASF GitHub Bot Created on: 01/May/22 00:22 Start Date: 01/May/22 00:22 Worklog Time Spent: 10m Work Description: kinow commented on code in PR #301: URL: https://github.com/apache/commons-collections/pull/301#discussion_r862407940 ## src/test/java/org/apache/commons/collections4/GuavaTestlibTest.java: ## @@ -0,0 +1,76 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.collections4; + +import java.util.Map; +import java.util.function.Supplier; + +import org.apache.commons.collections4.map.HashedMap; +import org.apache.commons.collections4.map.LRUMap; +import org.apache.commons.collections4.map.LinkedMap; +import org.apache.commons.collections4.map.ReferenceMap; + +import com.google.common.collect.testing.MapTestSuiteBuilder; +import com.google.common.collect.testing.TestStringMapGenerator; +import com.google.common.collect.testing.features.CollectionFeature; +import com.google.common.collect.testing.features.CollectionSize; +import com.google.common.collect.testing.features.MapFeature; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * This test uses Google's Guava Testlib testing libraries to validate the + * contract of collection classes in Commons Collections. This was introduced + * after COLLECTIONS-802, where the issue reported was found with Testlib, + * with thanks to Ben Manes. + * + * @since 4.5.0 + * @see https://github.com/google/guava/tree/master/guava-testlib";>https://github.com/google/guava/tree/master/guava-testlib + * @see https://issues.apache.org/jira/browse/COLLECTIONS-802";>https://issues.apache.org/jira/browse/COLLECTIONS-802 + */ +public final class GuavaTestlibTest extends TestCase { + +public static Test suite() { Review Comment: Thanks @ben-manes ! I will leave the List, Set, etc., for follow-up issues. I had some 5 minutes to test it, and managed to write some tests for Lists, but these tests found issues in some of the Lists. I'd have to confirm if the features I selected are actually pertinent to the List implementations I used, or if we have other bugs :slightly_smiling_face: So it's definitely useful, but I prefer to get this merged first for Maps, and later add other Map, List, Set implementations too :+1: Here's the diff of what I had FWIW, thanks!!! Bruno ```diff diff --git a/src/test/java/org/apache/commons/collections4/GuavaTestlibTest.java b/src/test/java/org/apache/commons/collections4/GuavaTestlibTest.java index 88108c6a..7d068e17 100644 - Issue Time Tracking --- Worklog Id: (was: 764713) Time Spent: 1.5h (was: 1h 20m) > Consider integration Guava testlib tests > > > Key: COLLECTIONS-811 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-811 > Project: Commons Collections > Issue Type: Test >Affects Versions: 4.4 >Reporter: Bruno P. Kinoshita >Assignee: Bruno P. Kinoshita >Priority: Minor > Fix For: 4.5 > > Time Spent: 1.5h > Remaining Estimate: 0h > > In COLLECTIONS-802 an issue reported was found with the help of Google Guava > testlib tests. > Maybe we could either have something similar (i.e. build ourselves?), use > Google Guava's testlib, or find another similar solution. From what I > understood, it uses a factory function to create an implementation of a > collection interface (e.g. Map) and then runs a series of functional tests > over the created object, failing tests if a contract is broken (e.g. > iterating a map doesn't leave the next-object as null, as it was the case of > the 802 issue). -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Work logged] (COLLECTIONS-811) Consider integration Guava testlib tests
[ https://issues.apache.org/jira/browse/COLLECTIONS-811?focusedWorklogId=764712&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-764712 ] ASF GitHub Bot logged work on COLLECTIONS-811: -- Author: ASF GitHub Bot Created on: 01/May/22 00:11 Start Date: 01/May/22 00:11 Worklog Time Spent: 10m Work Description: kinow commented on PR #301: URL: https://github.com/apache/commons-collections/pull/301#issuecomment-1114077324 Rebased. Issue Time Tracking --- Worklog Id: (was: 764712) Time Spent: 1h 20m (was: 1h 10m) > Consider integration Guava testlib tests > > > Key: COLLECTIONS-811 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-811 > Project: Commons Collections > Issue Type: Test >Affects Versions: 4.4 >Reporter: Bruno P. Kinoshita >Assignee: Bruno P. Kinoshita >Priority: Minor > Fix For: 4.5 > > Time Spent: 1h 20m > Remaining Estimate: 0h > > In COLLECTIONS-802 an issue reported was found with the help of Google Guava > testlib tests. > Maybe we could either have something similar (i.e. build ourselves?), use > Google Guava's testlib, or find another similar solution. From what I > understood, it uses a factory function to create an implementation of a > collection interface (e.g. Map) and then runs a series of functional tests > over the created object, failing tests if a contract is broken (e.g. > iterating a map doesn't leave the next-object as null, as it was the case of > the 802 issue). -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Work logged] (COLLECTIONS-811) Consider integration Guava testlib tests
[ https://issues.apache.org/jira/browse/COLLECTIONS-811?focusedWorklogId=763728&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-763728 ] ASF GitHub Bot logged work on COLLECTIONS-811: -- Author: ASF GitHub Bot Created on: 28/Apr/22 17:19 Start Date: 28/Apr/22 17:19 Worklog Time Spent: 10m Work Description: ben-manes commented on code in PR #301: URL: https://github.com/apache/commons-collections/pull/301#discussion_r861137680 ## src/test/java/org/apache/commons/collections4/GuavaTestlibTest.java: ## @@ -0,0 +1,76 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.collections4; + +import java.util.Map; +import java.util.function.Supplier; + +import org.apache.commons.collections4.map.HashedMap; +import org.apache.commons.collections4.map.LRUMap; +import org.apache.commons.collections4.map.LinkedMap; +import org.apache.commons.collections4.map.ReferenceMap; + +import com.google.common.collect.testing.MapTestSuiteBuilder; +import com.google.common.collect.testing.TestStringMapGenerator; +import com.google.common.collect.testing.features.CollectionFeature; +import com.google.common.collect.testing.features.CollectionSize; +import com.google.common.collect.testing.features.MapFeature; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * This test uses Google's Guava Testlib testing libraries to validate the + * contract of collection classes in Commons Collections. This was introduced + * after COLLECTIONS-802, where the issue reported was found with Testlib, + * with thanks to Ben Manes. + * + * @since 4.5.0 + * @see https://github.com/google/guava/tree/master/guava-testlib";>https://github.com/google/guava/tree/master/guava-testlib + * @see https://issues.apache.org/jira/browse/COLLECTIONS-802";>https://issues.apache.org/jira/browse/COLLECTIONS-802 + */ +public final class GuavaTestlibTest extends TestCase { + +public static Test suite() { Review Comment: The collection tests are JUnit3-based, and JUnit 4/5 have runners for supporting their older versions. Since those versions are not backwards compatible otherwise, it's a framework limitation. I think it is unlikely for Guava to revise the tests as it works well enough, even if old code. FYI there are more test cases you could add (List, Set, etc) and I only did a quick check for Maps. (I also [borrowed](https://github.com/ben-manes/caffeine/tree/master/caffeine/src/test/java/com/github/benmanes/caffeine) your tests for my implementation as another sanity check) Issue Time Tracking --- Worklog Id: (was: 763728) Time Spent: 1h 10m (was: 1h) > Consider integration Guava testlib tests > > > Key: COLLECTIONS-811 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-811 > Project: Commons Collections > Issue Type: Test >Affects Versions: 4.4 >Reporter: Bruno P. Kinoshita >Assignee: Bruno P. Kinoshita >Priority: Minor > Fix For: 4.5 > > Time Spent: 1h 10m > Remaining Estimate: 0h > > In COLLECTIONS-802 an issue reported was found with the help of Google Guava > testlib tests. > Maybe we could either have something similar (i.e. build ourselves?), use > Google Guava's testlib, or find another similar solution. From what I > understood, it uses a factory function to create an implementation of a > collection interface (e.g. Map) and then runs a series of functional tests > over the created object, failing tests if a contract is broken (e.g. > iterating a map doesn't leave the next-object as null, as it was the case of > the 802 issue). -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Work logged] (COLLECTIONS-811) Consider integration Guava testlib tests
[ https://issues.apache.org/jira/browse/COLLECTIONS-811?focusedWorklogId=763487&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-763487 ] ASF GitHub Bot logged work on COLLECTIONS-811: -- Author: ASF GitHub Bot Created on: 28/Apr/22 12:56 Start Date: 28/Apr/22 12:56 Worklog Time Spent: 10m Work Description: kinow commented on code in PR #301: URL: https://github.com/apache/commons-collections/pull/301#discussion_r860855659 ## src/test/java/org/apache/commons/collections4/GuavaTestlibTest.java: ## @@ -0,0 +1,76 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.collections4; + +import java.util.Map; +import java.util.function.Supplier; + +import org.apache.commons.collections4.map.HashedMap; +import org.apache.commons.collections4.map.LRUMap; +import org.apache.commons.collections4.map.LinkedMap; +import org.apache.commons.collections4.map.ReferenceMap; + +import com.google.common.collect.testing.MapTestSuiteBuilder; +import com.google.common.collect.testing.TestStringMapGenerator; +import com.google.common.collect.testing.features.CollectionFeature; +import com.google.common.collect.testing.features.CollectionSize; +import com.google.common.collect.testing.features.MapFeature; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * This test uses Google's Guava Testlib testing libraries to validate the + * contract of collection classes in Commons Collections. This was introduced + * after COLLECTIONS-802, where the issue reported was found with Testlib, + * with thanks to Ben Manes. + * + * @since 4.5.0 + * @see https://github.com/google/guava/tree/master/guava-testlib";>https://github.com/google/guava/tree/master/guava-testlib + * @see https://issues.apache.org/jira/browse/COLLECTIONS-802";>https://issues.apache.org/jira/browse/COLLECTIONS-802 + */ +public final class GuavaTestlibTest extends TestCase { + +public static Test suite() { Review Comment: I thought about that too, but I don't know how to translate the test suite created programmatically to JUnit 5 :disappointed_relieved: ping @ben-manes Issue Time Tracking --- Worklog Id: (was: 763487) Time Spent: 1h (was: 50m) > Consider integration Guava testlib tests > > > Key: COLLECTIONS-811 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-811 > Project: Commons Collections > Issue Type: Test >Affects Versions: 4.4 >Reporter: Bruno P. Kinoshita >Assignee: Bruno P. Kinoshita >Priority: Minor > Fix For: 4.5 > > Time Spent: 1h > Remaining Estimate: 0h > > In COLLECTIONS-802 an issue reported was found with the help of Google Guava > testlib tests. > Maybe we could either have something similar (i.e. build ourselves?), use > Google Guava's testlib, or find another similar solution. From what I > understood, it uses a factory function to create an implementation of a > collection interface (e.g. Map) and then runs a series of functional tests > over the created object, failing tests if a contract is broken (e.g. > iterating a map doesn't leave the next-object as null, as it was the case of > the 802 issue). -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Work logged] (COLLECTIONS-811) Consider integration Guava testlib tests
[ https://issues.apache.org/jira/browse/COLLECTIONS-811?focusedWorklogId=763423&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-763423 ] ASF GitHub Bot logged work on COLLECTIONS-811: -- Author: ASF GitHub Bot Created on: 28/Apr/22 10:58 Start Date: 28/Apr/22 10:58 Worklog Time Spent: 10m Work Description: garydgregory commented on code in PR #301: URL: https://github.com/apache/commons-collections/pull/301#discussion_r860754312 ## src/test/java/org/apache/commons/collections4/GuavaTestlibTest.java: ## @@ -0,0 +1,76 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.collections4; + +import java.util.Map; +import java.util.function.Supplier; + +import org.apache.commons.collections4.map.HashedMap; +import org.apache.commons.collections4.map.LRUMap; +import org.apache.commons.collections4.map.LinkedMap; +import org.apache.commons.collections4.map.ReferenceMap; + +import com.google.common.collect.testing.MapTestSuiteBuilder; +import com.google.common.collect.testing.TestStringMapGenerator; +import com.google.common.collect.testing.features.CollectionFeature; +import com.google.common.collect.testing.features.CollectionSize; +import com.google.common.collect.testing.features.MapFeature; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * This test uses Google's Guava Testlib testing libraries to validate the + * contract of collection classes in Commons Collections. This was introduced + * after COLLECTIONS-802, where the issue reported was found with Testlib, + * with thanks to Ben Manes. + * + * @since 4.5.0 + * @see https://github.com/google/guava/tree/master/guava-testlib";>https://github.com/google/guava/tree/master/guava-testlib + * @see https://issues.apache.org/jira/browse/COLLECTIONS-802";>https://issues.apache.org/jira/browse/COLLECTIONS-802 + */ +public final class GuavaTestlibTest extends TestCase { + +public static Test suite() { Review Comment: Can this be done in the JUnit 4 or 5 style? Issue Time Tracking --- Worklog Id: (was: 763423) Time Spent: 50m (was: 40m) > Consider integration Guava testlib tests > > > Key: COLLECTIONS-811 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-811 > Project: Commons Collections > Issue Type: Test >Affects Versions: 4.4 >Reporter: Bruno P. Kinoshita >Assignee: Bruno P. Kinoshita >Priority: Minor > Fix For: 4.5 > > Time Spent: 50m > Remaining Estimate: 0h > > In COLLECTIONS-802 an issue reported was found with the help of Google Guava > testlib tests. > Maybe we could either have something similar (i.e. build ourselves?), use > Google Guava's testlib, or find another similar solution. From what I > understood, it uses a factory function to create an implementation of a > collection interface (e.g. Map) and then runs a series of functional tests > over the created object, failing tests if a contract is broken (e.g. > iterating a map doesn't leave the next-object as null, as it was the case of > the 802 issue). -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Work logged] (COLLECTIONS-811) Consider integration Guava testlib tests
[ https://issues.apache.org/jira/browse/COLLECTIONS-811?focusedWorklogId=763421&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-763421 ] ASF GitHub Bot logged work on COLLECTIONS-811: -- Author: ASF GitHub Bot Created on: 28/Apr/22 10:44 Start Date: 28/Apr/22 10:44 Worklog Time Spent: 10m Work Description: kinow commented on PR #301: URL: https://github.com/apache/commons-collections/pull/301#issuecomment-1112055774 And didn't notice a difference in build time. Executed a few times locally as well, and can confirm it doesn't bring any brittleness to our tests. Looks like a good addition to our test code. Thanks for showing us this @ben-manes ! Issue Time Tracking --- Worklog Id: (was: 763421) Time Spent: 40m (was: 0.5h) > Consider integration Guava testlib tests > > > Key: COLLECTIONS-811 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-811 > Project: Commons Collections > Issue Type: Test >Affects Versions: 4.4 >Reporter: Bruno P. Kinoshita >Assignee: Bruno P. Kinoshita >Priority: Minor > Fix For: 4.5 > > Time Spent: 40m > Remaining Estimate: 0h > > In COLLECTIONS-802 an issue reported was found with the help of Google Guava > testlib tests. > Maybe we could either have something similar (i.e. build ourselves?), use > Google Guava's testlib, or find another similar solution. From what I > understood, it uses a factory function to create an implementation of a > collection interface (e.g. Map) and then runs a series of functional tests > over the created object, failing tests if a contract is broken (e.g. > iterating a map doesn't leave the next-object as null, as it was the case of > the 802 issue). -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Work logged] (COLLECTIONS-811) Consider integration Guava testlib tests
[ https://issues.apache.org/jira/browse/COLLECTIONS-811?focusedWorklogId=763420&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-763420 ] ASF GitHub Bot logged work on COLLECTIONS-811: -- Author: ASF GitHub Bot Created on: 28/Apr/22 10:42 Start Date: 28/Apr/22 10:42 Worklog Time Spent: 10m Work Description: kinow commented on PR #301: URL: https://github.com/apache/commons-collections/pull/301#issuecomment-1112054324 Rebased. Confirmed the license is compatible (AL as well). Waiting for CI, and will update `changes.xml` in the meantime. Then it should be ready for review :+1: Issue Time Tracking --- Worklog Id: (was: 763420) Time Spent: 0.5h (was: 20m) > Consider integration Guava testlib tests > > > Key: COLLECTIONS-811 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-811 > Project: Commons Collections > Issue Type: Test >Reporter: Bruno P. Kinoshita >Assignee: Bruno P. Kinoshita >Priority: Minor > Time Spent: 0.5h > Remaining Estimate: 0h > > In COLLECTIONS-802 an issue reported was found with the help of Google Guava > testlib tests. > Maybe we could either have something similar (i.e. build ourselves?), use > Google Guava's testlib, or find another similar solution. From what I > understood, it uses a factory function to create an implementation of a > collection interface (e.g. Map) and then runs a series of functional tests > over the created object, failing tests if a contract is broken (e.g. > iterating a map doesn't leave the next-object as null, as it was the case of > the 802 issue). -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Work logged] (COLLECTIONS-811) Consider integration Guava testlib tests
[ https://issues.apache.org/jira/browse/COLLECTIONS-811?focusedWorklogId=763202&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-763202 ] ASF GitHub Bot logged work on COLLECTIONS-811: -- Author: ASF GitHub Bot Created on: 28/Apr/22 00:14 Start Date: 28/Apr/22 00:14 Worklog Time Spent: 10m Work Description: ben-manes commented on PR #301: URL: https://github.com/apache/commons-collections/pull/301#issuecomment-598917 /cc @kevinb9n 🙂 Issue Time Tracking --- Worklog Id: (was: 763202) Time Spent: 20m (was: 10m) > Consider integration Guava testlib tests > > > Key: COLLECTIONS-811 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-811 > Project: Commons Collections > Issue Type: Test >Reporter: Bruno P. Kinoshita >Assignee: Bruno P. Kinoshita >Priority: Minor > Time Spent: 20m > Remaining Estimate: 0h > > In COLLECTIONS-802 an issue reported was found with the help of Google Guava > testlib tests. > Maybe we could either have something similar (i.e. build ourselves?), use > Google Guava's testlib, or find another similar solution. From what I > understood, it uses a factory function to create an implementation of a > collection interface (e.g. Map) and then runs a series of functional tests > over the created object, failing tests if a contract is broken (e.g. > iterating a map doesn't leave the next-object as null, as it was the case of > the 802 issue). -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Work logged] (COLLECTIONS-811) Consider integration Guava testlib tests
[ https://issues.apache.org/jira/browse/COLLECTIONS-811?focusedWorklogId=76&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-76 ] ASF GitHub Bot logged work on COLLECTIONS-811: -- Author: ASF GitHub Bot Created on: 26/Apr/22 10:40 Start Date: 26/Apr/22 10:40 Worklog Time Spent: 10m Work Description: kinow opened a new pull request, #301: URL: https://github.com/apache/commons-collections/pull/301 Adding the test class from @ben-manes, pending merge of #300 Issue Time Tracking --- Worklog Id: (was: 76) Remaining Estimate: 0h Time Spent: 10m > Consider integration Guava testlib tests > > > Key: COLLECTIONS-811 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-811 > Project: Commons Collections > Issue Type: Test >Reporter: Bruno P. Kinoshita >Assignee: Bruno P. Kinoshita >Priority: Minor > Time Spent: 10m > Remaining Estimate: 0h > > In COLLECTIONS-802 an issue reported was found with the help of Google Guava > testlib tests. > Maybe we could either have something similar (i.e. build ourselves?), use > Google Guava's testlib, or find another similar solution. From what I > understood, it uses a factory function to create an implementation of a > collection interface (e.g. Map) and then runs a series of functional tests > over the created object, failing tests if a contract is broken (e.g. > iterating a map doesn't leave the next-object as null, as it was the case of > the 802 issue). -- This message was sent by Atlassian Jira (v8.20.7#820007)