RFR: 8195649: reorganize tests for java.util.Optional

Stuart Marks stuart.marks at oracle.com
Fri Mar 30 19:03:01 UTC 2018


Thanks.

Regarding groups="unit" I wasn't entirely sure what to do about it. My first 
thought was that it's disused and to remove it, but then I looked and found that 
a bunch of other tests also declare themselves in the "unit" group:

test/jdk/java/io/BufferedReader/Lines.java
test/jdk/java/lang/String/StringJoinTest.java
test/jdk/java/net/Socks/SocksIPv6Test.java
test/jdk/java/nio/file/Files/BytesAndLines.java
test/jdk/java/nio/file/Files/StreamTest.java
test/jdk/java/util/Collections/SingletonIterator.java
test/jdk/java/util/Collections/UnmodifiableMapEntrySet.java
test/jdk/java/util/Collections/Wrappers.java
test/jdk/java/util/Comparator/BasicTest.java
test/jdk/java/util/Comparator/TypeTest.java
test/jdk/java/util/function/BiFunction/BiFunctionTest.java
test/jdk/java/util/function/BinaryOperator/BasicTest.java
test/jdk/java/util/logging/LoggerSupplierAPIsTest.java
test/jdk/java/util/Map/EntryComparators.java
test/jdk/java/util/StringJoiner/StringJoinerTest.java

I still think it's disused -- I can't find anything in the test makefiles or 
test group files that mentions it. But if we get rid of it, I'd rather have all 
the files cleaned up at once. I'll leave it in for now.

s'marks


On 3/30/18 10:35 AM, Paul Sandoz wrote:
> Very nice +1.
> 
> You can probably remove the "groups = “unit”" from the @Test declarations.
> 
> Paul.
> 
> 
>> On Mar 29, 2018, at 6:12 PM, Stuart Marks <stuart.marks at oracle.com> wrote:
>>
>> Hi all,
>>
>> Please review this changeset, which reorganizes (basically rewrites) the tests for Optional and Optional{Double,Int,Long}. The new arrangement clusters all the assertions together into check* methods. These are then called on the results of the various factories and other monadic operations. This reduced the amount of test code and actually increased the test coverage slightly.
>>
>> Bug:
>>
>> 	https://bugs.openjdk.java.net/browse/JDK-8195649
>>
>> Webrev:
>>
>> 	http://cr.openjdk.java.net/~smarks/reviews/8195649/webrev.0/
>>
>> Thanks,
>>
>> s'marks
> 


More information about the core-libs-dev mailing list