Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meke check for a VehicleClient instance more robust to not cause CNFEs. #1563

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion common/src/main/java/com/sun/ts/lib/harness/ServiceEETest.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,18 @@ public Properties getVehicleSpecificClientProps(Properties p) {
public Status run(String[] argv, Properties p) {
Status status = null;
boolean inTestHarness = TestUtil.iWhereAreWe == TestUtil.VM_HARNESS;
boolean isVehicleClient = this instanceof com.sun.ts.tests.common.vehicle.VehicleClient;
boolean isVehicleClient = false;
URL thisURL = getClass().getProtectionDomain().getCodeSource().getLocation();
TestUtil.logTrace("in ServiceEETest.run(), this URL is: " + thisURL);
try {
Class<?> vcClass = getClass().getClassLoader().loadClass("com.sun.ts.tests.common.vehicle.VehicleClient");
URL vcClassURL = vcClass.getProtectionDomain().getCodeSource().getLocation();
TestUtil.logTrace("VehicleClient URL is: " + vcClassURL);
isVehicleClient = vcClass.isAssignableFrom(getClass());
TestUtil.logTrace("VehicleClient URL is: " + vcClassURL);
} catch (ClassNotFoundException e) {
TestUtil.logTrace("VehicleClient class not found, so not a vehicle client.");
}
if (inTestHarness && isVehicleClient) {
TestUtil.logTrace("in ServiceEETest.run() method");
String sVehicle = TestUtil.getProperty(p, "vehicle");
Expand Down
Loading