Improved test readability

This commit is contained in:
Luca Frosini 2021-02-11 21:01:24 +01:00
parent f5b6885b8c
commit 62752a369d
1 changed files with 37 additions and 4 deletions

View File

@ -88,7 +88,12 @@ public class PropagationConstraintTest {
public void testPropagationConstraintSpecilizationInside() throws Exception {
AddConstraint addConstraint = AddConstraint.propagate;
RemoveConstraint removeConstraint = RemoveConstraint.cascade;
String pcString = "{\"" + Element.CLASS_PROPERTY + "\":\"My" + PropagationConstraint.NAME + "\",\"" + Element.SUPERCLASSES_PROPERTY + "\":[\"" + PropagationConstraint.NAME + "\", \"" + Property.NAME + "\"],\"" + PropagationConstraint.ADD_PROPERTY + "\":\""+ addConstraint + "\",\""+ PropagationConstraint.REMOVE_PROPERTY + "\":\"" + removeConstraint + "\"}";
String pcString = "{" +
"\"" + Element.CLASS_PROPERTY + "\":\"My" + PropagationConstraint.NAME + "\"," +
"\"" + Element.SUPERCLASSES_PROPERTY + "\":[\"" + PropagationConstraint.NAME + "\", \"" + Property.NAME + "\"],\"" +
PropagationConstraint.ADD_PROPERTY + "\":\""+ addConstraint + "\",\"" +
PropagationConstraint.REMOVE_PROPERTY + "\":\"" + removeConstraint + "\"" +
"}";
logger.debug(pcString);
HeaderImpl header = new HeaderImpl();
@ -101,9 +106,37 @@ public class PropagationConstraintTest {
String hString = ElementMapper.marshal(header);
String consistsOfString = "{\"" + Element.CLASS_PROPERTY + "\":\"" + ConsistsOf.NAME + "\",\"" + ConsistsOf.PROPAGATION_CONSTRAINT_PROPERTY + "\":"+ pcString + ",\"" + ConsistsOf.HEADER_PROPERTY + "\": " + hString + "," +
"\"" + ConsistsOf.SOURCE_PROPERTY + "\":{\"@class\":\"MyEService\", \"@superClasses\":[\"EService\", \"Service\", \"Resource\"],\"header\":"+ "{\"@class\":\"Header\",\"uuid\":\"4a971915-ca90-48cf-9975-63ee2dd28605\",\"creator\":null, \"creationTime\":null, \"lastUpdateTime\":null}" + "}," +
"\"" + ConsistsOf.TARGET_PROPERTY + "\":{\"@class\":\"MySoftwareFacet\",\"@superClasses\":[\"SoftwareFacet\", \"Facet\"],\"header\":"+ "{\"@class\":\"Header\",\"uuid\":\"3ace4bd0-e5cd-49a3-97a8-a0a9468ce6d4\",\"creator\":null, \"creationTime\":null, \"lastUpdateTime\":null}" + ",\"name\":\"WhnManager\",\"group\":\"VREManagement\",\"version\":\"2.0.0-SNAPSHOT\",\"description\":\"Web Hosting Node Service\",\"qualifier\":null,\"optional\":false}" + "}";
String consistsOfString = "{" +
"\"" + Element.CLASS_PROPERTY + "\":\"" + ConsistsOf.NAME + "\"," +
"\"" + ConsistsOf.PROPAGATION_CONSTRAINT_PROPERTY + "\":"+ pcString + "," +
"\"" + ConsistsOf.HEADER_PROPERTY + "\": " + hString + "," +
"\"" + ConsistsOf.SOURCE_PROPERTY + "\":{" +
"\"@class\":\"MyEService\"," +
"\"@superClasses\":[\"EService\", \"Service\", \"Resource\"]," +
"\"header\":"+ "{" +
"\"@class\":\"Header\"," +
"\"uuid\":\"4a971915-ca90-48cf-9975-63ee2dd28605\"," +
"\"creator\":null, " +
"\"creationTime\":null, " +
"\"lastUpdateTime\":null}" +
"}," +
"\"" + ConsistsOf.TARGET_PROPERTY + "\":{" +
"\"@class\":\"MySoftwareFacet\"," +
"\"@superClasses\":[\"SoftwareFacet\", \"Facet\"]," +
"\"header\":"+ "{" +
"\"@class\":\"Header\"," +
"\"uuid\":\"3ace4bd0-e5cd-49a3-97a8-a0a9468ce6d4\"," +
"\"creator\":null, " +
"\"creationTime\":null, " +
"\"lastUpdateTime\":null" +
"}" +
",\"name\":\"WhnManager\"," +
"\"group\":\"VREManagement\"," +
"\"version\":\"2.0.0-SNAPSHOT\"," +
"\"description\":\"Web Hosting Node Service\"," +
"\"qualifier\":null,\"optional\":false" +
"}" +
"}";
logger.debug(consistsOfString);
@SuppressWarnings("unchecked")