1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
package org.kuali.rice.test.data; |
17 |
|
|
18 |
|
import org.apache.commons.lang.StringUtils; |
19 |
|
import org.kuali.rice.test.SQLDataLoader; |
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
|
@author |
25 |
|
|
26 |
|
|
|
|
| 0% |
Uncovered Elements: 33 (33) |
Complexity: 7 |
Complexity Density: 0.28 |
|
27 |
|
public class UnitTestDataUtils { |
28 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
29 |
0
|
public static void executeDataLoader(UnitTestData[] data) throws Exception {... |
30 |
0
|
for (UnitTestData d: data) { |
31 |
0
|
executeDataLoader(d); |
32 |
|
} |
33 |
|
} |
34 |
|
|
|
|
| 0% |
Uncovered Elements: 29 (29) |
Complexity: 6 |
Complexity Density: 0.26 |
|
35 |
0
|
public static void executeDataLoader(UnitTestData data) throws Exception {... |
36 |
0
|
SQLDataLoader sqlDataLoader; |
37 |
0
|
for (UnitTestData.Type type : data.order()) { |
38 |
0
|
switch (type) { |
39 |
0
|
case SQL_FILES : |
40 |
0
|
for (UnitTestFile file : data.sqlFiles()) { |
41 |
0
|
sqlDataLoader = new SQLDataLoader(file.filename(), file.delimiter()); |
42 |
0
|
sqlDataLoader.runSql(); |
43 |
|
} |
44 |
0
|
break; |
45 |
0
|
case SQL_STATEMENTS : |
46 |
0
|
for (UnitTestSql statement : data.sqlStatements()) { |
47 |
0
|
sqlDataLoader = new SQLDataLoader(statement.value()); |
48 |
0
|
sqlDataLoader.runSql(); |
49 |
|
} |
50 |
0
|
break; |
51 |
0
|
default: break; |
52 |
|
} |
53 |
|
} |
54 |
|
|
55 |
0
|
if (!StringUtils.isEmpty(data.filename())) { |
56 |
0
|
if (!StringUtils.isEmpty(data.value())) |
57 |
0
|
throw new RuntimeException("UnitTestDataArtifact may not specify both SQL file and content"); |
58 |
0
|
sqlDataLoader = new SQLDataLoader(data.filename(), data.delimiter()); |
59 |
0
|
sqlDataLoader.runSql(); |
60 |
0
|
} else if (!StringUtils.isEmpty(data.value())) { |
61 |
0
|
sqlDataLoader = new SQLDataLoader(data.value()); |
62 |
0
|
sqlDataLoader.runSql(); |
63 |
|
} |
64 |
|
} |
65 |
|
} |