Clover Coverage Report - JDBC Support Utilities 1.0.22
Coverage timestamp: Wed Dec 31 1969 19:00:00 EST
13   42   3   4.33
0   33   0.23   3
3     1  
1    
 
  DatabaseUtilsTest       Line # 13 13 0% 3 16 0% 0.0
 
No Tests
 
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   
 
13    public class DatabaseUtilsTest extends TestCase {
 
14  0 toggle public static void main(String[] args) {
15  0 TestRunner.run(DatabaseUtilsTest.class);
16    }
17   
 
18  0 toggle @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   
 
25  0 toggle @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    }