# HG changeset patch # User chegar # Date 1510159187 0 # Node ID 5a59fa72a72a2b8b6346dbe74ee76287820e6485 # Parent d85e7823dce99934298bbc5140a7e0aad3266105 http-client-branch: additional Header test scenarios diff -r d85e7823dce9 -r 5a59fa72a72a test/jdk/java/net/httpclient/HeadersTest2.java --- a/test/jdk/java/net/httpclient/HeadersTest2.java Wed Nov 08 16:24:56 2017 +0000 +++ b/test/jdk/java/net/httpclient/HeadersTest2.java Wed Nov 08 16:39:47 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,10 +46,6 @@ * Each list contains header-name, header-value, header-name, header-value * sequences. The test creates two requests with the two lists * and compares the HttpHeaders objects returned from the requests - * - * @param succeed - * @param l1 - * @param l2 */ CompareTest(boolean succeed, List l1, List l2) { this.succeed = succeed; @@ -74,6 +70,13 @@ print(nameValues2); throw new RuntimeException(); } + + // Ensures that headers never equal a non-HttpHeaders type + if (h1.equals(new Object())) + throw new RuntimeException("Unexpected h1 equals Object"); + + if (h2.equals(r1)) + throw new RuntimeException("Unexpected h2 equals r1"); } static void print(List list) {