@Test(expected = IOException.class) public void invalid_variable() throws Exception { File lockDir = folder.getRoot(); VariableResolver var = new VariableResolver(Collections.singletonMap( "LOCATION", lockDir.getAbsolutePath())); Map<String, String> conf = new HashMap<>(); conf.put(BasicLockProvider.KEY_DIRECTORY, "${__INVALID__}"); ServiceProfile<ExecutionLockProvider> profile = new ServiceProfile<>( "testing", BasicLockProvider.class, conf, new ProfileContext(getClass().getClassLoader(), var)); profile.newInstance(); }
@Override protected ExecutionLock newInstance(Scope lockScope, String batchId) throws IOException { if (lockScope == null) { throw new IllegalArgumentException("lockScope must not be null"); } if (batchId == null) { throw new IllegalArgumentException("batchId must not be null"); } return new FileExecutionLock(lockScope, batchId, directory); }
BasicLockProvider extends ExecutionLockProvider { @Override protected ExecutionLock newInstance(Scope lockScope, String batchId) throws IOException { if (lockScope == null) { throw new IllegalArgumentException("lockScope must not be null"); } if (batchId == null) { throw new IllegalArgumentException("batchId must not be null"); } return new FileExecutionLock(lockScope, batchId, directory); } }
BasicLockProvider extends ExecutionLockProvider { @Override protected ExecutionLock newInstance(Scope lockScope, String batchId) throws IOException { if (lockScope == null) { throw new IllegalArgumentException("lockScope must not be null"); } if (batchId == null) { throw new IllegalArgumentException("batchId must not be null"); } return new FileExecutionLock(lockScope, batchId, directory); }  }
BasicLockProvider extends ExecutionLockProvider { @Override protected ExecutionLock newInstance(Scope lockScope, String batchId) throws IOException { if (lockScope == null) { throw new IllegalArgumentException("lockScope must not be null"); } if (batchId == null) { throw new IllegalArgumentException("batchId must not be null"); } return new FileExecutionLock(lockScope, batchId, directory); }  @Override void doConfigure(ServiceProfile<?> profile); }
BasicLockProvider extends ExecutionLockProvider { @Override protected ExecutionLock newInstance(Scope lockScope, String batchId) throws IOException { if (lockScope == null) { throw new IllegalArgumentException("lockScope must not be null"); } if (batchId == null) { throw new IllegalArgumentException("batchId must not be null"); } return new FileExecutionLock(lockScope, batchId, directory); }  @Override void doConfigure(ServiceProfile<?> profile); static final String KEY_DIRECTORY; }