1. Project Clover database Wed Nov 12 2025 05:07:35 UTC
  2. Package guru.mikelue.foxglove

File ColumnMetaTestUtils.java

 

Coverage histogram

../../../img/srcFileCovDistChart10.png
0% of files have more coverage

Code metrics

0
12
9
1
86
73
9
0.75
1.33
9
1

Classes

Class Line # Actions
ColumnMetaTestUtils 8 12 0% 9 0
1.0100%
 

Contributing tests

This file is covered by 118 tests. .

Source view

1    package guru.mikelue.foxglove;
2   
3    import java.sql.JDBCType;
4    import java.util.EnumSet;
5   
6    import guru.mikelue.foxglove.ColumnMeta.Property;
7   
 
8    public interface ColumnMetaTestUtils {
 
9  191 toggle static EnumSet<ColumnMeta.Property> newEmptyProperties()
10    {
11  191 return EnumSet.noneOf(ColumnMeta.Property.class);
12    }
13   
 
14  2 toggle static ColumnMeta newColumnMeta(
15    String name, String typeName, JDBCType jdbcType
16    ) {
17  2 return new ColumnMeta(
18    name, newEmptyProperties(),
19    typeName, jdbcType, 8, 0
20    );
21    }
22   
 
23  20 toggle static ColumnMeta newColumnMeta(
24    String name, JDBCType jdbcType,
25    EnumSet<Property> properties
26    ) {
27  20 return new ColumnMeta(
28    name, properties,
29    jdbcType.getName(), jdbcType,
30    32, 0
31    );
32    }
33   
 
34  11 toggle static ColumnMeta newColumnMeta(
35    String name, JDBCType jdbcType,
36    Property... properties
37    ) {
38  11 var propertySet = newEmptyProperties();
39   
40  11 for (var property : properties) {
41  11 propertySet.add(property);
42    }
43   
44  11 return newColumnMeta(name, jdbcType, propertySet);
45    }
46   
 
47  3 toggle static ColumnMeta newColumnMeta(
48    String name, Property... properties
49    ) {
50  3 return newColumnMeta(
51    name, JDBCType.VARCHAR, properties
52    );
53    }
54   
 
55  36 toggle static ColumnMeta newColumnMeta(
56    String columnName
57    ) {
58  36 return newColumnMeta(
59    columnName, JDBCType.VARCHAR
60    );
61    }
62   
 
63  141 toggle static ColumnMeta newColumnMeta(
64    String columnName, JDBCType jdbcType
65    ) {
66  141 return newColumnMeta(columnName, jdbcType, 16);
67    }
68   
 
69  174 toggle static ColumnMeta newColumnMeta(
70    String columnName, JDBCType jdbcType, int size
71    ) {
72  174 return newColumnMeta(
73    columnName, jdbcType, size, 0
74    );
75    }
76   
 
77  178 toggle static ColumnMeta newColumnMeta(
78    String columnName, JDBCType jdbcType,
79    int size, int scale
80    ) {
81  178 return new ColumnMeta(
82    columnName, newEmptyProperties(),
83    jdbcType.getName(), jdbcType, size, scale
84    );
85    }
86    }