1 |
|
package org.kuali.db; |
2 |
|
|
3 |
|
import java.util.HashSet; |
4 |
|
import java.util.List; |
5 |
|
import java.util.Set; |
6 |
|
|
7 |
|
import org.springframework.context.ApplicationContext; |
8 |
|
import org.springframework.context.support.ClassPathXmlApplicationContext; |
9 |
|
|
10 |
|
import junit.framework.TestCase; |
11 |
|
import junit.textui.TestRunner; |
12 |
|
|
|
|
| 0% |
Uncovered Elements: 16 (16) |
Complexity: 3 |
Complexity Density: 0.23 |
|
13 |
|
public class DatabaseUtilsTest extends TestCase { |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
14 |
0
|
public static void main(String[] args) {... |
15 |
0
|
TestRunner.run(DatabaseUtilsTest.class); |
16 |
|
} |
17 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
4
-
|
|
18 |
0
|
@SuppressWarnings("unchecked")... |
19 |
|
public void test1() { |
20 |
0
|
ApplicationContext ctx = new ClassPathXmlApplicationContext(JDBCUtils.JDBC_CONTEXT); |
21 |
0
|
List<JDBCConfiguration> databaseConfigs = (List<JDBCConfiguration>) ctx.getBean(JDBCUtils.JDBC_CONFIGURATIONS); |
22 |
0
|
assertNotNull(databaseConfigs); |
23 |
|
} |
24 |
|
|
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 1 |
Complexity Density: 0.11 |
4
-
|
|
25 |
0
|
@SuppressWarnings("unchecked")... |
26 |
|
public void test2() { |
27 |
0
|
ApplicationContext ctx = new ClassPathXmlApplicationContext(JDBCUtils.JDBC_CONTEXT); |
28 |
0
|
List<JDBCConfiguration> databaseConfigs = (List<JDBCConfiguration>) ctx.getBean(JDBCUtils.JDBC_CONFIGURATIONS); |
29 |
0
|
assertNotNull(databaseConfigs); |
30 |
0
|
DatabaseType[] typesArray = DatabaseType.values(); |
31 |
|
|
32 |
0
|
Set<DatabaseType> types = new HashSet<DatabaseType>(); |
33 |
0
|
for (DatabaseType type : typesArray) { |
34 |
0
|
types.add(type); |
35 |
|
} |
36 |
|
|
37 |
0
|
for (JDBCConfiguration databaseConfig : databaseConfigs) { |
38 |
0
|
assertTrue(types.contains(databaseConfig.getType())); |
39 |
|
} |
40 |
|
|
41 |
|
} |
42 |
|
} |