Path: blob/master/test/jdk/javax/net/ssl/TLSCommon/interop/TestCase.java
41154 views
/*1* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223import java.util.Map;2425/*26* A specific SSL/TLS communication test case on two peers.27*/28public class TestCase<U extends UseCase> {2930// The server side use case.31public final U serverCase;3233// The client side use case.34public final U clientCase;3536private Status status;3738public TestCase(U serverCase, U clientCase) {39this.serverCase = serverCase;40this.clientCase = clientCase;41}4243public TestCase<U> addServerProp(String prop, String value) {44serverCase.addProp(prop, value);45return this;46}4748public String getServerProp(String prop) {49return serverCase.getProp(prop);50}5152public TestCase<U> addAllServerProps(Map<String, String> props) {53serverCase.addAllProps(props);54return this;55}5657public Map<String, String> getAllServerProps() {58return serverCase.getAllProps();59}6061public TestCase<U> removeServerProp(String prop) {62serverCase.removeProp(prop);63return this;64}6566public TestCase<U> removeAllServerProp() {67serverCase.removeAllProps();68return this;69}7071public TestCase<U> addClientProp(String prop, String value) {72clientCase.addProp(prop, value);73return this;74}7576public String getClientProp(String prop) {77return clientCase.getProp(prop);78}7980public TestCase<U> addAllClientProps(Map<String, String> props) {81clientCase.addAllProps(props);82return this;83}8485public Map<String, String> getAllClientProps() {86return clientCase.getAllProps();87}8889public TestCase<U> removeClientProp(String prop) {90clientCase.removeProp(prop);91return this;92}9394public TestCase<U> removeAllClientProp() {95clientCase.removeAllProps();96return this;97}9899public Status getStatus() {100return status;101}102103public void setStatus(Status status) {104this.status = status;105}106107@Override108public String toString() {109return "Server: " + serverCase + "\n" + "Client: " + clientCase;110}111}112113114