Commit 2459f259 authored by Matija Obreza's avatar Matija Obreza

New GLIS XML integration protocol

parent f3646962
......@@ -24,6 +24,10 @@ import java.util.Date;
import java.util.List;
import org.genesys.glis.v1.invoker.ApiException;
import org.genesys.glis.v1.model.Acquisition;
import org.genesys.glis.v1.model.Actor;
import org.genesys.glis.v1.model.Collection;
import org.genesys.glis.v1.model.Collector;
import org.genesys.glis.v1.model.Location;
import org.genesys.glis.v1.model.Registration;
import org.genesys.glis.v1.model.RegistrationResponse;
......@@ -62,7 +66,7 @@ public class RegistrationApiTest extends BaseApiTest {
SimpleDateFormat df = new SimpleDateFormat("YYYY-MM-dd");
pgrfa.setDate(df.format(new Date()));
pgrfa.setCropname(cropName);
pgrfa.addCropnamesItem(cropName);
pgrfa.setSampleid(prefix + System.currentTimeMillis());
pgrfa.setMethod("obna");
Location location = new Location();
......@@ -77,12 +81,35 @@ public class RegistrationApiTest extends BaseApiTest {
RegistrationResponse response1 = api.registerPGRFA(pgrfa1);
assertThat(response1.getDoi(), not(nullValue()));
Registration pgrfa2 = makePGRFA("Matija", "Matija ").method("acqu");
Registration pgrfa2 = makePGRFA("Matija", "Matija ").method("nodi");
pgrfa2.addProgdoiItem(response1.getDoi()).addProgdoiItem(response1.getDoi());
RegistrationResponse response2 = api.registerPGRFA(pgrfa2);
assertThat(response2.getDoi(), not(nullValue()));
List<Relationship> rels = queryApi.listRelationships(response1.getDoi(), null, null);
assertThat(rels.size(), greaterThan(0));
}
@Test
public void testAcquisition() throws ApiException {
Registration pgrfa = makePGRFA("Matija", "Matija ").method("acqu").acquisition(new Acquisition().provenance("SVN").provider(new Actor().name("Genesys GLIS Tool").country("DEU")))
.date("2017-07-23");
RegistrationResponse response = api.registerPGRFA(pgrfa);
assertThat(response.getDoi(), not(nullValue()));
}
@Test
public void testCollection() throws ApiException {
Registration pgrfa = makePGRFA("Matija", "Matija ").method("acqu").collection(new Collection().date("2017-07-23").elevation(100).missid("Genesys GLIS"));
RegistrationResponse response = api.registerPGRFA(pgrfa);
assertThat(response.getDoi(), not(nullValue()));
}
@Test
public void testCollectionCollector() throws ApiException {
Registration pgrfa = makePGRFA("Matija", "Matija ").method("acqu")
.collection(new Collection().date("2017-07-23").elevation(100).missid("Genesys GLIS").addCollectorsItem(new Collector().name("Matija Obreza")));
RegistrationResponse response = api.registerPGRFA(pgrfa);
assertThat(response.getDoi(), not(nullValue()));
}
}
......@@ -48,7 +48,7 @@ public class RegistrationApiTest extends BaseApiTest {
SimpleDateFormat df = new SimpleDateFormat("YYYY-MM-dd");
pgrfa.setDate(df.format(new Date()));
// pgrfa.setDate("1990");
pgrfa.setCropname("Matija");
pgrfa.addCropnamesItem("Matija");
pgrfa.setSampleid("Matija " + System.currentTimeMillis());
pgrfa.setMethod("ihcp");
Location location = new Location();
......@@ -90,7 +90,7 @@ public class RegistrationApiTest extends BaseApiTest {
pgrfa.setDate(df.format(new Date()));
// pgrfa.setDate("1990-03-22");
pgrfa.setCropname("Matija");
pgrfa.addCropnamesItem("Matija");
pgrfa.setSampleid("Matija " + System.currentTimeMillis());
pgrfa.setMethod("ihcp");
Location location = new Location();
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment