@Test(expected = AecuException.class) public void execute_invalidResource() throws AecuException { service.execute("invalid"); }
@Override public ExecutionResult execute(String path) throws AecuException { try (ResourceResolver resolver = resolverService.getContentMigratorResourceResolver()) { Resource resource = resolver.getResource(path); if (resource == null) { throw new AecuException("Path is invalid"); } if (!isValidScriptName(resource.getName())) { throw new AecuException("Invalid script name"); } return executeScript(resolver, path); } catch (LoginException e) { throw new AecuException(ERR_NO_RESOLVER, e); } }
AecuServiceImpl implements AecuService { @Override public ExecutionResult execute(String path) throws AecuException { try (ResourceResolver resolver = resolverService.getContentMigratorResourceResolver()) { Resource resource = resolver.getResource(path); if (resource == null) { throw new AecuException("Path is invalid"); } if (!isValidScriptName(resource.getName())) { throw new AecuException("Invalid script name"); } return executeScript(resolver, path); } catch (LoginException e) { throw new AecuException(ERR_NO_RESOLVER, e); } } }
AecuServiceImpl implements AecuService { @Override public ExecutionResult execute(String path) throws AecuException { try (ResourceResolver resolver = resolverService.getContentMigratorResourceResolver()) { Resource resource = resolver.getResource(path); if (resource == null) { throw new AecuException("Path is invalid"); } if (!isValidScriptName(resource.getName())) { throw new AecuException("Invalid script name"); } return executeScript(resolver, path); } catch (LoginException e) { throw new AecuException(ERR_NO_RESOLVER, e); } }  }
AecuServiceImpl implements AecuService { @Override public ExecutionResult execute(String path) throws AecuException { try (ResourceResolver resolver = resolverService.getContentMigratorResourceResolver()) { Resource resource = resolver.getResource(path); if (resource == null) { throw new AecuException("Path is invalid"); } if (!isValidScriptName(resource.getName())) { throw new AecuException("Invalid script name"); } return executeScript(resolver, path); } catch (LoginException e) { throw new AecuException(ERR_NO_RESOLVER, e); } }  @Override String getVersion(); @Override List<String> getFiles(String path); @Override boolean matchesRunmodes(String name); @Override boolean isValidScriptName(String name); @Override ExecutionResult execute(String path); @Override HistoryEntry createHistoryEntry(); @Override HistoryEntry finishHistoryEntry(HistoryEntry history); @Override HistoryEntry storeExecutionInHistory(HistoryEntry history, ExecutionResult result); @Override List<HistoryEntry> getHistory(int startIndex, int count); }
AecuServiceImpl implements AecuService { @Override public ExecutionResult execute(String path) throws AecuException { try (ResourceResolver resolver = resolverService.getContentMigratorResourceResolver()) { Resource resource = resolver.getResource(path); if (resource == null) { throw new AecuException("Path is invalid"); } if (!isValidScriptName(resource.getName())) { throw new AecuException("Invalid script name"); } return executeScript(resolver, path); } catch (LoginException e) { throw new AecuException(ERR_NO_RESOLVER, e); } }  @Override String getVersion(); @Override List<String> getFiles(String path); @Override boolean matchesRunmodes(String name); @Override boolean isValidScriptName(String name); @Override ExecutionResult execute(String path); @Override HistoryEntry createHistoryEntry(); @Override HistoryEntry finishHistoryEntry(HistoryEntry history); @Override HistoryEntry storeExecutionInHistory(HistoryEntry history, ExecutionResult result); @Override List<HistoryEntry> getHistory(int startIndex, int count);  }