Catalog java bundle-version if nothing else found (#677)

This commit is contained in:
Keith Zantow 2021-12-13 17:38:25 -05:00 committed by GitHub
parent f98868b55e
commit 3a10ca7e6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View File

@ -127,6 +127,7 @@ func selectVersion(manifest *pkg.JavaManifest, filenameObj archiveFilename) stri
"Implementation-Version",
"Specification-Version",
"Plugin-Version",
"Bundle-Version",
}
for _, fieldName := range fieldNames {

View File

@ -212,6 +212,22 @@ func TestSelectVersion(t *testing.T) {
},
expected: "1.8.2",
},
{
name: "Implementation-Version takes precedence over Specification-Version in subsequent section",
manifest: pkg.JavaManifest{
Main: map[string]string{
"Manifest-Version": "1.0",
"Ant-Version": "Apache Ant 1.8.2",
"Created-By": "1.5.0_22-b03 (Sun Microsystems Inc.)",
},
NamedSections: map[string]map[string]string{
"some-other-section": {
"Bundle-Version": "1.11.28",
},
},
},
expected: "1.11.28",
},
}
for _, test := range tests {