use of org.ow2.proactive.scheduler.common.job.factories.spi.model.utils.RestrictedMethodResolver in project scheduling by ow2-proactive.
the class OptionalParserValidatorTest method init.
@Before
public void init() throws SchedulerException, IOException {
MockitoAnnotations.initMocks(this);
when(context.getSpace()).thenReturn(schedulerSpaceInterface);
when(schedulerSpaceInterface.checkFileExists(USERSPACE_NAME, existUserFilePath)).thenReturn(true);
when(schedulerSpaceInterface.checkFileExists(USERSPACE_NAME, notExistUserFilePath)).thenReturn(false);
when(schedulerSpaceInterface.checkFileExists(GLOBALSPACE_NAME, existGlobalFilePath)).thenReturn(true);
when(schedulerSpaceInterface.checkFileExists(GLOBALSPACE_NAME, notExistGlobalFilePath)).thenReturn(false);
when(context.getScheduler()).thenReturn(scheduler);
when(scheduler.thirdPartyCredentialsKeySet()).thenReturn(Collections.singleton(existCredential));
modelFile = testFolder.newFile("modelFile");
FileUtils.writeStringToFile(modelFile, validModel, Charset.defaultCharset());
StandardEvaluationContext spelContext = new StandardEvaluationContext();
spelContext.setTypeLocator(new RestrictedTypeLocator());
spelContext.setMethodResolvers(Collections.singletonList(new RestrictedMethodResolver()));
spelContext.addPropertyAccessor(new RestrictedPropertyAccessor());
when(context.getSpELContext()).thenReturn(spelContext);
}
use of org.ow2.proactive.scheduler.common.job.factories.spi.model.utils.RestrictedMethodResolver in project scheduling by ow2-proactive.
the class SpelValidatorTest method before.
@Before
public void before() {
ModelValidatorContext.SpELVariables spELVariables = new ModelValidatorContext.SpELVariables(null, null, null);
context = new StandardEvaluationContext(spELVariables);
context.setTypeLocator(new RestrictedTypeLocator());
context.setMethodResolvers(Collections.singletonList(new RestrictedMethodResolver()));
context.addPropertyAccessor(new RestrictedPropertyAccessor());
validatorContext = new ModelValidatorContext(context);
validatorContext.setSpELVariables(spELVariables);
}
Aggregations