8161291: Serialization Tests for URLPermission is failing

Reviewed-by: dfuchs, chegar
This commit is contained in:
Vyom Tewari 2016-07-26 13:26:12 +05:30
parent 1e34f70a1d
commit 620b097690
2 changed files with 14 additions and 14 deletions

View File

@ -461,11 +461,10 @@ public final class URLPermission extends Permission {
}
private String actions() {
String b = String.join(",", methods);
if (!requestHeaders.isEmpty()) {
b += ":" + String.join(",", requestHeaders);
}
return b;
// The colon separator is optional when the request headers list is
// empty.This implementation chooses to include it even when the request
// headers list is empty.
return String.join(",", methods) + ":" + String.join(",", requestHeaders);
}
/**

View File

@ -26,7 +26,7 @@ import java.io.*;
/**
* @test
* @bug 8010464 8027570 8027687 8029354 8114860 8071660
* @bug 8010464 8027570 8027687 8029354 8114860 8071660 8161291
*/
public class URLPermissionTest {
@ -355,15 +355,16 @@ public class URLPermissionTest {
};
static Test[] actionsStringTest = {
actionstest("", ""),
actionstest("", ":"),
actionstest(":", ":"),
actionstest(":X-Bar", ":X-Bar"),
actionstest("GET", "GET"),
actionstest("get", "GET"),
actionstest("GET,POST", "GET,POST"),
actionstest("GET,post", "GET,POST"),
actionstest("get,post", "GET,POST"),
actionstest("get,post,DELETE", "DELETE,GET,POST"),
actionstest("GET,POST:", "GET,POST"),
actionstest("GET", "GET:"),
actionstest("get", "GET:"),
actionstest("GET,POST", "GET,POST:"),
actionstest("GET,post", "GET,POST:"),
actionstest("get,post", "GET,POST:"),
actionstest("get,post,DELETE", "DELETE,GET,POST:"),
actionstest("GET,POST:", "GET,POST:"),
actionstest("GET:X-Foo,X-bar", "GET:X-Bar,X-Foo"),
actionstest("GET,POST,DELETE:X-Bar,X-Foo,X-Bar,Y-Foo", "DELETE,GET,POST:X-Bar,X-Bar,X-Foo,Y-Foo")
};