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