42 lines
1.1 KiB
Java
42 lines
1.1 KiB
Java
package org.gcube.tests;
|
|
|
|
import org.gcube.common.resources.gcore.GenericResource;
|
|
import org.gcube.common.resources.gcore.Resources;
|
|
import org.gcube.data.publishing.ckan2zenodo.Translator;
|
|
import org.gcube.data.publishing.ckan2zenodo.commons.IS;
|
|
import org.junit.BeforeClass;
|
|
import org.junit.Test;
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
public class TransformationTests {
|
|
|
|
static ObjectMapper mapper=null;
|
|
@BeforeClass
|
|
public static void init () {
|
|
mapper=TestCommons.getMapper();
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
public void transform() throws Exception {
|
|
Translator basic=new Translator();
|
|
TestCommons.readAndTransform("/simpleItem.json",basic);
|
|
TestCommons.readAndTransform("/FSKXModel.json",basic);
|
|
TestCommons.readAndTransform("/ResearchObject.json",basic);
|
|
}
|
|
|
|
|
|
@Test
|
|
public void transformWithMappings() throws Exception {
|
|
|
|
GenericResource res=Resources.unmarshal(GenericResource.class, TransformationTests.class.getResourceAsStream("/ResearchObject.xml"));
|
|
Translator t=new Translator(IS.readMappings(res));
|
|
// TestCommons.readAndTransform("/ResearchObject.json", t);
|
|
TestCommons.readAndTransform("/crop_parameters.json",t);
|
|
}
|
|
|
|
|
|
}
|