Github user Tibor17 commented on a diff in the pull request:

    https://github.com/apache/maven-surefire/pull/171#discussion_r154193802
  
    --- Diff: 
maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefirePropertiesTest.java
 ---
    @@ -70,9 +70,35 @@ public void testConstructWithOther()
             src.setProperty( "b", "2" );
             SurefireProperties orderedProperties = new SurefireProperties( src 
);
             // Cannot make assumptions about insertion order
    -        assertEquals( 2, orderedProperties.size() );
    -
    +        int expectedCount = 0;
    +        // keys() uses the items property, more reliable to test than 
size(),
    +        // which is based on the Properties class
    +        // see https://issues.apache.org/jira/browse/SUREFIRE-1445
    +        Enumeration<Object> keys = orderedProperties.keys();
    +        while ( keys.hasMoreElements() ) {
    +            keys.nextElement();
    +            expectedCount++;
    +        }
    +        assertEquals( 2, expectedCount );
    --- End diff --
    
    We missed one method I mentioned before. Can you add an assert that method 
`getStringKeySet()` returns same elements like it is in `keys()`. Maybe this 
will help:
    `java.util.Collections#list(Enumeration): List`
    We can do it in both tests.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to