You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2020/01/09 07:40:00 UTC

[jira] [Work logged] (COLLECTIONS-737) The test FluentIterableTest.size should be split

     [ https://issues.apache.org/jira/browse/COLLECTIONS-737?focusedWorklogId=368833&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-368833 ]

ASF GitHub Bot logged work on COLLECTIONS-737:
----------------------------------------------

                Author: ASF GitHub Bot
            Created on: 09/Jan/20 07:39
            Start Date: 09/Jan/20 07:39
    Worklog Time Spent: 10m 
      Work Description: kinow commented on pull request #120: [COLLECTIONS-737] The test FluentIterableTest.size should be splitted
URL: https://github.com/apache/commons-collections/pull/120#discussion_r364592914
 
 

 ##########
 File path: src/test/java/org/apache/commons/collections4/FluentIterableTest.java
 ##########
 @@ -416,12 +416,6 @@ public void isEmpty() {
 
     @Test
     public void size() {
-        try {
-            FluentIterable.of((Iterable<?>) null).size();
-            fail("expecting NullPointerException");
-        } catch (final NullPointerException npe) {
-            // expected
-        }
 
 Review comment:
   This test was covering the case of `FluentIterable.of(null)`, but there are other tests covering it too. And as pointed by the OP, this method was - according to its name - supposed to test the `.size()` method. :+1: 
 
----------------------------------------------------------------
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:
users@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 368833)
    Time Spent: 40m  (was: 0.5h)

> The test FluentIterableTest.size should be split
> ------------------------------------------------
>
>                 Key: COLLECTIONS-737
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-737
>             Project: Commons Collections
>          Issue Type: Test
>          Components: Collection
>            Reporter: Pengyu Nie
>            Priority: Major
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> The first part of FluentIterableTest.size is not testing function
> FluentIterable.size (see code copied below). Actually,
> FluentIterable.size will not be invoked at all, because
> FluentIterable.of(null) will throw an NPE before that. This part
> should be extracted as a separate unit test like
> FluentIterableTest.ofNull.
> {code:java}
> try {
>     FluentIterable.of((Iterable<?>) null).size();
>     fail("expecting NullPointerException");
> } catch (final NullPointerException npe) {
>     // expected
> }{code}
> I'll create a pull request for this issue.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)