1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
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") |
|
|
| 91.3% |
Uncovered Elements: 2 (23) |
Complexity: 5 |
Complexity Density: 0.25 |
|
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 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 1 |
Complexity Density: 0.14 |
1
PASS
|
|
37 |
1
|
@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 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
1
PASS
|
|
50 |
1
|
@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 |
|
|
|
|
| 75% |
Uncovered Elements: 2 (8) |
Complexity: 3 |
Complexity Density: 0.38 |
1
PASS
|
|
60 |
1
|
@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 |
|
} |