This commit is contained in:
Fabio Sinibaldi 2019-05-22 13:36:47 +00:00
parent b304a9b78a
commit a768d4576a
10 changed files with 25 additions and 19 deletions

View File

@ -150,8 +150,8 @@ public class GCatController implements CatalogueController{
Iterator<JsonNode> resIterator=node.path("resources").elements();
while(resIterator.hasNext()) {
JsonNode resNode=resIterator.next();
String resourceName=resNode.path("name").asText();
createResource(itemId, resourceName, resNode.asText());
String resourceName=resNode.path("name").textValue();
createResource(itemId, resourceName, resNode.toString());
}
}
@ -354,7 +354,7 @@ public class GCatController implements CatalogueController{
private static String getId(String publishResponse) {
try {
return mapper.readTree(publishResponse).path("result").path("id").asText();
return mapper.readTree(publishResponse).path("id").textValue();
} catch (Throwable t) {
t.printStackTrace();
throw new RuntimeException("FAILED Parsing of "+publishResponse);
@ -363,7 +363,7 @@ public class GCatController implements CatalogueController{
private static String getPublishedUrl(String publishResponse) {
try {
Iterator<JsonNode> iterator=mapper.readTree(publishResponse).path("result").path("extras").elements();
Iterator<JsonNode> iterator=mapper.readTree(publishResponse).path("extras").elements();
while(iterator.hasNext()) {
JsonNode node=iterator.next();
if(node.path("key").asText().equals("Item URL"))

View File

@ -86,7 +86,7 @@ public class Interactions extends BaseCataloguePluginTest{
}
@Test(expected=PublicationException.class)
@Test(expected=WrongObjectFormatException.class)
public void missingProfile() throws CatalogueInteractionException, WrongObjectFormatException, PublicationException, ControllerInstantiationFault, InternalConversionException {
Assume.assumeTrue(isTestInfrastructureEnabled());
publish(getController(),"missingProfile.json");

View File

@ -1,6 +1,7 @@
{
"profile": "<metadataformat type=\"My Profile\">\r\n <metadatafield categoryref=\"category1\">\r\n <fieldName>Field 1<\/fieldName>\r\n <mandatory>false<\/mandatory>\r\n <dataType>String<\/dataType>\r\n <defaultValue \/>\r\n <note>Write something here<\/note>\r\n <validator \/>\r\n <tagging create=\"true\" separator=\"-\">onFieldName<\/tagging>\r\n <\/metadatafield>\r\n <metadatafield categoryref=\"category1\">\r\n <fieldName>Field 2<\/fieldName>\r\n <mandatory>false<\/mandatory>\r\n <dataType>Boolean<\/dataType>\r\n <defaultValue>true<\/defaultValue>\r\n <note>Set true or false to the checkbox<\/note>\r\n <validator \/>\r\n <\/metadatafield>\r\n <metadatafield categoryref=\"category2\">\r\n <fieldName>Field 3<\/fieldName>\r\n <mandatory>true<\/mandatory>\r\n <dataType>String<\/dataType>\r\n <defaultValue>A<\/defaultValue>\r\n <note>A listbox of values<\/note>\r\n <vocabulary isMultiSelection=\"true\">\r\n <vocabularyField>A3<\/vocabularyField>\r\n <vocabularyField>B3<\/vocabularyField>\r\n <vocabularyField>C3<\/vocabularyField>\r\n <vocabularyField>D3<\/vocabularyField>\r\n <vocabularyField>E3<\/vocabularyField>\r\n <vocabularyField>F3<\/vocabularyField>\r\n <\/vocabulary>\r\n <validator \/>\r\n <tagging create=\"true\" separator=\"-\">onValue<\/tagging>\r\n <\/metadatafield>\r\n <metadatafield categoryref=\"category2\">\r\n <fieldName>Field 4<\/fieldName>\r\n <mandatory>true<\/mandatory>\r\n <dataType>Number<\/dataType>\r\n <defaultValue>4<\/defaultValue>\r\n <validator \/>\r\n <\/metadatafield>\r\n<\/metadataformat>",
"profile": "<metadataformat type=\"My Profile\">\r\n <metadatafield categoryref=\"category1\">\r\n <fieldName>Field 1<\/fieldName>\r\n <mandatory>false<\/mandatory>\r\n <dataType>String<\/dataType>\r\n <defaultValue \/>\r\n <note>Write something here<\/note> \r\n <tagging create=\"true\" separator=\"-\">onFieldName<\/tagging>\r\n <\/metadatafield>\r\n <metadatafield categoryref=\"category1\">\r\n <fieldName>Field 2<\/fieldName>\r\n <mandatory>false<\/mandatory>\r\n <dataType>Boolean<\/dataType>\r\n <defaultValue>true<\/defaultValue>\r\n <note>Set true or false to the checkbox<\/note> \r\n <\/metadatafield>\r\n <metadatafield categoryref=\"category2\">\r\n <fieldName>Field 3<\/fieldName>\r\n <mandatory>false<\/mandatory>\r\n <dataType>String<\/dataType>\r\n <defaultValue>A<\/defaultValue>\r\n <note>A listbox of values<\/note>\r\n <vocabulary isMultiSelection=\"true\">\r\n <vocabularyField>A3<\/vocabularyField>\r\n <vocabularyField>B3<\/vocabularyField>\r\n <vocabularyField>C3<\/vocabularyField>\r\n <vocabularyField>D3<\/vocabularyField>\r\n <vocabularyField>E3<\/vocabularyField>\r\n <vocabularyField>F3<\/vocabularyField>\r\n <\/vocabulary> \r\n <tagging create=\"true\" separator=\"-\">onValue<\/tagging>\r\n <\/metadatafield>\r\n <metadatafield categoryref=\"category2\">\r\n <fieldName>Field 4<\/fieldName>\r\n <mandatory>false<\/mandatory>\r\n <dataType>Number<\/dataType>\r\n <defaultValue>4<\/defaultValue>\r\n <\/metadatafield>\r\n<\/metadataformat>",
"item": {
"name": "full_wiki_test",
"license_title": "Creative Commons Attribution Share-Alike 4.0",
"maintainer": null,
"searchable": "true",
@ -105,7 +106,7 @@
"hash": "",
"description": "",
"format": "",
"url": "https://data.d4science.org/shub/E_MHpyWDlKS2hPRGhKNk9ackxMY25pMDhZWEs1Z2dCTWEyNkNzbTdyMjZveDlON1RTWW9xa1FvVnprT3liSmRncA==",
"url": "http://www.google.it",
"created": "2019-03-19T14:33:45.724709",
"state": "active",
"last_modified": null,
@ -123,7 +124,7 @@
"hash":"",
"description":"",
"format":"",
"url":"https://data.d4science.org/shub/E_MHpyWDlKS2hPRGhKNk9ackxMY25pMDhZWEs1Z2dCTWEyNkNzbTdyMjZveDlON1RTWW9xa1FvVnprT3liSmRncA==","created":"2019-03-19T14:33:45.724709","state":"active","last_modified":null,"mimetype":"application/pdf","url_type":null,"position":0,"revision_id":"ad5fbd19-fe67-4141-ad44-cf41d90b95fb",
"url": "http://www.google.it",
"size":null,
"datastore_active":false,
"resource_type":null,
@ -135,7 +136,7 @@
"hash": "",
"description": "",
"format": "",
"url": "https://data.d4science.org/shub/E_MHpyWDlKS2hPRGhKNk9ackxMY25pMDhZWEs1Z2dCTWEyNkNzbTdyMjZveDlON1RTWW9xa1FvVnprT3liSmRncA==",
"url": "http://www.google.it",
"created": "2019-03-19T14:33:45.724709",
"state": "active",
"last_modified": null,
@ -147,5 +148,5 @@
"datastore_active": false,
"resource_type": null,
"name": "RESTful Transaction Model2"
},null]
}]
}

View File

@ -1,6 +1,7 @@
{
"profile": null,
"item": {
"name": "wiki_test",
"license_title": "Creative Commons Attribution Share-Alike 4.0",
"maintainer": null,
"searchable": "true",

View File

@ -1,6 +1,7 @@
{
"profile": null,
"item": {
"name": "wiki_test",
"license_title": "Creative Commons Attribution Share-Alike 4.0",
"maintainer": null,
"searchable": "true",
@ -93,7 +94,7 @@
},
{
"key": "system:type",
"value": "My Profile"
"value": "EmptyProfile"
}
]
},

View File

@ -1,6 +1,7 @@
{
"profile": "<metadataformat type=\"My Profile\">\r\n <metadatafield categoryref=\"category1\">\r\n <fieldName>Field 1<\/fieldName>\r\n <mandatory>false<\/mandatory>\r\n <dataType>String<\/dataType>\r\n <defaultValue \/>\r\n <note>Write something here<\/note>\r\n <validator \/>\r\n <tagging create=\"true\" separator=\"-\">onFieldName<\/tagging>\r\n <\/metadatafield>\r\n <metadatafield categoryref=\"category1\">\r\n <fieldName>Field 2<\/fieldName>\r\n <mandatory>false<\/mandatory>\r\n <dataType>Boolean<\/dataType>\r\n <defaultValue>true<\/defaultValue>\r\n <note>Set true or false to the checkbox<\/note>\r\n <validator \/>\r\n <\/metadatafield>\r\n <metadatafield categoryref=\"category2\">\r\n <fieldName>Field 3<\/fieldName>\r\n <mandatory>true<\/mandatory>\r\n <dataType>String<\/dataType>\r\n <defaultValue>A<\/defaultValue>\r\n <note>A listbox of values<\/note>\r\n <vocabulary isMultiSelection=\"true\">\r\n <vocabularyField>A3<\/vocabularyField>\r\n <vocabularyField>B3<\/vocabularyField>\r\n <vocabularyField>C3<\/vocabularyField>\r\n <vocabularyField>D3<\/vocabularyField>\r\n <vocabularyField>E3<\/vocabularyField>\r\n <vocabularyField>F3<\/vocabularyField>\r\n <\/vocabulary>\r\n <validator \/>\r\n <tagging create=\"true\" separator=\"-\">onValue<\/tagging>\r\n <\/metadatafield>\r\n <metadatafield categoryref=\"category2\">\r\n <fieldName>Field 4<\/fieldName>\r\n <mandatory>true<\/mandatory>\r\n <dataType>Number<\/dataType>\r\n <defaultValue>4<\/defaultValue>\r\n <validator \/>\r\n <\/metadatafield>\r\n<\/metadataformat>",
"profile": "<metadataformat type=\"My Profile\">\r\n <metadatafield categoryref=\"category1\">\r\n <fieldName>Field 1<\/fieldName>\r\n <mandatory>false<\/mandatory>\r\n <dataType>String<\/dataType>\r\n <defaultValue \/>\r\n <note>Write something here<\/note> \r\n <tagging create=\"true\" separator=\"-\">onFieldName<\/tagging>\r\n <\/metadatafield>\r\n <metadatafield categoryref=\"category1\">\r\n <fieldName>Field 2<\/fieldName>\r\n <mandatory>false<\/mandatory>\r\n <dataType>Boolean<\/dataType>\r\n <defaultValue>true<\/defaultValue>\r\n <note>Set true or false to the checkbox<\/note> \r\n <\/metadatafield>\r\n <metadatafield categoryref=\"category2\">\r\n <fieldName>Field 3<\/fieldName>\r\n <mandatory>false<\/mandatory>\r\n <dataType>String<\/dataType>\r\n <defaultValue>A<\/defaultValue>\r\n <note>A listbox of values<\/note>\r\n <vocabulary isMultiSelection=\"true\">\r\n <vocabularyField>A3<\/vocabularyField>\r\n <vocabularyField>B3<\/vocabularyField>\r\n <vocabularyField>C3<\/vocabularyField>\r\n <vocabularyField>D3<\/vocabularyField>\r\n <vocabularyField>E3<\/vocabularyField>\r\n <vocabularyField>F3<\/vocabularyField>\r\n <\/vocabulary> \r\n <tagging create=\"true\" separator=\"-\">onValue<\/tagging>\r\n <\/metadatafield>\r\n <metadatafield categoryref=\"category2\">\r\n <fieldName>Field 4<\/fieldName>\r\n <mandatory>false<\/mandatory>\r\n <dataType>Number<\/dataType>\r\n <defaultValue>4<\/defaultValue>\r\n <\/metadatafield>\r\n<\/metadataformat>",
"item": {
"name": "full_wiki_test",
"license_title": "Creative Commons Attribution Share-Alike 4.0",
"maintainer": null,
"searchable": "true",
@ -105,7 +106,7 @@
"hash": "",
"description": "",
"format": "",
"url": "https://data.d4science.org/shub/E_MHpyWDlKS2hPRGhKNk9ackxMY25pMDhZWEs1Z2dCTWEyNkNzbTdyMjZveDlON1RTWW9xa1FvVnprT3liSmRncA==",
"url": "http://www.google.it",
"created": "2019-03-19T14:33:45.724709",
"state": "active",
"last_modified": null,
@ -123,7 +124,7 @@
"hash":"",
"description":"",
"format":"",
"url":"https://data.d4science.org/shub/E_MHpyWDlKS2hPRGhKNk9ackxMY25pMDhZWEs1Z2dCTWEyNkNzbTdyMjZveDlON1RTWW9xa1FvVnprT3liSmRncA==","created":"2019-03-19T14:33:45.724709","state":"active","last_modified":null,"mimetype":"application/pdf","url_type":null,"position":0,"revision_id":"ad5fbd19-fe67-4141-ad44-cf41d90b95fb",
"url": "http://www.google.it",
"size":null,
"datastore_active":false,
"resource_type":null,
@ -135,7 +136,7 @@
"hash": "",
"description": "",
"format": "",
"url": "https://data.d4science.org/shub/E_MHpyWDlKS2hPRGhKNk9ackxMY25pMDhZWEs1Z2dCTWEyNkNzbTdyMjZveDlON1RTWW9xa1FvVnprT3liSmRncA==",
"url": "http://www.google.it",
"created": "2019-03-19T14:33:45.724709",
"state": "active",
"last_modified": null,
@ -147,5 +148,5 @@
"datastore_active": false,
"resource_type": null,
"name": "RESTful Transaction Model2"
},null]
}]
}

View File

@ -1,6 +1,7 @@
{
"profile": null,
"item": {
"name": "wiki_test",
"license_title": "Creative Commons Attribution Share-Alike 4.0",
"maintainer": null,
"searchable": "true",

View File

@ -1,6 +1,7 @@
{
"profile": null,
"item": {
"name": "wiki_test",
"license_title": "Creative Commons Attribution Share-Alike 4.0",
"maintainer": null,
"searchable": "true",
@ -93,7 +94,7 @@
},
{
"key": "system:type",
"value": "My Profile"
"value": "EmptyProfile"
}
]
},