8299739: HashedPasswordFileTest.java and ExceptionTest.java can fail with java.lang.NullPointerException
Reviewed-by: sspitsyn, amenkov, cjplummer
This commit is contained in:
parent
83e2db6ba3
commit
04f30185e9
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -123,10 +123,13 @@ public class ExceptionTest {
|
||||
} finally {
|
||||
try {
|
||||
// Close JMX Connector Client
|
||||
cc.close();
|
||||
if (cc != null) {
|
||||
cc.close();
|
||||
}
|
||||
// Stop connertor server
|
||||
cs.stop();
|
||||
|
||||
if (cs != null) {
|
||||
cs.stop();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Utils.printThrowable(e, true);
|
||||
throw new RuntimeException(
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -200,6 +200,12 @@ public class HashedPasswordFileTest {
|
||||
return cs.getAddress();
|
||||
}
|
||||
|
||||
private void stopServerSide() throws IOException {
|
||||
if (cs != null) {
|
||||
cs.stop();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClearTextPasswordFile() throws IOException {
|
||||
Boolean[] bvals = new Boolean[]{true, false};
|
||||
@ -217,7 +223,7 @@ public class HashedPasswordFileTest {
|
||||
}
|
||||
Assert.assertEquals(isPasswordFileHashed(), bval);
|
||||
} finally {
|
||||
cs.stop();
|
||||
stopServerSide();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -241,7 +247,7 @@ public class HashedPasswordFileTest {
|
||||
}
|
||||
Assert.assertEquals(isPasswordFileHashed(), false);
|
||||
} finally {
|
||||
cs.stop();
|
||||
stopServerSide();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -263,7 +269,7 @@ public class HashedPasswordFileTest {
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
cs.stop();
|
||||
stopServerSide();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -400,7 +406,7 @@ public class HashedPasswordFileTest {
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
cs.stop();
|
||||
stopServerSide();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user