target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void shouldProvideSubmitterForHttpTopology() { TaskSubmitter taskSubmitter = new TaskSubmitterFactory( Mockito.mock(OaiTopologyTaskSubmitter.class), Mockito.mock(HttpTopologyTaskSubmitter.class), Mockito.mock(OtherTopologiesTaskSubmitter.class), Mockito.mock(DepublicationTaskSubmitter.class) ).provideTaskS... | public TaskSubmitter provideTaskSubmitter(SubmitTaskParameters parameters) { switch (parameters.getTopologyName()) { case TopologiesNames.OAI_TOPOLOGY: return oaiTopologyTaskSubmitter; case TopologiesNames.HTTP_TOPOLOGY: return httpTopologyTaskSubmitter; case TopologiesNames.ENRICHMENT_TOPOLOGY: case TopologiesNames.IN... | TaskSubmitterFactory { public TaskSubmitter provideTaskSubmitter(SubmitTaskParameters parameters) { switch (parameters.getTopologyName()) { case TopologiesNames.OAI_TOPOLOGY: return oaiTopologyTaskSubmitter; case TopologiesNames.HTTP_TOPOLOGY: return httpTopologyTaskSubmitter; case TopologiesNames.ENRICHMENT_TOPOLOGY: ... | TaskSubmitterFactory { public TaskSubmitter provideTaskSubmitter(SubmitTaskParameters parameters) { switch (parameters.getTopologyName()) { case TopologiesNames.OAI_TOPOLOGY: return oaiTopologyTaskSubmitter; case TopologiesNames.HTTP_TOPOLOGY: return httpTopologyTaskSubmitter; case TopologiesNames.ENRICHMENT_TOPOLOGY: ... | TaskSubmitterFactory { public TaskSubmitter provideTaskSubmitter(SubmitTaskParameters parameters) { switch (parameters.getTopologyName()) { case TopologiesNames.OAI_TOPOLOGY: return oaiTopologyTaskSubmitter; case TopologiesNames.HTTP_TOPOLOGY: return httpTopologyTaskSubmitter; case TopologiesNames.ENRICHMENT_TOPOLOGY: ... | TaskSubmitterFactory { public TaskSubmitter provideTaskSubmitter(SubmitTaskParameters parameters) { switch (parameters.getTopologyName()) { case TopologiesNames.OAI_TOPOLOGY: return oaiTopologyTaskSubmitter; case TopologiesNames.HTTP_TOPOLOGY: return httpTopologyTaskSubmitter; case TopologiesNames.ENRICHMENT_TOPOLOGY: ... |
@Test public void shouldProvideSubmitterForOtherTopologies() { TaskSubmitterFactory taskSubmitterFactory = new TaskSubmitterFactory( Mockito.mock(OaiTopologyTaskSubmitter.class), Mockito.mock(HttpTopologyTaskSubmitter.class), Mockito.mock(OtherTopologiesTaskSubmitter.class), Mockito.mock(DepublicationTaskSubmitter.clas... | public TaskSubmitter provideTaskSubmitter(SubmitTaskParameters parameters) { switch (parameters.getTopologyName()) { case TopologiesNames.OAI_TOPOLOGY: return oaiTopologyTaskSubmitter; case TopologiesNames.HTTP_TOPOLOGY: return httpTopologyTaskSubmitter; case TopologiesNames.ENRICHMENT_TOPOLOGY: case TopologiesNames.IN... | TaskSubmitterFactory { public TaskSubmitter provideTaskSubmitter(SubmitTaskParameters parameters) { switch (parameters.getTopologyName()) { case TopologiesNames.OAI_TOPOLOGY: return oaiTopologyTaskSubmitter; case TopologiesNames.HTTP_TOPOLOGY: return httpTopologyTaskSubmitter; case TopologiesNames.ENRICHMENT_TOPOLOGY: ... | TaskSubmitterFactory { public TaskSubmitter provideTaskSubmitter(SubmitTaskParameters parameters) { switch (parameters.getTopologyName()) { case TopologiesNames.OAI_TOPOLOGY: return oaiTopologyTaskSubmitter; case TopologiesNames.HTTP_TOPOLOGY: return httpTopologyTaskSubmitter; case TopologiesNames.ENRICHMENT_TOPOLOGY: ... | TaskSubmitterFactory { public TaskSubmitter provideTaskSubmitter(SubmitTaskParameters parameters) { switch (parameters.getTopologyName()) { case TopologiesNames.OAI_TOPOLOGY: return oaiTopologyTaskSubmitter; case TopologiesNames.HTTP_TOPOLOGY: return httpTopologyTaskSubmitter; case TopologiesNames.ENRICHMENT_TOPOLOGY: ... | TaskSubmitterFactory { public TaskSubmitter provideTaskSubmitter(SubmitTaskParameters parameters) { switch (parameters.getTopologyName()) { case TopologiesNames.OAI_TOPOLOGY: return oaiTopologyTaskSubmitter; case TopologiesNames.HTTP_TOPOLOGY: return httpTopologyTaskSubmitter; case TopologiesNames.ENRICHMENT_TOPOLOGY: ... |
@Test(expected = IllegalArgumentException.class) public void shouldThrowExceptionForUnknownTopologyName() { new TaskSubmitterFactory( Mockito.mock(OaiTopologyTaskSubmitter.class), Mockito.mock(HttpTopologyTaskSubmitter.class), Mockito.mock(OtherTopologiesTaskSubmitter.class), Mockito.mock(DepublicationTaskSubmitter.cla... | public TaskSubmitter provideTaskSubmitter(SubmitTaskParameters parameters) { switch (parameters.getTopologyName()) { case TopologiesNames.OAI_TOPOLOGY: return oaiTopologyTaskSubmitter; case TopologiesNames.HTTP_TOPOLOGY: return httpTopologyTaskSubmitter; case TopologiesNames.ENRICHMENT_TOPOLOGY: case TopologiesNames.IN... | TaskSubmitterFactory { public TaskSubmitter provideTaskSubmitter(SubmitTaskParameters parameters) { switch (parameters.getTopologyName()) { case TopologiesNames.OAI_TOPOLOGY: return oaiTopologyTaskSubmitter; case TopologiesNames.HTTP_TOPOLOGY: return httpTopologyTaskSubmitter; case TopologiesNames.ENRICHMENT_TOPOLOGY: ... | TaskSubmitterFactory { public TaskSubmitter provideTaskSubmitter(SubmitTaskParameters parameters) { switch (parameters.getTopologyName()) { case TopologiesNames.OAI_TOPOLOGY: return oaiTopologyTaskSubmitter; case TopologiesNames.HTTP_TOPOLOGY: return httpTopologyTaskSubmitter; case TopologiesNames.ENRICHMENT_TOPOLOGY: ... | TaskSubmitterFactory { public TaskSubmitter provideTaskSubmitter(SubmitTaskParameters parameters) { switch (parameters.getTopologyName()) { case TopologiesNames.OAI_TOPOLOGY: return oaiTopologyTaskSubmitter; case TopologiesNames.HTTP_TOPOLOGY: return httpTopologyTaskSubmitter; case TopologiesNames.ENRICHMENT_TOPOLOGY: ... | TaskSubmitterFactory { public TaskSubmitter provideTaskSubmitter(SubmitTaskParameters parameters) { switch (parameters.getTopologyName()) { case TopologiesNames.OAI_TOPOLOGY: return oaiTopologyTaskSubmitter; case TopologiesNames.HTTP_TOPOLOGY: return httpTopologyTaskSubmitter; case TopologiesNames.ENRICHMENT_TOPOLOGY: ... |
@Test public void shouldNotStartExecutionForEmptyTasksList() { List<TaskInfo> unfinishedTasks = new ArrayList<>(); Mockito.reset(cassandraTasksDAO); when(cassandraTasksDAO.findTasksInGivenState(Mockito.any(List.class))).thenReturn(unfinishedTasks); unfinishedTasksExecutor.reRunUnfinishedTasks(); Mockito.verify(cassandr... | @PostConstruct public void reRunUnfinishedTasks() { LOGGER.info("Will restart all pending tasks"); List<TaskInfo> results = findProcessingByRestTasks(); List<TaskInfo> tasksForCurrentMachine = findTasksForCurrentMachine(results); resumeExecutionFor(tasksForCurrentMachine); } | UnfinishedTasksExecutor { @PostConstruct public void reRunUnfinishedTasks() { LOGGER.info("Will restart all pending tasks"); List<TaskInfo> results = findProcessingByRestTasks(); List<TaskInfo> tasksForCurrentMachine = findTasksForCurrentMachine(results); resumeExecutionFor(tasksForCurrentMachine); } } | UnfinishedTasksExecutor { @PostConstruct public void reRunUnfinishedTasks() { LOGGER.info("Will restart all pending tasks"); List<TaskInfo> results = findProcessingByRestTasks(); List<TaskInfo> tasksForCurrentMachine = findTasksForCurrentMachine(results); resumeExecutionFor(tasksForCurrentMachine); } UnfinishedTasksExe... | UnfinishedTasksExecutor { @PostConstruct public void reRunUnfinishedTasks() { LOGGER.info("Will restart all pending tasks"); List<TaskInfo> results = findProcessingByRestTasks(); List<TaskInfo> tasksForCurrentMachine = findTasksForCurrentMachine(results); resumeExecutionFor(tasksForCurrentMachine); } UnfinishedTasksExe... | UnfinishedTasksExecutor { @PostConstruct public void reRunUnfinishedTasks() { LOGGER.info("Will restart all pending tasks"); List<TaskInfo> results = findProcessingByRestTasks(); List<TaskInfo> tasksForCurrentMachine = findTasksForCurrentMachine(results); resumeExecutionFor(tasksForCurrentMachine); } UnfinishedTasksExe... |
@Test public void shouldStartExecutionForOneTasks() throws TaskInfoDoesNotExistException { List<TaskInfo> unfinishedTasks = new ArrayList<>(); TaskInfo taskInfo = prepareTestTask(); unfinishedTasks.add(taskInfo); Mockito.reset(cassandraTasksDAO); Mockito.reset(taskSubmitterFactory); when(cassandraTasksDAO.findTasksInGi... | @PostConstruct public void reRunUnfinishedTasks() { LOGGER.info("Will restart all pending tasks"); List<TaskInfo> results = findProcessingByRestTasks(); List<TaskInfo> tasksForCurrentMachine = findTasksForCurrentMachine(results); resumeExecutionFor(tasksForCurrentMachine); } | UnfinishedTasksExecutor { @PostConstruct public void reRunUnfinishedTasks() { LOGGER.info("Will restart all pending tasks"); List<TaskInfo> results = findProcessingByRestTasks(); List<TaskInfo> tasksForCurrentMachine = findTasksForCurrentMachine(results); resumeExecutionFor(tasksForCurrentMachine); } } | UnfinishedTasksExecutor { @PostConstruct public void reRunUnfinishedTasks() { LOGGER.info("Will restart all pending tasks"); List<TaskInfo> results = findProcessingByRestTasks(); List<TaskInfo> tasksForCurrentMachine = findTasksForCurrentMachine(results); resumeExecutionFor(tasksForCurrentMachine); } UnfinishedTasksExe... | UnfinishedTasksExecutor { @PostConstruct public void reRunUnfinishedTasks() { LOGGER.info("Will restart all pending tasks"); List<TaskInfo> results = findProcessingByRestTasks(); List<TaskInfo> tasksForCurrentMachine = findTasksForCurrentMachine(results); resumeExecutionFor(tasksForCurrentMachine); } UnfinishedTasksExe... | UnfinishedTasksExecutor { @PostConstruct public void reRunUnfinishedTasks() { LOGGER.info("Will restart all pending tasks"); List<TaskInfo> results = findProcessingByRestTasks(); List<TaskInfo> tasksForCurrentMachine = findTasksForCurrentMachine(results); resumeExecutionFor(tasksForCurrentMachine); } UnfinishedTasksExe... |
@Test public void shouldExecuteTheSessionWithoutRetry() throws Exception { ResultSet resultSet = mock(ResultSet.class); when(resultSet.one()).thenReturn(rows.get(0)); when(resultSet.one().getLong("count")).thenReturn(1l); when(session.execute(matchingBoundStatement)).thenReturn(resultSet); PreparedStatement preparedSta... | @Override public Void call() throws Exception { validateRows(); return null; } | RowsValidatorJob implements Callable<Void> { @Override public Void call() throws Exception { validateRows(); return null; } } | RowsValidatorJob implements Callable<Void> { @Override public Void call() throws Exception { validateRows(); return null; } RowsValidatorJob(Session session, List<String> primaryKeys, BoundStatement matchingBoundStatement, List<Row> rows); } | RowsValidatorJob implements Callable<Void> { @Override public Void call() throws Exception { validateRows(); return null; } RowsValidatorJob(Session session, List<String> primaryKeys, BoundStatement matchingBoundStatement, List<Row> rows); @Override Void call(); } | RowsValidatorJob implements Callable<Void> { @Override public Void call() throws Exception { validateRows(); return null; } RowsValidatorJob(Session session, List<String> primaryKeys, BoundStatement matchingBoundStatement, List<Row> rows); @Override Void call(); } |
@Test public void shouldStartExecutionForTasksThatBelongsToGivenMachine() throws TaskInfoDoesNotExistException { List<TaskInfo> unfinishedTasks = new ArrayList<>(); TaskInfo taskInfo = prepareTestTask(); unfinishedTasks.add(taskInfo); unfinishedTasks.add(prepareTestTaskForAnotherMachine()); Mockito.reset(cassandraTasks... | @PostConstruct public void reRunUnfinishedTasks() { LOGGER.info("Will restart all pending tasks"); List<TaskInfo> results = findProcessingByRestTasks(); List<TaskInfo> tasksForCurrentMachine = findTasksForCurrentMachine(results); resumeExecutionFor(tasksForCurrentMachine); } | UnfinishedTasksExecutor { @PostConstruct public void reRunUnfinishedTasks() { LOGGER.info("Will restart all pending tasks"); List<TaskInfo> results = findProcessingByRestTasks(); List<TaskInfo> tasksForCurrentMachine = findTasksForCurrentMachine(results); resumeExecutionFor(tasksForCurrentMachine); } } | UnfinishedTasksExecutor { @PostConstruct public void reRunUnfinishedTasks() { LOGGER.info("Will restart all pending tasks"); List<TaskInfo> results = findProcessingByRestTasks(); List<TaskInfo> tasksForCurrentMachine = findTasksForCurrentMachine(results); resumeExecutionFor(tasksForCurrentMachine); } UnfinishedTasksExe... | UnfinishedTasksExecutor { @PostConstruct public void reRunUnfinishedTasks() { LOGGER.info("Will restart all pending tasks"); List<TaskInfo> results = findProcessingByRestTasks(); List<TaskInfo> tasksForCurrentMachine = findTasksForCurrentMachine(results); resumeExecutionFor(tasksForCurrentMachine); } UnfinishedTasksExe... | UnfinishedTasksExecutor { @PostConstruct public void reRunUnfinishedTasks() { LOGGER.info("Will restart all pending tasks"); List<TaskInfo> results = findProcessingByRestTasks(); List<TaskInfo> tasksForCurrentMachine = findTasksForCurrentMachine(results); resumeExecutionFor(tasksForCurrentMachine); } UnfinishedTasksExe... |
@Test public void shouldSuccessfullyParseTopicsList() { TopologiesTopicsParser t = new TopologiesTopicsParser(); Map<String, List<String>> topologiesTopicsList = t.parse(VALID_INPUT); Assert.assertEquals(2, topologiesTopicsList.size()); Assert.assertNotNull(topologiesTopicsList.get("oai_topology")); Assert.assertNotNul... | public Map<String, List<String>> parse(String topicsList) { if (isInputValid(topicsList)) { List<String> topologies = extractTopologies(topicsList); return extractTopics(topologies); } else { throw new RuntimeException("Topics list is not valid"); } } | TopologiesTopicsParser { public Map<String, List<String>> parse(String topicsList) { if (isInputValid(topicsList)) { List<String> topologies = extractTopologies(topicsList); return extractTopics(topologies); } else { throw new RuntimeException("Topics list is not valid"); } } } | TopologiesTopicsParser { public Map<String, List<String>> parse(String topicsList) { if (isInputValid(topicsList)) { List<String> topologies = extractTopologies(topicsList); return extractTopics(topologies); } else { throw new RuntimeException("Topics list is not valid"); } } } | TopologiesTopicsParser { public Map<String, List<String>> parse(String topicsList) { if (isInputValid(topicsList)) { List<String> topologies = extractTopologies(topicsList); return extractTopics(topologies); } else { throw new RuntimeException("Topics list is not valid"); } } Map<String, List<String>> parse(String top... | TopologiesTopicsParser { public Map<String, List<String>> parse(String topicsList) { if (isInputValid(topicsList)) { List<String> topologies = extractTopologies(topicsList); return extractTopics(topologies); } else { throw new RuntimeException("Topics list is not valid"); } } Map<String, List<String>> parse(String top... |
@Test public void shouldSuccessfullyParseTopicsList_1() { TopologiesTopicsParser t = new TopologiesTopicsParser(); Map<String, List<String>> topologiesTopicsList = t.parse(VALID_INPUT_1); Assert.assertEquals(2, topologiesTopicsList.size()); Assert.assertNotNull(topologiesTopicsList.get("oai_topology")); Assert.assertNo... | public Map<String, List<String>> parse(String topicsList) { if (isInputValid(topicsList)) { List<String> topologies = extractTopologies(topicsList); return extractTopics(topologies); } else { throw new RuntimeException("Topics list is not valid"); } } | TopologiesTopicsParser { public Map<String, List<String>> parse(String topicsList) { if (isInputValid(topicsList)) { List<String> topologies = extractTopologies(topicsList); return extractTopics(topologies); } else { throw new RuntimeException("Topics list is not valid"); } } } | TopologiesTopicsParser { public Map<String, List<String>> parse(String topicsList) { if (isInputValid(topicsList)) { List<String> topologies = extractTopologies(topicsList); return extractTopics(topologies); } else { throw new RuntimeException("Topics list is not valid"); } } } | TopologiesTopicsParser { public Map<String, List<String>> parse(String topicsList) { if (isInputValid(topicsList)) { List<String> topologies = extractTopologies(topicsList); return extractTopics(topologies); } else { throw new RuntimeException("Topics list is not valid"); } } Map<String, List<String>> parse(String top... | TopologiesTopicsParser { public Map<String, List<String>> parse(String topicsList) { if (isInputValid(topicsList)) { List<String> topologies = extractTopologies(topicsList); return extractTopics(topologies); } else { throw new RuntimeException("Topics list is not valid"); } } Map<String, List<String>> parse(String top... |
@Test(expected = RuntimeException.class) public void shouldThrowExceptionForInvalidTopicsList_1() { TopologiesTopicsParser t = new TopologiesTopicsParser(); t.parse(INVALID_INPUT_1); } | public Map<String, List<String>> parse(String topicsList) { if (isInputValid(topicsList)) { List<String> topologies = extractTopologies(topicsList); return extractTopics(topologies); } else { throw new RuntimeException("Topics list is not valid"); } } | TopologiesTopicsParser { public Map<String, List<String>> parse(String topicsList) { if (isInputValid(topicsList)) { List<String> topologies = extractTopologies(topicsList); return extractTopics(topologies); } else { throw new RuntimeException("Topics list is not valid"); } } } | TopologiesTopicsParser { public Map<String, List<String>> parse(String topicsList) { if (isInputValid(topicsList)) { List<String> topologies = extractTopologies(topicsList); return extractTopics(topologies); } else { throw new RuntimeException("Topics list is not valid"); } } } | TopologiesTopicsParser { public Map<String, List<String>> parse(String topicsList) { if (isInputValid(topicsList)) { List<String> topologies = extractTopologies(topicsList); return extractTopics(topologies); } else { throw new RuntimeException("Topics list is not valid"); } } Map<String, List<String>> parse(String top... | TopologiesTopicsParser { public Map<String, List<String>> parse(String topicsList) { if (isInputValid(topicsList)) { List<String> topologies = extractTopologies(topicsList); return extractTopics(topologies); } else { throw new RuntimeException("Topics list is not valid"); } } Map<String, List<String>> parse(String top... |
@Test public void findGhostTasksReturnsEmptyListIfNotTaskActive() { assertThat(service.findGhostTasks(), empty()); } | public List<TaskInfo> findGhostTasks() { return findTasksInGivenStates(TaskState.PROCESSING_BY_REST_APPLICATION, TaskState.QUEUED). filter(this::isGhost).collect(Collectors.toList()); } | GhostTaskService { public List<TaskInfo> findGhostTasks() { return findTasksInGivenStates(TaskState.PROCESSING_BY_REST_APPLICATION, TaskState.QUEUED). filter(this::isGhost).collect(Collectors.toList()); } } | GhostTaskService { public List<TaskInfo> findGhostTasks() { return findTasksInGivenStates(TaskState.PROCESSING_BY_REST_APPLICATION, TaskState.QUEUED). filter(this::isGhost).collect(Collectors.toList()); } GhostTaskService(Environment environment); } | GhostTaskService { public List<TaskInfo> findGhostTasks() { return findTasksInGivenStates(TaskState.PROCESSING_BY_REST_APPLICATION, TaskState.QUEUED). filter(this::isGhost).collect(Collectors.toList()); } GhostTaskService(Environment environment); @Scheduled(cron = "0 0 * * * *") void serviceTask(); List<TaskInfo> find... | GhostTaskService { public List<TaskInfo> findGhostTasks() { return findTasksInGivenStates(TaskState.PROCESSING_BY_REST_APPLICATION, TaskState.QUEUED). filter(this::isGhost).collect(Collectors.toList()); } GhostTaskService(Environment environment); @Scheduled(cron = "0 0 * * * *") void serviceTask(); List<TaskInfo> find... |
@Test public void findGhostTasksReturnsTaskIfItIsOldSentAndNoStarted() { when(tasksByStateDAO.findTasksInGivenState(eq(ACTIVE_TASK_STATES))) .thenReturn(Collections.singletonList(TOPIC_INFO_1)); when(taskInfoDAO.findById(anyLong())).thenReturn(Optional.of(OLD_SENT_NO_STARTED_TASK_INFO_1)); assertThat(service.findGhostT... | public List<TaskInfo> findGhostTasks() { return findTasksInGivenStates(TaskState.PROCESSING_BY_REST_APPLICATION, TaskState.QUEUED). filter(this::isGhost).collect(Collectors.toList()); } | GhostTaskService { public List<TaskInfo> findGhostTasks() { return findTasksInGivenStates(TaskState.PROCESSING_BY_REST_APPLICATION, TaskState.QUEUED). filter(this::isGhost).collect(Collectors.toList()); } } | GhostTaskService { public List<TaskInfo> findGhostTasks() { return findTasksInGivenStates(TaskState.PROCESSING_BY_REST_APPLICATION, TaskState.QUEUED). filter(this::isGhost).collect(Collectors.toList()); } GhostTaskService(Environment environment); } | GhostTaskService { public List<TaskInfo> findGhostTasks() { return findTasksInGivenStates(TaskState.PROCESSING_BY_REST_APPLICATION, TaskState.QUEUED). filter(this::isGhost).collect(Collectors.toList()); } GhostTaskService(Environment environment); @Scheduled(cron = "0 0 * * * *") void serviceTask(); List<TaskInfo> find... | GhostTaskService { public List<TaskInfo> findGhostTasks() { return findTasksInGivenStates(TaskState.PROCESSING_BY_REST_APPLICATION, TaskState.QUEUED). filter(this::isGhost).collect(Collectors.toList()); } GhostTaskService(Environment environment); @Scheduled(cron = "0 0 * * * *") void serviceTask(); List<TaskInfo> find... |
@Test public void findGhostTasksReturnsTaskIfItIsOldSentAndOldStarted() { when(tasksByStateDAO.findTasksInGivenState(eq(ACTIVE_TASK_STATES))) .thenReturn(Collections.singletonList(TOPIC_INFO_1)); when(taskInfoDAO.findById(anyLong())).thenReturn(Optional.of(OLD_SENT_OLD_STARTED_TASK_INFO_1)); assertThat(service.findGhos... | public List<TaskInfo> findGhostTasks() { return findTasksInGivenStates(TaskState.PROCESSING_BY_REST_APPLICATION, TaskState.QUEUED). filter(this::isGhost).collect(Collectors.toList()); } | GhostTaskService { public List<TaskInfo> findGhostTasks() { return findTasksInGivenStates(TaskState.PROCESSING_BY_REST_APPLICATION, TaskState.QUEUED). filter(this::isGhost).collect(Collectors.toList()); } } | GhostTaskService { public List<TaskInfo> findGhostTasks() { return findTasksInGivenStates(TaskState.PROCESSING_BY_REST_APPLICATION, TaskState.QUEUED). filter(this::isGhost).collect(Collectors.toList()); } GhostTaskService(Environment environment); } | GhostTaskService { public List<TaskInfo> findGhostTasks() { return findTasksInGivenStates(TaskState.PROCESSING_BY_REST_APPLICATION, TaskState.QUEUED). filter(this::isGhost).collect(Collectors.toList()); } GhostTaskService(Environment environment); @Scheduled(cron = "0 0 * * * *") void serviceTask(); List<TaskInfo> find... | GhostTaskService { public List<TaskInfo> findGhostTasks() { return findTasksInGivenStates(TaskState.PROCESSING_BY_REST_APPLICATION, TaskState.QUEUED). filter(this::isGhost).collect(Collectors.toList()); } GhostTaskService(Environment environment); @Scheduled(cron = "0 0 * * * *") void serviceTask(); List<TaskInfo> find... |
@Test public void findGhostTasksShouldIgnoreTasksThatNewlySentAndNewStarted() { when(tasksByStateDAO.findTasksInGivenState(eq(ACTIVE_TASK_STATES))) .thenReturn(Collections.singletonList(TOPIC_INFO_1)); when(taskInfoDAO.findById(anyLong())).thenReturn(Optional.of(OLD_SENT_NEWLY_STARTED_TASK_INFO_1)); assertThat(service.... | public List<TaskInfo> findGhostTasks() { return findTasksInGivenStates(TaskState.PROCESSING_BY_REST_APPLICATION, TaskState.QUEUED). filter(this::isGhost).collect(Collectors.toList()); } | GhostTaskService { public List<TaskInfo> findGhostTasks() { return findTasksInGivenStates(TaskState.PROCESSING_BY_REST_APPLICATION, TaskState.QUEUED). filter(this::isGhost).collect(Collectors.toList()); } } | GhostTaskService { public List<TaskInfo> findGhostTasks() { return findTasksInGivenStates(TaskState.PROCESSING_BY_REST_APPLICATION, TaskState.QUEUED). filter(this::isGhost).collect(Collectors.toList()); } GhostTaskService(Environment environment); } | GhostTaskService { public List<TaskInfo> findGhostTasks() { return findTasksInGivenStates(TaskState.PROCESSING_BY_REST_APPLICATION, TaskState.QUEUED). filter(this::isGhost).collect(Collectors.toList()); } GhostTaskService(Environment environment); @Scheduled(cron = "0 0 * * * *") void serviceTask(); List<TaskInfo> find... | GhostTaskService { public List<TaskInfo> findGhostTasks() { return findTasksInGivenStates(TaskState.PROCESSING_BY_REST_APPLICATION, TaskState.QUEUED). filter(this::isGhost).collect(Collectors.toList()); } GhostTaskService(Environment environment); @Scheduled(cron = "0 0 * * * *") void serviceTask(); List<TaskInfo> find... |
@Test public void findGhostTasksShouldIgnoreTasksThatOldSentButNewStarted() { when(tasksByStateDAO.findTasksInGivenState(eq(ACTIVE_TASK_STATES))) .thenReturn(Collections.singletonList(TOPIC_INFO_1)); when(taskInfoDAO.findById(anyLong())).thenReturn(Optional.of(NEWLY_SENT_NEWLY_STARTED_TASK_INFO_1)); assertThat(service.... | public List<TaskInfo> findGhostTasks() { return findTasksInGivenStates(TaskState.PROCESSING_BY_REST_APPLICATION, TaskState.QUEUED). filter(this::isGhost).collect(Collectors.toList()); } | GhostTaskService { public List<TaskInfo> findGhostTasks() { return findTasksInGivenStates(TaskState.PROCESSING_BY_REST_APPLICATION, TaskState.QUEUED). filter(this::isGhost).collect(Collectors.toList()); } } | GhostTaskService { public List<TaskInfo> findGhostTasks() { return findTasksInGivenStates(TaskState.PROCESSING_BY_REST_APPLICATION, TaskState.QUEUED). filter(this::isGhost).collect(Collectors.toList()); } GhostTaskService(Environment environment); } | GhostTaskService { public List<TaskInfo> findGhostTasks() { return findTasksInGivenStates(TaskState.PROCESSING_BY_REST_APPLICATION, TaskState.QUEUED). filter(this::isGhost).collect(Collectors.toList()); } GhostTaskService(Environment environment); @Scheduled(cron = "0 0 * * * *") void serviceTask(); List<TaskInfo> find... | GhostTaskService { public List<TaskInfo> findGhostTasks() { return findTasksInGivenStates(TaskState.PROCESSING_BY_REST_APPLICATION, TaskState.QUEUED). filter(this::isGhost).collect(Collectors.toList()); } GhostTaskService(Environment environment); @Scheduled(cron = "0 0 * * * *") void serviceTask(); List<TaskInfo> find... |
@Test public void findGhostTasksShouldIgnoreTasksThatNewlySentAndNotStarted() { when(tasksByStateDAO.findTasksInGivenState(eq(ACTIVE_TASK_STATES))) .thenReturn(Collections.singletonList(TOPIC_INFO_1)); when(taskInfoDAO.findById(anyLong())).thenReturn(Optional.of(NEWLY_SENT_NO_STARTED_TASK_INFO_1)); assertThat(service.f... | public List<TaskInfo> findGhostTasks() { return findTasksInGivenStates(TaskState.PROCESSING_BY_REST_APPLICATION, TaskState.QUEUED). filter(this::isGhost).collect(Collectors.toList()); } | GhostTaskService { public List<TaskInfo> findGhostTasks() { return findTasksInGivenStates(TaskState.PROCESSING_BY_REST_APPLICATION, TaskState.QUEUED). filter(this::isGhost).collect(Collectors.toList()); } } | GhostTaskService { public List<TaskInfo> findGhostTasks() { return findTasksInGivenStates(TaskState.PROCESSING_BY_REST_APPLICATION, TaskState.QUEUED). filter(this::isGhost).collect(Collectors.toList()); } GhostTaskService(Environment environment); } | GhostTaskService { public List<TaskInfo> findGhostTasks() { return findTasksInGivenStates(TaskState.PROCESSING_BY_REST_APPLICATION, TaskState.QUEUED). filter(this::isGhost).collect(Collectors.toList()); } GhostTaskService(Environment environment); @Scheduled(cron = "0 0 * * * *") void serviceTask(); List<TaskInfo> find... | GhostTaskService { public List<TaskInfo> findGhostTasks() { return findTasksInGivenStates(TaskState.PROCESSING_BY_REST_APPLICATION, TaskState.QUEUED). filter(this::isGhost).collect(Collectors.toList()); } GhostTaskService(Environment environment); @Scheduled(cron = "0 0 * * * *") void serviceTask(); List<TaskInfo> find... |
@Test public void shouldExecuteTheSessionWithMaximumRetry() throws Exception { ResultSet resultSet = mock(ResultSet.class); when(resultSet.one()).thenReturn(rows.get(0)); when(resultSet.one().getLong("count")).thenReturn(0l); final Session session = mock(Session.class); when(session.execute(matchingBoundStatement)).the... | @Override public Void call() throws Exception { validateRows(); return null; } | RowsValidatorJob implements Callable<Void> { @Override public Void call() throws Exception { validateRows(); return null; } } | RowsValidatorJob implements Callable<Void> { @Override public Void call() throws Exception { validateRows(); return null; } RowsValidatorJob(Session session, List<String> primaryKeys, BoundStatement matchingBoundStatement, List<Row> rows); } | RowsValidatorJob implements Callable<Void> { @Override public Void call() throws Exception { validateRows(); return null; } RowsValidatorJob(Session session, List<String> primaryKeys, BoundStatement matchingBoundStatement, List<Row> rows); @Override Void call(); } | RowsValidatorJob implements Callable<Void> { @Override public Void call() throws Exception { validateRows(); return null; } RowsValidatorJob(Session session, List<String> primaryKeys, BoundStatement matchingBoundStatement, List<Row> rows); @Override Void call(); } |
@Test public void shouldRemoveEntireRepresentation() throws Exception { final int NUMBER_OF_REVISIONS = 1; final int NUMBER_OF_RESPONSES = 2; RevisionInformation revisionInformation = new RevisionInformation("DATASET", DATA_PROVIDER, SOURCE + REPRESENTATION_NAME, REVISION_NAME, REVISION_PROVIDER, getUTCDateString(date)... | void setRevisionInformation(RevisionInformation revisionInformation) { this.revisionInformation = revisionInformation; } | RevisionRemoverJob implements Runnable { void setRevisionInformation(RevisionInformation revisionInformation) { this.revisionInformation = revisionInformation; } } | RevisionRemoverJob implements Runnable { void setRevisionInformation(RevisionInformation revisionInformation) { this.revisionInformation = revisionInformation; } RevisionRemoverJob(DataSetServiceClient dataSetServiceClient, RecordServiceClient recordServiceClient, RevisionInformation revisionInformation, RevisionServic... | RevisionRemoverJob implements Runnable { void setRevisionInformation(RevisionInformation revisionInformation) { this.revisionInformation = revisionInformation; } RevisionRemoverJob(DataSetServiceClient dataSetServiceClient, RecordServiceClient recordServiceClient, RevisionInformation revisionInformation, RevisionServic... | RevisionRemoverJob implements Runnable { void setRevisionInformation(RevisionInformation revisionInformation) { this.revisionInformation = revisionInformation; } RevisionRemoverJob(DataSetServiceClient dataSetServiceClient, RecordServiceClient recordServiceClient, RevisionInformation revisionInformation, RevisionServic... |
@Test public void findGhostTasksShouldIgnoreTasksThatNotReserveTopicBelongingToTopology() { when(tasksByStateDAO.findTasksInGivenState(eq(ACTIVE_TASK_STATES))) .thenReturn(Collections.singletonList(TOPIC_INFO_1_UNKNONW_TOPIC)); when(taskInfoDAO.findById(anyLong())).thenReturn(Optional.of(OLD_SENT_NO_STARTED_TASK_INFO_1... | public List<TaskInfo> findGhostTasks() { return findTasksInGivenStates(TaskState.PROCESSING_BY_REST_APPLICATION, TaskState.QUEUED). filter(this::isGhost).collect(Collectors.toList()); } | GhostTaskService { public List<TaskInfo> findGhostTasks() { return findTasksInGivenStates(TaskState.PROCESSING_BY_REST_APPLICATION, TaskState.QUEUED). filter(this::isGhost).collect(Collectors.toList()); } } | GhostTaskService { public List<TaskInfo> findGhostTasks() { return findTasksInGivenStates(TaskState.PROCESSING_BY_REST_APPLICATION, TaskState.QUEUED). filter(this::isGhost).collect(Collectors.toList()); } GhostTaskService(Environment environment); } | GhostTaskService { public List<TaskInfo> findGhostTasks() { return findTasksInGivenStates(TaskState.PROCESSING_BY_REST_APPLICATION, TaskState.QUEUED). filter(this::isGhost).collect(Collectors.toList()); } GhostTaskService(Environment environment); @Scheduled(cron = "0 0 * * * *") void serviceTask(); List<TaskInfo> find... | GhostTaskService { public List<TaskInfo> findGhostTasks() { return findTasksInGivenStates(TaskState.PROCESSING_BY_REST_APPLICATION, TaskState.QUEUED). filter(this::isGhost).collect(Collectors.toList()); } GhostTaskService(Environment environment); @Scheduled(cron = "0 0 * * * *") void serviceTask(); List<TaskInfo> find... |
@Test public void shouldReturnProcessedFiles() throws Exception { TaskInfo taskInfo = new TaskInfo(TASK_ID, TOPOLOGY_NAME, TaskState.PROCESSED, "", EXPECTED_SIZE, EXPECTED_SIZE, 0, 0, new Date(), new Date(), new Date()); when(taskInfoDAO.findById(TASK_ID)).thenReturn(Optional.of(taskInfo)); dpsTask.addParameter(PluginP... | public int getFilesCount(DpsTask task) throws TaskSubmissionException { String providedTaskId = task.getParameter(PluginParameterKeys.PREVIOUS_TASK_ID); if (providedTaskId==null) return UNKNOWN_EXPECTED_SIZE; try { long taskId = Long.parseLong(providedTaskId); TaskInfo taskInfo = taskInfoDAO.findById(taskId).orElseThro... | DatasetFilesCounter extends FilesCounter { public int getFilesCount(DpsTask task) throws TaskSubmissionException { String providedTaskId = task.getParameter(PluginParameterKeys.PREVIOUS_TASK_ID); if (providedTaskId==null) return UNKNOWN_EXPECTED_SIZE; try { long taskId = Long.parseLong(providedTaskId); TaskInfo taskInf... | DatasetFilesCounter extends FilesCounter { public int getFilesCount(DpsTask task) throws TaskSubmissionException { String providedTaskId = task.getParameter(PluginParameterKeys.PREVIOUS_TASK_ID); if (providedTaskId==null) return UNKNOWN_EXPECTED_SIZE; try { long taskId = Long.parseLong(providedTaskId); TaskInfo taskInf... | DatasetFilesCounter extends FilesCounter { public int getFilesCount(DpsTask task) throws TaskSubmissionException { String providedTaskId = task.getParameter(PluginParameterKeys.PREVIOUS_TASK_ID); if (providedTaskId==null) return UNKNOWN_EXPECTED_SIZE; try { long taskId = Long.parseLong(providedTaskId); TaskInfo taskInf... | DatasetFilesCounter extends FilesCounter { public int getFilesCount(DpsTask task) throws TaskSubmissionException { String providedTaskId = task.getParameter(PluginParameterKeys.PREVIOUS_TASK_ID); if (providedTaskId==null) return UNKNOWN_EXPECTED_SIZE; try { long taskId = Long.parseLong(providedTaskId); TaskInfo taskInf... |
@Test public void shouldReturnedDefaultFilesCountWhenNoPreviousTaskIdIsProvided() throws Exception { int expectedFilesCount = datasetFilesCounter.getFilesCount(dpsTask); assertEquals(DEFAULT_FILES_COUNT, expectedFilesCount); } | public int getFilesCount(DpsTask task) throws TaskSubmissionException { String providedTaskId = task.getParameter(PluginParameterKeys.PREVIOUS_TASK_ID); if (providedTaskId==null) return UNKNOWN_EXPECTED_SIZE; try { long taskId = Long.parseLong(providedTaskId); TaskInfo taskInfo = taskInfoDAO.findById(taskId).orElseThro... | DatasetFilesCounter extends FilesCounter { public int getFilesCount(DpsTask task) throws TaskSubmissionException { String providedTaskId = task.getParameter(PluginParameterKeys.PREVIOUS_TASK_ID); if (providedTaskId==null) return UNKNOWN_EXPECTED_SIZE; try { long taskId = Long.parseLong(providedTaskId); TaskInfo taskInf... | DatasetFilesCounter extends FilesCounter { public int getFilesCount(DpsTask task) throws TaskSubmissionException { String providedTaskId = task.getParameter(PluginParameterKeys.PREVIOUS_TASK_ID); if (providedTaskId==null) return UNKNOWN_EXPECTED_SIZE; try { long taskId = Long.parseLong(providedTaskId); TaskInfo taskInf... | DatasetFilesCounter extends FilesCounter { public int getFilesCount(DpsTask task) throws TaskSubmissionException { String providedTaskId = task.getParameter(PluginParameterKeys.PREVIOUS_TASK_ID); if (providedTaskId==null) return UNKNOWN_EXPECTED_SIZE; try { long taskId = Long.parseLong(providedTaskId); TaskInfo taskInf... | DatasetFilesCounter extends FilesCounter { public int getFilesCount(DpsTask task) throws TaskSubmissionException { String providedTaskId = task.getParameter(PluginParameterKeys.PREVIOUS_TASK_ID); if (providedTaskId==null) return UNKNOWN_EXPECTED_SIZE; try { long taskId = Long.parseLong(providedTaskId); TaskInfo taskInf... |
@Test public void shouldReturnedDefaultFilesCountWhenPreviousTaskIdIsNotLongValue() throws Exception { int expectedFilesCount = datasetFilesCounter.getFilesCount(dpsTask); dpsTask.addParameter(PluginParameterKeys.PREVIOUS_TASK_ID, "Not long value"); assertEquals(DEFAULT_FILES_COUNT, expectedFilesCount); } | public int getFilesCount(DpsTask task) throws TaskSubmissionException { String providedTaskId = task.getParameter(PluginParameterKeys.PREVIOUS_TASK_ID); if (providedTaskId==null) return UNKNOWN_EXPECTED_SIZE; try { long taskId = Long.parseLong(providedTaskId); TaskInfo taskInfo = taskInfoDAO.findById(taskId).orElseThro... | DatasetFilesCounter extends FilesCounter { public int getFilesCount(DpsTask task) throws TaskSubmissionException { String providedTaskId = task.getParameter(PluginParameterKeys.PREVIOUS_TASK_ID); if (providedTaskId==null) return UNKNOWN_EXPECTED_SIZE; try { long taskId = Long.parseLong(providedTaskId); TaskInfo taskInf... | DatasetFilesCounter extends FilesCounter { public int getFilesCount(DpsTask task) throws TaskSubmissionException { String providedTaskId = task.getParameter(PluginParameterKeys.PREVIOUS_TASK_ID); if (providedTaskId==null) return UNKNOWN_EXPECTED_SIZE; try { long taskId = Long.parseLong(providedTaskId); TaskInfo taskInf... | DatasetFilesCounter extends FilesCounter { public int getFilesCount(DpsTask task) throws TaskSubmissionException { String providedTaskId = task.getParameter(PluginParameterKeys.PREVIOUS_TASK_ID); if (providedTaskId==null) return UNKNOWN_EXPECTED_SIZE; try { long taskId = Long.parseLong(providedTaskId); TaskInfo taskInf... | DatasetFilesCounter extends FilesCounter { public int getFilesCount(DpsTask task) throws TaskSubmissionException { String providedTaskId = task.getParameter(PluginParameterKeys.PREVIOUS_TASK_ID); if (providedTaskId==null) return UNKNOWN_EXPECTED_SIZE; try { long taskId = Long.parseLong(providedTaskId); TaskInfo taskInf... |
@Test public void shouldReturnedDefaultFilesCountWhenPreviousTaskIdDoesNotExist() throws Exception { dpsTask.addParameter(PluginParameterKeys.PREVIOUS_TASK_ID, String.valueOf(TASK_ID)); doReturn(Optional.empty()).when(taskInfoDAO).findById(TASK_ID); int expectedFilesCount = datasetFilesCounter.getFilesCount(dpsTask); a... | public int getFilesCount(DpsTask task) throws TaskSubmissionException { String providedTaskId = task.getParameter(PluginParameterKeys.PREVIOUS_TASK_ID); if (providedTaskId==null) return UNKNOWN_EXPECTED_SIZE; try { long taskId = Long.parseLong(providedTaskId); TaskInfo taskInfo = taskInfoDAO.findById(taskId).orElseThro... | DatasetFilesCounter extends FilesCounter { public int getFilesCount(DpsTask task) throws TaskSubmissionException { String providedTaskId = task.getParameter(PluginParameterKeys.PREVIOUS_TASK_ID); if (providedTaskId==null) return UNKNOWN_EXPECTED_SIZE; try { long taskId = Long.parseLong(providedTaskId); TaskInfo taskInf... | DatasetFilesCounter extends FilesCounter { public int getFilesCount(DpsTask task) throws TaskSubmissionException { String providedTaskId = task.getParameter(PluginParameterKeys.PREVIOUS_TASK_ID); if (providedTaskId==null) return UNKNOWN_EXPECTED_SIZE; try { long taskId = Long.parseLong(providedTaskId); TaskInfo taskInf... | DatasetFilesCounter extends FilesCounter { public int getFilesCount(DpsTask task) throws TaskSubmissionException { String providedTaskId = task.getParameter(PluginParameterKeys.PREVIOUS_TASK_ID); if (providedTaskId==null) return UNKNOWN_EXPECTED_SIZE; try { long taskId = Long.parseLong(providedTaskId); TaskInfo taskInf... | DatasetFilesCounter extends FilesCounter { public int getFilesCount(DpsTask task) throws TaskSubmissionException { String providedTaskId = task.getParameter(PluginParameterKeys.PREVIOUS_TASK_ID); if (providedTaskId==null) return UNKNOWN_EXPECTED_SIZE; try { long taskId = Long.parseLong(providedTaskId); TaskInfo taskInf... |
@Test(expected = TaskSubmissionException.class) public void shouldThrowExceptionWhenQueryingDatabaseUsingPreviousTaskIdThrowAnExceptionOtherThanTaskInfoDoesNotExistException() throws Exception { dpsTask.addParameter(PluginParameterKeys.PREVIOUS_TASK_ID, String.valueOf(TASK_ID)); doThrow(Exception.class).when(taskInfoDA... | public int getFilesCount(DpsTask task) throws TaskSubmissionException { String providedTaskId = task.getParameter(PluginParameterKeys.PREVIOUS_TASK_ID); if (providedTaskId==null) return UNKNOWN_EXPECTED_SIZE; try { long taskId = Long.parseLong(providedTaskId); TaskInfo taskInfo = taskInfoDAO.findById(taskId).orElseThro... | DatasetFilesCounter extends FilesCounter { public int getFilesCount(DpsTask task) throws TaskSubmissionException { String providedTaskId = task.getParameter(PluginParameterKeys.PREVIOUS_TASK_ID); if (providedTaskId==null) return UNKNOWN_EXPECTED_SIZE; try { long taskId = Long.parseLong(providedTaskId); TaskInfo taskInf... | DatasetFilesCounter extends FilesCounter { public int getFilesCount(DpsTask task) throws TaskSubmissionException { String providedTaskId = task.getParameter(PluginParameterKeys.PREVIOUS_TASK_ID); if (providedTaskId==null) return UNKNOWN_EXPECTED_SIZE; try { long taskId = Long.parseLong(providedTaskId); TaskInfo taskInf... | DatasetFilesCounter extends FilesCounter { public int getFilesCount(DpsTask task) throws TaskSubmissionException { String providedTaskId = task.getParameter(PluginParameterKeys.PREVIOUS_TASK_ID); if (providedTaskId==null) return UNKNOWN_EXPECTED_SIZE; try { long taskId = Long.parseLong(providedTaskId); TaskInfo taskInf... | DatasetFilesCounter extends FilesCounter { public int getFilesCount(DpsTask task) throws TaskSubmissionException { String providedTaskId = task.getParameter(PluginParameterKeys.PREVIOUS_TASK_ID); if (providedTaskId==null) return UNKNOWN_EXPECTED_SIZE; try { long taskId = Long.parseLong(providedTaskId); TaskInfo taskInf... |
@Test public void shouldGetCorrectCompleteListSize() throws Exception { stubFor(get(urlEqualTo("/oai-phm/?verb=ListIdentifiers")) .willReturn(response200XmlContent(getFileContent("/oaiListIdentifiers.xml")))); OaiPmhFilesCounter counter = new OaiPmhFilesCounter(); OAIPMHHarvestingDetails details = new OAIPMHHarvestingD... | @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExcludedSchemas())) { LOGGER.info("Cannot count... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... |
@Test public void shouldReturnMinusOneWhenEmptyCompleteListSize() throws Exception { stubFor(get(urlEqualTo("/oai-phm/?verb=ListIdentifiers")) .willReturn(response200XmlContent(getFileContent("/oaiListIdentifiersNoCompleteListSize.xml")))); OaiPmhFilesCounter counter = new OaiPmhFilesCounter(); OAIPMHHarvestingDetails ... | @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExcludedSchemas())) { LOGGER.info("Cannot count... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... |
@Test public void shouldReturnMinusOneWhenIncorrectCompleteListSize() throws Exception { stubFor(get(urlEqualTo("/oai-phm/?verb=ListIdentifiers")) .willReturn(response200XmlContent(getFileContent("/oaiListIdentifiersIncorrectCompleteListSize.xml")))); OaiPmhFilesCounter counter = new OaiPmhFilesCounter(); OAIPMHHarvest... | @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExcludedSchemas())) { LOGGER.info("Cannot count... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... |
@Test public void shouldReturnMinusOneWhen200ReturnedButErrorInResponse() throws Exception { stubFor(get(urlEqualTo("/oai-phm/?verb=ListIdentifiers")) .willReturn(response200XmlContent(getFileContent("/oaiListIdentifiersIncorrectMetadataPrefix.xml")))); OaiPmhFilesCounter counter = new OaiPmhFilesCounter(); OAIPMHHarve... | @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExcludedSchemas())) { LOGGER.info("Cannot count... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... |
@Test public void shouldThrowAnExceptionWithCorrectMessage() throws Exception { ResultSet resultSet = mock(ResultSet.class); when(resultSet.one()).thenReturn(rows.get(0)); when(resultSet.one().getLong("count")).thenReturn(0l); final Session session = mock(Session.class); when(session.execute(matchingBoundStatement)).th... | @Override public Void call() throws Exception { validateRows(); return null; } | RowsValidatorJob implements Callable<Void> { @Override public Void call() throws Exception { validateRows(); return null; } } | RowsValidatorJob implements Callable<Void> { @Override public Void call() throws Exception { validateRows(); return null; } RowsValidatorJob(Session session, List<String> primaryKeys, BoundStatement matchingBoundStatement, List<Row> rows); } | RowsValidatorJob implements Callable<Void> { @Override public Void call() throws Exception { validateRows(); return null; } RowsValidatorJob(Session session, List<String> primaryKeys, BoundStatement matchingBoundStatement, List<Row> rows); @Override Void call(); } | RowsValidatorJob implements Callable<Void> { @Override public Void call() throws Exception { validateRows(); return null; } RowsValidatorJob(Session session, List<String> primaryKeys, BoundStatement matchingBoundStatement, List<Row> rows); @Override Void call(); } |
@Test public void shouldReturnMinusOneWhenNoResumptionToken() throws Exception { stubFor(get(urlEqualTo("/oai-phm/?verb=ListIdentifiers")) .willReturn(response200XmlContent(getFileContent("/oaiListIdentifiersNoResumptionToken.xml")))); OaiPmhFilesCounter counter = new OaiPmhFilesCounter(); OAIPMHHarvestingDetails detai... | @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExcludedSchemas())) { LOGGER.info("Cannot count... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... |
@Test(expected = TaskSubmissionException.class) public void shouldRetry10TimesAndFail() throws Exception { stubFor(get(urlEqualTo("/oai-phm/?verb=ListIdentifiers")).inScenario("Retry and fail scenario") .willReturn(response404())); OaiPmhFilesCounter counter = new OaiPmhFilesCounter(); OAIPMHHarvestingDetails details =... | @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExcludedSchemas())) { LOGGER.info("Cannot count... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... |
@Test public void shouldRetryAndReturnACorrectValue() throws Exception { stubFor(get(urlEqualTo("/oai-phm/?verb=ListIdentifiers")).inScenario("Retry and success scenario").whenScenarioStateIs(STARTED).willSetStateTo("one time requested") .willReturn(response404())); stubFor(get(urlEqualTo("/oai-phm/?verb=ListIdentifier... | @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExcludedSchemas())) { LOGGER.info("Cannot count... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... |
@Test public void shouldReturnCorrectSumWhenSchemasAndSetListed() throws Exception { String schema1 = "schema1"; String schema2 = "schema2"; String set1 = "set1"; stubFor(get(urlEqualTo("/oai-phm/?verb=ListIdentifiers&set=" + set1 + "&metadataPrefix=" + schema1)) .willReturn(response200XmlContent(getFileContent("/oaiLi... | @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExcludedSchemas())) { LOGGER.info("Cannot count... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... |
@Test public void shouldReturnCorrectSumWhenSchemasAndNoSetsListed() throws Exception { String schema1 = "schema1"; String schema2 = "schema2"; stubFor(get(urlEqualTo("/oai-phm/?verb=ListIdentifiers&metadataPrefix=" + schema1)) .willReturn(response200XmlContent(getFileContent("/oaiListIdentifiers.xml")))); stubFor(get(... | @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExcludedSchemas())) { LOGGER.info("Cannot count... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... |
@Test public void shouldReturnMinusOneWhenMultipleSetsSpecified() throws Exception { OaiPmhFilesCounter counter = new OaiPmhFilesCounter(); OAIPMHHarvestingDetails details = new OAIPMHHarvestingDetails(null, null, Sets.newHashSet("a", "b", "c"), null, null, null, null); DpsTask task = getDpsTask(details); assertEquals(... | @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExcludedSchemas())) { LOGGER.info("Cannot count... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... |
@Test public void shouldReturnCountForSchemaWhenEmptySetsProvided() throws Exception { stubFor(get(urlEqualTo("/oai-phm/?verb=ListIdentifiers")) .willReturn(response200XmlContent(getFileContent("/oaiListIdentifiers.xml")))); OaiPmhFilesCounter counter = new OaiPmhFilesCounter(); OAIPMHHarvestingDetails details = new OA... | @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExcludedSchemas())) { LOGGER.info("Cannot count... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... |
@Test public void shouldReturnMinusOneWhenSetsExcluded() throws Exception { OaiPmhFilesCounter counter = new OaiPmhFilesCounter(); OAIPMHHarvestingDetails details = new OAIPMHHarvestingDetails(null, null, null, Sets.newHashSet("a", "b", "c"), null, null, null); DpsTask task = getDpsTask(details); assertEquals(-1, count... | @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExcludedSchemas())) { LOGGER.info("Cannot count... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... |
@Test public void shouldReturnMinusOneWheHarvestingDetailsIsNotProvided() throws Exception { OaiPmhFilesCounter counter = new OaiPmhFilesCounter(); DpsTask task = getDpsTask(null); assertEquals(-1, counter.getFilesCount(task)); } | @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExcludedSchemas())) { LOGGER.info("Cannot count... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... |
@Test public void shouldReturnMinusOneWhenSchemasExcluded() throws Exception { OaiPmhFilesCounter counter = new OaiPmhFilesCounter(); OAIPMHHarvestingDetails details = new OAIPMHHarvestingDetails(null, Sets.newHashSet("a", "b", "c"), null, null, null, null, null); DpsTask task = getDpsTask(details); assertEquals(-1, co... | @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExcludedSchemas())) { LOGGER.info("Cannot count... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... |
@Test public void TestValidator() { Validator validator = ValidatorFactory.getValidator(ValidatorType.KEYSPACE); assertTrue(validator instanceof KeyspaceValidator); validator = ValidatorFactory.getValidator(ValidatorType.TABLE); assertTrue(validator instanceof TableValidator); } | public static Validator getValidator(ValidatorType type) { if (type == ValidatorType.KEYSPACE) return new KeyspaceValidator(); if (type == ValidatorType.TABLE) return new TableValidator(); return null; } | ValidatorFactory { public static Validator getValidator(ValidatorType type) { if (type == ValidatorType.KEYSPACE) return new KeyspaceValidator(); if (type == ValidatorType.TABLE) return new TableValidator(); return null; } } | ValidatorFactory { public static Validator getValidator(ValidatorType type) { if (type == ValidatorType.KEYSPACE) return new KeyspaceValidator(); if (type == ValidatorType.TABLE) return new TableValidator(); return null; } } | ValidatorFactory { public static Validator getValidator(ValidatorType type) { if (type == ValidatorType.KEYSPACE) return new KeyspaceValidator(); if (type == ValidatorType.TABLE) return new TableValidator(); return null; } static Validator getValidator(ValidatorType type); } | ValidatorFactory { public static Validator getValidator(ValidatorType type) { if (type == ValidatorType.KEYSPACE) return new KeyspaceValidator(); if (type == ValidatorType.TABLE) return new TableValidator(); return null; } static Validator getValidator(ValidatorType type); } |
@Test(expected = TaskSubmissionException.class) public void shouldThrowTaskSubmissionExceptionWhenURLsIsNull() throws Exception { OaiPmhFilesCounter counter = new OaiPmhFilesCounter(); OAIPMHHarvestingDetails details = new OAIPMHHarvestingDetails(null, null, null, null, null, null, null); DpsTask task = getDpsTaskNoEnd... | @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExcludedSchemas())) { LOGGER.info("Cannot count... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... | OaiPmhFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { OAIPMHHarvestingDetails harvestingDetails = task.getHarvestingDetails(); if (harvestingDetails != null) { if (specified(harvestingDetails.getExcludedSets()) || specified(harvestingDetails.getExclu... |
@Test public void shouldCountRecords() throws Exception { int randomNum = ThreadLocalRandom.current().nextInt(1, DATASET_EXPECTED_SIZE); StringBuilder records = new StringBuilder("r1"); for(int index = 2; index <= randomNum; index++) { records.append(", r"); records.append(index); } DpsTask dpsTask = new DpsTask(); dps... | @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { if (task.getParameter(PluginParameterKeys.RECORD_IDS_TO_DEPUBLISH) != null) { return calculateRecordsNumber(task); } if (task.getParameter(PluginParameterKeys.METIS_DATASET_ID) != null) { return calculateDatasetSize(task); } throw new Tas... | DepublicationFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { if (task.getParameter(PluginParameterKeys.RECORD_IDS_TO_DEPUBLISH) != null) { return calculateRecordsNumber(task); } if (task.getParameter(PluginParameterKeys.METIS_DATASET_ID) != null) { r... | DepublicationFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { if (task.getParameter(PluginParameterKeys.RECORD_IDS_TO_DEPUBLISH) != null) { return calculateRecordsNumber(task); } if (task.getParameter(PluginParameterKeys.METIS_DATASET_ID) != null) { r... | DepublicationFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { if (task.getParameter(PluginParameterKeys.RECORD_IDS_TO_DEPUBLISH) != null) { return calculateRecordsNumber(task); } if (task.getParameter(PluginParameterKeys.METIS_DATASET_ID) != null) { r... | DepublicationFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { if (task.getParameter(PluginParameterKeys.RECORD_IDS_TO_DEPUBLISH) != null) { return calculateRecordsNumber(task); } if (task.getParameter(PluginParameterKeys.METIS_DATASET_ID) != null) { r... |
@Test public void shouldCountEntireDataset() throws Exception { DpsTask dpsTask = new DpsTask(); dpsTask.addParameter(METIS_DATASET_ID, ""); DepublicationFilesCounter depublicationFilesCounter = new DepublicationFilesCounter(datasetDepublisher); int count = depublicationFilesCounter.getFilesCount(dpsTask); assertEquals... | @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { if (task.getParameter(PluginParameterKeys.RECORD_IDS_TO_DEPUBLISH) != null) { return calculateRecordsNumber(task); } if (task.getParameter(PluginParameterKeys.METIS_DATASET_ID) != null) { return calculateDatasetSize(task); } throw new Tas... | DepublicationFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { if (task.getParameter(PluginParameterKeys.RECORD_IDS_TO_DEPUBLISH) != null) { return calculateRecordsNumber(task); } if (task.getParameter(PluginParameterKeys.METIS_DATASET_ID) != null) { r... | DepublicationFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { if (task.getParameter(PluginParameterKeys.RECORD_IDS_TO_DEPUBLISH) != null) { return calculateRecordsNumber(task); } if (task.getParameter(PluginParameterKeys.METIS_DATASET_ID) != null) { r... | DepublicationFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { if (task.getParameter(PluginParameterKeys.RECORD_IDS_TO_DEPUBLISH) != null) { return calculateRecordsNumber(task); } if (task.getParameter(PluginParameterKeys.METIS_DATASET_ID) != null) { r... | DepublicationFilesCounter extends FilesCounter { @Override public int getFilesCount(DpsTask task) throws TaskSubmissionException { if (task.getParameter(PluginParameterKeys.RECORD_IDS_TO_DEPUBLISH) != null) { return calculateRecordsNumber(task); } if (task.getParameter(PluginParameterKeys.METIS_DATASET_ID) != null) { r... |
@Test public void verifyUseValidEnvironmentIfNoAlternativeEnvironmentParameterSet() throws IndexingException, URISyntaxException { service.depublishDataset(parameters); verify(metisIndexerFactory, atLeast(1)).openIndexer(eq(false)); verify(metisIndexerFactory, never()).openIndexer(eq(true)); } | public void depublishDataset(SubmitTaskParameters parameters) { try { long taskId = parameters.getTask().getTaskId(); checkTaskKilled(taskId); Future<Integer> future = depublisher.executeDatasetDepublicationAsync(parameters); waitForFinish(future, parameters); } catch (SubmitingTaskWasKilled e) { LOGGER.warn(e.getMessa... | DepublicationService { public void depublishDataset(SubmitTaskParameters parameters) { try { long taskId = parameters.getTask().getTaskId(); checkTaskKilled(taskId); Future<Integer> future = depublisher.executeDatasetDepublicationAsync(parameters); waitForFinish(future, parameters); } catch (SubmitingTaskWasKilled e) {... | DepublicationService { public void depublishDataset(SubmitTaskParameters parameters) { try { long taskId = parameters.getTask().getTaskId(); checkTaskKilled(taskId); Future<Integer> future = depublisher.executeDatasetDepublicationAsync(parameters); waitForFinish(future, parameters); } catch (SubmitingTaskWasKilled e) {... | DepublicationService { public void depublishDataset(SubmitTaskParameters parameters) { try { long taskId = parameters.getTask().getTaskId(); checkTaskKilled(taskId); Future<Integer> future = depublisher.executeDatasetDepublicationAsync(parameters); waitForFinish(future, parameters); } catch (SubmitingTaskWasKilled e) {... | DepublicationService { public void depublishDataset(SubmitTaskParameters parameters) { try { long taskId = parameters.getTask().getTaskId(); checkTaskKilled(taskId); Future<Integer> future = depublisher.executeDatasetDepublicationAsync(parameters); waitForFinish(future, parameters); } catch (SubmitingTaskWasKilled e) {... |
@Test public void verifyUseAlternativeEnvironmentIfAlternativeEnvironmentParameterSet() throws IndexingException, URISyntaxException { task.addParameter(PluginParameterKeys.METIS_USE_ALT_INDEXING_ENV, "true"); service.depublishDataset(parameters); verify(metisIndexerFactory, atLeast(1)).openIndexer(eq(true)); verify(me... | public void depublishDataset(SubmitTaskParameters parameters) { try { long taskId = parameters.getTask().getTaskId(); checkTaskKilled(taskId); Future<Integer> future = depublisher.executeDatasetDepublicationAsync(parameters); waitForFinish(future, parameters); } catch (SubmitingTaskWasKilled e) { LOGGER.warn(e.getMessa... | DepublicationService { public void depublishDataset(SubmitTaskParameters parameters) { try { long taskId = parameters.getTask().getTaskId(); checkTaskKilled(taskId); Future<Integer> future = depublisher.executeDatasetDepublicationAsync(parameters); waitForFinish(future, parameters); } catch (SubmitingTaskWasKilled e) {... | DepublicationService { public void depublishDataset(SubmitTaskParameters parameters) { try { long taskId = parameters.getTask().getTaskId(); checkTaskKilled(taskId); Future<Integer> future = depublisher.executeDatasetDepublicationAsync(parameters); waitForFinish(future, parameters); } catch (SubmitingTaskWasKilled e) {... | DepublicationService { public void depublishDataset(SubmitTaskParameters parameters) { try { long taskId = parameters.getTask().getTaskId(); checkTaskKilled(taskId); Future<Integer> future = depublisher.executeDatasetDepublicationAsync(parameters); waitForFinish(future, parameters); } catch (SubmitingTaskWasKilled e) {... | DepublicationService { public void depublishDataset(SubmitTaskParameters parameters) { try { long taskId = parameters.getTask().getTaskId(); checkTaskKilled(taskId); Future<Integer> future = depublisher.executeDatasetDepublicationAsync(parameters); waitForFinish(future, parameters); } catch (SubmitingTaskWasKilled e) {... |
@Test public void verifyTaskRemoveInvokedOnIndexer() throws IndexingException { service.depublishDataset(parameters); verify(indexer).removeAll(eq(DATASET_METIS_ID), isNull(Date.class)); assertTaskSucceed(); } | public void depublishDataset(SubmitTaskParameters parameters) { try { long taskId = parameters.getTask().getTaskId(); checkTaskKilled(taskId); Future<Integer> future = depublisher.executeDatasetDepublicationAsync(parameters); waitForFinish(future, parameters); } catch (SubmitingTaskWasKilled e) { LOGGER.warn(e.getMessa... | DepublicationService { public void depublishDataset(SubmitTaskParameters parameters) { try { long taskId = parameters.getTask().getTaskId(); checkTaskKilled(taskId); Future<Integer> future = depublisher.executeDatasetDepublicationAsync(parameters); waitForFinish(future, parameters); } catch (SubmitingTaskWasKilled e) {... | DepublicationService { public void depublishDataset(SubmitTaskParameters parameters) { try { long taskId = parameters.getTask().getTaskId(); checkTaskKilled(taskId); Future<Integer> future = depublisher.executeDatasetDepublicationAsync(parameters); waitForFinish(future, parameters); } catch (SubmitingTaskWasKilled e) {... | DepublicationService { public void depublishDataset(SubmitTaskParameters parameters) { try { long taskId = parameters.getTask().getTaskId(); checkTaskKilled(taskId); Future<Integer> future = depublisher.executeDatasetDepublicationAsync(parameters); waitForFinish(future, parameters); } catch (SubmitingTaskWasKilled e) {... | DepublicationService { public void depublishDataset(SubmitTaskParameters parameters) { try { long taskId = parameters.getTask().getTaskId(); checkTaskKilled(taskId); Future<Integer> future = depublisher.executeDatasetDepublicationAsync(parameters); waitForFinish(future, parameters); } catch (SubmitingTaskWasKilled e) {... |
@Test public void verifyWaitForAllRowsRemoved() throws IndexingException { AtomicBoolean allRowsRemoved = new AtomicBoolean(false); StopWatch watch = StopWatch.createStarted(); when(indexer.countRecords(anyString())).then(r -> { allRowsRemoved.set(watch.getTime() > WAITING_FOR_COMPLETE_TIME); if (allRowsRemoved.get()) ... | public void depublishDataset(SubmitTaskParameters parameters) { try { long taskId = parameters.getTask().getTaskId(); checkTaskKilled(taskId); Future<Integer> future = depublisher.executeDatasetDepublicationAsync(parameters); waitForFinish(future, parameters); } catch (SubmitingTaskWasKilled e) { LOGGER.warn(e.getMessa... | DepublicationService { public void depublishDataset(SubmitTaskParameters parameters) { try { long taskId = parameters.getTask().getTaskId(); checkTaskKilled(taskId); Future<Integer> future = depublisher.executeDatasetDepublicationAsync(parameters); waitForFinish(future, parameters); } catch (SubmitingTaskWasKilled e) {... | DepublicationService { public void depublishDataset(SubmitTaskParameters parameters) { try { long taskId = parameters.getTask().getTaskId(); checkTaskKilled(taskId); Future<Integer> future = depublisher.executeDatasetDepublicationAsync(parameters); waitForFinish(future, parameters); } catch (SubmitingTaskWasKilled e) {... | DepublicationService { public void depublishDataset(SubmitTaskParameters parameters) { try { long taskId = parameters.getTask().getTaskId(); checkTaskKilled(taskId); Future<Integer> future = depublisher.executeDatasetDepublicationAsync(parameters); waitForFinish(future, parameters); } catch (SubmitingTaskWasKilled e) {... | DepublicationService { public void depublishDataset(SubmitTaskParameters parameters) { try { long taskId = parameters.getTask().getTaskId(); checkTaskKilled(taskId); Future<Integer> future = depublisher.executeDatasetDepublicationAsync(parameters); waitForFinish(future, parameters); } catch (SubmitingTaskWasKilled e) {... |
@Test public void verifyTaskRemoveNotInvokedIfTaskWereKilledBefore() throws IndexingException { when(taskStatusChecker.hasKillFlag(anyLong())).thenReturn(true); service.depublishDataset(parameters); verify(indexer, never()).removeAll(eq(DATASET_METIS_ID), isNull(Date.class)); verify(updater, never()).setTaskCompletelyP... | public void depublishDataset(SubmitTaskParameters parameters) { try { long taskId = parameters.getTask().getTaskId(); checkTaskKilled(taskId); Future<Integer> future = depublisher.executeDatasetDepublicationAsync(parameters); waitForFinish(future, parameters); } catch (SubmitingTaskWasKilled e) { LOGGER.warn(e.getMessa... | DepublicationService { public void depublishDataset(SubmitTaskParameters parameters) { try { long taskId = parameters.getTask().getTaskId(); checkTaskKilled(taskId); Future<Integer> future = depublisher.executeDatasetDepublicationAsync(parameters); waitForFinish(future, parameters); } catch (SubmitingTaskWasKilled e) {... | DepublicationService { public void depublishDataset(SubmitTaskParameters parameters) { try { long taskId = parameters.getTask().getTaskId(); checkTaskKilled(taskId); Future<Integer> future = depublisher.executeDatasetDepublicationAsync(parameters); waitForFinish(future, parameters); } catch (SubmitingTaskWasKilled e) {... | DepublicationService { public void depublishDataset(SubmitTaskParameters parameters) { try { long taskId = parameters.getTask().getTaskId(); checkTaskKilled(taskId); Future<Integer> future = depublisher.executeDatasetDepublicationAsync(parameters); waitForFinish(future, parameters); } catch (SubmitingTaskWasKilled e) {... | DepublicationService { public void depublishDataset(SubmitTaskParameters parameters) { try { long taskId = parameters.getTask().getTaskId(); checkTaskKilled(taskId); Future<Integer> future = depublisher.executeDatasetDepublicationAsync(parameters); waitForFinish(future, parameters); } catch (SubmitingTaskWasKilled e) {... |
@Test public void verifyTaskFailedWhenRemoveMethodThrowsException() throws IndexingException { when(indexer.removeAll(anyString(), any(Date.class))).thenThrow(new IndexerRelatedIndexingException("Indexer exception!")); service.depublishDataset(parameters); assertTaskFailed(); } | public void depublishDataset(SubmitTaskParameters parameters) { try { long taskId = parameters.getTask().getTaskId(); checkTaskKilled(taskId); Future<Integer> future = depublisher.executeDatasetDepublicationAsync(parameters); waitForFinish(future, parameters); } catch (SubmitingTaskWasKilled e) { LOGGER.warn(e.getMessa... | DepublicationService { public void depublishDataset(SubmitTaskParameters parameters) { try { long taskId = parameters.getTask().getTaskId(); checkTaskKilled(taskId); Future<Integer> future = depublisher.executeDatasetDepublicationAsync(parameters); waitForFinish(future, parameters); } catch (SubmitingTaskWasKilled e) {... | DepublicationService { public void depublishDataset(SubmitTaskParameters parameters) { try { long taskId = parameters.getTask().getTaskId(); checkTaskKilled(taskId); Future<Integer> future = depublisher.executeDatasetDepublicationAsync(parameters); waitForFinish(future, parameters); } catch (SubmitingTaskWasKilled e) {... | DepublicationService { public void depublishDataset(SubmitTaskParameters parameters) { try { long taskId = parameters.getTask().getTaskId(); checkTaskKilled(taskId); Future<Integer> future = depublisher.executeDatasetDepublicationAsync(parameters); waitForFinish(future, parameters); } catch (SubmitingTaskWasKilled e) {... | DepublicationService { public void depublishDataset(SubmitTaskParameters parameters) { try { long taskId = parameters.getTask().getTaskId(); checkTaskKilled(taskId); Future<Integer> future = depublisher.executeDatasetDepublicationAsync(parameters); waitForFinish(future, parameters); } catch (SubmitingTaskWasKilled e) {... |
@Test public void verifyTaskFailedWhenRemovedRowCountNotMatchExpected() throws IndexingException { when(indexer.removeAll(anyString(), any(Date.class))).thenReturn(EXPECTED_SIZE + 2); service.depublishDataset(parameters); assertTaskFailed(); } | public void depublishDataset(SubmitTaskParameters parameters) { try { long taskId = parameters.getTask().getTaskId(); checkTaskKilled(taskId); Future<Integer> future = depublisher.executeDatasetDepublicationAsync(parameters); waitForFinish(future, parameters); } catch (SubmitingTaskWasKilled e) { LOGGER.warn(e.getMessa... | DepublicationService { public void depublishDataset(SubmitTaskParameters parameters) { try { long taskId = parameters.getTask().getTaskId(); checkTaskKilled(taskId); Future<Integer> future = depublisher.executeDatasetDepublicationAsync(parameters); waitForFinish(future, parameters); } catch (SubmitingTaskWasKilled e) {... | DepublicationService { public void depublishDataset(SubmitTaskParameters parameters) { try { long taskId = parameters.getTask().getTaskId(); checkTaskKilled(taskId); Future<Integer> future = depublisher.executeDatasetDepublicationAsync(parameters); waitForFinish(future, parameters); } catch (SubmitingTaskWasKilled e) {... | DepublicationService { public void depublishDataset(SubmitTaskParameters parameters) { try { long taskId = parameters.getTask().getTaskId(); checkTaskKilled(taskId); Future<Integer> future = depublisher.executeDatasetDepublicationAsync(parameters); waitForFinish(future, parameters); } catch (SubmitingTaskWasKilled e) {... | DepublicationService { public void depublishDataset(SubmitTaskParameters parameters) { try { long taskId = parameters.getTask().getTaskId(); checkTaskKilled(taskId); Future<Integer> future = depublisher.executeDatasetDepublicationAsync(parameters); waitForFinish(future, parameters); } catch (SubmitingTaskWasKilled e) {... |
@Test public void verifyJobExecution() throws Exception { CassandraConnectionProvider cassandraConnectionProvider = mock(CassandraConnectionProvider.class); int threadCount = 1; String tableName = "tableName"; KeyspaceValidator keyspaceValidator = new KeyspaceValidator(); Metadata metadata = mock(Metadata.class); Keysp... | @Override public void validate(CassandraConnectionProvider sourceCassandraConnectionProvider, CassandraConnectionProvider targetCassandraConnectionProvider, String sourceTableName, String targetTableName, int threadsCount) throws InterruptedException, ExecutionException { ExecutorService executorService = null; try { I... | KeyspaceValidator implements Validator { @Override public void validate(CassandraConnectionProvider sourceCassandraConnectionProvider, CassandraConnectionProvider targetCassandraConnectionProvider, String sourceTableName, String targetTableName, int threadsCount) throws InterruptedException, ExecutionException { Execut... | KeyspaceValidator implements Validator { @Override public void validate(CassandraConnectionProvider sourceCassandraConnectionProvider, CassandraConnectionProvider targetCassandraConnectionProvider, String sourceTableName, String targetTableName, int threadsCount) throws InterruptedException, ExecutionException { Execut... | KeyspaceValidator implements Validator { @Override public void validate(CassandraConnectionProvider sourceCassandraConnectionProvider, CassandraConnectionProvider targetCassandraConnectionProvider, String sourceTableName, String targetTableName, int threadsCount) throws InterruptedException, ExecutionException { Execut... | KeyspaceValidator implements Validator { @Override public void validate(CassandraConnectionProvider sourceCassandraConnectionProvider, CassandraConnectionProvider targetCassandraConnectionProvider, String sourceTableName, String targetTableName, int threadsCount) throws InterruptedException, ExecutionException { Execut... |
@Betamax(tape = "DPSClient/submitTaskAndFail") @Test(expected = AccessDeniedOrObjectDoesNotExistException.class) public final void shouldThrowAnExceptionWhenCannotSubmitATask() throws Exception { dpsClient = new DpsClient(BASE_URL, REGULAR_USER_NAME, REGULAR_USER_PASSWORD); DpsTask task = prepareDpsTask(); dpsClient.su... | public long submitTask(DpsTask task, String topologyName) throws DpsException { Response resp = null; try { resp = client.target(dpsUrl) .path(TASKS_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .request() .post(Entity.json(task)); if (resp.getStatus() == Response.Status.CREATED.getStatusCode()) { return getTaskId... | DpsClient { public long submitTask(DpsTask task, String topologyName) throws DpsException { Response resp = null; try { resp = client.target(dpsUrl) .path(TASKS_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .request() .post(Entity.json(task)); if (resp.getStatus() == Response.Status.CREATED.getStatusCode()) { retu... | DpsClient { public long submitTask(DpsTask task, String topologyName) throws DpsException { Response resp = null; try { resp = client.target(dpsUrl) .path(TASKS_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .request() .post(Entity.json(task)); if (resp.getStatus() == Response.Status.CREATED.getStatusCode()) { retu... | DpsClient { public long submitTask(DpsTask task, String topologyName) throws DpsException { Response resp = null; try { resp = client.target(dpsUrl) .path(TASKS_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .request() .post(Entity.json(task)); if (resp.getStatus() == Response.Status.CREATED.getStatusCode()) { retu... | DpsClient { public long submitTask(DpsTask task, String topologyName) throws DpsException { Response resp = null; try { resp = client.target(dpsUrl) .path(TASKS_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .request() .post(Entity.json(task)); if (resp.getStatus() == Response.Status.CREATED.getStatusCode()) { retu... |
@Betamax(tape = "DPSClient/permitAndSubmitTaskReturnBadURI") @Test(expected = RuntimeException.class) public final void shouldThrowAnExceptionWhenReturnedTaskIdIsNotParsable() throws Exception { dpsClient = new DpsClient(BASE_URL, REGULAR_USER_NAME, REGULAR_USER_PASSWORD); DpsTask task = prepareDpsTask(); dpsClient.sub... | public long submitTask(DpsTask task, String topologyName) throws DpsException { Response resp = null; try { resp = client.target(dpsUrl) .path(TASKS_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .request() .post(Entity.json(task)); if (resp.getStatus() == Response.Status.CREATED.getStatusCode()) { return getTaskId... | DpsClient { public long submitTask(DpsTask task, String topologyName) throws DpsException { Response resp = null; try { resp = client.target(dpsUrl) .path(TASKS_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .request() .post(Entity.json(task)); if (resp.getStatus() == Response.Status.CREATED.getStatusCode()) { retu... | DpsClient { public long submitTask(DpsTask task, String topologyName) throws DpsException { Response resp = null; try { resp = client.target(dpsUrl) .path(TASKS_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .request() .post(Entity.json(task)); if (resp.getStatus() == Response.Status.CREATED.getStatusCode()) { retu... | DpsClient { public long submitTask(DpsTask task, String topologyName) throws DpsException { Response resp = null; try { resp = client.target(dpsUrl) .path(TASKS_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .request() .post(Entity.json(task)); if (resp.getStatus() == Response.Status.CREATED.getStatusCode()) { retu... | DpsClient { public long submitTask(DpsTask task, String topologyName) throws DpsException { Response resp = null; try { resp = client.target(dpsUrl) .path(TASKS_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .request() .post(Entity.json(task)); if (resp.getStatus() == Response.Status.CREATED.getStatusCode()) { retu... |
@Test @Betamax(tape = "DPSClient/permitForNotDefinedTopologyTest") public final void shouldNotBeAbleToPermitUserForNotDefinedTopology() throws Exception { dpsClient = new DpsClient(BASE_URL, REGULAR_USER_NAME, REGULAR_USER_PASSWORD); try { dpsClient.topologyPermit(NOT_DEFINED_TOPOLOGY_NAME, "user"); fail(); } catch (Ac... | public Response.StatusType topologyPermit(String topologyName, String username) throws DpsException { Form form = new Form(); form.param("username", username); Response resp = null; try { resp = client.target(dpsUrl) .path(PERMIT_TOPOLOGY_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .request() .post(Entity.entity... | DpsClient { public Response.StatusType topologyPermit(String topologyName, String username) throws DpsException { Form form = new Form(); form.param("username", username); Response resp = null; try { resp = client.target(dpsUrl) .path(PERMIT_TOPOLOGY_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .request() .post(E... | DpsClient { public Response.StatusType topologyPermit(String topologyName, String username) throws DpsException { Form form = new Form(); form.param("username", username); Response resp = null; try { resp = client.target(dpsUrl) .path(PERMIT_TOPOLOGY_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .request() .post(E... | DpsClient { public Response.StatusType topologyPermit(String topologyName, String username) throws DpsException { Form form = new Form(); form.param("username", username); Response resp = null; try { resp = client.target(dpsUrl) .path(PERMIT_TOPOLOGY_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .request() .post(E... | DpsClient { public Response.StatusType topologyPermit(String topologyName, String username) throws DpsException { Form form = new Form(); form.param("username", username); Response resp = null; try { resp = client.target(dpsUrl) .path(PERMIT_TOPOLOGY_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .request() .post(E... |
@Test @Betamax(tape = "DPSClient/getTaskProgressTest") public final void shouldReturnedProgressReport() throws DpsException { dpsClient = new DpsClient(BASE_URL, REGULAR_USER_NAME, REGULAR_USER_NAME); TaskInfo taskInfo = new TaskInfo(TASK_ID, TOPOLOGY_NAME, TaskState.PROCESSED, "", 1, 0, 0, 0, null, null, null); assert... | public TaskInfo getTaskProgress(String topologyName, final long taskId) throws DpsException { Response response = null; try { response = client .target(dpsUrl) .path(TASK_PROGRESS_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, taskId) .request().get(); if (response.getStatus() == Response.... | DpsClient { public TaskInfo getTaskProgress(String topologyName, final long taskId) throws DpsException { Response response = null; try { response = client .target(dpsUrl) .path(TASK_PROGRESS_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, taskId) .request().get(); if (response.getStatus() ... | DpsClient { public TaskInfo getTaskProgress(String topologyName, final long taskId) throws DpsException { Response response = null; try { response = client .target(dpsUrl) .path(TASK_PROGRESS_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, taskId) .request().get(); if (response.getStatus() ... | DpsClient { public TaskInfo getTaskProgress(String topologyName, final long taskId) throws DpsException { Response response = null; try { response = client .target(dpsUrl) .path(TASK_PROGRESS_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, taskId) .request().get(); if (response.getStatus() ... | DpsClient { public TaskInfo getTaskProgress(String topologyName, final long taskId) throws DpsException { Response response = null; try { response = client .target(dpsUrl) .path(TASK_PROGRESS_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, taskId) .request().get(); if (response.getStatus() ... |
@Test @Betamax(tape = "DPSClient/killTaskTest") public final void shouldKillTask() throws DpsException { dpsClient = new DpsClient(BASE_URL, REGULAR_USER_NAME, REGULAR_USER_NAME); String responseMessage = dpsClient.killTask(TOPOLOGY_NAME, TASK_ID, null); assertEquals(responseMessage, "The task was killed because of Dro... | public String killTask(final String topologyName, final long taskId, String info) throws DpsException { Response response = null; try { WebTarget webTarget = client.target(dpsUrl).path(KILL_TASK_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName).resolveTemplate(TASK_ID, taskId); if (info != null) { webTarget = webTarge... | DpsClient { public String killTask(final String topologyName, final long taskId, String info) throws DpsException { Response response = null; try { WebTarget webTarget = client.target(dpsUrl).path(KILL_TASK_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName).resolveTemplate(TASK_ID, taskId); if (info != null) { webTarge... | DpsClient { public String killTask(final String topologyName, final long taskId, String info) throws DpsException { Response response = null; try { WebTarget webTarget = client.target(dpsUrl).path(KILL_TASK_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName).resolveTemplate(TASK_ID, taskId); if (info != null) { webTarge... | DpsClient { public String killTask(final String topologyName, final long taskId, String info) throws DpsException { Response response = null; try { WebTarget webTarget = client.target(dpsUrl).path(KILL_TASK_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName).resolveTemplate(TASK_ID, taskId); if (info != null) { webTarge... | DpsClient { public String killTask(final String topologyName, final long taskId, String info) throws DpsException { Response response = null; try { WebTarget webTarget = client.target(dpsUrl).path(KILL_TASK_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName).resolveTemplate(TASK_ID, taskId); if (info != null) { webTarge... |
@Test @Betamax(tape = "DPSClient/killTaskTestWithSpecificInfo") public final void shouldKillTaskWithSpecificInfo() throws DpsException { dpsClient = new DpsClient(BASE_URL, REGULAR_USER_NAME, REGULAR_USER_NAME); String responseMessage = dpsClient.killTask(TOPOLOGY_NAME, TASK_ID, "Aggregator-choice"); assertEquals(respo... | public String killTask(final String topologyName, final long taskId, String info) throws DpsException { Response response = null; try { WebTarget webTarget = client.target(dpsUrl).path(KILL_TASK_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName).resolveTemplate(TASK_ID, taskId); if (info != null) { webTarget = webTarge... | DpsClient { public String killTask(final String topologyName, final long taskId, String info) throws DpsException { Response response = null; try { WebTarget webTarget = client.target(dpsUrl).path(KILL_TASK_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName).resolveTemplate(TASK_ID, taskId); if (info != null) { webTarge... | DpsClient { public String killTask(final String topologyName, final long taskId, String info) throws DpsException { Response response = null; try { WebTarget webTarget = client.target(dpsUrl).path(KILL_TASK_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName).resolveTemplate(TASK_ID, taskId); if (info != null) { webTarge... | DpsClient { public String killTask(final String topologyName, final long taskId, String info) throws DpsException { Response response = null; try { WebTarget webTarget = client.target(dpsUrl).path(KILL_TASK_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName).resolveTemplate(TASK_ID, taskId); if (info != null) { webTarge... | DpsClient { public String killTask(final String topologyName, final long taskId, String info) throws DpsException { Response response = null; try { WebTarget webTarget = client.target(dpsUrl).path(KILL_TASK_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName).resolveTemplate(TASK_ID, taskId); if (info != null) { webTarge... |
@Test(expected = AccessDeniedOrObjectDoesNotExistException.class) @Betamax(tape = "DPSClient/shouldThrowExceptionWhenKillingNonExistingTaskTest") public final void shouldThrowExceptionWhenKillingNonExistingTaskTest() throws DpsException { dpsClient = new DpsClient(BASE_URL, REGULAR_USER_NAME, REGULAR_USER_NAME); long n... | public String killTask(final String topologyName, final long taskId, String info) throws DpsException { Response response = null; try { WebTarget webTarget = client.target(dpsUrl).path(KILL_TASK_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName).resolveTemplate(TASK_ID, taskId); if (info != null) { webTarget = webTarge... | DpsClient { public String killTask(final String topologyName, final long taskId, String info) throws DpsException { Response response = null; try { WebTarget webTarget = client.target(dpsUrl).path(KILL_TASK_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName).resolveTemplate(TASK_ID, taskId); if (info != null) { webTarge... | DpsClient { public String killTask(final String topologyName, final long taskId, String info) throws DpsException { Response response = null; try { WebTarget webTarget = client.target(dpsUrl).path(KILL_TASK_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName).resolveTemplate(TASK_ID, taskId); if (info != null) { webTarge... | DpsClient { public String killTask(final String topologyName, final long taskId, String info) throws DpsException { Response response = null; try { WebTarget webTarget = client.target(dpsUrl).path(KILL_TASK_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName).resolveTemplate(TASK_ID, taskId); if (info != null) { webTarge... | DpsClient { public String killTask(final String topologyName, final long taskId, String info) throws DpsException { Response response = null; try { WebTarget webTarget = client.target(dpsUrl).path(KILL_TASK_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName).resolveTemplate(TASK_ID, taskId); if (info != null) { webTarge... |
@Test(expected = AccessDeniedOrTopologyDoesNotExistException.class) @Betamax(tape = "DPSClient/shouldThrowExceptionWhenKillingTaskForNonExistedTopologyTest") public final void shouldThrowExceptionWhenKillingTaskForNonExistedTopologyTest() throws DpsException { dpsClient = new DpsClient(BASE_URL, REGULAR_USER_NAME, REGU... | public String killTask(final String topologyName, final long taskId, String info) throws DpsException { Response response = null; try { WebTarget webTarget = client.target(dpsUrl).path(KILL_TASK_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName).resolveTemplate(TASK_ID, taskId); if (info != null) { webTarget = webTarge... | DpsClient { public String killTask(final String topologyName, final long taskId, String info) throws DpsException { Response response = null; try { WebTarget webTarget = client.target(dpsUrl).path(KILL_TASK_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName).resolveTemplate(TASK_ID, taskId); if (info != null) { webTarge... | DpsClient { public String killTask(final String topologyName, final long taskId, String info) throws DpsException { Response response = null; try { WebTarget webTarget = client.target(dpsUrl).path(KILL_TASK_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName).resolveTemplate(TASK_ID, taskId); if (info != null) { webTarge... | DpsClient { public String killTask(final String topologyName, final long taskId, String info) throws DpsException { Response response = null; try { WebTarget webTarget = client.target(dpsUrl).path(KILL_TASK_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName).resolveTemplate(TASK_ID, taskId); if (info != null) { webTarge... | DpsClient { public String killTask(final String topologyName, final long taskId, String info) throws DpsException { Response response = null; try { WebTarget webTarget = client.target(dpsUrl).path(KILL_TASK_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName).resolveTemplate(TASK_ID, taskId); if (info != null) { webTarge... |
@Test @Betamax(tape = "DPSClient_getTaskDetailsReportTest") public final void shouldReturnedDetailsReport() throws DpsException { dpsClient = new DpsClient(BASE_URL, REGULAR_USER_NAME, REGULAR_USER_PASSWORD); SubTaskInfo subTaskInfo = new SubTaskInfo(1, "resource", RecordState.SUCCESS, "", "", "result"); List<SubTaskIn... | public List<SubTaskInfo> getDetailedTaskReport(final String topologyName, final long taskId) throws DpsException { Response response = null; try { response = client .target(dpsUrl) .path(DETAILED_TASK_REPORT_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, taskId) .request().get(); return ha... | DpsClient { public List<SubTaskInfo> getDetailedTaskReport(final String topologyName, final long taskId) throws DpsException { Response response = null; try { response = client .target(dpsUrl) .path(DETAILED_TASK_REPORT_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, taskId) .request().get(... | DpsClient { public List<SubTaskInfo> getDetailedTaskReport(final String topologyName, final long taskId) throws DpsException { Response response = null; try { response = client .target(dpsUrl) .path(DETAILED_TASK_REPORT_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, taskId) .request().get(... | DpsClient { public List<SubTaskInfo> getDetailedTaskReport(final String topologyName, final long taskId) throws DpsException { Response response = null; try { response = client .target(dpsUrl) .path(DETAILED_TASK_REPORT_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, taskId) .request().get(... | DpsClient { public List<SubTaskInfo> getDetailedTaskReport(final String topologyName, final long taskId) throws DpsException { Response response = null; try { response = client .target(dpsUrl) .path(DETAILED_TASK_REPORT_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, taskId) .request().get(... |
@Test @Betamax(tape = "DPSClient_shouldReturnedGeneralErrorReport") public final void shouldReturnedGeneralErrorReport() throws DpsException { dpsClient = new DpsClient(BASE_URL, REGULAR_USER_NAME, REGULAR_USER_PASSWORD); TaskErrorsInfo report = createErrorInfo(TASK_ID, false); assertThat(dpsClient.getTaskErrorsReport(... | public TaskErrorsInfo getTaskErrorsReport(final String topologyName, final long taskId, final String error, final int idsCount) throws DpsException { Response response = null; try { response = client .target(dpsUrl) .path(ERRORS_TASK_REPORT_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, ta... | DpsClient { public TaskErrorsInfo getTaskErrorsReport(final String topologyName, final long taskId, final String error, final int idsCount) throws DpsException { Response response = null; try { response = client .target(dpsUrl) .path(ERRORS_TASK_REPORT_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate... | DpsClient { public TaskErrorsInfo getTaskErrorsReport(final String topologyName, final long taskId, final String error, final int idsCount) throws DpsException { Response response = null; try { response = client .target(dpsUrl) .path(ERRORS_TASK_REPORT_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate... | DpsClient { public TaskErrorsInfo getTaskErrorsReport(final String topologyName, final long taskId, final String error, final int idsCount) throws DpsException { Response response = null; try { response = client .target(dpsUrl) .path(ERRORS_TASK_REPORT_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate... | DpsClient { public TaskErrorsInfo getTaskErrorsReport(final String topologyName, final long taskId, final String error, final int idsCount) throws DpsException { Response response = null; try { response = client .target(dpsUrl) .path(ERRORS_TASK_REPORT_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate... |
@Test public void prepareBoundStatementForMatchingTargetTableTest() { assertThat(CassandraHelper.prepareBoundStatementForMatchingTargetTable(cassandraConnectionProvider, "table", primaryKeys), is(boundStatement)); } | public static BoundStatement prepareBoundStatementForMatchingTargetTable(CassandraConnectionProvider cassandraConnectionProvider, String targetTableName, List<String> primaryKeys) { String matchCountStatementCQL = CQLBuilder.getMatchCountStatementFromTargetTable(targetTableName, primaryKeys); PreparedStatement matchCou... | CassandraHelper { public static BoundStatement prepareBoundStatementForMatchingTargetTable(CassandraConnectionProvider cassandraConnectionProvider, String targetTableName, List<String> primaryKeys) { String matchCountStatementCQL = CQLBuilder.getMatchCountStatementFromTargetTable(targetTableName, primaryKeys); Prepared... | CassandraHelper { public static BoundStatement prepareBoundStatementForMatchingTargetTable(CassandraConnectionProvider cassandraConnectionProvider, String targetTableName, List<String> primaryKeys) { String matchCountStatementCQL = CQLBuilder.getMatchCountStatementFromTargetTable(targetTableName, primaryKeys); Prepared... | CassandraHelper { public static BoundStatement prepareBoundStatementForMatchingTargetTable(CassandraConnectionProvider cassandraConnectionProvider, String targetTableName, List<String> primaryKeys) { String matchCountStatementCQL = CQLBuilder.getMatchCountStatementFromTargetTable(targetTableName, primaryKeys); Prepared... | CassandraHelper { public static BoundStatement prepareBoundStatementForMatchingTargetTable(CassandraConnectionProvider cassandraConnectionProvider, String targetTableName, List<String> primaryKeys) { String matchCountStatementCQL = CQLBuilder.getMatchCountStatementFromTargetTable(targetTableName, primaryKeys); Prepared... |
@Test @Betamax(tape = "DPSClient_shouldReturnTrueWhenErrorsReportExists") public final void shouldReturnTrueWhenErrorsReportExists() throws DpsException { dpsClient = new DpsClient(BASE_URL, REGULAR_USER_NAME, REGULAR_USER_PASSWORD); assertTrue(dpsClient.checkIfErrorReportExists(TOPOLOGY_NAME, TASK_ID)); } | public boolean checkIfErrorReportExists(final String topologyName, final long taskId) { Response response = null; try { response = client .target(dpsUrl) .path(ERRORS_TASK_REPORT_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, taskId) .request().head(); return response.getStatus() == Respon... | DpsClient { public boolean checkIfErrorReportExists(final String topologyName, final long taskId) { Response response = null; try { response = client .target(dpsUrl) .path(ERRORS_TASK_REPORT_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, taskId) .request().head(); return response.getStatus... | DpsClient { public boolean checkIfErrorReportExists(final String topologyName, final long taskId) { Response response = null; try { response = client .target(dpsUrl) .path(ERRORS_TASK_REPORT_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, taskId) .request().head(); return response.getStatus... | DpsClient { public boolean checkIfErrorReportExists(final String topologyName, final long taskId) { Response response = null; try { response = client .target(dpsUrl) .path(ERRORS_TASK_REPORT_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, taskId) .request().head(); return response.getStatus... | DpsClient { public boolean checkIfErrorReportExists(final String topologyName, final long taskId) { Response response = null; try { response = client .target(dpsUrl) .path(ERRORS_TASK_REPORT_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, taskId) .request().head(); return response.getStatus... |
@Test @Betamax(tape = "DPSClient_shouldReturnFalseWhenErrorsReportDoesNotExists") public final void shouldReturnFalseWhenErrorsReportDoesNotExists() throws DpsException { dpsClient = new DpsClient(BASE_URL, REGULAR_USER_NAME, REGULAR_USER_PASSWORD); assertFalse(dpsClient.checkIfErrorReportExists(TOPOLOGY_NAME, TASK_ID)... | public boolean checkIfErrorReportExists(final String topologyName, final long taskId) { Response response = null; try { response = client .target(dpsUrl) .path(ERRORS_TASK_REPORT_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, taskId) .request().head(); return response.getStatus() == Respon... | DpsClient { public boolean checkIfErrorReportExists(final String topologyName, final long taskId) { Response response = null; try { response = client .target(dpsUrl) .path(ERRORS_TASK_REPORT_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, taskId) .request().head(); return response.getStatus... | DpsClient { public boolean checkIfErrorReportExists(final String topologyName, final long taskId) { Response response = null; try { response = client .target(dpsUrl) .path(ERRORS_TASK_REPORT_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, taskId) .request().head(); return response.getStatus... | DpsClient { public boolean checkIfErrorReportExists(final String topologyName, final long taskId) { Response response = null; try { response = client .target(dpsUrl) .path(ERRORS_TASK_REPORT_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, taskId) .request().head(); return response.getStatus... | DpsClient { public boolean checkIfErrorReportExists(final String topologyName, final long taskId) { Response response = null; try { response = client .target(dpsUrl) .path(ERRORS_TASK_REPORT_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, taskId) .request().head(); return response.getStatus... |
@Test @Betamax(tape = "DPSClient_shouldReturnedSpecificErrorReport") public final void shouldReturnedSpecificErrorReport() throws DpsException { dpsClient = new DpsClient(BASE_URL, REGULAR_USER_NAME, REGULAR_USER_PASSWORD); TaskErrorsInfo report = createErrorInfo(TASK_ID, true); assertThat(dpsClient.getTaskErrorsReport... | public TaskErrorsInfo getTaskErrorsReport(final String topologyName, final long taskId, final String error, final int idsCount) throws DpsException { Response response = null; try { response = client .target(dpsUrl) .path(ERRORS_TASK_REPORT_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, ta... | DpsClient { public TaskErrorsInfo getTaskErrorsReport(final String topologyName, final long taskId, final String error, final int idsCount) throws DpsException { Response response = null; try { response = client .target(dpsUrl) .path(ERRORS_TASK_REPORT_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate... | DpsClient { public TaskErrorsInfo getTaskErrorsReport(final String topologyName, final long taskId, final String error, final int idsCount) throws DpsException { Response response = null; try { response = client .target(dpsUrl) .path(ERRORS_TASK_REPORT_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate... | DpsClient { public TaskErrorsInfo getTaskErrorsReport(final String topologyName, final long taskId, final String error, final int idsCount) throws DpsException { Response response = null; try { response = client .target(dpsUrl) .path(ERRORS_TASK_REPORT_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate... | DpsClient { public TaskErrorsInfo getTaskErrorsReport(final String topologyName, final long taskId, final String error, final int idsCount) throws DpsException { Response response = null; try { response = client .target(dpsUrl) .path(ERRORS_TASK_REPORT_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate... |
@Test @Betamax(tape = "DPSClient_shouldReturnElementReport") public void shouldGetTheElementReport() throws DpsException { dpsClient = new DpsClient(BASE_URL, REGULAR_USER_NAME, REGULAR_USER_PASSWORD); List<NodeReport> nodeReports = dpsClient.getElementReport(TOPOLOGY_NAME, TASK_ID, " assertNotNull(nodeReports); assert... | public List<NodeReport> getElementReport(final String topologyName, final long taskId, String elementPath) throws DpsException { Response getResponse = null; try { getResponse = client .target(dpsUrl) .path(ELEMENT_REPORT) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, taskId).queryParam("path"... | DpsClient { public List<NodeReport> getElementReport(final String topologyName, final long taskId, String elementPath) throws DpsException { Response getResponse = null; try { getResponse = client .target(dpsUrl) .path(ELEMENT_REPORT) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, taskId).query... | DpsClient { public List<NodeReport> getElementReport(final String topologyName, final long taskId, String elementPath) throws DpsException { Response getResponse = null; try { getResponse = client .target(dpsUrl) .path(ELEMENT_REPORT) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, taskId).query... | DpsClient { public List<NodeReport> getElementReport(final String topologyName, final long taskId, String elementPath) throws DpsException { Response getResponse = null; try { getResponse = client .target(dpsUrl) .path(ELEMENT_REPORT) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, taskId).query... | DpsClient { public List<NodeReport> getElementReport(final String topologyName, final long taskId, String elementPath) throws DpsException { Response getResponse = null; try { getResponse = client .target(dpsUrl) .path(ELEMENT_REPORT) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, taskId).query... |
@Test(expected = AccessDeniedOrTopologyDoesNotExistException.class) @Betamax(tape = "DPSClient_shouldThrowExceptionForStatisticsWhenTopologyDoesNotExist") public void shouldThrowExceptionForStatistics() throws DpsException { dpsClient = new DpsClient(BASE_URL, REGULAR_USER_NAME, REGULAR_USER_PASSWORD); dpsClient.getTas... | public StatisticsReport getTaskStatisticsReport(final String topologyName, final long taskId) throws DpsException { Response response = null; try { response = client.target(dpsUrl).path(STATISTICS_REPORT_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName).resolveTemplate(TASK_ID, taskId).request() .get(); if (response.g... | DpsClient { public StatisticsReport getTaskStatisticsReport(final String topologyName, final long taskId) throws DpsException { Response response = null; try { response = client.target(dpsUrl).path(STATISTICS_REPORT_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName).resolveTemplate(TASK_ID, taskId).request() .get(); if... | DpsClient { public StatisticsReport getTaskStatisticsReport(final String topologyName, final long taskId) throws DpsException { Response response = null; try { response = client.target(dpsUrl).path(STATISTICS_REPORT_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName).resolveTemplate(TASK_ID, taskId).request() .get(); if... | DpsClient { public StatisticsReport getTaskStatisticsReport(final String topologyName, final long taskId) throws DpsException { Response response = null; try { response = client.target(dpsUrl).path(STATISTICS_REPORT_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName).resolveTemplate(TASK_ID, taskId).request() .get(); if... | DpsClient { public StatisticsReport getTaskStatisticsReport(final String topologyName, final long taskId) throws DpsException { Response response = null; try { response = client.target(dpsUrl).path(STATISTICS_REPORT_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName).resolveTemplate(TASK_ID, taskId).request() .get(); if... |
@Test(expected = AccessDeniedOrObjectDoesNotExistException.class) @Betamax(tape = "DPSClient_shouldThrowExceptionForStatisticsWhenTaskIdDoesNotExistOrUnAccessible") public void shouldThrowExceptionForStatisticsWhenTaskIdIsUnAccessible() throws DpsException { dpsClient = new DpsClient(BASE_URL, REGULAR_USER_NAME, REGULA... | public StatisticsReport getTaskStatisticsReport(final String topologyName, final long taskId) throws DpsException { Response response = null; try { response = client.target(dpsUrl).path(STATISTICS_REPORT_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName).resolveTemplate(TASK_ID, taskId).request() .get(); if (response.g... | DpsClient { public StatisticsReport getTaskStatisticsReport(final String topologyName, final long taskId) throws DpsException { Response response = null; try { response = client.target(dpsUrl).path(STATISTICS_REPORT_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName).resolveTemplate(TASK_ID, taskId).request() .get(); if... | DpsClient { public StatisticsReport getTaskStatisticsReport(final String topologyName, final long taskId) throws DpsException { Response response = null; try { response = client.target(dpsUrl).path(STATISTICS_REPORT_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName).resolveTemplate(TASK_ID, taskId).request() .get(); if... | DpsClient { public StatisticsReport getTaskStatisticsReport(final String topologyName, final long taskId) throws DpsException { Response response = null; try { response = client.target(dpsUrl).path(STATISTICS_REPORT_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName).resolveTemplate(TASK_ID, taskId).request() .get(); if... | DpsClient { public StatisticsReport getTaskStatisticsReport(final String topologyName, final long taskId) throws DpsException { Response response = null; try { response = client.target(dpsUrl).path(STATISTICS_REPORT_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName).resolveTemplate(TASK_ID, taskId).request() .get(); if... |
@Test @Betamax(tape = "DPSClient_shouldCleanIndexingDataSet") public void shouldCleanIndexingDataSet() throws DpsException { DpsClient dpsClient = new DpsClient(BASE_URL, REGULAR_USER_NAME, REGULAR_USER_PASSWORD); dpsClient.cleanMetisIndexingDataset(TOPOLOGY_NAME, TASK_ID, new DataSetCleanerParameters()); } | public void cleanMetisIndexingDataset(String topologyName, long taskId, DataSetCleanerParameters dataSetCleanerParameters) throws DpsException { Response resp = null; try { resp = client.target(dpsUrl) .path(TASK_CLEAN_DATASET_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, taskId) .request... | DpsClient { public void cleanMetisIndexingDataset(String topologyName, long taskId, DataSetCleanerParameters dataSetCleanerParameters) throws DpsException { Response resp = null; try { resp = client.target(dpsUrl) .path(TASK_CLEAN_DATASET_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, task... | DpsClient { public void cleanMetisIndexingDataset(String topologyName, long taskId, DataSetCleanerParameters dataSetCleanerParameters) throws DpsException { Response resp = null; try { resp = client.target(dpsUrl) .path(TASK_CLEAN_DATASET_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, task... | DpsClient { public void cleanMetisIndexingDataset(String topologyName, long taskId, DataSetCleanerParameters dataSetCleanerParameters) throws DpsException { Response resp = null; try { resp = client.target(dpsUrl) .path(TASK_CLEAN_DATASET_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, task... | DpsClient { public void cleanMetisIndexingDataset(String topologyName, long taskId, DataSetCleanerParameters dataSetCleanerParameters) throws DpsException { Response resp = null; try { resp = client.target(dpsUrl) .path(TASK_CLEAN_DATASET_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, task... |
@Test(expected = AccessDeniedOrObjectDoesNotExistException.class) @Betamax(tape = "DPSClient_shouldThrowAccessDeniedWhenTaskIdDoesNotExistOrUnAccessible") public void shouldThrowAccessDeniedWhenTaskIdDoesNotExistOrUnAccessible() throws DpsException { DpsClient dpsClient = new DpsClient(BASE_URL, REGULAR_USER_NAME, REGU... | public void cleanMetisIndexingDataset(String topologyName, long taskId, DataSetCleanerParameters dataSetCleanerParameters) throws DpsException { Response resp = null; try { resp = client.target(dpsUrl) .path(TASK_CLEAN_DATASET_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, taskId) .request... | DpsClient { public void cleanMetisIndexingDataset(String topologyName, long taskId, DataSetCleanerParameters dataSetCleanerParameters) throws DpsException { Response resp = null; try { resp = client.target(dpsUrl) .path(TASK_CLEAN_DATASET_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, task... | DpsClient { public void cleanMetisIndexingDataset(String topologyName, long taskId, DataSetCleanerParameters dataSetCleanerParameters) throws DpsException { Response resp = null; try { resp = client.target(dpsUrl) .path(TASK_CLEAN_DATASET_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, task... | DpsClient { public void cleanMetisIndexingDataset(String topologyName, long taskId, DataSetCleanerParameters dataSetCleanerParameters) throws DpsException { Response resp = null; try { resp = client.target(dpsUrl) .path(TASK_CLEAN_DATASET_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, task... | DpsClient { public void cleanMetisIndexingDataset(String topologyName, long taskId, DataSetCleanerParameters dataSetCleanerParameters) throws DpsException { Response resp = null; try { resp = client.target(dpsUrl) .path(TASK_CLEAN_DATASET_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, task... |
@Test(expected = AccessDeniedOrObjectDoesNotExistException.class) @Betamax(tape = "DPSClient_shouldThrowAccessDeniedWhenTopologyDoesNotExist") public void shouldThrowAccessDeniedWhenTopologyDoesNotExist() throws DpsException { DpsClient dpsClient = new DpsClient(BASE_URL, REGULAR_USER_NAME, REGULAR_USER_PASSWORD); Stri... | public void cleanMetisIndexingDataset(String topologyName, long taskId, DataSetCleanerParameters dataSetCleanerParameters) throws DpsException { Response resp = null; try { resp = client.target(dpsUrl) .path(TASK_CLEAN_DATASET_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, taskId) .request... | DpsClient { public void cleanMetisIndexingDataset(String topologyName, long taskId, DataSetCleanerParameters dataSetCleanerParameters) throws DpsException { Response resp = null; try { resp = client.target(dpsUrl) .path(TASK_CLEAN_DATASET_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, task... | DpsClient { public void cleanMetisIndexingDataset(String topologyName, long taskId, DataSetCleanerParameters dataSetCleanerParameters) throws DpsException { Response resp = null; try { resp = client.target(dpsUrl) .path(TASK_CLEAN_DATASET_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, task... | DpsClient { public void cleanMetisIndexingDataset(String topologyName, long taskId, DataSetCleanerParameters dataSetCleanerParameters) throws DpsException { Response resp = null; try { resp = client.target(dpsUrl) .path(TASK_CLEAN_DATASET_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, task... | DpsClient { public void cleanMetisIndexingDataset(String topologyName, long taskId, DataSetCleanerParameters dataSetCleanerParameters) throws DpsException { Response resp = null; try { resp = client.target(dpsUrl) .path(TASK_CLEAN_DATASET_URL) .resolveTemplate(TOPOLOGY_NAME, topologyName) .resolveTemplate(TASK_ID, task... |
@Test public void shouldFilterOaiDcResponse() throws IOException, HarvesterException { final String fileContent = WiremockHelper.getFileContent("/sampleOaiRecord.xml"); final InputStream inputStream = IOUtils.toInputStream(fileContent, ENCODING); String content = IOUtils.toString(inputStream, ENCODING); final InputStre... | InputStream xpathToStream(XPathExpression expr) throws HarvesterException { try { final InputSource inputSource = getInputSource(); final ArrayList<NodeInfo> result = (ArrayList<NodeInfo>) expr.evaluate(inputSource, XPathConstants.NODESET); return convertToStream(result); } catch (XPathExpressionException | Transformer... | XmlXPath { InputStream xpathToStream(XPathExpression expr) throws HarvesterException { try { final InputSource inputSource = getInputSource(); final ArrayList<NodeInfo> result = (ArrayList<NodeInfo>) expr.evaluate(inputSource, XPathConstants.NODESET); return convertToStream(result); } catch (XPathExpressionException | ... | XmlXPath { InputStream xpathToStream(XPathExpression expr) throws HarvesterException { try { final InputSource inputSource = getInputSource(); final ArrayList<NodeInfo> result = (ArrayList<NodeInfo>) expr.evaluate(inputSource, XPathConstants.NODESET); return convertToStream(result); } catch (XPathExpressionException | ... | XmlXPath { InputStream xpathToStream(XPathExpression expr) throws HarvesterException { try { final InputSource inputSource = getInputSource(); final ArrayList<NodeInfo> result = (ArrayList<NodeInfo>) expr.evaluate(inputSource, XPathConstants.NODESET); return convertToStream(result); } catch (XPathExpressionException | ... | XmlXPath { InputStream xpathToStream(XPathExpression expr) throws HarvesterException { try { final InputSource inputSource = getInputSource(); final ArrayList<NodeInfo> result = (ArrayList<NodeInfo>) expr.evaluate(inputSource, XPathConstants.NODESET); return convertToStream(result); } catch (XPathExpressionException | ... |
@Test public void getPrimaryKeysFromSourceTableTest() { ResultSet resultSet = mock(ResultSet.class); when(session.execute(boundStatement)).thenReturn(resultSet); assertThat(CassandraHelper.getPrimaryKeysFromSourceTable(cassandraConnectionProvider, "table", primaryKeys), is(resultSet)); } | public static ResultSet getPrimaryKeysFromSourceTable(CassandraConnectionProvider cassandraConnectionProvider, String sourceTableName, List<String> primaryKeys) { String selectPrimaryKeysFromSourceTable = CQLBuilder.constructSelectPrimaryKeysFromSourceTable(sourceTableName, primaryKeys); PreparedStatement sourceSelectS... | CassandraHelper { public static ResultSet getPrimaryKeysFromSourceTable(CassandraConnectionProvider cassandraConnectionProvider, String sourceTableName, List<String> primaryKeys) { String selectPrimaryKeysFromSourceTable = CQLBuilder.constructSelectPrimaryKeysFromSourceTable(sourceTableName, primaryKeys); PreparedState... | CassandraHelper { public static ResultSet getPrimaryKeysFromSourceTable(CassandraConnectionProvider cassandraConnectionProvider, String sourceTableName, List<String> primaryKeys) { String selectPrimaryKeysFromSourceTable = CQLBuilder.constructSelectPrimaryKeysFromSourceTable(sourceTableName, primaryKeys); PreparedState... | CassandraHelper { public static ResultSet getPrimaryKeysFromSourceTable(CassandraConnectionProvider cassandraConnectionProvider, String sourceTableName, List<String> primaryKeys) { String selectPrimaryKeysFromSourceTable = CQLBuilder.constructSelectPrimaryKeysFromSourceTable(sourceTableName, primaryKeys); PreparedState... | CassandraHelper { public static ResultSet getPrimaryKeysFromSourceTable(CassandraConnectionProvider cassandraConnectionProvider, String sourceTableName, List<String> primaryKeys) { String selectPrimaryKeysFromSourceTable = CQLBuilder.constructSelectPrimaryKeysFromSourceTable(sourceTableName, primaryKeys); PreparedState... |
@Test public void shouldReturnRecordIsDeleted() throws IOException, HarvesterException { final String fileContent = WiremockHelper.getFileContent("/deletedOaiRecord.xml"); final InputStream inputStream = IOUtils.toInputStream(fileContent, ENCODING); String content = IOUtils.toString(inputStream, ENCODING); assertEquals... | String xpathToString(XPathExpression expr) throws HarvesterException { try { return evaluateExpression(expr); } catch (XPathExpressionException e) { throw new HarvesterException("Cannot xpath XML!", e); } } | XmlXPath { String xpathToString(XPathExpression expr) throws HarvesterException { try { return evaluateExpression(expr); } catch (XPathExpressionException e) { throw new HarvesterException("Cannot xpath XML!", e); } } } | XmlXPath { String xpathToString(XPathExpression expr) throws HarvesterException { try { return evaluateExpression(expr); } catch (XPathExpressionException e) { throw new HarvesterException("Cannot xpath XML!", e); } } XmlXPath(String input); } | XmlXPath { String xpathToString(XPathExpression expr) throws HarvesterException { try { return evaluateExpression(expr); } catch (XPathExpressionException e) { throw new HarvesterException("Cannot xpath XML!", e); } } XmlXPath(String input); } | XmlXPath { String xpathToString(XPathExpression expr) throws HarvesterException { try { return evaluateExpression(expr); } catch (XPathExpressionException e) { throw new HarvesterException("Cannot xpath XML!", e); } } XmlXPath(String input); } |
@Test public void shouldReturnRecordIsNotDeleted() throws IOException, HarvesterException { final String fileContent = WiremockHelper.getFileContent("/sampleOaiRecord.xml"); final InputStream inputStream = IOUtils.toInputStream(fileContent, ENCODING); String content = IOUtils.toString(inputStream, ENCODING); assertFals... | String xpathToString(XPathExpression expr) throws HarvesterException { try { return evaluateExpression(expr); } catch (XPathExpressionException e) { throw new HarvesterException("Cannot xpath XML!", e); } } | XmlXPath { String xpathToString(XPathExpression expr) throws HarvesterException { try { return evaluateExpression(expr); } catch (XPathExpressionException e) { throw new HarvesterException("Cannot xpath XML!", e); } } } | XmlXPath { String xpathToString(XPathExpression expr) throws HarvesterException { try { return evaluateExpression(expr); } catch (XPathExpressionException e) { throw new HarvesterException("Cannot xpath XML!", e); } } XmlXPath(String input); } | XmlXPath { String xpathToString(XPathExpression expr) throws HarvesterException { try { return evaluateExpression(expr); } catch (XPathExpressionException e) { throw new HarvesterException("Cannot xpath XML!", e); } } XmlXPath(String input); } | XmlXPath { String xpathToString(XPathExpression expr) throws HarvesterException { try { return evaluateExpression(expr); } catch (XPathExpressionException e) { throw new HarvesterException("Cannot xpath XML!", e); } } XmlXPath(String input); } |
@Test public void shouldThrowExceptionNonSingleOutputCandidate() throws IOException, XPathExpressionException { final String fileContent = WiremockHelper.getFileContent("/sampleOaiRecord.xml"); final InputStream inputStream = IOUtils.toInputStream(fileContent, ENCODING); String content = IOUtils.toString(inputStream, E... | InputStream xpathToStream(XPathExpression expr) throws HarvesterException { try { final InputSource inputSource = getInputSource(); final ArrayList<NodeInfo> result = (ArrayList<NodeInfo>) expr.evaluate(inputSource, XPathConstants.NODESET); return convertToStream(result); } catch (XPathExpressionException | Transformer... | XmlXPath { InputStream xpathToStream(XPathExpression expr) throws HarvesterException { try { final InputSource inputSource = getInputSource(); final ArrayList<NodeInfo> result = (ArrayList<NodeInfo>) expr.evaluate(inputSource, XPathConstants.NODESET); return convertToStream(result); } catch (XPathExpressionException | ... | XmlXPath { InputStream xpathToStream(XPathExpression expr) throws HarvesterException { try { final InputSource inputSource = getInputSource(); final ArrayList<NodeInfo> result = (ArrayList<NodeInfo>) expr.evaluate(inputSource, XPathConstants.NODESET); return convertToStream(result); } catch (XPathExpressionException | ... | XmlXPath { InputStream xpathToStream(XPathExpression expr) throws HarvesterException { try { final InputSource inputSource = getInputSource(); final ArrayList<NodeInfo> result = (ArrayList<NodeInfo>) expr.evaluate(inputSource, XPathConstants.NODESET); return convertToStream(result); } catch (XPathExpressionException | ... | XmlXPath { InputStream xpathToStream(XPathExpression expr) throws HarvesterException { try { final InputSource inputSource = getInputSource(); final ArrayList<NodeInfo> result = (ArrayList<NodeInfo>) expr.evaluate(inputSource, XPathConstants.NODESET); return convertToStream(result); } catch (XPathExpressionException | ... |
@Test public void shouldThrowExceptionOnEmpty() throws IOException { final String fileContent = ""; final InputStream inputStream = IOUtils.toInputStream(fileContent, ENCODING); String content = IOUtils.toString(inputStream, ENCODING); try { new XmlXPath(content).xpathToStream(expr); fail(); } catch (HarvesterException... | InputStream xpathToStream(XPathExpression expr) throws HarvesterException { try { final InputSource inputSource = getInputSource(); final ArrayList<NodeInfo> result = (ArrayList<NodeInfo>) expr.evaluate(inputSource, XPathConstants.NODESET); return convertToStream(result); } catch (XPathExpressionException | Transformer... | XmlXPath { InputStream xpathToStream(XPathExpression expr) throws HarvesterException { try { final InputSource inputSource = getInputSource(); final ArrayList<NodeInfo> result = (ArrayList<NodeInfo>) expr.evaluate(inputSource, XPathConstants.NODESET); return convertToStream(result); } catch (XPathExpressionException | ... | XmlXPath { InputStream xpathToStream(XPathExpression expr) throws HarvesterException { try { final InputSource inputSource = getInputSource(); final ArrayList<NodeInfo> result = (ArrayList<NodeInfo>) expr.evaluate(inputSource, XPathConstants.NODESET); return convertToStream(result); } catch (XPathExpressionException | ... | XmlXPath { InputStream xpathToStream(XPathExpression expr) throws HarvesterException { try { final InputSource inputSource = getInputSource(); final ArrayList<NodeInfo> result = (ArrayList<NodeInfo>) expr.evaluate(inputSource, XPathConstants.NODESET); return convertToStream(result); } catch (XPathExpressionException | ... | XmlXPath { InputStream xpathToStream(XPathExpression expr) throws HarvesterException { try { final InputSource inputSource = getInputSource(); final ArrayList<NodeInfo> result = (ArrayList<NodeInfo>) expr.evaluate(inputSource, XPathConstants.NODESET); return convertToStream(result); } catch (XPathExpressionException | ... |
@Test public void shouldHarvestRecord() throws IOException, HarvesterException { stubFor(get(urlEqualTo("/oai-phm/?verb=GetRecord&identifier=mediateka" + "&metadataPrefix=oai_dc")) .willReturn(response200XmlContent(getFileContent("/sampleOaiRecord.xml")) )); final HarvesterImpl harvester = new HarvesterImpl(DEFAULT_RET... | @Override public InputStream harvestRecord(String oaiPmhEndpoint, String recordId, String metadataPrefix, XPathExpression expression, XPathExpression statusCheckerExpression) throws HarvesterException { return harvestRecord(DEFAULT_CONNECTION_FACTORY, oaiPmhEndpoint, recordId, metadataPrefix, expression, statusCheckerE... | HarvesterImpl implements Harvester { @Override public InputStream harvestRecord(String oaiPmhEndpoint, String recordId, String metadataPrefix, XPathExpression expression, XPathExpression statusCheckerExpression) throws HarvesterException { return harvestRecord(DEFAULT_CONNECTION_FACTORY, oaiPmhEndpoint, recordId, metad... | HarvesterImpl implements Harvester { @Override public InputStream harvestRecord(String oaiPmhEndpoint, String recordId, String metadataPrefix, XPathExpression expression, XPathExpression statusCheckerExpression) throws HarvesterException { return harvestRecord(DEFAULT_CONNECTION_FACTORY, oaiPmhEndpoint, recordId, metad... | HarvesterImpl implements Harvester { @Override public InputStream harvestRecord(String oaiPmhEndpoint, String recordId, String metadataPrefix, XPathExpression expression, XPathExpression statusCheckerExpression) throws HarvesterException { return harvestRecord(DEFAULT_CONNECTION_FACTORY, oaiPmhEndpoint, recordId, metad... | HarvesterImpl implements Harvester { @Override public InputStream harvestRecord(String oaiPmhEndpoint, String recordId, String metadataPrefix, XPathExpression expression, XPathExpression statusCheckerExpression) throws HarvesterException { return harvestRecord(DEFAULT_CONNECTION_FACTORY, oaiPmhEndpoint, recordId, metad... |
@Test(expected = HarvesterException.class) public void shouldHandleDeletedRecords() throws IOException, HarvesterException { stubFor(get(urlEqualTo("/oai-phm/?verb=GetRecord&identifier=mediateka" + "&metadataPrefix=oai_dc")) .willReturn(response200XmlContent(getFileContent("/deletedOaiRecord.xml")) )); final HarvesterI... | @Override public InputStream harvestRecord(String oaiPmhEndpoint, String recordId, String metadataPrefix, XPathExpression expression, XPathExpression statusCheckerExpression) throws HarvesterException { return harvestRecord(DEFAULT_CONNECTION_FACTORY, oaiPmhEndpoint, recordId, metadataPrefix, expression, statusCheckerE... | HarvesterImpl implements Harvester { @Override public InputStream harvestRecord(String oaiPmhEndpoint, String recordId, String metadataPrefix, XPathExpression expression, XPathExpression statusCheckerExpression) throws HarvesterException { return harvestRecord(DEFAULT_CONNECTION_FACTORY, oaiPmhEndpoint, recordId, metad... | HarvesterImpl implements Harvester { @Override public InputStream harvestRecord(String oaiPmhEndpoint, String recordId, String metadataPrefix, XPathExpression expression, XPathExpression statusCheckerExpression) throws HarvesterException { return harvestRecord(DEFAULT_CONNECTION_FACTORY, oaiPmhEndpoint, recordId, metad... | HarvesterImpl implements Harvester { @Override public InputStream harvestRecord(String oaiPmhEndpoint, String recordId, String metadataPrefix, XPathExpression expression, XPathExpression statusCheckerExpression) throws HarvesterException { return harvestRecord(DEFAULT_CONNECTION_FACTORY, oaiPmhEndpoint, recordId, metad... | HarvesterImpl implements Harvester { @Override public InputStream harvestRecord(String oaiPmhEndpoint, String recordId, String metadataPrefix, XPathExpression expression, XPathExpression statusCheckerExpression) throws HarvesterException { return harvestRecord(DEFAULT_CONNECTION_FACTORY, oaiPmhEndpoint, recordId, metad... |
@Test public void shouldThrowExceptionHarvestedRecordNotFound() { stubFor(get(urlEqualTo("/oai-phm/?verb=GetRecord&identifier=oai%3Amediateka.centrumzamenhofa" + ".pl%3A19&metadataPrefix=oai_dc")) .willReturn(response404())); final HarvesterImpl harvester = new HarvesterImpl(DEFAULT_RETRIES, SLEEP_TIME); try { harveste... | @Override public InputStream harvestRecord(String oaiPmhEndpoint, String recordId, String metadataPrefix, XPathExpression expression, XPathExpression statusCheckerExpression) throws HarvesterException { return harvestRecord(DEFAULT_CONNECTION_FACTORY, oaiPmhEndpoint, recordId, metadataPrefix, expression, statusCheckerE... | HarvesterImpl implements Harvester { @Override public InputStream harvestRecord(String oaiPmhEndpoint, String recordId, String metadataPrefix, XPathExpression expression, XPathExpression statusCheckerExpression) throws HarvesterException { return harvestRecord(DEFAULT_CONNECTION_FACTORY, oaiPmhEndpoint, recordId, metad... | HarvesterImpl implements Harvester { @Override public InputStream harvestRecord(String oaiPmhEndpoint, String recordId, String metadataPrefix, XPathExpression expression, XPathExpression statusCheckerExpression) throws HarvesterException { return harvestRecord(DEFAULT_CONNECTION_FACTORY, oaiPmhEndpoint, recordId, metad... | HarvesterImpl implements Harvester { @Override public InputStream harvestRecord(String oaiPmhEndpoint, String recordId, String metadataPrefix, XPathExpression expression, XPathExpression statusCheckerExpression) throws HarvesterException { return harvestRecord(DEFAULT_CONNECTION_FACTORY, oaiPmhEndpoint, recordId, metad... | HarvesterImpl implements Harvester { @Override public InputStream harvestRecord(String oaiPmhEndpoint, String recordId, String metadataPrefix, XPathExpression expression, XPathExpression statusCheckerExpression) throws HarvesterException { return harvestRecord(DEFAULT_CONNECTION_FACTORY, oaiPmhEndpoint, recordId, metad... |
@Test(expected = HarvesterException.class) public void shouldHandleTimeout() throws IOException, HarvesterException { stubFor(get(urlEqualTo("/oai-phm/?verb=GetRecord&identifier=mediateka" + "&metadataPrefix=oai_dc")) .willReturn(responsTimeoutGreaterThanSocketTimeout(getFileContent("/sampleOaiRecord.xml"), TEST_SOCKET... | @Override public InputStream harvestRecord(String oaiPmhEndpoint, String recordId, String metadataPrefix, XPathExpression expression, XPathExpression statusCheckerExpression) throws HarvesterException { return harvestRecord(DEFAULT_CONNECTION_FACTORY, oaiPmhEndpoint, recordId, metadataPrefix, expression, statusCheckerE... | HarvesterImpl implements Harvester { @Override public InputStream harvestRecord(String oaiPmhEndpoint, String recordId, String metadataPrefix, XPathExpression expression, XPathExpression statusCheckerExpression) throws HarvesterException { return harvestRecord(DEFAULT_CONNECTION_FACTORY, oaiPmhEndpoint, recordId, metad... | HarvesterImpl implements Harvester { @Override public InputStream harvestRecord(String oaiPmhEndpoint, String recordId, String metadataPrefix, XPathExpression expression, XPathExpression statusCheckerExpression) throws HarvesterException { return harvestRecord(DEFAULT_CONNECTION_FACTORY, oaiPmhEndpoint, recordId, metad... | HarvesterImpl implements Harvester { @Override public InputStream harvestRecord(String oaiPmhEndpoint, String recordId, String metadataPrefix, XPathExpression expression, XPathExpression statusCheckerExpression) throws HarvesterException { return harvestRecord(DEFAULT_CONNECTION_FACTORY, oaiPmhEndpoint, recordId, metad... | HarvesterImpl implements Harvester { @Override public InputStream harvestRecord(String oaiPmhEndpoint, String recordId, String metadataPrefix, XPathExpression expression, XPathExpression statusCheckerExpression) throws HarvesterException { return harvestRecord(DEFAULT_CONNECTION_FACTORY, oaiPmhEndpoint, recordId, metad... |
@Test public void should_successfully_getTopologyNames() { List<String> resultNameList = instance.getNames(); List<String> expectedNameList = convertStringToList(nameList); assertThat(resultNameList, is(equalTo(expectedNameList))); } | public List<String> getNames() { return topologies; } | TopologyManager { public List<String> getNames() { return topologies; } } | TopologyManager { public List<String> getNames() { return topologies; } TopologyManager(final String nameList); } | TopologyManager { public List<String> getNames() { return topologies; } TopologyManager(final String nameList); List<String> getNames(); boolean containsTopology(String topologyName); } | TopologyManager { public List<String> getNames() { return topologies; } TopologyManager(final String nameList); List<String> getNames(); boolean containsTopology(String topologyName); static final String separatorChar; static final Logger logger; } |
@Test public void should_successfully_containsTopology1() { final String topologyName = "topologyA"; boolean result = instance.containsTopology(topologyName); assertThat(result, is(equalTo(true))); } | public boolean containsTopology(String topologyName) { return topologies.contains(topologyName); } | TopologyManager { public boolean containsTopology(String topologyName) { return topologies.contains(topologyName); } } | TopologyManager { public boolean containsTopology(String topologyName) { return topologies.contains(topologyName); } TopologyManager(final String nameList); } | TopologyManager { public boolean containsTopology(String topologyName) { return topologies.contains(topologyName); } TopologyManager(final String nameList); List<String> getNames(); boolean containsTopology(String topologyName); } | TopologyManager { public boolean containsTopology(String topologyName) { return topologies.contains(topologyName); } TopologyManager(final String nameList); List<String> getNames(); boolean containsTopology(String topologyName); static final String separatorChar; static final Logger logger; } |
@Test public void getPrimaryKeysNamesTest() { ResultSet resultSet = mock(ResultSet.class); when(preparedStatement.bind(anyString(), anyString())).thenReturn(boundStatement); when(session.execute(boundStatement)).thenReturn(resultSet); Iterator iterator = mock(Iterator.class); when(resultSet.iterator()).thenReturn(itera... | public static List<String> getPrimaryKeysNames(CassandraConnectionProvider cassandraConnectionProvider, String tableName, String selectColumnNames) { List<String> names = new LinkedList<>(); PreparedStatement selectStatement = cassandraConnectionProvider.getSession().prepare(selectColumnNames); selectStatement.setConsi... | CassandraHelper { public static List<String> getPrimaryKeysNames(CassandraConnectionProvider cassandraConnectionProvider, String tableName, String selectColumnNames) { List<String> names = new LinkedList<>(); PreparedStatement selectStatement = cassandraConnectionProvider.getSession().prepare(selectColumnNames); select... | CassandraHelper { public static List<String> getPrimaryKeysNames(CassandraConnectionProvider cassandraConnectionProvider, String tableName, String selectColumnNames) { List<String> names = new LinkedList<>(); PreparedStatement selectStatement = cassandraConnectionProvider.getSession().prepare(selectColumnNames); select... | CassandraHelper { public static List<String> getPrimaryKeysNames(CassandraConnectionProvider cassandraConnectionProvider, String tableName, String selectColumnNames) { List<String> names = new LinkedList<>(); PreparedStatement selectStatement = cassandraConnectionProvider.getSession().prepare(selectColumnNames); select... | CassandraHelper { public static List<String> getPrimaryKeysNames(CassandraConnectionProvider cassandraConnectionProvider, String tableName, String selectColumnNames) { List<String> names = new LinkedList<>(); PreparedStatement selectStatement = cassandraConnectionProvider.getSession().prepare(selectColumnNames); select... |
@Test public void should_successfully_containsTopology2() { final String topologyName = "topologyB"; boolean result = instance.containsTopology(topologyName); assertThat(result, is(equalTo(true))); } | public boolean containsTopology(String topologyName) { return topologies.contains(topologyName); } | TopologyManager { public boolean containsTopology(String topologyName) { return topologies.contains(topologyName); } } | TopologyManager { public boolean containsTopology(String topologyName) { return topologies.contains(topologyName); } TopologyManager(final String nameList); } | TopologyManager { public boolean containsTopology(String topologyName) { return topologies.contains(topologyName); } TopologyManager(final String nameList); List<String> getNames(); boolean containsTopology(String topologyName); } | TopologyManager { public boolean containsTopology(String topologyName) { return topologies.contains(topologyName); } TopologyManager(final String nameList); List<String> getNames(); boolean containsTopology(String topologyName); static final String separatorChar; static final Logger logger; } |
@Test public void should_unsuccessfully_containsTopology() { final String topologyName = "topologyC"; boolean result = instance.containsTopology(topologyName); assertThat(result, is(equalTo(false))); } | public boolean containsTopology(String topologyName) { return topologies.contains(topologyName); } | TopologyManager { public boolean containsTopology(String topologyName) { return topologies.contains(topologyName); } } | TopologyManager { public boolean containsTopology(String topologyName) { return topologies.contains(topologyName); } TopologyManager(final String nameList); } | TopologyManager { public boolean containsTopology(String topologyName) { return topologies.contains(topologyName); } TopologyManager(final String nameList); List<String> getNames(); boolean containsTopology(String topologyName); } | TopologyManager { public boolean containsTopology(String topologyName) { return topologies.contains(topologyName); } TopologyManager(final String nameList); List<String> getNames(); boolean containsTopology(String topologyName); static final String separatorChar; static final Logger logger; } |
@Test(expected = ProviderNotExistsException.class) public void exceptionShouldBeThrowForNotExistingProviderId() throws RepresentationNotExistsException, ProviderNotExistsException, RecordNotExistsException { representationResource.getRepresentation(null, NOT_EXISTING_PROVIDER_ID, "localID", "repName"); } | @GetMapping @PostAuthorize("hasPermission" + "( " + " (returnObject.cloudId).concat('/').concat(#representationName).concat('/').concat(returnObject.version) ," + " 'eu.europeana.cloud.common.model.Representation', read" + ")") public @ResponseBody Representation getRepresentation( HttpServletRequest httpServletRequest... | SimplifiedRepresentationResource { @GetMapping @PostAuthorize("hasPermission" + "( " + " (returnObject.cloudId).concat('/').concat(#representationName).concat('/').concat(returnObject.version) ," + " 'eu.europeana.cloud.common.model.Representation', read" + ")") public @ResponseBody Representation getRepresentation( Ht... | SimplifiedRepresentationResource { @GetMapping @PostAuthorize("hasPermission" + "( " + " (returnObject.cloudId).concat('/').concat(#representationName).concat('/').concat(returnObject.version) ," + " 'eu.europeana.cloud.common.model.Representation', read" + ")") public @ResponseBody Representation getRepresentation( Ht... | SimplifiedRepresentationResource { @GetMapping @PostAuthorize("hasPermission" + "( " + " (returnObject.cloudId).concat('/').concat(#representationName).concat('/').concat(returnObject.version) ," + " 'eu.europeana.cloud.common.model.Representation', read" + ")") public @ResponseBody Representation getRepresentation( Ht... | SimplifiedRepresentationResource { @GetMapping @PostAuthorize("hasPermission" + "( " + " (returnObject.cloudId).concat('/').concat(#representationName).concat('/').concat(returnObject.version) ," + " 'eu.europeana.cloud.common.model.Representation', read" + ")") public @ResponseBody Representation getRepresentation( Ht... |
@Test(expected = RecordNotExistsException.class) public void exceptionShouldBeThrowForNotExistingCloudId() throws RepresentationNotExistsException, ProviderNotExistsException, RecordNotExistsException { representationResource.getRepresentation(null, PROVIDER_ID, LOCAL_ID_FOR_NOT_EXISTING_RECORD, "repName"); } | @GetMapping @PostAuthorize("hasPermission" + "( " + " (returnObject.cloudId).concat('/').concat(#representationName).concat('/').concat(returnObject.version) ," + " 'eu.europeana.cloud.common.model.Representation', read" + ")") public @ResponseBody Representation getRepresentation( HttpServletRequest httpServletRequest... | SimplifiedRepresentationResource { @GetMapping @PostAuthorize("hasPermission" + "( " + " (returnObject.cloudId).concat('/').concat(#representationName).concat('/').concat(returnObject.version) ," + " 'eu.europeana.cloud.common.model.Representation', read" + ")") public @ResponseBody Representation getRepresentation( Ht... | SimplifiedRepresentationResource { @GetMapping @PostAuthorize("hasPermission" + "( " + " (returnObject.cloudId).concat('/').concat(#representationName).concat('/').concat(returnObject.version) ," + " 'eu.europeana.cloud.common.model.Representation', read" + ")") public @ResponseBody Representation getRepresentation( Ht... | SimplifiedRepresentationResource { @GetMapping @PostAuthorize("hasPermission" + "( " + " (returnObject.cloudId).concat('/').concat(#representationName).concat('/').concat(returnObject.version) ," + " 'eu.europeana.cloud.common.model.Representation', read" + ")") public @ResponseBody Representation getRepresentation( Ht... | SimplifiedRepresentationResource { @GetMapping @PostAuthorize("hasPermission" + "( " + " (returnObject.cloudId).concat('/').concat(#representationName).concat('/').concat(returnObject.version) ," + " 'eu.europeana.cloud.common.model.Representation', read" + ")") public @ResponseBody Representation getRepresentation( Ht... |
@Test(expected = RepresentationNotExistsException.class) public void exceptionShouldBeThrowForRecordWithoutNamedRepresentation() throws RepresentationNotExistsException, ProviderNotExistsException, RecordNotExistsException { representationResource.getRepresentation(null, PROVIDER_ID, LOCAL_ID, RANDOM_REPRESENTATION_NAM... | @GetMapping @PostAuthorize("hasPermission" + "( " + " (returnObject.cloudId).concat('/').concat(#representationName).concat('/').concat(returnObject.version) ," + " 'eu.europeana.cloud.common.model.Representation', read" + ")") public @ResponseBody Representation getRepresentation( HttpServletRequest httpServletRequest... | SimplifiedRepresentationResource { @GetMapping @PostAuthorize("hasPermission" + "( " + " (returnObject.cloudId).concat('/').concat(#representationName).concat('/').concat(returnObject.version) ," + " 'eu.europeana.cloud.common.model.Representation', read" + ")") public @ResponseBody Representation getRepresentation( Ht... | SimplifiedRepresentationResource { @GetMapping @PostAuthorize("hasPermission" + "( " + " (returnObject.cloudId).concat('/').concat(#representationName).concat('/').concat(returnObject.version) ," + " 'eu.europeana.cloud.common.model.Representation', read" + ")") public @ResponseBody Representation getRepresentation( Ht... | SimplifiedRepresentationResource { @GetMapping @PostAuthorize("hasPermission" + "( " + " (returnObject.cloudId).concat('/').concat(#representationName).concat('/').concat(returnObject.version) ," + " 'eu.europeana.cloud.common.model.Representation', read" + ")") public @ResponseBody Representation getRepresentation( Ht... | SimplifiedRepresentationResource { @GetMapping @PostAuthorize("hasPermission" + "( " + " (returnObject.cloudId).concat('/').concat(#representationName).concat('/').concat(returnObject.version) ," + " 'eu.europeana.cloud.common.model.Representation', read" + ")") public @ResponseBody Representation getRepresentation( Ht... |
@Test public void properRepresentationShouldBeReturned() throws RepresentationNotExistsException, ProviderNotExistsException, RecordNotExistsException { HttpServletRequest info = mockHttpServletRequest(); Representation rep = representationResource.getRepresentation(info, PROVIDER_ID, LOCAL_ID, EXISTING_REPRESENTATION_... | @GetMapping @PostAuthorize("hasPermission" + "( " + " (returnObject.cloudId).concat('/').concat(#representationName).concat('/').concat(returnObject.version) ," + " 'eu.europeana.cloud.common.model.Representation', read" + ")") public @ResponseBody Representation getRepresentation( HttpServletRequest httpServletRequest... | SimplifiedRepresentationResource { @GetMapping @PostAuthorize("hasPermission" + "( " + " (returnObject.cloudId).concat('/').concat(#representationName).concat('/').concat(returnObject.version) ," + " 'eu.europeana.cloud.common.model.Representation', read" + ")") public @ResponseBody Representation getRepresentation( Ht... | SimplifiedRepresentationResource { @GetMapping @PostAuthorize("hasPermission" + "( " + " (returnObject.cloudId).concat('/').concat(#representationName).concat('/').concat(returnObject.version) ," + " 'eu.europeana.cloud.common.model.Representation', read" + ")") public @ResponseBody Representation getRepresentation( Ht... | SimplifiedRepresentationResource { @GetMapping @PostAuthorize("hasPermission" + "( " + " (returnObject.cloudId).concat('/').concat(#representationName).concat('/').concat(returnObject.version) ," + " 'eu.europeana.cloud.common.model.Representation', read" + ")") public @ResponseBody Representation getRepresentation( Ht... | SimplifiedRepresentationResource { @GetMapping @PostAuthorize("hasPermission" + "( " + " (returnObject.cloudId).concat('/').concat(#representationName).concat('/').concat(returnObject.version) ," + " 'eu.europeana.cloud.common.model.Representation', read" + ")") public @ResponseBody Representation getRepresentation( Ht... |
@Test(expected = RecordNotExistsException.class) public void exceptionShouldBeThrownWhenProviderIdDoesNotExist() throws RecordNotExistsException, FileNotExistsException, WrongContentRangeException, RepresentationNotExistsException, ProviderNotExistsException { fileAccessResource.getFile(null, NOT_EXISTING_PROVIDER_ID, ... | @GetMapping public ResponseEntity<StreamingResponseBody> getFile( HttpServletRequest httpServletRequest, @PathVariable final String providerId, @PathVariable final String localId, @PathVariable final String representationName, @PathVariable final String fileName) throws RepresentationNotExistsException, FileNotExistsEx... | SimplifiedFileAccessResource { @GetMapping public ResponseEntity<StreamingResponseBody> getFile( HttpServletRequest httpServletRequest, @PathVariable final String providerId, @PathVariable final String localId, @PathVariable final String representationName, @PathVariable final String fileName) throws RepresentationNotE... | SimplifiedFileAccessResource { @GetMapping public ResponseEntity<StreamingResponseBody> getFile( HttpServletRequest httpServletRequest, @PathVariable final String providerId, @PathVariable final String localId, @PathVariable final String representationName, @PathVariable final String fileName) throws RepresentationNotE... | SimplifiedFileAccessResource { @GetMapping public ResponseEntity<StreamingResponseBody> getFile( HttpServletRequest httpServletRequest, @PathVariable final String providerId, @PathVariable final String localId, @PathVariable final String representationName, @PathVariable final String fileName) throws RepresentationNotE... | SimplifiedFileAccessResource { @GetMapping public ResponseEntity<StreamingResponseBody> getFile( HttpServletRequest httpServletRequest, @PathVariable final String providerId, @PathVariable final String localId, @PathVariable final String representationName, @PathVariable final String fileName) throws RepresentationNotE... |
@Test(expected = RecordNotExistsException.class) public void exceptionShouldBeThrownWhenLocalIdDoesNotExist() throws RecordNotExistsException, FileNotExistsException, WrongContentRangeException, RepresentationNotExistsException, ProviderNotExistsException { fileAccessResource.getFile(null, EXISTING_PROVIDER_ID, NOT_EXI... | @GetMapping public ResponseEntity<StreamingResponseBody> getFile( HttpServletRequest httpServletRequest, @PathVariable final String providerId, @PathVariable final String localId, @PathVariable final String representationName, @PathVariable final String fileName) throws RepresentationNotExistsException, FileNotExistsEx... | SimplifiedFileAccessResource { @GetMapping public ResponseEntity<StreamingResponseBody> getFile( HttpServletRequest httpServletRequest, @PathVariable final String providerId, @PathVariable final String localId, @PathVariable final String representationName, @PathVariable final String fileName) throws RepresentationNotE... | SimplifiedFileAccessResource { @GetMapping public ResponseEntity<StreamingResponseBody> getFile( HttpServletRequest httpServletRequest, @PathVariable final String providerId, @PathVariable final String localId, @PathVariable final String representationName, @PathVariable final String fileName) throws RepresentationNotE... | SimplifiedFileAccessResource { @GetMapping public ResponseEntity<StreamingResponseBody> getFile( HttpServletRequest httpServletRequest, @PathVariable final String providerId, @PathVariable final String localId, @PathVariable final String representationName, @PathVariable final String fileName) throws RepresentationNotE... | SimplifiedFileAccessResource { @GetMapping public ResponseEntity<StreamingResponseBody> getFile( HttpServletRequest httpServletRequest, @PathVariable final String providerId, @PathVariable final String localId, @PathVariable final String representationName, @PathVariable final String fileName) throws RepresentationNotE... |
@Test(expected = RepresentationNotExistsException.class) public void exceptionShouldBeThrownWhenRepresentationIsMissing() throws RecordNotExistsException, FileNotExistsException, WrongContentRangeException, RepresentationNotExistsException, ProviderNotExistsException { fileAccessResource.getFile(null, EXISTING_PROVIDER... | @GetMapping public ResponseEntity<StreamingResponseBody> getFile( HttpServletRequest httpServletRequest, @PathVariable final String providerId, @PathVariable final String localId, @PathVariable final String representationName, @PathVariable final String fileName) throws RepresentationNotExistsException, FileNotExistsEx... | SimplifiedFileAccessResource { @GetMapping public ResponseEntity<StreamingResponseBody> getFile( HttpServletRequest httpServletRequest, @PathVariable final String providerId, @PathVariable final String localId, @PathVariable final String representationName, @PathVariable final String fileName) throws RepresentationNotE... | SimplifiedFileAccessResource { @GetMapping public ResponseEntity<StreamingResponseBody> getFile( HttpServletRequest httpServletRequest, @PathVariable final String providerId, @PathVariable final String localId, @PathVariable final String representationName, @PathVariable final String fileName) throws RepresentationNotE... | SimplifiedFileAccessResource { @GetMapping public ResponseEntity<StreamingResponseBody> getFile( HttpServletRequest httpServletRequest, @PathVariable final String providerId, @PathVariable final String localId, @PathVariable final String representationName, @PathVariable final String fileName) throws RepresentationNotE... | SimplifiedFileAccessResource { @GetMapping public ResponseEntity<StreamingResponseBody> getFile( HttpServletRequest httpServletRequest, @PathVariable final String providerId, @PathVariable final String localId, @PathVariable final String representationName, @PathVariable final String fileName) throws RepresentationNotE... |
@Test(expected = RepresentationNotExistsException.class) public void exceptionShouldBeThrownWhenThereIsNoPersistentRepresentationInGivenRecord() throws RecordNotExistsException, FileNotExistsException, WrongContentRangeException, RepresentationNotExistsException, ProviderNotExistsException { fileAccessResource.getFile(... | @GetMapping public ResponseEntity<StreamingResponseBody> getFile( HttpServletRequest httpServletRequest, @PathVariable final String providerId, @PathVariable final String localId, @PathVariable final String representationName, @PathVariable final String fileName) throws RepresentationNotExistsException, FileNotExistsEx... | SimplifiedFileAccessResource { @GetMapping public ResponseEntity<StreamingResponseBody> getFile( HttpServletRequest httpServletRequest, @PathVariable final String providerId, @PathVariable final String localId, @PathVariable final String representationName, @PathVariable final String fileName) throws RepresentationNotE... | SimplifiedFileAccessResource { @GetMapping public ResponseEntity<StreamingResponseBody> getFile( HttpServletRequest httpServletRequest, @PathVariable final String providerId, @PathVariable final String localId, @PathVariable final String representationName, @PathVariable final String fileName) throws RepresentationNotE... | SimplifiedFileAccessResource { @GetMapping public ResponseEntity<StreamingResponseBody> getFile( HttpServletRequest httpServletRequest, @PathVariable final String providerId, @PathVariable final String localId, @PathVariable final String representationName, @PathVariable final String fileName) throws RepresentationNotE... | SimplifiedFileAccessResource { @GetMapping public ResponseEntity<StreamingResponseBody> getFile( HttpServletRequest httpServletRequest, @PathVariable final String providerId, @PathVariable final String localId, @PathVariable final String representationName, @PathVariable final String fileName) throws RepresentationNotE... |
@Test public void shouldReturnTheExpectedPrimaryKeysSelectionCQL() { assertEquals(EXPECTED_PRIMARY_KEYS_SELECTION_STATEMENT, CQLBuilder.constructSelectPrimaryKeysFromSourceTable(SOURCE_TABLE, primaryKeys)); } | public static String constructSelectPrimaryKeysFromSourceTable(String sourceTableName, List<String> primaryKeyNames) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("SELECT "); for (int i = 0; i < primaryKeyNames.size() - 1; i++) stringBuilder.append(primaryKeyNames.get(i)).append(" , "); stri... | CQLBuilder { public static String constructSelectPrimaryKeysFromSourceTable(String sourceTableName, List<String> primaryKeyNames) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("SELECT "); for (int i = 0; i < primaryKeyNames.size() - 1; i++) stringBuilder.append(primaryKeyNames.get(i)).append... | CQLBuilder { public static String constructSelectPrimaryKeysFromSourceTable(String sourceTableName, List<String> primaryKeyNames) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("SELECT "); for (int i = 0; i < primaryKeyNames.size() - 1; i++) stringBuilder.append(primaryKeyNames.get(i)).append... | CQLBuilder { public static String constructSelectPrimaryKeysFromSourceTable(String sourceTableName, List<String> primaryKeyNames) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("SELECT "); for (int i = 0; i < primaryKeyNames.size() - 1; i++) stringBuilder.append(primaryKeyNames.get(i)).append... | CQLBuilder { public static String constructSelectPrimaryKeysFromSourceTable(String sourceTableName, List<String> primaryKeyNames) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("SELECT "); for (int i = 0; i < primaryKeyNames.size() - 1; i++) stringBuilder.append(primaryKeyNames.get(i)).append... |
@Test public void fileShouldBeReadSuccessfully() throws RecordNotExistsException, FileNotExistsException, WrongContentRangeException, RepresentationNotExistsException, ProviderNotExistsException, URISyntaxException { setupUriInfo(); ResponseEntity<?> response = fileAccessResource.getFile(URI_INFO, EXISTING_PROVIDER_ID,... | @GetMapping public ResponseEntity<StreamingResponseBody> getFile( HttpServletRequest httpServletRequest, @PathVariable final String providerId, @PathVariable final String localId, @PathVariable final String representationName, @PathVariable final String fileName) throws RepresentationNotExistsException, FileNotExistsEx... | SimplifiedFileAccessResource { @GetMapping public ResponseEntity<StreamingResponseBody> getFile( HttpServletRequest httpServletRequest, @PathVariable final String providerId, @PathVariable final String localId, @PathVariable final String representationName, @PathVariable final String fileName) throws RepresentationNotE... | SimplifiedFileAccessResource { @GetMapping public ResponseEntity<StreamingResponseBody> getFile( HttpServletRequest httpServletRequest, @PathVariable final String providerId, @PathVariable final String localId, @PathVariable final String representationName, @PathVariable final String fileName) throws RepresentationNotE... | SimplifiedFileAccessResource { @GetMapping public ResponseEntity<StreamingResponseBody> getFile( HttpServletRequest httpServletRequest, @PathVariable final String providerId, @PathVariable final String localId, @PathVariable final String representationName, @PathVariable final String fileName) throws RepresentationNotE... | SimplifiedFileAccessResource { @GetMapping public ResponseEntity<StreamingResponseBody> getFile( HttpServletRequest httpServletRequest, @PathVariable final String providerId, @PathVariable final String localId, @PathVariable final String representationName, @PathVariable final String fileName) throws RepresentationNotE... |
@Test public void fileHeadersShouldBeReadSuccessfully() throws FileNotExistsException, RecordNotExistsException, ProviderNotExistsException, RepresentationNotExistsException, URISyntaxException { setupUriInfo(); ResponseEntity<?> response = fileAccessResource.getFileHeaders(URI_INFO, EXISTING_PROVIDER_ID, EXISTING_LOCA... | @RequestMapping(method = RequestMethod.HEAD) public ResponseEntity<?> getFileHeaders( HttpServletRequest httpServletRequest, @PathVariable final String providerId, @PathVariable final String localId, @PathVariable final String representationName, @PathVariable final String fileName) throws RepresentationNotExistsExcept... | SimplifiedFileAccessResource { @RequestMapping(method = RequestMethod.HEAD) public ResponseEntity<?> getFileHeaders( HttpServletRequest httpServletRequest, @PathVariable final String providerId, @PathVariable final String localId, @PathVariable final String representationName, @PathVariable final String fileName) throw... | SimplifiedFileAccessResource { @RequestMapping(method = RequestMethod.HEAD) public ResponseEntity<?> getFileHeaders( HttpServletRequest httpServletRequest, @PathVariable final String providerId, @PathVariable final String localId, @PathVariable final String representationName, @PathVariable final String fileName) throw... | SimplifiedFileAccessResource { @RequestMapping(method = RequestMethod.HEAD) public ResponseEntity<?> getFileHeaders( HttpServletRequest httpServletRequest, @PathVariable final String providerId, @PathVariable final String localId, @PathVariable final String representationName, @PathVariable final String fileName) throw... | SimplifiedFileAccessResource { @RequestMapping(method = RequestMethod.HEAD) public ResponseEntity<?> getFileHeaders( HttpServletRequest httpServletRequest, @PathVariable final String providerId, @PathVariable final String localId, @PathVariable final String representationName, @PathVariable final String fileName) throw... |
@Test @Parameters(method = "mimeTypes") public void testListVersions(MediaType mediaType) throws Exception { List<Representation> expected = copy(REPRESENTATIONS); Representation expectedRepresentation = expected.get(0); URITools.enrich(expectedRepresentation, getBaseUri()); when(recordService.listRepresentationVersion... | @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public RepresentationsListWrapper listVersions( final HttpServletRequest request, @PathVariable String cloudId, @PathVariable String representationName) throws RepresentationNotExistsException { List<Representation... | RepresentationVersionsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public RepresentationsListWrapper listVersions( final HttpServletRequest request, @PathVariable String cloudId, @PathVariable String representationName) throws RepresentationNotExis... | RepresentationVersionsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public RepresentationsListWrapper listVersions( final HttpServletRequest request, @PathVariable String cloudId, @PathVariable String representationName) throws RepresentationNotExis... | RepresentationVersionsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public RepresentationsListWrapper listVersions( final HttpServletRequest request, @PathVariable String cloudId, @PathVariable String representationName) throws RepresentationNotExis... | RepresentationVersionsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public RepresentationsListWrapper listVersions( final HttpServletRequest request, @PathVariable String cloudId, @PathVariable String representationName) throws RepresentationNotExis... |
@Test(expected = ProviderNotExistsException.class) public void exceptionShouldBeThrowForNotExistingProviderId() throws RecordNotExistsException, ProviderNotExistsException { recordsResource.getRecord(null, NOT_EXISTING_PROVIDER_ID, "anyLocalId"); } | @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) public @ResponseBody Record getRecord( HttpServletRequest httpServletRequest, @PathVariable String providerId, @PathVariable String localId) throws RecordNotExistsException, ProviderNotExistsException { final String cloudId = fi... | SimplifiedRecordsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) public @ResponseBody Record getRecord( HttpServletRequest httpServletRequest, @PathVariable String providerId, @PathVariable String localId) throws RecordNotExistsException, ProviderNotExistsException... | SimplifiedRecordsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) public @ResponseBody Record getRecord( HttpServletRequest httpServletRequest, @PathVariable String providerId, @PathVariable String localId) throws RecordNotExistsException, ProviderNotExistsException... | SimplifiedRecordsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) public @ResponseBody Record getRecord( HttpServletRequest httpServletRequest, @PathVariable String providerId, @PathVariable String localId) throws RecordNotExistsException, ProviderNotExistsException... | SimplifiedRecordsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) public @ResponseBody Record getRecord( HttpServletRequest httpServletRequest, @PathVariable String providerId, @PathVariable String localId) throws RecordNotExistsException, ProviderNotExistsException... |
@Test(expected = RecordNotExistsException.class) public void exceptionShouldBeThrowForNotExistingCloudId() throws RecordNotExistsException, ProviderNotExistsException { recordsResource.getRecord(null, PROVIDER_ID, LOCAL_ID_FOR_NOT_EXISTING_RECORD); } | @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) public @ResponseBody Record getRecord( HttpServletRequest httpServletRequest, @PathVariable String providerId, @PathVariable String localId) throws RecordNotExistsException, ProviderNotExistsException { final String cloudId = fi... | SimplifiedRecordsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) public @ResponseBody Record getRecord( HttpServletRequest httpServletRequest, @PathVariable String providerId, @PathVariable String localId) throws RecordNotExistsException, ProviderNotExistsException... | SimplifiedRecordsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) public @ResponseBody Record getRecord( HttpServletRequest httpServletRequest, @PathVariable String providerId, @PathVariable String localId) throws RecordNotExistsException, ProviderNotExistsException... | SimplifiedRecordsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) public @ResponseBody Record getRecord( HttpServletRequest httpServletRequest, @PathVariable String providerId, @PathVariable String localId) throws RecordNotExistsException, ProviderNotExistsException... | SimplifiedRecordsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) public @ResponseBody Record getRecord( HttpServletRequest httpServletRequest, @PathVariable String providerId, @PathVariable String localId) throws RecordNotExistsException, ProviderNotExistsException... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.