1
1
/*
2
- * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
@@ -109,6 +109,7 @@ static void testWithEagerInitializationDisabled() throws Exception {
109
109
static void testDefaultArchiveWithEagerInitializationEnabled () throws Exception {
110
110
// run with default CDS archive with the -Djdk.internal.lambda.disableEagerInitialization=true property
111
111
CDSOptions runOpts = (new CDSOptions ())
112
+ .setXShareMode ("auto" )
112
113
.addPrefix ("-cp" , appJar , testProperty , "-Xlog:class+load,cds=debug" )
113
114
.setUseSystemArchive (true )
114
115
.setUseVersion (false )
@@ -122,13 +123,16 @@ static void testDefaultArchiveWithEagerInitializationEnabled() throws Exception
122
123
static void testDefaultArchiveWithEagerInitializationDisabled () throws Exception {
123
124
// run with default CDS archive without the -Djdk.internal.lambda.disableEagerInitialization=true property
124
125
CDSOptions runOpts = (new CDSOptions ())
126
+ .setXShareMode ("auto" )
125
127
.addPrefix ("-cp" , appJar , "-Xlog:class+load,cds=debug" )
126
128
.setUseSystemArchive (true )
127
129
.setUseVersion (false )
128
- .addSuffix (mainClass );
130
+ .addSuffix ("-showversion" , mainClass );
129
131
OutputAnalyzer output = CDSTestUtils .runWithArchive (runOpts );
130
- output .shouldMatch (lambdaLoadedFromArchive )
131
- .shouldMatch (cdsLoadedLambdaProxy )
132
- .shouldHaveExitValue (0 );
132
+ if (output .getStderr ().contains ("sharing" )) {
133
+ output .shouldMatch (lambdaLoadedFromArchive )
134
+ .shouldMatch (cdsLoadedLambdaProxy );
135
+ }
136
+ output .shouldHaveExitValue (0 );
133
137
}
134
138
}
0 commit comments