Clover Coverage Report - ksb-test 2.0.0-SNAPSHOT
Coverage timestamp: Wed Dec 31 1969 19:00:00 EST
27   165   29   0.93
0   103   1.07   14.5
29     1  
2    
 
  X509CredentialsSourceTest       Line # 35 5 0% 2 7 0% 0.0
  X509CredentialsSourceTest.KualiX509Certificate       Line # 55 22 0% 27 49 0% 0.0
 
No Tests
 
1    /*
2    * Copyright 2007 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
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    package org.kuali.rice.ksb.security.credentials;
17   
18    import org.junit.Before;
19    import org.junit.Test;
20   
21    import java.math.BigInteger;
22    import java.security.*;
23    import java.security.cert.*;
24    import java.util.Date;
25    import java.util.Set;
26   
27    import static org.junit.Assert.assertEquals;
28    import static org.junit.Assert.assertNotNull;
29    /**
30    *
31    * @author Kuali Rice Team (rice.collab@kuali.org)
32    * @since 0.9
33    *
34    */
 
35    public class X509CredentialsSourceTest {
36   
37    private X509CredentialsSource credentialsSource;
38   
39    private X509Certificate cert = new KualiX509Certificate();
40   
 
41  0 toggle @Before
42    public void setUp() throws Exception {
43  0 this.credentialsSource = new X509CredentialsSource(cert);
44    }
45   
 
46  0 toggle @Test
47    public void testX509Certificate() {
48  0 final X509Credentials context = (X509Credentials) this.credentialsSource.getCredentials("test");
49  0 assertNotNull(context);
50  0 final X509Certificate cert = context.getX509Certificate();
51   
52  0 assertEquals(this.cert, cert);
53    }
54   
 
55    public static class KualiX509Certificate extends X509Certificate {
56   
 
57  0 toggle protected KualiX509Certificate() {
58    // nothing to do
59    }
60   
 
61  0 toggle public void checkValidity() throws CertificateExpiredException, CertificateNotYetValidException {
62    // nothing to do
63    }
64   
 
65  0 toggle public void checkValidity(Date date) throws CertificateExpiredException, CertificateNotYetValidException {
66    // nothing to do
67    }
68   
 
69  0 toggle public int getBasicConstraints() {
70  0 return 0;
71    }
72   
 
73  0 toggle public Principal getIssuerDN() {
74  0 return null;
75    }
76   
 
77  0 toggle public boolean[] getIssuerUniqueID() {
78  0 return null;
79    }
80   
 
81  0 toggle public boolean[] getKeyUsage() {
82  0 return null;
83    }
84   
 
85  0 toggle public Date getNotAfter() {
86  0 return null;
87    }
88   
 
89  0 toggle public Date getNotBefore() {
90  0 return null;
91    }
92   
 
93  0 toggle public BigInteger getSerialNumber() {
94  0 return null;
95    }
96   
 
97  0 toggle public String getSigAlgName() {
98  0 return null;
99    }
100   
 
101  0 toggle public String getSigAlgOID() {
102  0 return null;
103    }
104   
 
105  0 toggle public byte[] getSigAlgParams() {
106  0 return null;
107    }
108   
 
109  0 toggle public byte[] getSignature() {
110  0 return null;
111    }
112   
 
113  0 toggle public Principal getSubjectDN() {
114  0 return null;
115    }
116   
 
117  0 toggle public boolean[] getSubjectUniqueID() {
118  0 return null;
119    }
120   
 
121  0 toggle public byte[] getTBSCertificate() throws CertificateEncodingException {
122  0 return null;
123    }
124   
 
125  0 toggle public int getVersion() {
126  0 return 0;
127    }
128   
 
129  0 toggle public Set<String> getCriticalExtensionOIDs() {
130  0 return null;
131    }
132   
 
133  0 toggle public byte[] getExtensionValue(String arg0) {
134  0 return null;
135    }
136   
 
137  0 toggle public Set<String> getNonCriticalExtensionOIDs() {
138  0 return null;
139    }
140   
 
141  0 toggle public boolean hasUnsupportedCriticalExtension() {
142  0 return false;
143    }
144   
 
145  0 toggle public byte[] getEncoded() throws CertificateEncodingException {
146  0 return null;
147    }
148   
 
149  0 toggle public PublicKey getPublicKey() {
150  0 return null;
151    }
152   
 
153  0 toggle public String toString() {
154  0 return null;
155    }
156   
 
157  0 toggle public void verify(PublicKey arg0, String arg1) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException {
158    // nothing to do
159    }
160   
 
161  0 toggle public void verify(PublicKey arg0) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException {
162    // nothing to do
163    }
164    }
165    }