test/jdk/java/net/httpclient/ThrowingPushPromisesAsLinesCustom.java
author chegar
Wed, 20 Jun 2018 09:05:57 -0700
changeset 50681 4254bed3c09d
child 52121 934969c63223
permissions -rw-r--r--
8204679: HTTP Client refresh Reviewed-by: chegar, dfuchs, michaelm Contributed-by: Chris Hegarty <chris.hegarty@oracle.com>, Daniel Fuchs <daniel.fuchs@oracle.com>, Michael McMahon <michael.x.mcmahon@oracle.com>, Pavel Rappo <pavel.rappo@oracle.com>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
50681
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
     1
/*
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
     2
 * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
     4
 *
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
     7
 * published by the Free Software Foundation.
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
     8
 *
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    13
 * accompanied this code).
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    14
 *
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    18
 *
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    21
 * questions.
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    22
 */
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    23
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    24
/*
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    25
 * @test
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    26
 * @summary Tests what happens when push promise handlers and their
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    27
 *          response body handlers and subscribers throw unexpected exceptions.
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    28
 * @library /lib/testlibrary http2/server
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    29
 * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    30
  *       ReferenceTracker AbstractThrowingPushPromises ThrowingPushPromisesAsLinesCustom
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    31
 * @modules java.base/sun.net.www.http
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    32
 *          java.net.http/jdk.internal.net.http.common
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    33
 *          java.net.http/jdk.internal.net.http.frame
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    34
 *          java.net.http/jdk.internal.net.http.hpack
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    35
 * @run testng/othervm -Djdk.internal.httpclient.debug=true ThrowingPushPromisesAsLinesCustom
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    36
 */
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    37
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    38
import org.testng.annotations.Test;
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    39
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    40
public class ThrowingPushPromisesAsLinesCustom extends AbstractThrowingPushPromises {
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    41
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    42
    @Test(dataProvider = "customVariants")
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    43
    public void testThrowingAsLines(String uri, boolean sameClient, Thrower thrower)
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    44
            throws Exception {
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    45
        super.testThrowingAsLinesImpl(uri, sameClient, thrower);
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    46
    }
4254bed3c09d 8204679: HTTP Client refresh
chegar
parents:
diff changeset
    47
}