01: /* Licensed to the Apache Software Foundation (ASF) under one or more
02: * contributor license agreements. See the NOTICE file distributed with
03: * this work for additional information regarding copyright ownership.
04: * The ASF licenses this file to You under the Apache License, Version 2.0
05: * (the "License"); you may not use this file except in compliance with
06: * the License. You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.apache.harmony.luni.tests.java.net;
18:
19: import java.io.IOException;
20: import java.io.InputStream;
21: import java.net.SecureCacheResponse;
22: import java.security.Principal;
23: import java.security.cert.Certificate;
24: import java.util.List;
25: import java.util.Map;
26:
27: import javax.net.ssl.SSLPeerUnverifiedException;
28:
29: import junit.framework.TestCase;
30:
31: public class SecureCacheResponseTest extends TestCase {
32:
33: public void testSecureCacheResponse() {
34: // test constructor
35: SecureCacheResponse sc = new MockCacheResponse();
36: // nothing happened
37: assertNull(sc.getCipherSuite());
38: }
39:
40: class MockCacheResponse extends SecureCacheResponse {
41:
42: @Override
43: public String getCipherSuite() {
44: // do nothing
45: return null;
46: }
47:
48: @Override
49: public List<Certificate> getLocalCertificateChain() {
50: // do nothing
51: return null;
52: }
53:
54: @Override
55: public Principal getLocalPrincipal() {
56: // do nothing
57: return null;
58: }
59:
60: @Override
61: public Principal getPeerPrincipal()
62: throws SSLPeerUnverifiedException {
63: // do nothing
64: return null;
65: }
66:
67: @Override
68: public List<Certificate> getServerCertificateChain()
69: throws SSLPeerUnverifiedException {
70: // do nothing
71: return null;
72: }
73:
74: @Override
75: public InputStream getBody() throws IOException {
76: // do nothing
77: return null;
78: }
79:
80: @Override
81: public Map<String, List<String>> getHeaders()
82: throws IOException {
83: // do nothing
84: return null;
85: }
86:
87: }
88: }
|