@@ -114,16 +114,16 @@ class ItMiiAuxiliaryImage {
114
114
private static String wdtDomainNamespace = null ;
115
115
private static LoggingFacade logger = null ;
116
116
private String domainUid = "domain1" ;
117
- private static String miiAuxiliaryImage1 = MII_AUXILIARY_IMAGE_NAME + ":" + MII_BASIC_IMAGE_TAG + "1" ;
118
- private static String miiAuxiliaryImage2 = MII_AUXILIARY_IMAGE_NAME + ":" + MII_BASIC_IMAGE_TAG + "2" ;
119
- private static String miiAuxiliaryImage3 = MII_AUXILIARY_IMAGE_NAME + ":" + MII_BASIC_IMAGE_TAG + "3" ;
120
- private static String miiAuxiliaryImage4 = MII_AUXILIARY_IMAGE_NAME + ":" + MII_BASIC_IMAGE_TAG + "4" ;
121
- private static String miiAuxiliaryImage5 = MII_AUXILIARY_IMAGE_NAME + ":" + MII_BASIC_IMAGE_TAG + "5" ;
122
- private static String miiAuxiliaryImage6 = MII_AUXILIARY_IMAGE_NAME + ":" + MII_BASIC_IMAGE_TAG + "6" ;
123
- private static String errorPathAuxiliaryImage1 = MII_AUXILIARY_IMAGE_NAME + ":errorpathimage1" ;
124
- private static String errorPathAuxiliaryImage2 = MII_AUXILIARY_IMAGE_NAME + ":errorpathimage2" ;
125
- private static String errorPathAuxiliaryImage3 = MII_AUXILIARY_IMAGE_NAME + ":errorpathimage3" ;
126
- private static String errorPathAuxiliaryImage4 = MII_AUXILIARY_IMAGE_NAME + ":errorpathimage4" ;
117
+ private static String miiAuxiliaryImage1 = MII_AUXILIARY_IMAGE_NAME + "-domain :" + MII_BASIC_IMAGE_TAG + "1" ;
118
+ private static String miiAuxiliaryImage2 = MII_AUXILIARY_IMAGE_NAME + "-domain :" + MII_BASIC_IMAGE_TAG + "2" ;
119
+ private static String miiAuxiliaryImage3 = MII_AUXILIARY_IMAGE_NAME + "-domain :" + MII_BASIC_IMAGE_TAG + "3" ;
120
+ private static String miiAuxiliaryImage4 = MII_AUXILIARY_IMAGE_NAME + "-domain :" + MII_BASIC_IMAGE_TAG + "4" ;
121
+ private static String miiAuxiliaryImage5 = MII_AUXILIARY_IMAGE_NAME + "-domain :" + MII_BASIC_IMAGE_TAG + "5" ;
122
+ private static String miiAuxiliaryImage6 = MII_AUXILIARY_IMAGE_NAME + "-domain :" + MII_BASIC_IMAGE_TAG + "6" ;
123
+ private static String errorPathAuxiliaryImage1 = MII_AUXILIARY_IMAGE_NAME + "-domain :errorpathimage1" ;
124
+ private static String errorPathAuxiliaryImage2 = MII_AUXILIARY_IMAGE_NAME + "-domain :errorpathimage2" ;
125
+ private static String errorPathAuxiliaryImage3 = MII_AUXILIARY_IMAGE_NAME + "-domain :errorpathimage3" ;
126
+ private static String errorPathAuxiliaryImage4 = MII_AUXILIARY_IMAGE_NAME + "-domain :errorpathimage4" ;
127
127
private static Map <String , OffsetDateTime > podsWithTimeStamps = null ;
128
128
private final String adminServerPodName = domainUid + "-admin-server" ;
129
129
private final String managedServerPrefix = domainUid + "-managed-server" ;
@@ -193,12 +193,13 @@ void testCreateDomainUsingMultipleAuxiliaryImages() {
193
193
"weblogicenc" , "weblogicenc" );
194
194
195
195
// create stage dir for first auxiliary image with image1
196
- Path multipleAIPath1 = Paths .get (RESULTS_ROOT , "multipleauxiliaryimage1" );
196
+ Path multipleAIPath1 = Paths .get (RESULTS_ROOT , this . getClass (). getSimpleName (), "multipleauxiliaryimage1" );
197
197
assertDoesNotThrow (() -> FileUtils .deleteDirectory (multipleAIPath1 .toFile ()),
198
198
"Delete directory failed" );
199
199
assertDoesNotThrow (() -> Files .createDirectories (multipleAIPath1 ),
200
200
"Create directory failed" );
201
- Path multipleAIPathToFile1 = Paths .get (RESULTS_ROOT , "multipleauxiliaryimage1/test.txt" );
201
+ Path multipleAIPathToFile1 =
202
+ Paths .get (RESULTS_ROOT , this .getClass ().getSimpleName (), "multipleauxiliaryimage1/test.txt" );
202
203
String content = "1" ;
203
204
assertDoesNotThrow (() -> Files .write (multipleAIPathToFile1 , content .getBytes ()),
204
205
"Can't write to file " + multipleAIPathToFile1 );
@@ -241,7 +242,7 @@ void testCreateDomainUsingMultipleAuxiliaryImages() {
241
242
}
242
243
243
244
// create stage dir for second auxiliary image with image2
244
- Path multipleAIPath2 = Paths .get (RESULTS_ROOT , "multipleauxiliaryimage2" );
245
+ Path multipleAIPath2 = Paths .get (RESULTS_ROOT , this . getClass (). getSimpleName (), "multipleauxiliaryimage2" );
245
246
assertDoesNotThrow (() -> FileUtils .deleteDirectory (multipleAIPath2 .toFile ()),
246
247
"Delete directory failed" );
247
248
assertDoesNotThrow (() -> Files .createDirectories (multipleAIPath2 ),
@@ -250,7 +251,8 @@ void testCreateDomainUsingMultipleAuxiliaryImages() {
250
251
// create models dir and copy model, archive files if any
251
252
Path modelsPath2 = Paths .get (multipleAIPath2 .toString (), "models" );
252
253
assertDoesNotThrow (() -> Files .createDirectories (modelsPath2 ));
253
- Path multipleAIPathToFile2 = Paths .get (RESULTS_ROOT , "multipleauxiliaryimage2/test.txt" );
254
+ Path multipleAIPathToFile2 =
255
+ Paths .get (RESULTS_ROOT , this .getClass ().getSimpleName (), "multipleauxiliaryimage2/test.txt" );
254
256
String content2 = "2" ;
255
257
assertDoesNotThrow (() -> Files .write (multipleAIPathToFile2 , content2 .getBytes ()),
256
258
"Can't write to file " + multipleAIPathToFile2 );
@@ -287,14 +289,17 @@ void testCreateDomainUsingMultipleAuxiliaryImages() {
287
289
checkConfiguredJMSresouce (domainNamespace , adminServerPodName );
288
290
289
291
//checking the order of loading for the auxiliary images, expecting file with content =2
290
- assertDoesNotThrow (() -> FileUtils .deleteQuietly (Paths .get (RESULTS_ROOT , "/test.txt" ).toFile ()));
292
+ assertDoesNotThrow (() ->
293
+ FileUtils .deleteQuietly (Paths .get (RESULTS_ROOT , this .getClass ().getSimpleName (), "/test.txt" ).toFile ()));
291
294
assertDoesNotThrow (() -> copyFileFromPod (domainNamespace ,
292
295
adminServerPodName , "weblogic-server" ,
293
296
auxiliaryImagePath + "/test.txt" ,
294
- Paths .get (RESULTS_ROOT , "/test.txt" )), " Can't find file in the pod, or failed to copy" );
297
+ Paths .get (RESULTS_ROOT , this .getClass ().getSimpleName (), "/test.txt" )),
298
+ " Can't find file in the pod, or failed to copy" );
295
299
296
300
assertDoesNotThrow (() -> {
297
- String fileContent = Files .readAllLines (Paths .get (RESULTS_ROOT , "/test.txt" )).get (0 );
301
+ String fileContent =
302
+ Files .readAllLines (Paths .get (RESULTS_ROOT , this .getClass ().getSimpleName (), "/test.txt" )).get (0 );
298
303
assertEquals ("2" , fileContent , "The content of the file from auxiliary image path "
299
304
+ fileContent + "does not match the expected 2" );
300
305
}, "File from image2 was not loaded in the expected order" );
@@ -309,7 +314,7 @@ void testCreateDomainUsingMultipleAuxiliaryImages() {
309
314
@ Order (2 )
310
315
@ DisplayName ("Test to update data source url in the domain using auxiliary image" )
311
316
void testUpdateDataSourceInDomainUsingAuxiliaryImage () {
312
- Path multipleAIPath1 = Paths .get (RESULTS_ROOT , "multipleauxiliaryimage1" );
317
+ Path multipleAIPath1 = Paths .get (RESULTS_ROOT , this . getClass (). getSimpleName (), "multipleauxiliaryimage1" );
313
318
Path modelsPath1 = Paths .get (multipleAIPath1 .toString (), "models" );
314
319
315
320
@@ -435,7 +440,7 @@ void testErrorPathDomainMismatchMountPath() {
435
440
createSecretsForDomain (adminSecretName , encryptionSecretName , errorpathDomainNamespace );
436
441
437
442
// create stage dir for auxiliary image
438
- Path errorpathAIPath1 = Paths .get (RESULTS_ROOT , "errorpathauxiimage1" );
443
+ Path errorpathAIPath1 = Paths .get (RESULTS_ROOT , this . getClass (). getSimpleName (), "errorpathauxiimage1" );
439
444
assertDoesNotThrow (() -> FileUtils .deleteDirectory (errorpathAIPath1 .toFile ()),
440
445
"Delete directory failed" );
441
446
assertDoesNotThrow (() -> Files .createDirectories (errorpathAIPath1 ),
@@ -517,7 +522,7 @@ void testErrorPathDomainMissingWDTBinary() {
517
522
createSecretsForDomain (adminSecretName , encryptionSecretName , errorpathDomainNamespace );
518
523
519
524
// create stage dir for auxiliary image
520
- Path errorpathAIPath2 = Paths .get (RESULTS_ROOT , "errorpathauxiimage2" );
525
+ Path errorpathAIPath2 = Paths .get (RESULTS_ROOT , this . getClass (). getSimpleName (), "errorpathauxiimage2" );
521
526
assertDoesNotThrow (() -> FileUtils .deleteDirectory (errorpathAIPath2 .toFile ()),
522
527
"Delete directory failed" );
523
528
assertDoesNotThrow (() -> Files .createDirectories (errorpathAIPath2 ),
@@ -600,7 +605,7 @@ void testErrorPathDomainMissingDomainConfig() {
600
605
createSecretsForDomain (adminSecretName , encryptionSecretName , errorpathDomainNamespace );
601
606
602
607
// create stage dir for auxiliary image
603
- Path errorpathAIPath3 = Paths .get (RESULTS_ROOT , "errorpathauxiimage3" );
608
+ Path errorpathAIPath3 = Paths .get (RESULTS_ROOT , this . getClass (). getSimpleName (), "errorpathauxiimage3" );
604
609
assertDoesNotThrow (() -> FileUtils .deleteDirectory (errorpathAIPath3 .toFile ()),
605
610
"Delete directory failed" );
606
611
assertDoesNotThrow (() -> Files .createDirectories (errorpathAIPath3 ),
@@ -778,13 +783,14 @@ void testErrorPathFilePermission() {
778
783
createSecretsForDomain (adminSecretName , encryptionSecretName , errorpathDomainNamespace );
779
784
780
785
// create stage dir for auxiliary image
781
- Path errorpathAIPath1 = Paths .get (RESULTS_ROOT , "errorpathauxiimage4" );
786
+ Path errorpathAIPath1 = Paths .get (RESULTS_ROOT , this . getClass (). getSimpleName (), "errorpathauxiimage4" );
782
787
assertDoesNotThrow (() -> FileUtils .deleteDirectory (errorpathAIPath1 .toFile ()),
783
788
"Can't delete directory" );
784
789
assertDoesNotThrow (() -> Files .createDirectories (errorpathAIPath1 ),
785
790
"Can't create directory" );
786
791
787
- Path errorpathAIPathToFile = Paths .get (RESULTS_ROOT , "errorpathauxiimage4/test1.txt" );
792
+ Path errorpathAIPathToFile =
793
+ Paths .get (RESULTS_ROOT , this .getClass ().getSimpleName (), "errorpathauxiimage4/test1.txt" );
788
794
String content = "some text " ;
789
795
assertDoesNotThrow (() -> Files .write (errorpathAIPathToFile , content .getBytes ()),
790
796
"Can't write to file " + errorpathAIPathToFile );
@@ -896,7 +902,7 @@ void testUpdateWDTVersionUsingMultipleAuxiliaryImages() {
896
902
"weblogicenc" , "weblogicenc" );
897
903
898
904
// create stage dir for first auxiliary image containing domain configuration
899
- Path multipleAIPath1 = Paths .get (RESULTS_ROOT , "multipleauxiliaryimage1" );
905
+ Path multipleAIPath1 = Paths .get (RESULTS_ROOT , this . getClass (). getSimpleName (), "multipleauxiliaryimage1" );
900
906
assertDoesNotThrow (() -> FileUtils .deleteDirectory (multipleAIPath1 .toFile ()),
901
907
"Delete directory failed" );
902
908
assertDoesNotThrow (() -> Files .createDirectories (multipleAIPath1 ),
@@ -937,7 +943,7 @@ void testUpdateWDTVersionUsingMultipleAuxiliaryImages() {
937
943
}
938
944
939
945
// create stage dir for second auxiliary image
940
- Path multipleAIPath2 = Paths .get (RESULTS_ROOT , "multipleauxiliaryimage2" );
946
+ Path multipleAIPath2 = Paths .get (RESULTS_ROOT , this . getClass (). getSimpleName (), "multipleauxiliaryimage2" );
941
947
assertDoesNotThrow (() -> FileUtils .deleteDirectory (multipleAIPath2 .toFile ()),
942
948
"Delete directory failed" );
943
949
assertDoesNotThrow (() -> Files .createDirectories (multipleAIPath2 ), "Create directory failed" );
@@ -963,7 +969,7 @@ void testUpdateWDTVersionUsingMultipleAuxiliaryImages() {
963
969
}
964
970
965
971
// create stage dir for third auxiliary image with latest wdt installation files only
966
- Path multipleAIPath3 = Paths .get (RESULTS_ROOT , "multipleauxiliaryimage3" );
972
+ Path multipleAIPath3 = Paths .get (RESULTS_ROOT , this . getClass (). getSimpleName (), "multipleauxiliaryimage3" );
967
973
assertDoesNotThrow (() -> FileUtils .deleteDirectory (multipleAIPath3 .toFile ()),
968
974
"Delete directory failed" );
969
975
assertDoesNotThrow (() -> Files .createDirectories (multipleAIPath3 ),
@@ -1220,14 +1226,16 @@ private void checkConfiguredJDBCresouce(String domainNamespace, String adminServ
1220
1226
}
1221
1227
1222
1228
private String checkWDTVersion (String domainNamespace , String auxiliaryImagePath ) throws Exception {
1223
- assertDoesNotThrow (() -> FileUtils .deleteQuietly (Paths .get (RESULTS_ROOT , "/WDTversion.txt" ).toFile ()));
1229
+ assertDoesNotThrow (() ->
1230
+ FileUtils .deleteQuietly (Paths .get (RESULTS_ROOT , this .getClass ().getSimpleName (), "/WDTversion.txt" ).toFile ()));
1224
1231
assertDoesNotThrow (() -> copyFileFromPod (domainNamespace ,
1225
1232
adminServerPodName , "weblogic-server" ,
1226
1233
auxiliaryImagePath + "/weblogic-deploy/VERSION.txt" ,
1227
- Paths .get (RESULTS_ROOT , "/WDTversion.txt" )), " Can't find file in the pod, or failed to copy" );
1234
+ Paths .get (RESULTS_ROOT , this .getClass ().getSimpleName (), "/WDTversion.txt" )),
1235
+ " Can't find file in the pod, or failed to copy" );
1228
1236
1229
1237
1230
- return Files .readAllLines (Paths .get (RESULTS_ROOT , "/WDTversion.txt" )).get (0 );
1238
+ return Files .readAllLines (Paths .get (RESULTS_ROOT , this . getClass (). getSimpleName (), "/WDTversion.txt" )).get (0 );
1231
1239
}
1232
1240
1233
1241
private boolean introspectorPodLogContainsExpectedErrorMsg (String domainUid ,
0 commit comments