test/jdk/javax/net/ssl/compatibility/TestCase.java
changeset 47955 0887e20e7173
equal deleted inserted replaced
47954:3148be499e41 47955:0887e20e7173
       
     1 /*
       
     2  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
       
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       
     4  *
       
     5  * This code is free software; you can redistribute it and/or modify it
       
     6  * under the terms of the GNU General Public License version 2 only, as
       
     7  * published by the Free Software Foundation.
       
     8  *
       
     9  * This code is distributed in the hope that it will be useful, but WITHOUT
       
    10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
       
    11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
       
    12  * version 2 for more details (a copy is included in the LICENSE file that
       
    13  * accompanied this code).
       
    14  *
       
    15  * You should have received a copy of the GNU General Public License version
       
    16  * 2 along with this work; if not, write to the Free Software Foundation,
       
    17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
       
    18  *
       
    19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
       
    20  * or visit www.oracle.com if you need additional information or have any
       
    21  * questions.
       
    22  */
       
    23 
       
    24 /*
       
    25  * A test case for a specific TLS communication use case between two JDKs.
       
    26  */
       
    27 public class TestCase {
       
    28 
       
    29     public final JdkInfo serverJdk;
       
    30     public final JdkInfo clientJdk;
       
    31     public final UseCase useCase;
       
    32 
       
    33     public final boolean negativeCaseOnServer;
       
    34     public final boolean negativeCaseOnClient;
       
    35 
       
    36     private Status status;
       
    37 
       
    38     public TestCase(JdkInfo serverJdk, JdkInfo clientJdk, UseCase useCase) {
       
    39         this.serverJdk = serverJdk;
       
    40         this.clientJdk = clientJdk;
       
    41         this.useCase = useCase;
       
    42 
       
    43         negativeCaseOnServer = useCase.negativeCase
       
    44                 || !serverJdk.supportsCipherSuite(useCase.cipherSuite);
       
    45         negativeCaseOnClient = useCase.negativeCase
       
    46                 || !clientJdk.supportsCipherSuite(useCase.cipherSuite);
       
    47     }
       
    48 
       
    49     public Status getStatus() {
       
    50         return status;
       
    51     }
       
    52 
       
    53     public void setStatus(Status status) {
       
    54         this.status = status;
       
    55     }
       
    56 
       
    57     @Override
       
    58     public String toString() {
       
    59         return Utils.join(Utils.PARAM_DELIMITER,
       
    60                 "ServerJDK=" + serverJdk.version,
       
    61                 "ClientJDK=" + clientJdk.version,
       
    62                 useCase.toString());
       
    63     }
       
    64 }