8014783: java/net/HttpURLPermission/HttpURLPermissionTest.java leaves files open
Reviewed-by: michaelm
This commit is contained in:
parent
c17637a0f8
commit
d6531cbf9f
@ -187,11 +187,12 @@ public class HttpURLPermissionTest {
|
|||||||
throws Exception {
|
throws Exception {
|
||||||
|
|
||||||
HttpURLPermission out = new HttpURLPermission(name, actions);
|
HttpURLPermission out = new HttpURLPermission(name, actions);
|
||||||
FileOutputStream fos = new FileOutputStream("out.ser");
|
|
||||||
ObjectOutputStream o = new ObjectOutputStream(fos);
|
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||||
|
ObjectOutputStream o = new ObjectOutputStream(baos);
|
||||||
o.writeObject(out);
|
o.writeObject(out);
|
||||||
FileInputStream fis = new FileInputStream("out.ser");
|
ByteArrayInputStream bain = new ByteArrayInputStream(baos.toByteArray());
|
||||||
ObjectInputStream i = new ObjectInputStream(fis);
|
ObjectInputStream i = new ObjectInputStream(bain);
|
||||||
HttpURLPermission in = (HttpURLPermission)i.readObject();
|
HttpURLPermission in = (HttpURLPermission)i.readObject();
|
||||||
if (!in.equals(out)) {
|
if (!in.equals(out)) {
|
||||||
System.out.println ("FAIL");
|
System.out.println ("FAIL");
|
||||||
|
Loading…
Reference in New Issue
Block a user