Clover Coverage Report - JDBC Support Utilities 1.0.24-SNAPSHOT
Coverage timestamp: Tue Oct 4 2011 20:45:01 EDT
13   42   3   4.33
0   33   0.23   3
3     1  
1    
 
  DatabaseUtilsTest       Line # 13 13 0% 3 2 87.5% 0.875
 
  (2)
 
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  1 toggle @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   
 
25  1 toggle @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    }