| 1 |
|
package guru.mikelue.foxglove.vendor; |
| 2 |
|
|
| 3 |
|
import java.io.IOException; |
| 4 |
|
|
| 5 |
|
import org.springframework.beans.factory.annotation.Autowired; |
| 6 |
|
import org.springframework.context.ApplicationContext; |
| 7 |
|
import org.springframework.jdbc.core.JdbcTemplate; |
| 8 |
|
import org.springframework.transaction.annotation.Transactional; |
| 9 |
|
|
| 10 |
|
import org.junit.jupiter.api.*; |
| 11 |
|
|
| 12 |
|
import guru.mikelue.foxglove.TableFacet; |
| 13 |
|
import guru.mikelue.foxglove.annotation.GenData; |
| 14 |
|
import guru.mikelue.foxglove.annotation.TableFacetsSource; |
| 15 |
|
import guru.mikelue.foxglove.jdbc.JdbcTableFacet; |
| 16 |
|
import guru.mikelue.foxglove.test.AbstractVendorTestBase; |
| 17 |
|
|
| 18 |
|
@Tag("vendor-hsqldb") |
| |
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 5 |
Complexity Density: 1.67 |
|
| 19 |
|
public class HsqldbTest extends AbstractVendorTestBase { |
| 20 |
|
private final static int RANDOM_ROWS = gen().ints().range(5, 10).get(); |
| 21 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 22 |
0 |
public HsqldbTest() {}... |
| 23 |
|
|
| |
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 24 |
0 |
@BeforeAll... |
| 25 |
|
static void beforeAllSetup( |
| 26 |
|
@Autowired ApplicationContext appContext, |
| 27 |
|
@Autowired JdbcTemplate jdbcTemplate |
| 28 |
|
) throws IOException { |
| 29 |
0 |
dropTables(jdbcTemplate, "ap_types"); |
| 30 |
|
|
| 31 |
0 |
build("classpath:hsqldb-types.sql", appContext); |
| 32 |
|
} |
| 33 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 34 |
0 |
@BeforeEach... |
| 35 |
|
void setup() {} |
| 36 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 37 |
0 |
@AfterEach... |
| 38 |
|
void tearDown() {} |
| 39 |
|
|
| 40 |
|
@TableFacetsSource |
| 41 |
|
TableFacet defaultData = JdbcTableFacet.builder("ap_types") |
| 42 |
|
.numberOfRows(RANDOM_ROWS) |
| 43 |
|
.column("tp_color").fixed("green") |
| 44 |
|
.column("tp_int_array").fixed( |
| 45 |
|
new Integer[] { 1, 2, 3 } |
| 46 |
|
) |
| 47 |
|
.build(); |
| 48 |
|
|
| 49 |
|
|
| 50 |
|
|
| 51 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
4-
|
|
| 52 |
0 |
@Test... |
| 53 |
|
@GenData @Transactional |
| 54 |
|
void basic() |
| 55 |
|
{ |
| 56 |
0 |
assertNumberOfRows( |
| 57 |
|
"ap_types", "tp_color = 'green'" |
| 58 |
|
) |
| 59 |
|
.isEqualTo(RANDOM_ROWS); |
| 60 |
|
} |
| 61 |
|
} |