• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Licensed to the Apache Software Foundation (ASF) under one or more
2  * contributor license agreements.  See the NOTICE file distributed with
3  * this work for additional information regarding copyright ownership.
4  * The ASF licenses this file to You under the Apache License, Version 2.0
5  * (the "License"); you may not use this file except in compliance with
6  * the License.  You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
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 
testSecureCacheResponse()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
getCipherSuite()43         public String getCipherSuite() {
44             // do nothing
45             return null;
46         }
47 
48         @Override
getLocalCertificateChain()49         public List<Certificate> getLocalCertificateChain() {
50             // do nothing
51             return null;
52         }
53 
54         @Override
getLocalPrincipal()55         public Principal getLocalPrincipal() {
56             // do nothing
57             return null;
58         }
59 
60         @Override
getPeerPrincipal()61         public Principal getPeerPrincipal() throws SSLPeerUnverifiedException {
62             // do nothing
63             return null;
64         }
65 
66         @Override
getServerCertificateChain()67         public List<Certificate> getServerCertificateChain() throws SSLPeerUnverifiedException {
68             // do nothing
69             return null;
70         }
71 
72         @Override
getBody()73         public InputStream getBody() throws IOException {
74             // do nothing
75             return null;
76         }
77 
78         @Override
getHeaders()79         public Map<String, List<String>> getHeaders() throws IOException {
80             // do nothing
81             return null;
82         }
83 
84     }
85 }
86