Commit ba2839768e9668d81afa9e1df8c2d7724afb3044

Authored by Paulo Graça
1 parent ea66d8355f
Exists in tests

PG: Java8 downgrade

ptcrisync-test/src/main/java/pt/ptcris/test/dummy/ORCIDClientDummyImpl.java
... ... @@ -79,7 +79,7 @@ public class ORCIDClientDummyImpl implements ORCIDClient {
79 79 if (dummyWorks.containsKey(putCode)) {
80 80 return dummyWorks.get(putCode);
81 81 } else {
82   - List<BigInteger> putCodesList = new LinkedList<>();
  82 + List<BigInteger> putCodesList = new LinkedList<BigInteger>();
83 83 putCodesList.add(putCode);
84 84 try {
85 85 List<Work> workList = WorkTestPrepare.loadLocalWorksFromResources(putCodesList);
... ...
ptcrisync-test/src/main/java/pt/ptcris/test/dummy/ProgressHandlerDummyImpl.java
... ... @@ -8,7 +8,10 @@ import org.apache.logging.log4j.Logger;
8 8  
9 9 import pt.ptcris.handlers.ProgressHandler;
10 10  
  11 +
11 12 public class ProgressHandlerDummyImpl implements ProgressHandler {
  13 +
  14 +
12 15 private static final Logger _log = LogManager.getLogger(ProgressHandlerDummyImpl.class);
13 16 private long start_init = 0L;
14 17 private long start_process = 0L;
... ... @@ -19,6 +22,17 @@ public class ProgressHandlerDummyImpl implements ProgressHandler {
19 22 private List<Long> timeEachExecution;
20 23 private List<String> report = new Vector<String>();
21 24 private String message;
  25 +
  26 + public enum SyncStatus {
  27 + ORCID_SYNC_EXPORT_STARTED
  28 + , ORCID_SYNC_IMPORT_WORKS_STARTED
  29 + , ORCID_SYNC_IMPORT_UPDATES_STARTED
  30 + , ORCID_SYNC_EXPORT_UPDATING_WORKS
  31 + , ORCID_SYNC_EXPORT_ADDING_WORKS
  32 + , ORCID_SYNC_EXPORT_WORKS_ITERATION
  33 + , ORCID_SYNC_IMPORT_WORKS_ITERATION
  34 + , ORCID_SYNC_IMPORT_UPDATES_ITERATION
  35 + }
22 36  
23 37 public void setProgress(int progress) {
24 38 if (progress == 0) {
... ... @@ -34,20 +48,21 @@ public class ProgressHandlerDummyImpl implements ProgressHandler {
34 48 }
35 49  
36 50 public void setCurrentStatus(String message) {
37   - // TODO Auto-generated method stub
  51 + SyncStatus status = SyncStatus.valueOf(message);
  52 +
38 53 _log.debug(message);
39   - switch (message) {
40   - case "ORCID_SYNC_EXPORT_STARTED":
41   - case "ORCID_SYNC_IMPORT_WORKS_STARTED":
42   - case "ORCID_SYNC_IMPORT_UPDATES_STARTED":
  54 + switch (status) {
  55 + case ORCID_SYNC_EXPORT_STARTED:
  56 + case ORCID_SYNC_IMPORT_WORKS_STARTED:
  57 + case ORCID_SYNC_IMPORT_UPDATES_STARTED:
43 58 this.message = message;
44 59 start_init = System.nanoTime();
45 60 break;
46   - //case "ORCID_SYNC_EXPORT_UPDATING_WORKS":
47   - //case "ORCID_SYNC_EXPORT_ADDING_WORKS":
48   - case "ORCID_SYNC_EXPORT_WORKS_ITERATION":
49   - case "ORCID_SYNC_IMPORT_WORKS_ITERATION":
50   - case "ORCID_SYNC_IMPORT_UPDATES_ITERATION":
  61 + //case ORCID_SYNC_EXPORT_UPDATING_WORKS:
  62 + //case ORCID_SYNC_EXPORT_ADDING_WORKS:
  63 + case ORCID_SYNC_EXPORT_WORKS_ITERATION:
  64 + case ORCID_SYNC_IMPORT_WORKS_ITERATION:
  65 + case ORCID_SYNC_IMPORT_UPDATES_ITERATION:
51 66 start_process = System.nanoTime();
52 67 default:
53 68 if (time_init == null) {
... ...