@@ -104,7 +104,7 @@ private static void validateEnvironmentSettings() {
104
104
missingSettings .add ("STAGING_DIR" );
105
105
}
106
106
107
- if (missingSettings .size () > 0 ) {
107
+ if (! missingSettings .isEmpty () ) {
108
108
String error = String .join (", " , missingSettings )
109
109
+ " must be set as a system property in the pom.xml" ;
110
110
throw new IllegalArgumentException (error );
@@ -145,7 +145,7 @@ private static void verifyStagedFiles(String... installers) {
145
145
missingInstallers .add (installer );
146
146
}
147
147
}
148
- if (missingInstallers .size () > 0 ) {
148
+ if (! missingInstallers .isEmpty () ) {
149
149
String error = "Could not find these installers in the staging directory: " + STAGING_DIR + "\n " ;
150
150
error += String .join ("\n " , missingInstallers );
151
151
throw new IllegalStateException (error );
@@ -1162,4 +1162,42 @@ void createWlsImgWithOpenShiftSettings(TestInfo testInfo) throws Exception {
1162
1162
}
1163
1163
1164
1164
}
1165
+
1166
+ /**
1167
+ * create a WLS image using a JAR installer not in a zip.
1168
+ *
1169
+ * @throws Exception - if any error occurs
1170
+ */
1171
+ @ Test
1172
+ @ Order (31 )
1173
+ @ Tag ("nightly" )
1174
+ @ DisplayName ("Create WebLogic Server image from a JAR" )
1175
+ void createWlsImgFromJar (TestInfo testInfo ) throws Exception {
1176
+ // Create an imagetool command to cache the JAR installer for 12.2.1.4.0
1177
+ String cacheCommand = new CacheCommand ()
1178
+ .addInstaller (true )
1179
+ .type ("wls" )
1180
+ .version ("12.2.1.4.0" )
1181
+ .path (Paths .get (STAGING_DIR , "fmw_12.2.1.4.0_wls_lite_generic.jar" ))
1182
+ .build ();
1183
+
1184
+ // Create an imagetool command to build the image for 12.2.1.4.0
1185
+ String tagName = build_tag + ":" + getMethodName (testInfo );
1186
+ String buildCommand = new CreateCommand ()
1187
+ .tag (tagName )
1188
+ .version ("12.2.1.4.0" )
1189
+ .build ();
1190
+
1191
+ try (PrintWriter out = getTestMethodWriter (testInfo )) {
1192
+ // run imagetool cache command
1193
+ CommandResult cacheResult = Runner .run (cacheCommand , out , logger );
1194
+ assertEquals (0 , cacheResult .exitValue (), "for command: " + cacheCommand );
1195
+ // run imagetool build command
1196
+ CommandResult buildResult = Runner .run (buildCommand , out , logger );
1197
+ assertEquals (0 , buildResult .exitValue (), "for command: " + buildCommand );
1198
+
1199
+ // verify that the container image was created
1200
+ assertTrue (imageExists (tagName ), "Image was not created: " + tagName );
1201
+ }
1202
+ }
1165
1203
}
0 commit comments