Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/jdk/javax/net/ssl/TLSCommon/interop/TestCase.java
41154 views
1
/*
2
* Copyright (c) 2020, 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
import java.util.Map;
25
26
/*
27
* A specific SSL/TLS communication test case on two peers.
28
*/
29
public class TestCase<U extends UseCase> {
30
31
// The server side use case.
32
public final U serverCase;
33
34
// The client side use case.
35
public final U clientCase;
36
37
private Status status;
38
39
public TestCase(U serverCase, U clientCase) {
40
this.serverCase = serverCase;
41
this.clientCase = clientCase;
42
}
43
44
public TestCase<U> addServerProp(String prop, String value) {
45
serverCase.addProp(prop, value);
46
return this;
47
}
48
49
public String getServerProp(String prop) {
50
return serverCase.getProp(prop);
51
}
52
53
public TestCase<U> addAllServerProps(Map<String, String> props) {
54
serverCase.addAllProps(props);
55
return this;
56
}
57
58
public Map<String, String> getAllServerProps() {
59
return serverCase.getAllProps();
60
}
61
62
public TestCase<U> removeServerProp(String prop) {
63
serverCase.removeProp(prop);
64
return this;
65
}
66
67
public TestCase<U> removeAllServerProp() {
68
serverCase.removeAllProps();
69
return this;
70
}
71
72
public TestCase<U> addClientProp(String prop, String value) {
73
clientCase.addProp(prop, value);
74
return this;
75
}
76
77
public String getClientProp(String prop) {
78
return clientCase.getProp(prop);
79
}
80
81
public TestCase<U> addAllClientProps(Map<String, String> props) {
82
clientCase.addAllProps(props);
83
return this;
84
}
85
86
public Map<String, String> getAllClientProps() {
87
return clientCase.getAllProps();
88
}
89
90
public TestCase<U> removeClientProp(String prop) {
91
clientCase.removeProp(prop);
92
return this;
93
}
94
95
public TestCase<U> removeAllClientProp() {
96
clientCase.removeAllProps();
97
return this;
98
}
99
100
public Status getStatus() {
101
return status;
102
}
103
104
public void setStatus(Status status) {
105
this.status = status;
106
}
107
108
@Override
109
public String toString() {
110
return "Server: " + serverCase + "\n" + "Client: " + clientCase;
111
}
112
}
113
114