Loading .gitlab-ci.yml +1 −3 Original line number Diff line number Diff line Loading @@ -42,10 +42,8 @@ test: - docker image: "${CI_REGISTRY_IMAGE}/vospace-test-env" variables: FILE_CATALOG_REPO_URL: "https://gitlab-ci-token:${CI_JOB_TOKEN}@www.ict.inaf.it/gitlab/ia2/vospace-file-catalog.git" FILE_CATALOG_REPO_URL: "https://gitlab-ci-token:${CI_JOB_TOKEN}@www.ict.inaf.it/gitlab/vospace/vospace-file-catalog.git" script: - pwd - ls - git clone ${FILE_CATALOG_REPO_URL} - mvn clean test -Dinit_database_scripts_path=../../vospace-file-catalog - awk -F"," '{ instructions += $4 + $5; covered += $5 } END { print "coverage=" 100*covered/instructions }' target/site/jacoco/jacoco.csv Loading src/main/java/it/inaf/oats/vospace/TapeService.java→src/main/java/it/inaf/oats/vospace/AsyncTransferService.java +6 −2 Original line number Diff line number Diff line Loading @@ -11,9 +11,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service public class TapeService { public class AsyncTransferService { private static final Logger LOG = LoggerFactory.getLogger(TapeService.class); private static final Logger LOG = LoggerFactory.getLogger(AsyncTransferService.class); @Autowired private RabbitTemplate template; Loading @@ -25,6 +25,10 @@ public class TapeService { byte[] message = MAPPER.writeValueAsBytes(job); byte[] result = (byte[]) template.convertSendAndReceive("start_job_queue", message); if (result == null) { throw new IllegalStateException("Transfer service returned an empty response"); } LOG.trace("Tape transfer service answered:\n{}", new String(result)); return MAPPER.readValue(result, JobSummary.class); Loading src/main/java/it/inaf/oats/vospace/JobService.java +2 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ public class JobService { private UriService uriService; @Autowired private TapeService tapeService; private AsyncTransferService asyncTransfService; public enum JobType { pullToVoSpace, Loading Loading @@ -58,7 +58,7 @@ public class JobService { private void handlePullToVoSpace(JobSummary job) { // TODO: check protocol tapeService.startJob(job); asyncTransfService.startJob(job); } private void handleVoSpaceUrlsListResult(JobSummary job) { Loading src/test/java/it/inaf/oats/vospace/TransferControllerTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -55,7 +55,7 @@ public class TransferControllerTest { private NodeDAO nodeDao; @MockBean private TapeService tapeService; private AsyncTransferService tapeService; @Autowired private MockMvc mockMvc; Loading Loading
.gitlab-ci.yml +1 −3 Original line number Diff line number Diff line Loading @@ -42,10 +42,8 @@ test: - docker image: "${CI_REGISTRY_IMAGE}/vospace-test-env" variables: FILE_CATALOG_REPO_URL: "https://gitlab-ci-token:${CI_JOB_TOKEN}@www.ict.inaf.it/gitlab/ia2/vospace-file-catalog.git" FILE_CATALOG_REPO_URL: "https://gitlab-ci-token:${CI_JOB_TOKEN}@www.ict.inaf.it/gitlab/vospace/vospace-file-catalog.git" script: - pwd - ls - git clone ${FILE_CATALOG_REPO_URL} - mvn clean test -Dinit_database_scripts_path=../../vospace-file-catalog - awk -F"," '{ instructions += $4 + $5; covered += $5 } END { print "coverage=" 100*covered/instructions }' target/site/jacoco/jacoco.csv Loading
src/main/java/it/inaf/oats/vospace/TapeService.java→src/main/java/it/inaf/oats/vospace/AsyncTransferService.java +6 −2 Original line number Diff line number Diff line Loading @@ -11,9 +11,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service public class TapeService { public class AsyncTransferService { private static final Logger LOG = LoggerFactory.getLogger(TapeService.class); private static final Logger LOG = LoggerFactory.getLogger(AsyncTransferService.class); @Autowired private RabbitTemplate template; Loading @@ -25,6 +25,10 @@ public class TapeService { byte[] message = MAPPER.writeValueAsBytes(job); byte[] result = (byte[]) template.convertSendAndReceive("start_job_queue", message); if (result == null) { throw new IllegalStateException("Transfer service returned an empty response"); } LOG.trace("Tape transfer service answered:\n{}", new String(result)); return MAPPER.readValue(result, JobSummary.class); Loading
src/main/java/it/inaf/oats/vospace/JobService.java +2 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ public class JobService { private UriService uriService; @Autowired private TapeService tapeService; private AsyncTransferService asyncTransfService; public enum JobType { pullToVoSpace, Loading Loading @@ -58,7 +58,7 @@ public class JobService { private void handlePullToVoSpace(JobSummary job) { // TODO: check protocol tapeService.startJob(job); asyncTransfService.startJob(job); } private void handleVoSpaceUrlsListResult(JobSummary job) { Loading
src/test/java/it/inaf/oats/vospace/TransferControllerTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -55,7 +55,7 @@ public class TransferControllerTest { private NodeDAO nodeDao; @MockBean private TapeService tapeService; private AsyncTransferService tapeService; @Autowired private MockMvc mockMvc; Loading