4 |
4 |
import java.io.IOException;
|
5 |
5 |
import java.io.InputStream;
|
6 |
6 |
import java.io.InputStreamReader;
|
|
7 |
import java.util.List;
|
7 |
8 |
|
8 |
9 |
import org.apache.commons.lang3.StringUtils;
|
9 |
10 |
import org.junit.Before;
|
10 |
11 |
import org.junit.Test;
|
11 |
12 |
|
|
13 |
import com.google.gson.Gson;
|
12 |
14 |
import com.google.gson.JsonObject;
|
13 |
15 |
import com.google.gson.JsonParser;
|
14 |
16 |
|
15 |
17 |
import eu.dnetlib.actionmanager.actions.ActionFactory;
|
|
18 |
import eu.dnetlib.actionmanager.actions.AtomicAction;
|
16 |
19 |
import eu.dnetlib.actionmanager.common.Agent;
|
17 |
20 |
import eu.dnetlib.data.mapreduce.hbase.Reporter;
|
18 |
21 |
import eu.dnetlib.data.mapreduce.hbase.dataimport.OrcidToActions;
|
... | ... | |
25 |
28 |
|
26 |
29 |
@Before
|
27 |
30 |
public void setup() {
|
28 |
|
setName = "DLI";
|
|
31 |
setName = "ORCID";
|
29 |
32 |
agent = new Agent("agentId", "agentName", Agent.AGENT_TYPE.service);
|
30 |
33 |
reporter =
|
31 |
34 |
(Reporter) (counterGroup, counterName, delta) -> System.out.println(String.format("COUNTER: %s - %s : %d", counterGroup, counterName, delta));
|
... | ... | |
76 |
79 |
|
77 |
80 |
final JsonParser parser = new JsonParser();
|
78 |
81 |
final JsonObject root = parser.parse(line).getAsJsonObject();
|
79 |
|
OrcidToActions.generatePublicationActionsFromDump(root, new ActionFactory(), setName, agent, reporter);
|
80 |
|
|
|
82 |
final List<AtomicAction> lista = OrcidToActions.generatePublicationActionsFromDump(root, new ActionFactory(), setName, agent, reporter);
|
|
83 |
System.out.println(new Gson().toJson(lista));
|
81 |
84 |
}
|
82 |
85 |
|
83 |
86 |
private void doTestAllOrcidAction(final String filePath) throws IOException {
|
code cleaning