Fixed tests

This commit is contained in:
Luca Frosini 2023-04-26 09:02:04 +02:00
parent 955ad64456
commit 10ae0d1894
5 changed files with 15 additions and 15 deletions

View File

@ -57,7 +57,7 @@ public class AccessPointFacetTest {
@Test @Test
public void testEncryptedSpecilization() throws Exception { public void testEncryptedSpecilization() throws Exception {
String marshalled = "{\"@class\":\"AccessPointFacet\",\"@uuid\":null,\"@metadata\":null,\"entryName\":\"port1\",\"endpoint\":\"https://localhost\",\"protocol\":null,\"description\":null,\"authorization\":{\"@class\":\"ValueSchema\",\"value\":\"pwd\",\"type\":\"https://www.gcube-system.org\"},\"Test\":\"MyTest\",\"Enc\":{\"@class\":\"MyEncrypted\",\"@superClasses\":[\"Encrypted\", \"Property\"],\"value\":\"Encrypted\"}}"; String marshalled = "{\"@class\":\"AccessPointFacet\",\"uuid\":null,\"metadata\":null,\"entryName\":\"port1\",\"endpoint\":\"https://localhost\",\"protocol\":null,\"description\":null,\"authorization\":{\"@class\":\"ValueSchema\",\"value\":\"pwd\",\"type\":\"https://www.gcube-system.org\"},\"Test\":\"MyTest\",\"Enc\":{\"@class\":\"MyEncrypted\",\"@superClasses\":[\"Encrypted\", \"Property\"],\"value\":\"Encrypted\"}}";
AccessPointFacet apf = ElementMapper.unmarshal(AccessPointFacet.class, marshalled); AccessPointFacet apf = ElementMapper.unmarshal(AccessPointFacet.class, marshalled);
Encrypted vlt = (Encrypted) apf.getAdditionalProperty("Enc"); Encrypted vlt = (Encrypted) apf.getAdditionalProperty("Enc");
logger.debug(ElementMapper.marshal(vlt)); logger.debug(ElementMapper.marshal(vlt));

View File

@ -48,7 +48,7 @@ public class ActionFacetTest {
//@Test //@Test
public void deserialize() { public void deserialize() {
String marshalled = "{\"@class\":\"ActionFacet\",\"@metadata\":null,\"name\":\"FirstAction\"," String marshalled = "{\"@class\":\"ActionFacet\",\"metadata\":null,\"name\":\"FirstAction\","
+ "\"type\":{\"@class\":\"EnumStringPropertyImpl\",\"type\":[\"EXECUTABLE\",\"ANSIBLE\",\"COMMAND\",\"REMOTE_SERVICE\"]," + "\"type\":{\"@class\":\"EnumStringPropertyImpl\",\"type\":[\"EXECUTABLE\",\"ANSIBLE\",\"COMMAND\",\"REMOTE_SERVICE\"],"
+ "\"value\":\"ANSIBLE\"},\"source\":\"git@myrepo:playbook.yml\",\"options\":\"playbook.yml\",\"command\":\"ansible-pull\"}"; + "\"value\":\"ANSIBLE\"},\"source\":\"git@myrepo:playbook.yml\",\"options\":\"playbook.yml\",\"command\":\"ansible-pull\"}";
ActionFacet facet = null; ActionFacet facet = null;

View File

@ -36,7 +36,7 @@ public class ContactFacetImplTest {
public void test() throws Exception{ public void test() throws Exception{
String json = "{ " String json = "{ "
+ "\"@class\":\"ContactFacet\"," + "\"@class\":\"ContactFacet\","
+ "\"@metadata\" : {" + "\"metadata\" : {"
+ "\"@class\":\"Metadata\"," + "\"@class\":\"Metadata\","
+ "\"creator\":\"luca.frosini\"" + "\"creator\":\"luca.frosini\""
+ "}," + "},"

View File

@ -29,13 +29,13 @@ public class PolymorphismTest {
private static Logger logger = LoggerFactory private static Logger logger = LoggerFactory
.getLogger(PolymorphismTest.class); .getLogger(PolymorphismTest.class);
public static final String NYESERVICE = "{\"@class\":\"EService\",\"@uuid\":\"3ace4bd0-e5cd-49a3-97a8-a0a9468ce6d4\",\"metadata\":{\"@class\":\"Metadata\",\"creator\":null, \"creationTime\":null, \"lastUpdateTime\":null},\"consistsOf\":[{\"@class\":\"IsIdentifiedBy\",\"metadata\":null,\"target\":{\"@superClasses\":[\"SoftwareFacet\", \"Facet\", \"Entity\"],\"@class\":\"MySoftwareFacet\",\"metadata\":null,\"name\":\"WhnManager\",\"group\":\"VREManagement\",\"version\":\"2.0.0-SNAPSHOT\",\"description\":\"Web Hosting Node Service\",\"qualifier\":null,\"optional\":false}},{\"@class\":\"ConsistsOf\",\"metadata\":null,\"target\":{\"@class\":\"AccessPointFacet\",\"metadata\":null,\"entryName\":\"whnmanager\",\"endpoint\":\"https://pc-frosini.isti.cnr.it:8080/whn-manager/gcube/vremanagement/ws/whnmanager\",\"protocol\":null,\"description\":null,\"authorization\": {\"@class\":\"ValueSchema\",\"value\":\"gcube-token\",\"schema\":null},\"properties\":null}},{\"@class\":\"ConsistsOf\",\"metadata\":null,\"target\":{\"@class\":\"AccessPointFacet\",\"metadata\":null,\"entryName\":\"WhnManager-remote-management\",\"endpoint\":\"https://pc-frosini.isti.cnr.it:8080/whn-manager/gcube/resource\",\"protocol\":null,\"description\":null,\"authorization\":{\"@class\":\"ValueSchema\",\"value\":\"gcube-token\",\"schema\":null},\"properties\":null}}],\"isRelatedTo\":[]}"; public static final String NYESERVICE = "{\"@class\":\"EService\",\"uuid\":\"3ace4bd0-e5cd-49a3-97a8-a0a9468ce6d4\",\"metadata\":{\"@class\":\"Metadata\",\"creator\":null, \"creationTime\":null, \"lastUpdateTime\":null},\"consistsOf\":[{\"@class\":\"IsIdentifiedBy\",\"metadata\":null,\"target\":{\"@superClasses\":[\"SoftwareFacet\", \"Facet\", \"Entity\"],\"@class\":\"MySoftwareFacet\",\"metadata\":null,\"name\":\"WhnManager\",\"group\":\"VREManagement\",\"version\":\"2.0.0-SNAPSHOT\",\"description\":\"Web Hosting Node Service\",\"qualifier\":null,\"optional\":false}},{\"@class\":\"ConsistsOf\",\"metadata\":null,\"target\":{\"@class\":\"AccessPointFacet\",\"metadata\":null,\"entryName\":\"whnmanager\",\"endpoint\":\"https://pc-frosini.isti.cnr.it:8080/whn-manager/gcube/vremanagement/ws/whnmanager\",\"protocol\":null,\"description\":null,\"authorization\": {\"@class\":\"ValueSchema\",\"value\":\"gcube-token\",\"schema\":null},\"properties\":null}},{\"@class\":\"ConsistsOf\",\"metadata\":null,\"target\":{\"@class\":\"AccessPointFacet\",\"metadata\":null,\"entryName\":\"WhnManager-remote-management\",\"endpoint\":\"https://pc-frosini.isti.cnr.it:8080/whn-manager/gcube/resource\",\"protocol\":null,\"description\":null,\"authorization\":{\"@class\":\"ValueSchema\",\"value\":\"gcube-token\",\"schema\":null},\"properties\":null}}],\"isRelatedTo\":[]}";
public static final String MYESERVICE = "{\"@class\":\"EService\",\"@uuid\":\"3ace4bd0-e5cd-49a3-97a8-a0a9468ce6d4\",\"metadata\":{\"@class\":\"Metadata\",\"creator\":null, \"creationTime\":null, \"lastUpdateTime\":null},\"consistsOf\":[{\"@class\":\"IsIdentifiedBy\",\"metadata\":null,\"target\":{\"@class\":\"MySoftwareFacet\",\"@superClasses\":[\"SoftwareFacet\", \"Facet\", \"Entity\"],\"metadata\":null,\"name\":\"WhnManager\",\"group\":\"VREManagement\",\"version\":\"2.0.0-SNAPSHOT\",\"description\":\"Web Hosting Node Service\",\"qualifier\":null,\"optional\":false}},{\"@class\":\"ConsistsOf\",\"metadata\":null,\"target\":{\"@class\":\"AccessPointFacet\",\"@superClasses\":[\"Facet\", \"Entity\"],\"metadata\":null,\"entryName\":\"whnmanager\",\"endpoint\":\"https://pc-frosini.isti.cnr.it:8080/whn-manager/gcube/vremanagement/ws/whnmanager\",\"protocol\":null,\"description\":null,\"authorization\": {\"@class\":\"ValueSchema\",\"value\":\"gcube-token\",\"schema\":null},\"properties\":null}},{\"@class\":\"ConsistsOf\",\"metadata\":null,\"target\":{\"@class\":\"AccessPointFacet\",\"metadata\":null,\"entryName\":\"WhnManager-remote-management\",\"endpoint\":\"https://pc-frosini.isti.cnr.it:8080/whn-manager/gcube/resource\",\"protocol\":null,\"description\":null,\"authorization\":{\"@class\":\"ValueSchema\",\"value\":\"gcube-token\",\"schema\":null},\"properties\":null}}],\"isRelatedTo\":[]}"; public static final String MYESERVICE = "{\"@class\":\"EService\",\"uuid\":\"3ace4bd0-e5cd-49a3-97a8-a0a9468ce6d4\",\"metadata\":{\"@class\":\"Metadata\",\"creator\":null, \"creationTime\":null, \"lastUpdateTime\":null},\"consistsOf\":[{\"@class\":\"IsIdentifiedBy\",\"metadata\":null,\"target\":{\"@class\":\"MySoftwareFacet\",\"@superClasses\":[\"SoftwareFacet\", \"Facet\", \"Entity\"],\"metadata\":null,\"name\":\"WhnManager\",\"group\":\"VREManagement\",\"version\":\"2.0.0-SNAPSHOT\",\"description\":\"Web Hosting Node Service\",\"qualifier\":null,\"optional\":false}},{\"@class\":\"ConsistsOf\",\"metadata\":null,\"target\":{\"@class\":\"AccessPointFacet\",\"@superClasses\":[\"Facet\", \"Entity\"],\"metadata\":null,\"entryName\":\"whnmanager\",\"endpoint\":\"https://pc-frosini.isti.cnr.it:8080/whn-manager/gcube/vremanagement/ws/whnmanager\",\"protocol\":null,\"description\":null,\"authorization\": {\"@class\":\"ValueSchema\",\"value\":\"gcube-token\",\"schema\":null},\"properties\":null}},{\"@class\":\"ConsistsOf\",\"metadata\":null,\"target\":{\"@class\":\"AccessPointFacet\",\"metadata\":null,\"entryName\":\"WhnManager-remote-management\",\"endpoint\":\"https://pc-frosini.isti.cnr.it:8080/whn-manager/gcube/resource\",\"protocol\":null,\"description\":null,\"authorization\":{\"@class\":\"ValueSchema\",\"value\":\"gcube-token\",\"schema\":null},\"properties\":null}}],\"isRelatedTo\":[]}";
public static final String MYOTHERESERVICE = "{\"@class\":\"EService\",\"@uuid\":\"3ace4bd0-e5cd-49a3-97a8-a0a9468ce6d4\",\"metadata\":{\"@class\":\"Metadata\",\"creator\":null, \"creationTime\":null, \"lastUpdateTime\":null},\"consistsOf\":[{\"@class\":\"IsIdentifiedBy\",\"metadata\":null,\"target\":{\"@class\":\"MySoftwareFacet\",\"metadata\":null,\"@superClasses\":[\"SoftwareFacet\", \"Facet\", \"Entity\"],\"name\":\"WhnManager\",\"group\":\"VREManagement\",\"version\":\"2.0.0-SNAPSHOT\",\"description\":\"Web Hosting Node Service\",\"qualifier\":null,\"optional\":false}},{\"@class\":\"ConsistsOf\",\"metadata\":null,\"target\":{\"@class\":\"AccessPointFacet\",\"metadata\":null,\"entryName\":\"whnmanager\",\"endpoint\":\"https://pc-frosini.isti.cnr.it:8080/whn-manager/gcube/vremanagement/ws/whnmanager\",\"protocol\":null,\"description\":null,\"authorization\": {\"@class\":\"ValueSchema\",\"value\":\"gcube-token\",\"schema\":null},\"properties\":null}},{\"@class\":\"ConsistsOf\",\"metadata\":null,\"target\":{\"@class\":\"AccessPointFacet\",\"metadata\":null,\"entryName\":\"WhnManager-remote-management\",\"endpoint\":\"https://pc-frosini.isti.cnr.it:8080/whn-manager/gcube/resource\",\"protocol\":null,\"description\":null,\"authorization\":{\"@class\":\"ValueSchema\",\"value\":\"gcube-token\",\"schema\":null},\"properties\":null}}],\"isRelatedTo\":[]}"; public static final String MYOTHERESERVICE = "{\"@class\":\"EService\",\"uuid\":\"3ace4bd0-e5cd-49a3-97a8-a0a9468ce6d4\",\"metadata\":{\"@class\":\"Metadata\",\"creator\":null, \"creationTime\":null, \"lastUpdateTime\":null},\"consistsOf\":[{\"@class\":\"IsIdentifiedBy\",\"metadata\":null,\"target\":{\"@class\":\"MySoftwareFacet\",\"metadata\":null,\"@superClasses\":[\"SoftwareFacet\", \"Facet\", \"Entity\"],\"name\":\"WhnManager\",\"group\":\"VREManagement\",\"version\":\"2.0.0-SNAPSHOT\",\"description\":\"Web Hosting Node Service\",\"qualifier\":null,\"optional\":false}},{\"@class\":\"ConsistsOf\",\"metadata\":null,\"target\":{\"@class\":\"AccessPointFacet\",\"metadata\":null,\"entryName\":\"whnmanager\",\"endpoint\":\"https://pc-frosini.isti.cnr.it:8080/whn-manager/gcube/vremanagement/ws/whnmanager\",\"protocol\":null,\"description\":null,\"authorization\": {\"@class\":\"ValueSchema\",\"value\":\"gcube-token\",\"schema\":null},\"properties\":null}},{\"@class\":\"ConsistsOf\",\"metadata\":null,\"target\":{\"@class\":\"AccessPointFacet\",\"metadata\":null,\"entryName\":\"WhnManager-remote-management\",\"endpoint\":\"https://pc-frosini.isti.cnr.it:8080/whn-manager/gcube/resource\",\"protocol\":null,\"description\":null,\"authorization\":{\"@class\":\"ValueSchema\",\"value\":\"gcube-token\",\"schema\":null},\"properties\":null}}],\"isRelatedTo\":[]}";
public static final String MYANOTHERESERVICE = "{\"@class\":\"EService\",\"@uuid\":\"3ace4bd0-e5cd-49a3-97a8-a0a9468ce6d4\",\"metadata\":{\"@class\":\"Metadata\",\"creator\":null, \"creationTime\":null, \"lastUpdateTime\":null},\"consistsOf\":[{\"@class\":\"IsIdentifiedBy\",\"metadata\":null,\"target\":{\"@class\":\"MySoftwareFacet\",\"metadata\":null,\"@superClasses\":[\"SoftwareFacet\", \"Facet\", \"Entity\"],\"name\":\"WhnManager\",\"group\":\"VREManagement\",\"version\":\"2.0.0-SNAPSHOT\",\"description\":\"Web Hosting Node Service\",\"qualifier\":null,\"optional\":false}},{\"@class\":\"ConsistsOf\",\"metadata\":null,\"target\":{\"@class\":\"AccessPointFacet\",\"metadata\":null,\"entryName\":\"whnmanager\",\"endpoint\":\"https://pc-frosini.isti.cnr.it:8080/whn-manager/gcube/vremanagement/ws/whnmanager\",\"protocol\":null,\"description\":null,\"authorization\": {\"@class\":\"ValueSchema\",\"value\":\"gcube-token\",\"schema\":null},\"properties\":null}},{\"@class\":\"ConsistsOf\",\"metadata\":null,\"target\":{\"@class\":\"AccessPointFacet\",\"metadata\":null,\"entryName\":\"WhnManager-remote-management\",\"endpoint\":\"https://pc-frosini.isti.cnr.it:8080/whn-manager/gcube/resource\",\"protocol\":null,\"description\":null,\"authorization\":{\"@class\":\"ValueSchema\",\"value\":\"gcube-token\",\"schema\":null},\"properties\":null}}],\"isRelatedTo\":[]}"; public static final String MYANOTHERESERVICE = "{\"@class\":\"EService\",\"uuid\":\"3ace4bd0-e5cd-49a3-97a8-a0a9468ce6d4\",\"metadata\":{\"@class\":\"Metadata\",\"creator\":null, \"creationTime\":null, \"lastUpdateTime\":null},\"consistsOf\":[{\"@class\":\"IsIdentifiedBy\",\"metadata\":null,\"target\":{\"@class\":\"MySoftwareFacet\",\"metadata\":null,\"@superClasses\":[\"SoftwareFacet\", \"Facet\", \"Entity\"],\"name\":\"WhnManager\",\"group\":\"VREManagement\",\"version\":\"2.0.0-SNAPSHOT\",\"description\":\"Web Hosting Node Service\",\"qualifier\":null,\"optional\":false}},{\"@class\":\"ConsistsOf\",\"metadata\":null,\"target\":{\"@class\":\"AccessPointFacet\",\"metadata\":null,\"entryName\":\"whnmanager\",\"endpoint\":\"https://pc-frosini.isti.cnr.it:8080/whn-manager/gcube/vremanagement/ws/whnmanager\",\"protocol\":null,\"description\":null,\"authorization\": {\"@class\":\"ValueSchema\",\"value\":\"gcube-token\",\"schema\":null},\"properties\":null}},{\"@class\":\"ConsistsOf\",\"metadata\":null,\"target\":{\"@class\":\"AccessPointFacet\",\"metadata\":null,\"entryName\":\"WhnManager-remote-management\",\"endpoint\":\"https://pc-frosini.isti.cnr.it:8080/whn-manager/gcube/resource\",\"protocol\":null,\"description\":null,\"authorization\":{\"@class\":\"ValueSchema\",\"value\":\"gcube-token\",\"schema\":null},\"properties\":null}}],\"isRelatedTo\":[]}";
public static final String NYESERVICE2 = "{\"@class\":\"MyEService\",\"@superClasses\":[\"EService\",\"Service\",\"Resource\"],\"@uuid\":\"3ace4bd0-e5cd-49a3-97a8-a0a9468ce6d4\",\"metadata\":{\"@class\":\"Metadata\",\"creator\":null, \"creationTime\":null, \"lastUpdateTime\":null},\"consistsOf\":[{\"@class\":\"IsIdentifiedBy\",\"metadata\":null,\"target\":{\"@superClasses\":[\"SoftwareFacet\", \"Facet\", \"Entity\"],\"@class\":\"MySoftwareFacet\",\"@superClasses\":[\"SoftwareFacet\", \"Facet\", \"Entity\"],\"metadata\":null,\"name\":\"WhnManager\",\"group\":\"VREManagement\",\"version\":\"2.0.0-SNAPSHOT\",\"description\":\"Web Hosting Node Service\",\"qualifier\":null,\"optional\":false}},{\"@class\":\"ConsistsOf\",\"metadata\":null,\"target\":{\"@class\":\"AccessPointFacet\",\"metadata\":null,\"entryName\":\"whnmanager\",\"endpoint\":\"https://pc-frosini.isti.cnr.it:8080/whn-manager/gcube/vremanagement/ws/whnmanager\",\"protocol\":null,\"description\":null,\"authorization\": {\"@class\":\"ValueSchema\",\"value\":\"gcube-token\",\"schema\":null},\"properties\":null}},{\"@class\":\"ConsistsOf\",\"metadata\":null,\"target\":{\"@class\":\"AccessPointFacet\",\"metadata\":null,\"entryName\":\"WhnManager-remote-management\",\"endpoint\":\"https://pc-frosini.isti.cnr.it:8080/whn-manager/gcube/resource\",\"protocol\":null,\"description\":null,\"authorization\":{\"@class\":\"ValueSchema\",\"value\":\"gcube-token\",\"schema\":null},\"properties\":null}}],\"isRelatedTo\":[]}"; public static final String NYESERVICE2 = "{\"@class\":\"MyEService\",\"@superClasses\":[\"EService\",\"Service\",\"Resource\"],\"uuid\":\"3ace4bd0-e5cd-49a3-97a8-a0a9468ce6d4\",\"metadata\":{\"@class\":\"Metadata\",\"creator\":null, \"creationTime\":null, \"lastUpdateTime\":null},\"consistsOf\":[{\"@class\":\"IsIdentifiedBy\",\"metadata\":null,\"target\":{\"@superClasses\":[\"SoftwareFacet\", \"Facet\", \"Entity\"],\"@class\":\"MySoftwareFacet\",\"@superClasses\":[\"SoftwareFacet\", \"Facet\", \"Entity\"],\"metadata\":null,\"name\":\"WhnManager\",\"group\":\"VREManagement\",\"version\":\"2.0.0-SNAPSHOT\",\"description\":\"Web Hosting Node Service\",\"qualifier\":null,\"optional\":false}},{\"@class\":\"ConsistsOf\",\"metadata\":null,\"target\":{\"@class\":\"AccessPointFacet\",\"metadata\":null,\"entryName\":\"whnmanager\",\"endpoint\":\"https://pc-frosini.isti.cnr.it:8080/whn-manager/gcube/vremanagement/ws/whnmanager\",\"protocol\":null,\"description\":null,\"authorization\": {\"@class\":\"ValueSchema\",\"value\":\"gcube-token\",\"schema\":null},\"properties\":null}},{\"@class\":\"ConsistsOf\",\"metadata\":null,\"target\":{\"@class\":\"AccessPointFacet\",\"metadata\":null,\"entryName\":\"WhnManager-remote-management\",\"endpoint\":\"https://pc-frosini.isti.cnr.it:8080/whn-manager/gcube/resource\",\"protocol\":null,\"description\":null,\"authorization\":{\"@class\":\"ValueSchema\",\"value\":\"gcube-token\",\"schema\":null},\"properties\":null}}],\"isRelatedTo\":[]}";
public static final String MYANOTHERESERVICE2 = "{\"@class\":\"MyEService\",\"@superClasses\":[\"EService\",\"Service\",\"Resource\"],\"@uuid\":\"3ace4bd0-e5cd-49a3-97a8-a0a9468ce6d4\",\"metadata\":{\"@class\":\"Metadata\",\"creator\":null, \"creationTime\":null, \"lastUpdateTime\":null},\"consistsOf\":[{\"@class\":\"IsIdentifiedBy\",\"metadata\":null,\"target\":{\"@class\":\"MySoftwareFacet\",\"@superClasses\":[\"SoftwareFacet\", \"Facet\", \"Entity\"],\"metadata\":null,\"name\":\"WhnManager\",\"group\":\"VREManagement\",\"version\":\"2.0.0-SNAPSHOT\",\"description\":\"Web Hosting Node Service\",\"qualifier\":null,\"optional\":false}},{\"@class\":\"ConsistsOf\",\"metadata\":null,\"target\":{\"@class\":\"AccessPointFacet\",\"metadata\":null,\"entryName\":\"whnmanager\",\"endpoint\":\"https://pc-frosini.isti.cnr.it:8080/whn-manager/gcube/vremanagement/ws/whnmanager\",\"protocol\":null,\"description\":null,\"authorization\": {\"@class\":\"ValueSchema\",\"value\":\"gcube-token\",\"schema\":null},\"properties\":null}},{\"@class\":\"ConsistsOf\",\"metadata\":null,\"target\":{\"@class\":\"AccessPointFacet\",\"metadata\":null,\"entryName\":\"WhnManager-remote-management\",\"endpoint\":\"https://pc-frosini.isti.cnr.it:8080/whn-manager/gcube/resource\",\"protocol\":null,\"description\":null,\"authorization\":{\"@class\":\"ValueSchema\",\"value\":\"gcube-token\",\"schema\":null},\"properties\":null}}],\"isRelatedTo\":[]}"; public static final String MYANOTHERESERVICE2 = "{\"@class\":\"MyEService\",\"@superClasses\":[\"EService\",\"Service\",\"Resource\"],\"uuid\":\"3ace4bd0-e5cd-49a3-97a8-a0a9468ce6d4\",\"metadata\":{\"@class\":\"Metadata\",\"creator\":null, \"creationTime\":null, \"lastUpdateTime\":null},\"consistsOf\":[{\"@class\":\"IsIdentifiedBy\",\"metadata\":null,\"target\":{\"@class\":\"MySoftwareFacet\",\"@superClasses\":[\"SoftwareFacet\", \"Facet\", \"Entity\"],\"metadata\":null,\"name\":\"WhnManager\",\"group\":\"VREManagement\",\"version\":\"2.0.0-SNAPSHOT\",\"description\":\"Web Hosting Node Service\",\"qualifier\":null,\"optional\":false}},{\"@class\":\"ConsistsOf\",\"metadata\":null,\"target\":{\"@class\":\"AccessPointFacet\",\"metadata\":null,\"entryName\":\"whnmanager\",\"endpoint\":\"https://pc-frosini.isti.cnr.it:8080/whn-manager/gcube/vremanagement/ws/whnmanager\",\"protocol\":null,\"description\":null,\"authorization\": {\"@class\":\"ValueSchema\",\"value\":\"gcube-token\",\"schema\":null},\"properties\":null}},{\"@class\":\"ConsistsOf\",\"metadata\":null,\"target\":{\"@class\":\"AccessPointFacet\",\"metadata\":null,\"entryName\":\"WhnManager-remote-management\",\"endpoint\":\"https://pc-frosini.isti.cnr.it:8080/whn-manager/gcube/resource\",\"protocol\":null,\"description\":null,\"authorization\":{\"@class\":\"ValueSchema\",\"value\":\"gcube-token\",\"schema\":null},\"properties\":null}}],\"isRelatedTo\":[]}";
public static final String MY_CONSISTS_OF = "{\"@superClasses\":[\"IsIdentifiedBy\", \"ConsistsOf\", \"Relation\"],\"@class\":\"MyIsIdentifiedBy\",\"target\":{\"@superClasses\":[\"SoftwareFacet\", \"Facet\", \"Entity\"],\"@class\":\"MySoftwareFacet\",\"metadata\":null,\"name\":\"WhnManager\",\"group\":\"VREManagement\",\"version\":\"2.0.0-SNAPSHOT\",\"description\":\"Web Hosting Node Service\",\"qualifier\":null,\"optional\":false}}"; public static final String MY_CONSISTS_OF = "{\"@superClasses\":[\"IsIdentifiedBy\", \"ConsistsOf\", \"Relation\"],\"@class\":\"MyIsIdentifiedBy\",\"target\":{\"@superClasses\":[\"SoftwareFacet\", \"Facet\", \"Entity\"],\"@class\":\"MySoftwareFacet\",\"metadata\":null,\"name\":\"WhnManager\",\"group\":\"VREManagement\",\"version\":\"2.0.0-SNAPSHOT\",\"description\":\"Web Hosting Node Service\",\"qualifier\":null,\"optional\":false}}";
public static final String MY_TEST_FACET = "{\"@superClasses\":[\"SoftwareFacet\", \"Facet\", \"Entity\"],\"@class\":\"MySoftwareFacet\",\"name\":\"WhnManager\",\"group\":\"VREManagement\",\"version\":\"2.0.0-SNAPSHOT\",\"description\":\"Web Hosting Node Service\",\"qualifier\":null,\"optional\":false}"; public static final String MY_TEST_FACET = "{\"@superClasses\":[\"SoftwareFacet\", \"Facet\", \"Entity\"],\"@class\":\"MySoftwareFacet\",\"name\":\"WhnManager\",\"group\":\"VREManagement\",\"version\":\"2.0.0-SNAPSHOT\",\"description\":\"Web Hosting Node Service\",\"qualifier\":null,\"optional\":false}";

View File

@ -141,12 +141,12 @@ public class Serializer {
@Test @Test
public void deserializeResource() throws JsonGenerationException, JsonMappingException, IOException { public void deserializeResource() throws JsonGenerationException, JsonMappingException, IOException {
StringReader stringReader = new StringReader("{" + "\"@class\":\"HostingNode\"," + "\"@metadata\":null," StringReader stringReader = new StringReader("{" + "\"@class\":\"HostingNode\"," + "\"metadata\":null,"
+ "\"consistsOf\":[{" + "\"@class\":\"ConsistsOf\"," + "\"@metadata\":null," + "\"target\":{" + "\"consistsOf\":[{" + "\"@class\":\"ConsistsOf\"," + "\"metadata\":null," + "\"target\":{"
+ "\"@class\":\"CPUFacet\"," + "\"@metadata\":null," + "\"model\":\"Opteron\"," + "\"vendor\":\"AMD\"," + "\"@class\":\"CPUFacet\"," + "\"metadata\":null," + "\"model\":\"Opteron\"," + "\"vendor\":\"AMD\","
+ "\"clockSpeed\":\"1 GHz\"" + "}," + "\"relationProperty\":null" + "}," + "{" + "\"clockSpeed\":\"1 GHz\"" + "}," + "\"relationProperty\":null" + "}," + "{"
+ "\"@class\":\"ConsistsOf\"," + "\"@metadata\":null," + "\"target\":{" + "\"@class\":\"ContactFacet\"," + "\"@class\":\"ConsistsOf\"," + "\"metadata\":null," + "\"target\":{" + "\"@class\":\"ContactFacet\","
+ "\"@metadata\":null," + "\"title\":null," + "\"name\":\"Luca\"," + "\"middleName\":null," + "\"metadata\":null," + "\"title\":null," + "\"name\":\"Luca\"," + "\"middleName\":null,"
+ "\"surname\":\"Frosini\"," + "\"eMail\":\"luca.frosini@isti.cnr.it\"" + "}," + "\"surname\":\"Frosini\"," + "\"eMail\":\"luca.frosini@isti.cnr.it\"" + "},"
+ "\"relationProperty\":null" + "}" + "]," + "\"isRelatedTo\":[]" + "}"); + "\"relationProperty\":null" + "}" + "]," + "\"isRelatedTo\":[]" + "}");
@ -158,7 +158,7 @@ public class Serializer {
@Test @Test
public void deserializeContext() throws JsonParseException, JsonMappingException, IOException { public void deserializeContext() throws JsonParseException, JsonMappingException, IOException {
String contextString = "{\"name\":\"gcube\",\"@uuid\":\"fe44822a-d8bb-418b-ba79-59b4aef01cf9\",\"@metadata\":{\"@class\":\"Metadata\",\"creator\":\"UNKNOWN_USER\",\"creationTime\":\"2019-02-06 11:08:33.706 +0100\",\"modifiedBy\":\"UNKNOWN_USER\",\"lastUpdateTime\":\"2019-02-06 11:08:33.706 +0100\"},\"@class\":\"Context\",\"@superClasses\":[\"Entity\"],\"children\":[{\"@metadata\":{\"@class\":\"Metadata\",\"creator\":\"UNKNOWN_USER\",\"creationTime\":\"2019-02-06 11:08:34.627 +0100\",\"modifiedBy\":\"UNKNOWN_USER\",\"lastUpdateTime\":\"2019-02-06 11:08:34.627 +0100\"},\"propagationConstraint\":{\"@class\":\"PropagationConstraint\",\"add\":\"unpropagate\",\"remove\":\"keep\"},\"@class\":\"IsParentOf\",\"@superClasses\":[\"Relation\"],\"target\":{\"name\":\"devsec\",\"@uuid\":\"007f9154-25fa-4f52-9cd4-ec1f8c3c3baf\",\"@metadata\":{\"@class\":\"Metadata\",\"creator\":\"UNKNOWN_USER\",\"creationTime\":\"2019-02-06 11:08:34.663 +0100\",\"modifiedBy\":\"UNKNOWN_USER\",\"lastUpdateTime\":\"2019-02-06 11:08:34.663 +0100\"},\"@class\":\"Context\",\"@superClasses\":[\"Entity\"]}},{\"@uuid\":\"aeec2ea9-c3d2-43af-998e-d19953fc2c42\",\"@metadata\":{\"@class\":\"Metadata\",\"creator\":\"UNKNOWN_USER\",\"creationTime\":\"2019-02-06 11:08:36.658 +0100\",\"modifiedBy\":\"UNKNOWN_USER\",\"lastUpdateTime\":\"2019-02-06 11:08:36.658 +0100\"},\"propagationConstraint\":{\"@class\":\"PropagationConstraint\",\"add\":\"unpropagate\",\"remove\":\"keep\"},\"@class\":\"IsParentOf\",\"@superClasses\":[\"Relation\"],\"target\":{\"name\":\"devNext\",\"@uuid\":\"b16bc587-3fd8-4c0a-9196-8515c4501649\",\"@metadata\":{\"@class\":\"Metadata\",\"creator\":\"UNKNOWN_USER\",\"creationTime\":\"2019-02-06 11:08:36.695 +0100\",\"modifiedBy\":\"UNKNOWN_USER\",\"lastUpdateTime\":\"2019-02-06 11:08:36.695 +0100\"},\"@class\":\"Context\",\"@superClasses\":[\"Entity\"]}},{\"@uuid\":\"eba6cd76-525c-4037-9095-a712b054fd1b\",\"@metadata\":{\"@class\":\"Metadata\",\"creator\":\"UNKNOWN_USER\",\"creationTime\":\"2019-02-06 11:08:38.224 +0100\",\"modifiedBy\":\"UNKNOWN_USER\",\"lastUpdateTime\":\"2019-02-06 11:08:38.224 +0100\"},\"propagationConstraint\":{\"@class\":\"PropagationConstraint\",\"add\":\"unpropagate\",\"remove\":\"keep\"},\"@class\":\"IsParentOf\",\"@superClasses\":[\"Relation\"],\"target\":{\"name\":\"preprod\",\"@metadata\":{\"@class\":\"Metadata\",\"creator\":\"UNKNOWN_USER\",\"creationTime\":\"2019-02-06 11:08:38.248 +0100\",\"modifiedBy\":\"UNKNOWN_USER\",\"lastUpdateTime\":\"2019-02-06 11:08:38.248 +0100\"},\"@class\":\"Context\",\"@superClasses\":[\"Entity\"]}}]}"; String contextString = "{\"name\":\"gcube\",\"uuid\":\"fe44822a-d8bb-418b-ba79-59b4aef01cf9\",\"metadata\":{\"@class\":\"Metadata\",\"creator\":\"UNKNOWN_USER\",\"creationTime\":\"2019-02-06 11:08:33.706 +0100\",\"modifiedBy\":\"UNKNOWN_USER\",\"lastUpdateTime\":\"2019-02-06 11:08:33.706 +0100\"},\"@class\":\"Context\",\"@superClasses\":[\"Entity\"],\"children\":[{\"metadata\":{\"@class\":\"Metadata\",\"creator\":\"UNKNOWN_USER\",\"creationTime\":\"2019-02-06 11:08:34.627 +0100\",\"modifiedBy\":\"UNKNOWN_USER\",\"lastUpdateTime\":\"2019-02-06 11:08:34.627 +0100\"},\"propagationConstraint\":{\"@class\":\"PropagationConstraint\",\"add\":\"unpropagate\",\"remove\":\"keep\"},\"@class\":\"IsParentOf\",\"@superClasses\":[\"Relation\"],\"target\":{\"name\":\"devsec\",\"uuid\":\"007f9154-25fa-4f52-9cd4-ec1f8c3c3baf\",\"metadata\":{\"@class\":\"Metadata\",\"creator\":\"UNKNOWN_USER\",\"creationTime\":\"2019-02-06 11:08:34.663 +0100\",\"modifiedBy\":\"UNKNOWN_USER\",\"lastUpdateTime\":\"2019-02-06 11:08:34.663 +0100\"},\"@class\":\"Context\",\"@superClasses\":[\"Entity\"]}},{\"uuid\":\"aeec2ea9-c3d2-43af-998e-d19953fc2c42\",\"metadata\":{\"@class\":\"Metadata\",\"creator\":\"UNKNOWN_USER\",\"creationTime\":\"2019-02-06 11:08:36.658 +0100\",\"modifiedBy\":\"UNKNOWN_USER\",\"lastUpdateTime\":\"2019-02-06 11:08:36.658 +0100\"},\"propagationConstraint\":{\"@class\":\"PropagationConstraint\",\"add\":\"unpropagate\",\"remove\":\"keep\"},\"@class\":\"IsParentOf\",\"@superClasses\":[\"Relation\"],\"target\":{\"name\":\"devNext\",\"uuid\":\"b16bc587-3fd8-4c0a-9196-8515c4501649\",\"metadata\":{\"@class\":\"Metadata\",\"creator\":\"UNKNOWN_USER\",\"creationTime\":\"2019-02-06 11:08:36.695 +0100\",\"modifiedBy\":\"UNKNOWN_USER\",\"lastUpdateTime\":\"2019-02-06 11:08:36.695 +0100\"},\"@class\":\"Context\",\"@superClasses\":[\"Entity\"]}},{\"uuid\":\"eba6cd76-525c-4037-9095-a712b054fd1b\",\"metadata\":{\"@class\":\"Metadata\",\"creator\":\"UNKNOWN_USER\",\"creationTime\":\"2019-02-06 11:08:38.224 +0100\",\"modifiedBy\":\"UNKNOWN_USER\",\"lastUpdateTime\":\"2019-02-06 11:08:38.224 +0100\"},\"propagationConstraint\":{\"@class\":\"PropagationConstraint\",\"add\":\"unpropagate\",\"remove\":\"keep\"},\"@class\":\"IsParentOf\",\"@superClasses\":[\"Relation\"],\"target\":{\"name\":\"preprod\",\"metadata\":{\"@class\":\"Metadata\",\"creator\":\"UNKNOWN_USER\",\"creationTime\":\"2019-02-06 11:08:38.248 +0100\",\"modifiedBy\":\"UNKNOWN_USER\",\"lastUpdateTime\":\"2019-02-06 11:08:38.248 +0100\"},\"@class\":\"Context\",\"@superClasses\":[\"Entity\"]}}]}";
logger.trace("Source Context String {}",contextString); logger.trace("Source Context String {}",contextString);
StringReader stringReader = new StringReader(contextString); StringReader stringReader = new StringReader(contextString);
Context c = ElementMapper.unmarshal(Context.class, stringReader); Context c = ElementMapper.unmarshal(Context.class, stringReader);