}
}
public void testParseStaticMethods()throws Exception{
//Positive test case
DefinitionAccess access = definitionParser.parseAccess(null, "org.auraframework.test.TestAccessMethods.allowGlobal");
assertTrue(access.isGlobal());
//Negative test cases
for(String s : new String[]{
"org.auraframework.test.TestAccessMethods.privateMethod",
"org.auraframework.test.TestAccessMethods.allowAuthenticated", //Return type is not Access
"java://org.auraframework.test.TestAccessMethods.allowGlobal",
"org.auraframework.test.TestAccessMethods.nonStaticMethod",
"org.auraframework.test.TestAccessMethods.allowGlobal, org.auraframework.test.TestAccessMethods.allowPrivate",
"org.auraframework.test.TestAccessMethods.lostSoul",
"org.auraframework.test.LostParent.lostSoul",
})
{
try{
definitionParser.parseAccess(null, s);
fail("Should have failed because this access method is unusable :"+ s);
}catch(InvalidAccessValueException expected){
//Expected
}
}
access = definitionParser.parseAccess(null, "org.auraframework.test.TestAccessMethods.throwsException");
try{
access.isGlobal();
fail("Should throw an AuraRuntimeException when access method throws an exception.");
}catch(AuraRuntimeException expected){
assertTrue(expected.getMessage().startsWith("Exception executing access-checking method"));
}