1515public class BaseTest {
1616
1717 protected static final Logger logger = Logger .getLogger (ITImagetool .class .getName ());
18- protected static final String VERSION = "1.0.1" ;
1918 protected static final String PS = File .pathSeparator ;
2019 protected static final String FS = File .separator ;
2120 private static final String OCIR_SERVER = "phx.ocir.io" ;
@@ -33,6 +32,8 @@ public class BaseTest {
3332 private static String imagetoolZipfile = "" ;
3433 private static int maxIterations = 50 ;
3534 private static int waitTime = 5 ;
35+ private static String IMAGETOOLZIPFILE_PREFIX = "imagetool-" ;
36+ private static String IMAGETOOLZIPFILE_SUFFIX = ".zip" ;
3637
3738 protected static void initialize () throws Exception {
3839 logger .info ("Initializing the tests ..." );
@@ -50,7 +51,7 @@ protected static void initialize() throws Exception {
5051 wlsImgCacheDir = System .getenv ("HOME" ) + FS + "cache" ;
5152 }
5253
53- imagetoolZipfile = "imagetool-" + VERSION + "-SNAPSHOT.zip" ;
54+ imagetoolZipfile = getImagetoolZipfile () ;
5455
5556 imagetool = "java -cp \" " + getImagetoolHome () + FS + "lib" + FS + "*\" -Djava.util.logging.config.file=" +
5657 getImagetoolHome () + FS + "bin" + FS + "logging.properties com.oracle.weblogic.imagetool.cli.CLIDriver" ;
@@ -153,8 +154,10 @@ protected static String getTargetDir() {
153154 return getProjectRoot () + FS + "target" ;
154155 }
155156
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 ;
158161 }
159162
160163 protected static String getInstallerCacheDir () {
@@ -316,4 +319,9 @@ private static void checkCmdInLoop(String cmd, String matchStr)
316319 }
317320 }
318321 }
322+
323+ private static String getImagetoolZipfile () throws Exception {
324+ String version = System .getProperty ("imagetoolversion" );
325+ return IMAGETOOLZIPFILE_PREFIX + version + IMAGETOOLZIPFILE_SUFFIX ;
326+ }
319327}
0 commit comments