Clover Coverage Report - KS LUM 1.1.0-SNAPSHOT (Aggregated)
Coverage timestamp: Tue Feb 15 2011 05:34:20 EST
20   79   5   6.67
0   52   0.25   3
3     1.67  
1    
 
  TestLrcDaoImpl       Line # 33 20 0% 5 2 91.3% 0.9130435
 
  (3)
 
1    /**
2    * Copyright 2010 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10    * software distributed under the License is distributed on an "AS IS"
11    * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12    * or implied. See the License for the specific language governing
13    * permissions and limitations under the License.
14    */
15   
16    package org.kuali.student.lum.lrc.dao.impl;
17   
18    import static org.junit.Assert.assertEquals;
19    import static org.junit.Assert.assertNotNull;
20    import static org.junit.Assert.assertTrue;
21   
22    import java.util.List;
23   
24    import org.junit.Test;
25    import org.kuali.student.common.test.spring.AbstractTransactionalDaoTest;
26    import org.kuali.student.common.test.spring.Dao;
27    import org.kuali.student.common.test.spring.PersistenceFileLocation;
28    import org.kuali.student.core.exceptions.DoesNotExistException;
29    import org.kuali.student.lum.lrc.dao.LrcDao;
30    import org.kuali.student.lum.lrc.entity.ResultComponentType;
31   
32    @PersistenceFileLocation("classpath:META-INF/lrc-persistence.xml")
 
33    public class TestLrcDaoImpl extends AbstractTransactionalDaoTest {
34    @Dao(value = "org.kuali.student.lum.lrc.dao.impl.LrcDaoImpl", testSqlFile = "classpath:ks-lrc.sql")
35    public LrcDao dao;
36   
 
37  1 toggle @Test
38    public void testGetResultComponentIdsByResult() {
39  1 List<String> rcis = dao.getResultComponentIdsByResult("LRC-RESULT_VALUE-CREDIT-1", "resultComponentType.credential");
40  1 assertNotNull(rcis);
41  1 assertEquals(1, rcis.size());
42   
43  1 rcis = dao.getResultComponentIdsByResult("LRC-RESULT_VALUE-CREDIT-1x", "resultComponentType.credential");
44  1 assertTrue(rcis.isEmpty());
45   
46  1 rcis = dao.getResultComponentIdsByResult("LRC-RESULT_VALUE-CREDIT-1", "resultComponentType.credentialx");
47  1 assertTrue(rcis.isEmpty());
48    }
49   
 
50  1 toggle @Test
51    public void testGetResultComponentIdsByResultComponentType() {
52  1 List<String> rcis = dao.getResultComponentIdsByResultComponentType("resultComponentType.credential");
53  1 assertNotNull(rcis);
54  1 assertEquals(1, rcis.size());
55   
56  1 rcis = dao.getResultComponentIdsByResultComponentType("resultComponentType.credentialx");
57  1 assertTrue(rcis.isEmpty());
58    }
59   
 
60  1 toggle @Test
61    public void testGetResultComponentType() {
62  1 try {
63  1 @SuppressWarnings("unused")
64    ResultComponentType rcti = dao.getResultComponentType("resultComponentType.credential");
65  1 assertTrue(true);
66    } catch (DoesNotExistException e) {
67  0 assertTrue(false);
68    }
69   
70  1 try {
71  1 @SuppressWarnings("unused")
72    ResultComponentType rcti = dao.getResultComponentType("resultComponentType.credentialYYY");
73  0 assertTrue(false);
74    } catch (DoesNotExistException e) {
75  1 assertTrue(true);
76    }
77   
78    }
79    }