SecureCacheResponseTest.java revision 561ee011997c6c2f1befbfaa9d5f0a99771c1d63
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 17package org.apache.harmony.luni.tests.java.net; 18 19import java.io.IOException; 20import java.io.InputStream; 21import java.net.SecureCacheResponse; 22import java.security.Principal; 23import java.security.cert.Certificate; 24import java.util.List; 25import java.util.Map; 26 27import javax.net.ssl.SSLPeerUnverifiedException; 28 29import junit.framework.TestCase; 30 31public 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() throws SSLPeerUnverifiedException { 62 // do nothing 63 return null; 64 } 65 66 @Override 67 public List<Certificate> getServerCertificateChain() throws SSLPeerUnverifiedException { 68 // do nothing 69 return null; 70 } 71 72 @Override 73 public InputStream getBody() throws IOException { 74 // do nothing 75 return null; 76 } 77 78 @Override 79 public Map<String, List<String>> getHeaders() throws IOException { 80 // do nothing 81 return null; 82 } 83 84 } 85} 86