@@ -43,11 +43,17 @@ public void testReadsBundleReadsAndIndex() {
43
43
public void testNoReadsInSerializedBundle () {
44
44
final String vcfJSON = """
45
45
{
46
- "schemaVersion":"0.1.0 ",
46
+ "schemaVersion":"%s ",
47
47
"schemaName":"htsbundle",
48
- "VARIANT_CONTEXTS":{"path":"my.vcf","format":"VCF"},
49
- "primary":"VARIANT_CONTEXTS"
50
- }""" ;
48
+ "%s":{"path":"my.vcf","format":"%s"},
49
+ "primary":"%s"
50
+ }"""
51
+ .formatted (
52
+ BundleJSON .JSON_SCHEMA_VERSION ,
53
+ BundleResourceType .PRIMARY_CT_VARIANT_CONTEXTS ,
54
+ BundleResourceType .FMT_VARIANTS_VCF ,
55
+ BundleResourceType .PRIMARY_CT_VARIANT_CONTEXTS
56
+ );
51
57
try {
52
58
ReadsBundle .getReadsBundleFromString (vcfJSON );
53
59
} catch (final IllegalArgumentException e ) {
@@ -76,22 +82,29 @@ public Object[][] getRoundTripJSONTestData() {
76
82
// reads only, without format included
77
83
"""
78
84
{
79
- "schemaVersion":"0.1.0 ",
85
+ "schemaVersion":"%s ",
80
86
"schemaName":"htsbundle",
81
- "ALIGNED_READS":{"path":"%s"},
82
- "primary":"ALIGNED_READS"
83
- }""" .formatted (BAM_FILE ),
87
+ "%s":{"path":"%s"},
88
+ "primary":"%s"
89
+ }""" .formatted (
90
+ BundleJSON .JSON_SCHEMA_VERSION ,
91
+ BundleResourceType .PRIMARY_CT_ALIGNED_READS , BAM_FILE ,
92
+ BundleResourceType .PRIMARY_CT_ALIGNED_READS
93
+ ),
84
94
new ReadsBundle <IOPath >(new HtsPath (BAM_FILE ))
85
95
},
86
96
{
87
97
// reads only, with format included
88
98
"""
89
99
{
90
- "schemaVersion":"0.1.0 ",
100
+ "schemaVersion":"%s ",
91
101
"schemaName":"htsbundle",
92
- "ALIGNED_READS":{"path":"%s", "format":"BAM"},
93
- "primary":"ALIGNED_READS"
94
- }""" .formatted (BAM_FILE ),
102
+ "%s":{"path":"%s", "format":"%s"},
103
+ "primary":"%s"
104
+ }""" .formatted (
105
+ BundleJSON .JSON_SCHEMA_VERSION ,
106
+ BundleResourceType .PRIMARY_CT_ALIGNED_READS , BAM_FILE , BundleResourceType .FMT_READS_BAM ,
107
+ BundleResourceType .PRIMARY_CT_ALIGNED_READS ),
95
108
// ReadsBundle doesn't automatically infer format, so create one manually
96
109
new ReadsBundle (
97
110
new BundleBuilder ()
@@ -106,12 +119,17 @@ public Object[][] getRoundTripJSONTestData() {
106
119
// reads with index, with format included
107
120
"""
108
121
{
109
- "schemaVersion":"0.1.0 ",
122
+ "schemaVersion":"%s ",
110
123
"schemaName":"htsbundle",
111
- "ALIGNED_READS":{"path":"%s", "format":"BAM"},
112
- "READS_INDEX":{"path":"%s", "format":"BAI"},
113
- "primary":"ALIGNED_READS"
114
- }""" .formatted (BAM_FILE , INDEX_FILE ),
124
+ "%s":{"path":"%s", "format":"%s"},
125
+ "%s":{"path":"%s", "format":"%s"},
126
+ "primary":"%s"
127
+ }""" .formatted (
128
+ BundleJSON .JSON_SCHEMA_VERSION ,
129
+ BundleResourceType .PRIMARY_CT_ALIGNED_READS , BAM_FILE , BundleResourceType .FMT_READS_BAM ,
130
+ BundleResourceType .SECONDARY_CT_READS_INDEX , INDEX_FILE , BundleResourceType .FMT_READS_INDEX_BAI ,
131
+ BundleResourceType .PRIMARY_CT_ALIGNED_READS
132
+ ),
115
133
// ReadsBundle doesn't automatically infer format, so create one manually
116
134
new ReadsBundle (
117
135
new BundleBuilder ()
0 commit comments