15
15
public class BaseTest {
16
16
17
17
protected static final Logger logger = Logger .getLogger (ITImagetool .class .getName ());
18
- protected static final String VERSION = "1.0.1" ;
19
18
protected static final String PS = File .pathSeparator ;
20
19
protected static final String FS = File .separator ;
21
20
private static final String OCIR_SERVER = "phx.ocir.io" ;
@@ -33,6 +32,8 @@ public class BaseTest {
33
32
private static String imagetoolZipfile = "" ;
34
33
private static int maxIterations = 50 ;
35
34
private static int waitTime = 5 ;
35
+ private static String IMAGETOOLZIPFILE_PREFIX = "imagetool-" ;
36
+ private static String IMAGETOOLZIPFILE_SUFFIX = ".zip" ;
36
37
37
38
protected static void initialize () throws Exception {
38
39
logger .info ("Initializing the tests ..." );
@@ -50,7 +51,7 @@ protected static void initialize() throws Exception {
50
51
wlsImgCacheDir = System .getenv ("HOME" ) + FS + "cache" ;
51
52
}
52
53
53
- imagetoolZipfile = "imagetool-" + VERSION + "-SNAPSHOT.zip" ;
54
+ imagetoolZipfile = getImagetoolZipfile () ;
54
55
55
56
imagetool = "java -cp \" " + getImagetoolHome () + FS + "lib" + FS + "*\" -Djava.util.logging.config.file=" +
56
57
getImagetoolHome () + FS + "bin" + FS + "logging.properties com.oracle.weblogic.imagetool.cli.CLIDriver" ;
@@ -153,8 +154,10 @@ protected static String getTargetDir() {
153
154
return getProjectRoot () + FS + "target" ;
154
155
}
155
156
156
- protected static String getImagetoolHome () {
157
- return getProjectRoot () + FS + "imagetool-" + VERSION + "-SNAPSHOT" ;
157
+ protected static String getImagetoolHome () throws Exception {
158
+ int endIndex = getImagetoolZipfile ().length () - IMAGETOOLZIPFILE_SUFFIX .length ();
159
+ String imagetooldir = getImagetoolZipfile ().substring (0 , endIndex );
160
+ return getProjectRoot () + FS + imagetooldir ;
158
161
}
159
162
160
163
protected static String getInstallerCacheDir () {
@@ -316,4 +319,9 @@ private static void checkCmdInLoop(String cmd, String matchStr)
316
319
}
317
320
}
318
321
}
322
+
323
+ private static String getImagetoolZipfile () throws Exception {
324
+ String version = System .getProperty ("imagetoolversion" );
325
+ return IMAGETOOLZIPFILE_PREFIX + version + IMAGETOOLZIPFILE_SUFFIX ;
326
+ }
319
327
}
0 commit comments