Project

General

Profile

« Previous | Next » 

Revision 55895

code cleaning

View differences:

modules/dnet-mapreduce-jobs/trunk/src/test/java/eu/dnetlib/data/mapreduce/actions/OrcidToActionsTest.java
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 {
modules/dnet-mapreduce-jobs/trunk/src/main/java/eu/dnetlib/data/mapreduce/hbase/dataimport/OrcidImportMapper.java
24 24
	private JsonParser parser;
25 25
	private ActionFactory factory;
26 26

  
27
	private static final String SEPARATOR = "@";
28

  
29 27
	@Override
30 28
	protected void setup(final Context context) throws IOException, InterruptedException {
31 29
		setName = context.getConfiguration().get("setName");

Also available in: Unified diff