Commit 46bbd487 authored by Sonia Zorba's avatar Sonia Zorba
Browse files

Minor changes

parent 9a072bf8
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -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
+6 −2
Original line number Diff line number Diff line
@@ -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;
@@ -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);
+2 −2
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ public class JobService {
    private UriService uriService;

    @Autowired
    private TapeService tapeService;
    private AsyncTransferService asyncTransfService;

    public enum JobType {
        pullToVoSpace,
@@ -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) {
+1 −1
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ public class TransferControllerTest {
    private NodeDAO nodeDao;

    @MockBean
    private TapeService tapeService;
    private AsyncTransferService tapeService;

    @Autowired
    private MockMvc mockMvc;