try
{
/* No pattern may exist in the URLPatternList that matches
the first pattern.
*/
WebUserDataPermission p = new WebUserDataPermission("/:/*", "");
fail("Should not have been able to use a pattern with matching qualifiying pattern");
}
catch(IllegalArgumentException e)
{
// Failed as expected
}
try
{
/* If the first pattern is a path-prefix pattern, only exact
patterns matched by the first pattern and path-prefix patterns
matched by, but different from, the first pattern may occur
in the URLPatternList.
*/
WebUserDataPermission p = new WebUserDataPermission("/*:*.ext", "");
fail("Should not have been able to use a pattern with extension qualifiying pattern");
}
catch(IllegalArgumentException e)
{
// Failed as expected
}
try
{
/* If the first pattern is an extension pattern, only exact
patterns that are matched by the first pattern and path-prefix
patterns may occur in the URLPatternList.
*/
WebUserDataPermission p = new WebUserDataPermission("*.ext:*.ext2", "");
fail("Should not have been able to use an extension in qualifiying pattern");
}
catch(IllegalArgumentException e)
{
// Failed as expected
}
try
{
/* If the first pattern is the default pattern, "/", any
pattern except the default pattern may occur in the
URLPatternList.
*/
WebUserDataPermission p0 = new WebUserDataPermission("/:/", "");
fail("Should not have been able to use the default pattern in qualifiying pattern");
}
catch(IllegalArgumentException e)
{
// Failed as expected
}
try
{
/* If the first pattern is an exact pattern a URLPatternList
must not be present in the URLPatternSpec.
*/
WebUserDataPermission p0 = new WebUserDataPermission("/exact:/*", "");
fail("Should not have been able to use a qualifiying pattern");
}
catch(IllegalArgumentException e)
{
// Failed as expected