| 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 |
|
|
|
|
|
| 87.5% |
Uncovered Elements: 2 (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 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
1
PASS
|
|
| 18 |
1
|
@SuppressWarnings("unchecked")... |
| 19 |
|
public void test1() { |
| 20 |
1
|
ApplicationContext ctx = new ClassPathXmlApplicationContext(JDBCUtils.JDBC_CONTEXT); |
| 21 |
1
|
List<JDBCConfiguration> databaseConfigs = (List<JDBCConfiguration>) ctx.getBean(JDBCUtils.JDBC_CONFIGURATIONS); |
| 22 |
1
|
assertNotNull(databaseConfigs); |
| 23 |
|
} |
| 24 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 1 |
Complexity Density: 0.11 |
1
PASS
|
|
| 25 |
1
|
@SuppressWarnings("unchecked")... |
| 26 |
|
public void test2() { |
| 27 |
1
|
ApplicationContext ctx = new ClassPathXmlApplicationContext(JDBCUtils.JDBC_CONTEXT); |
| 28 |
1
|
List<JDBCConfiguration> databaseConfigs = (List<JDBCConfiguration>) ctx.getBean(JDBCUtils.JDBC_CONFIGURATIONS); |
| 29 |
1
|
assertNotNull(databaseConfigs); |
| 30 |
1
|
DatabaseType[] typesArray = DatabaseType.values(); |
| 31 |
|
|
| 32 |
1
|
Set<DatabaseType> types = new HashSet<DatabaseType>(); |
| 33 |
1
|
for (DatabaseType type : typesArray) { |
| 34 |
9
|
types.add(type); |
| 35 |
|
} |
| 36 |
|
|
| 37 |
1
|
for (JDBCConfiguration databaseConfig : databaseConfigs) { |
| 38 |
10
|
assertTrue(types.contains(databaseConfig.getType())); |
| 39 |
|
} |
| 40 |
|
|
| 41 |
|
} |
| 42 |
|
} |