1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
package org.kuali.rice.test.lifecycles; |
17 |
|
|
18 |
|
import org.apache.log4j.Logger; |
19 |
|
import org.kuali.rice.core.api.config.property.ConfigContext; |
20 |
|
import org.kuali.rice.core.api.lifecycle.BaseLifecycle; |
21 |
|
import org.kuali.rice.test.SQLDataLoader; |
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
@author |
30 |
|
|
|
|
| 0% |
Uncovered Elements: 17 (17) |
Complexity: 6 |
Complexity Density: 0.55 |
|
31 |
|
public class SQLDataLoaderLifecycle extends BaseLifecycle { |
32 |
|
private static final Logger LOG = Logger.getLogger(SQLDataLoaderLifecycle.class); |
33 |
|
|
34 |
|
private SQLDataLoader sqlDataLoader; |
35 |
|
|
36 |
|
private String filename; |
37 |
|
|
38 |
|
private String delimiter; |
39 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
40 |
0
|
public SQLDataLoaderLifecycle() {... |
41 |
0
|
this("classpath:DefaultTestData.sql", ";"); |
42 |
|
} |
43 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
44 |
0
|
public SQLDataLoaderLifecycle(String filename, String delimiter) {... |
45 |
0
|
this.filename = filename; |
46 |
0
|
this.delimiter = delimiter; |
47 |
|
} |
48 |
|
|
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 3 |
Complexity Density: 0.43 |
|
49 |
0
|
public void start() throws Exception {... |
50 |
0
|
String useSqlDataLoaderLifecycle = ConfigContext.getCurrentContextConfig().getProperty("use.sqlDataLoaderLifecycle"); |
51 |
0
|
if (useSqlDataLoaderLifecycle != null && !Boolean.valueOf(useSqlDataLoaderLifecycle)) { |
52 |
0
|
LOG.debug("Skipping SQLDataLoaderLifecycle due to property: use.sqlDataLoaderLifecycle=" + useSqlDataLoaderLifecycle); |
53 |
0
|
return; |
54 |
|
} |
55 |
|
|
56 |
0
|
sqlDataLoader = new SQLDataLoader(filename, delimiter); |
57 |
0
|
sqlDataLoader.runSql(); |
58 |
0
|
super.start(); |
59 |
|
} |
60 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
61 |
0
|
public void stop() throws Exception {... |
62 |
|
|
63 |
0
|
super.stop(); |
64 |
|
} |
65 |
|
} |