From 87a6fea524117f13b663e6b6cc02b3a4d5590efe Mon Sep 17 00:00:00 2001 From: Anna Babu Palathingal <148897727+annaibm@users.noreply.github.com> Date: Fri, 31 May 2024 10:37:45 -0400 Subject: [PATCH] Removed the getPrereqRoots function - SharedClasses tests to generate related classes under workspace dir - with getResultsDir function instead of getPrereqRoots. related:https://github.com/eclipse-openj9/openj9/issues/19582 Signed-off-by: Anna Babu Palathingal --- .../net/openj9/stf/SharedClasses.java | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/openj9.test.sharedClasses/src/test.sharedClasses/net/openj9/stf/SharedClasses.java b/openj9.test.sharedClasses/src/test.sharedClasses/net/openj9/stf/SharedClasses.java index 81e8140..fe7a590 100644 --- a/openj9.test.sharedClasses/src/test.sharedClasses/net/openj9/stf/SharedClasses.java +++ b/openj9.test.sharedClasses/src/test.sharedClasses/net/openj9/stf/SharedClasses.java @@ -187,21 +187,23 @@ public void setUp(StfCoreExtension test, StfSharedClassesExtension sharedClasses // If not, create them in the first -systemtest-prereqs directory (or the default location if no -systemtest-prereqs were supplied). DirectoryRef sharedClassesDataDir = null; // This will be initialised when we find it. String dataSubdir = "sharedClassesTestData/v1"; - ArrayList prereqRoots = test.env().getPrereqRoots(); + System.out.println("Test Roots: " + test.env().getTestRoots()); + System.out.println("Temporary Directory: " + test.env().getTmpDir()); + System.out.println("Results Directory: " + test.env().getResultsDir()); + System.out.println("Prereqroot Directory " + test.env().getPrereqRoots()); + DirectoryRef prereqRoots = test.env().getResultsDir(); int found = 0; - for (int i = 0 ; (i < prereqRoots.size()) && ( found == 0 ); i++ ) { - sharedClassesDataDir = prereqRoots.get(i).childDirectory(dataSubdir); - if (!sharedClassesDataDir.exists()) { - System.out.println(sharedClassesDataDir.getSpec() + " does not exist"); - } - else { - System.out.println(sharedClassesDataDir.getSpec() + " exists"); - found = 1; - } + sharedClassesDataDir = prereqRoots.childDirectory(dataSubdir); + if (!sharedClassesDataDir.exists()) { + System.out.println(sharedClassesDataDir.getSpec() + " does not exist"); + } + else { + System.out.println(sharedClassesDataDir.getSpec() + " exists"); + found = 1; } if ( found == 0 ) { - sharedClassesDataDir = prereqRoots.get(0).childDirectory(dataSubdir); + sharedClassesDataDir = prereqRoots.childDirectory(dataSubdir); test.doRunForegroundProcess("Create Shared Classes jars", "CSC", ECHO_ON,