Skip to content

Commit

Permalink
add test to validate maven mappings resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
zspitzer committed Jun 21, 2024
1 parent 39c29c4 commit 12f666e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
29 changes: 29 additions & 0 deletions tests/testMavenMappings.cfc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
component extends="org.lucee.cfml.test.LuceeTestCase" labels="data-provider-integration" {

function beforeAll (){
variables.dir = getDirectoryFromPath(getCurrentTemplatePath());
application action="update" mappings={
"/update" : expandPath( dir & "../apps/updateserver/" )
};
}

function run( testResults , testBox ) {
describe( "check all maven mapping are valid", function() {
it(title="check each maven mapping resolves", body=function(){
var mappings = fileRead("/services/legacy/mavenMappings.json");
expect( isJons( mappings) ).toBeTrue();
mappings = deserializeJSON( mappings );
var meta = "";

var mavenMatcher = new services.legacy.MavenMatcher();
for (var mapping in mappings ){
systemOutput( "checking #mappings[mappings].toJson()#", true );
meta = mavenMatcher.getMatch( mapping, "latest" );
systemOutput( meta.toJson(), true );
}
});

});
}

}
6 changes: 4 additions & 2 deletions tests/testStableReleaseBundles.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="data-provider-inte
function beforeAll (){
variables.dir = getDirectoryFromPath(getCurrentTemplatePath());
application action="update" mappings={
"/update" : expandPath( dir & "../update/" )
"/update" : expandPath( dir & "../apps/updateserver/" )
};
systemOutput( getApplicationSettings().mappings, true );
variables.artifacts = dir & "/artifacts";
Expand Down Expand Up @@ -54,13 +54,15 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="data-provider-inte
var requiredBundles = manifest.main[ "Require-Bundle" ];
var bundle = "";
var meta = {};
var mavenMatcher = new update.MavenMatcher();
var mavenMatcher = new services.legacy.MavenMatcher();
// var BundleDownloadService = new services.BundleDownloadService(); // needs creds
var missing = [];

loop list=requiredBundles item="bundle" {
// systemOutput( bundle, true );
try {
meta = mavenMatcher.getMatch( listFirst( bundle,";" ), listLast( listLast( bundle, ";" ), "=" ) );
//meta = bundleDownloadService.findBundle( listFirst( bundle,";" ), listLast( listLast( bundle, ";" ), "=" ) );
} catch ( e ){
var st = new test._testRunner().trimJavaStackTrace( e.stacktrace );
systemOutput( st, true );
Expand Down

0 comments on commit 12f666e

Please sign in to comment.