use of com.agiletec.plugins.jacms.aps.system.services.content.model.extraAttribute.AbstractResourceAttribute in project entando-core by entando.
the class TestValidateResourceAttribute method testValidate_Single.
protected void testValidate_Single(String attributeName, String testResourceId) throws Throwable {
try {
String contentOnSessionMarker = this.executeCreateNewContent();
Content content = this.getContentOnEdit(contentOnSessionMarker);
AttributeTracer tracer = this.getTracer();
AttributeInterface resourceAttribute = (AttributeInterface) content.getAttribute(attributeName);
String formFieldName = tracer.getFormFieldName(resourceAttribute);
String resourceFieldName = resourceAttribute.getType() + ":" + attributeName;
this.initSaveContentAction(contentOnSessionMarker);
this.executeAction(Action.INPUT);
this.checkFieldErrors(0, resourceFieldName);
this.checkFieldErrors(0, formFieldName);
this.initSaveContentAction(contentOnSessionMarker);
this.addParameter(formFieldName, "resourceDescription");
this.executeAction(Action.INPUT);
this.checkFieldErrors(1, resourceFieldName);
content = this.getContentOnEdit(contentOnSessionMarker);
AbstractResourceAttribute attachAttribute = (AbstractResourceAttribute) content.getAttribute(attributeName);
ResourceInterface resource = this._resourceManager.loadResource(testResourceId);
attachAttribute.setResource(resource, this.getLangManager().getDefaultLang().getCode());
this.initSaveContentAction(contentOnSessionMarker);
this.executeAction(Action.INPUT);
this.checkFieldErrors(0, resourceFieldName);
} catch (Throwable t) {
this.deleteTestContent();
throw t;
}
}
Aggregations