Skip to content

Commit

Permalink
Removed the code from the fileref and added to the core file
Browse files Browse the repository at this point in the history
  • Loading branch information
annaibm committed Oct 10, 2024
1 parent 4c4bf27 commit 888d071
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,6 @@ public static DirectoryRef findFileRoot(String fileRef, ArrayList<DirectoryRef>
* @throws StfException In case we cannot find the file, or if we found it in more than one test root.
*/
public static FileRef findFile(String fileRef, ArrayList<DirectoryRef> testRootRefs, String... errorPrefixes) throws StfException {
// Get the value of JAVA_HOME and construct the path to ../lib
try {
String javaHome = System.getProperty("java.home");
File javaLibDir = new File(javaHome, "../lib");
testRootRefs.add(new DirectoryRef(javaLibDir.getCanonicalPath()));
} catch (IOException e) {
throw new RuntimeException("Failed to add Java lib directory to test roots", e);
}
ArrayList<DirectoryRef> matchingTestRoots = new ArrayList<DirectoryRef>();
for (DirectoryRef oneTestRoot : testRootRefs) {
if (oneTestRoot.childFile(fileRef).exists()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@ public StfEnvironmentCore(ArrayList<PropertyFileDetails> propertyFileDetails, Ar
this.testRoots.add(defaultTestRoot);
invocationProperties.put(Stf.ARG_TEST_ROOT.getName(), defaultTestRoot.getSpec());
}

try {
String javaHome = System.getProperty("java.home");
File javaLibDir = new File(javaHome, "../lib");
this.testRoots.add(new DirectoryRef(javaLibDir.getCanonicalPath())); // Add ../lib directory
} catch (IOException e) {
throw new RuntimeException("Failed to add Java lib directory to test roots", e);
}

// Work out where the prereqs are
if (!getProperty(Stf.ARG_SYSTEMTEST_PREREQS).isEmpty()) {
Expand Down

0 comments on commit 888d071

Please sign in to comment.