diff options
author | liamfallon <liam.fallon@ericsson.com> | 2018-09-10 17:05:36 +0100 |
---|---|---|
committer | liamfallon <liam.fallon@ericsson.com> | 2018-09-10 17:07:47 +0100 |
commit | d100854291559df1426ea1e64351872ae2d3867b (patch) | |
tree | 78baab90111307cd3d2460b2cca37e93a20ac9a3 /model/model-api | |
parent | 8f82d7adcb53b349e14d3b356bda03588a554f95 (diff) |
Checkstyle changes for apex model
Fix checkstyle warnings in the apex mode
and knock on changes.
Issue-ID: POLICY-1034
Change-Id: I10537e4288e9cad5ef18165ed2cdc1d3ab3139c1
Signed-off-by: liamfallon <liam.fallon@ericsson.com>
Diffstat (limited to 'model/model-api')
22 files changed, 1717 insertions, 1706 deletions
diff --git a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/ApexAPIResult.java b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/ApexApiResult.java index 2e4328fc5..ae2609e1d 100644 --- a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/ApexAPIResult.java +++ b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/ApexApiResult.java @@ -39,14 +39,14 @@ import javax.xml.bind.annotation.XmlRootElement; */ @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) -public class ApexAPIResult { +public class ApexApiResult { /** * This enumeration is used to represent the result status of a call on the {@link ApexModel} * API. */ @XmlEnum(value = String.class) - public enum RESULT { + public enum Result { /** The method call succeeded. */ SUCCESS, /** The method call succeeded and all operations are now completed. */ @@ -73,14 +73,14 @@ public class ApexAPIResult { OTHER_ERROR } - private RESULT result; + private Result result; private List<String> messages = new ArrayList<>(); /** * The Default Constructor creates a result for a successful operation with no messages. */ - public ApexAPIResult() { - result = RESULT.SUCCESS; + public ApexApiResult() { + result = Result.SUCCESS; } /** @@ -88,7 +88,7 @@ public class ApexAPIResult { * * @param result the result status to use on this result */ - public ApexAPIResult(final RESULT result) { + public ApexApiResult(final Result result) { this.result = result; } @@ -98,7 +98,7 @@ public class ApexAPIResult { * @param result the result status to use on this result * @param message the message to return with the result */ - public ApexAPIResult(final RESULT result, final String message) { + public ApexApiResult(final Result result, final String message) { this.result = result; addMessage(message); } @@ -111,7 +111,7 @@ public class ApexAPIResult { * @param result the result status to use on this result * @param throwable the throwable object from which to add the message and stack trace */ - public ApexAPIResult(final RESULT result, final Throwable throwable) { + public ApexApiResult(final Result result, final Throwable throwable) { this.result = result; addThrowable(throwable); } @@ -125,7 +125,7 @@ public class ApexAPIResult { * @param message the message to return with the result * @param throwable the throwable object from which to add the message and stack trace */ - public ApexAPIResult(final RESULT result, final String message, final Throwable throwable) { + public ApexApiResult(final Result result, final String message, final Throwable throwable) { this.result = result; addMessage(message); addThrowable(throwable); @@ -138,8 +138,8 @@ public class ApexAPIResult { * @return true, if the result indicates the API operation succeeded */ @XmlAttribute(required = true) - public boolean isOK() { - return result == RESULT.SUCCESS || result == RESULT.FINISHED; + public boolean isOk() { + return result == Result.SUCCESS || result == Result.FINISHED; } /** @@ -148,8 +148,8 @@ public class ApexAPIResult { * * @return true, if the result indicates the API operation did not succeed */ - public boolean isNOK() { - return !isOK(); + public boolean isNok() { + return !isOk(); } /** @@ -158,7 +158,7 @@ public class ApexAPIResult { * @return the result status */ @XmlAttribute(required = true) - public RESULT getResult() { + public Result getResult() { return result; } @@ -167,7 +167,7 @@ public class ApexAPIResult { * * @param result the result status */ - public void setResult(final RESULT result) { + public void setResult(final Result result) { this.result = result; } @@ -236,11 +236,11 @@ public class ApexAPIResult { } /** - * Gets a representation of the {@link ApexAPIResult} instance as a JSON string. + * Gets a representation of the {@link ApexApiResult} instance as a JSON string. * * @return the result instance JSON string */ - public String toJSON() { + public String toJson() { final StringBuilder builder = new StringBuilder(); builder.append("{\n"); diff --git a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/ApexEditorAPI.java b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/ApexEditorApi.java index 617cbc786..741fbdc90 100644 --- a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/ApexEditorAPI.java +++ b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/ApexEditorApi.java @@ -23,7 +23,7 @@ package org.onap.policy.apex.model.modelapi; /** * The Interface ApexEditorAPI is used to manipulate Apex models. */ -public interface ApexEditorAPI { +public interface ApexEditorApi { /* * Model API Methods */ @@ -37,7 +37,7 @@ public interface ApexEditorAPI { * @param description model description, set to null to generate a description * @return result of the operation */ - ApexAPIResult createModel(final String name, final String version, final String uuid, final String description); + ApexApiResult createModel(final String name, final String version, final String uuid, final String description); /** * Update model. @@ -48,28 +48,28 @@ public interface ApexEditorAPI { * @param description policy description, set to null to not update * @return result of the operation */ - ApexAPIResult updateModel(final String name, final String version, final String uuid, final String description); + ApexApiResult updateModel(final String name, final String version, final String uuid, final String description); /** * Get the key of an Apex model. * * @return the result of the operation */ - ApexAPIResult getModelKey(); + ApexApiResult getModelKey(); /** * List an Apex model. * * @return the result of the operation */ - ApexAPIResult listModel(); + ApexApiResult listModel(); /** * Delete an Apex model, clear all the concepts in the model. * * @return the result of the operation */ - ApexAPIResult deleteModel(); + ApexApiResult deleteModel(); /* * Key Information API Methods @@ -85,7 +85,7 @@ public interface ApexEditorAPI { * @param description key information description, set to null to generate a description * @return result of the operation */ - ApexAPIResult createKeyInformation(final String name, final String version, final String uuid, + ApexApiResult createKeyInformation(final String name, final String version, final String uuid, final String description); /** @@ -98,7 +98,7 @@ public interface ApexEditorAPI { * @param description key information description, set to null to not update * @return result of the operation */ - ApexAPIResult updateKeyInformation(final String name, final String version, final String uuid, + ApexApiResult updateKeyInformation(final String name, final String version, final String uuid, final String description); /** @@ -109,7 +109,7 @@ public interface ApexEditorAPI { * all versions * @return result of the operation */ - ApexAPIResult listKeyInformation(final String name, final String version); + ApexApiResult listKeyInformation(final String name, final String version); /** * Delete key information. @@ -119,7 +119,7 @@ public interface ApexEditorAPI { * versions * @return result of the operation */ - ApexAPIResult deleteKeyInformation(final String name, final String version); + ApexApiResult deleteKeyInformation(final String name, final String version); /** * Validate key information. @@ -129,7 +129,7 @@ public interface ApexEditorAPI { * versions * @return result of the operation */ - ApexAPIResult validateKeyInformation(final String name, final String version); + ApexApiResult validateKeyInformation(final String name, final String version); /* * Context Schema API Methods @@ -146,7 +146,7 @@ public interface ApexEditorAPI { * @param description context schema description, set to null to generate a description * @return result of the operation */ - ApexAPIResult createContextSchema(final String name, final String version, final String schemaFlavour, + ApexApiResult createContextSchema(final String name, final String version, final String schemaFlavour, final String schemaDefinition, final String uuid, final String description); /** @@ -160,7 +160,7 @@ public interface ApexEditorAPI { * @param description context schema description, set to null to not update * @return result of the operation */ - ApexAPIResult updateContextSchema(final String name, final String version, final String schemaFlavour, + ApexApiResult updateContextSchema(final String name, final String version, final String schemaFlavour, final String schemaDefinition, final String uuid, final String description); /** @@ -170,7 +170,7 @@ public interface ApexEditorAPI { * @param version starting version of the context schema, set to null to list all versions * @return result of the operation */ - ApexAPIResult listContextSchemas(final String name, final String version); + ApexApiResult listContextSchemas(final String name, final String version); /** * Delete a context schema. @@ -179,7 +179,7 @@ public interface ApexEditorAPI { * @param version version of the context schema, set to null to delete all versions * @return result of the operation */ - ApexAPIResult deleteContextSchema(final String name, final String version); + ApexApiResult deleteContextSchema(final String name, final String version); /** * Validate context schemas. @@ -188,7 +188,7 @@ public interface ApexEditorAPI { * @param version starting version of the context schema, set to null to list all versions * @return result of the operation */ - ApexAPIResult validateContextSchemas(final String name, final String version); + ApexApiResult validateContextSchemas(final String name, final String version); /* * Event API Methods @@ -206,7 +206,7 @@ public interface ApexEditorAPI { * @param description event description, set to null to generate a description * @return result of the operation */ - ApexAPIResult createEvent(final String name, final String version, final String nameSpace, final String source, + ApexApiResult createEvent(final String name, final String version, final String nameSpace, final String source, final String target, final String uuid, final String description); /** @@ -221,7 +221,7 @@ public interface ApexEditorAPI { * @param description event description, set to null to not update * @return result of the operation */ - ApexAPIResult updateEvent(final String name, final String version, final String nameSpace, final String source, + ApexApiResult updateEvent(final String name, final String version, final String nameSpace, final String source, final String target, final String uuid, final String description); /** @@ -231,7 +231,7 @@ public interface ApexEditorAPI { * @param version starting version of the event, set to null to list all versions * @return result of the operation */ - ApexAPIResult listEvent(final String name, final String version); + ApexApiResult listEvent(final String name, final String version); /** * Delete an event. @@ -240,7 +240,7 @@ public interface ApexEditorAPI { * @param version version of the event, set to null to delete all versions * @return result of the operation */ - ApexAPIResult deleteEvent(final String name, final String version); + ApexApiResult deleteEvent(final String name, final String version); /** * Validate events. @@ -249,7 +249,7 @@ public interface ApexEditorAPI { * @param version starting version of the event, set to null to list all versions * @return result of the operation */ - ApexAPIResult validateEvent(final String name, final String version); + ApexApiResult validateEvent(final String name, final String version); /** * Create an event parameter. @@ -263,7 +263,7 @@ public interface ApexEditorAPI { * @param optional true if the event parameter is optional, false otherwise * @return result of the operation */ - ApexAPIResult createEventPar(final String name, final String version, final String parName, + ApexApiResult createEventPar(final String name, final String version, final String parName, final String contextSchemaName, final String contextSchemaVersion, boolean optional); /** @@ -274,7 +274,7 @@ public interface ApexEditorAPI { * @param parName name of the parameter, set to null to list all parameters of the event * @return result of the operation */ - ApexAPIResult listEventPar(final String name, final String version, final String parName); + ApexApiResult listEventPar(final String name, final String version, final String parName); /** * Delete an event parameter. @@ -284,7 +284,7 @@ public interface ApexEditorAPI { * @param parName of the parameter, set to null to delete all parameters * @return result of the operation */ - ApexAPIResult deleteEventPar(final String name, final String version, final String parName); + ApexApiResult deleteEventPar(final String name, final String version, final String parName); /* * Context Album API Methods @@ -306,7 +306,7 @@ public interface ApexEditorAPI { * @return result of the operation */ // CHECKSTYLE:OFF: checkstyle:parameterNumber - ApexAPIResult createContextAlbum(final String name, final String version, final String scope, final String writable, + ApexApiResult createContextAlbum(final String name, final String version, final String scope, final String writable, final String contextSchemaName, final String contextSchemaVersion, final String uuid, final String description); // CHECKSTYLE:ON: checkstyle:parameterNumber @@ -327,7 +327,7 @@ public interface ApexEditorAPI { * @return result of the operation */ // CHECKSTYLE:OFF: checkstyle:parameterNumber - ApexAPIResult updateContextAlbum(final String name, final String version, final String scope, final String writable, + ApexApiResult updateContextAlbum(final String name, final String version, final String scope, final String writable, final String contextSchemaName, final String contextSchemaVersion, final String uuid, final String description); // CHECKSTYLE:ON: checkstyle:parameterNumber @@ -339,7 +339,7 @@ public interface ApexEditorAPI { * @param version starting version of the context album, set to null to list all versions * @return result of the operation */ - ApexAPIResult listContextAlbum(final String name, final String version); + ApexApiResult listContextAlbum(final String name, final String version); /** * Delete a context album. @@ -348,7 +348,7 @@ public interface ApexEditorAPI { * @param version version of the context album, set to null to delete versions * @return result of the operation */ - ApexAPIResult deleteContextAlbum(final String name, final String version); + ApexApiResult deleteContextAlbum(final String name, final String version); /** * Validate context albums. @@ -357,7 +357,7 @@ public interface ApexEditorAPI { * @param version starting version of the context album, set to null to list all versions * @return result of the operation */ - ApexAPIResult validateContextAlbum(final String name, final String version); + ApexApiResult validateContextAlbum(final String name, final String version); /* * Task API Methods @@ -372,7 +372,7 @@ public interface ApexEditorAPI { * @param description task description, set to null to generate a description * @return result of the operation */ - ApexAPIResult createTask(final String name, final String version, final String uuid, final String description); + ApexApiResult createTask(final String name, final String version, final String uuid, final String description); /** * Update a task. @@ -383,7 +383,7 @@ public interface ApexEditorAPI { * @param description task description, set to null to not update * @return result of the operation */ - ApexAPIResult updateTask(final String name, final String version, final String uuid, final String description); + ApexApiResult updateTask(final String name, final String version, final String uuid, final String description); /** * List tasks. @@ -392,7 +392,7 @@ public interface ApexEditorAPI { * @param version starting version of the task, set to null to list all versions * @return result of the operation */ - ApexAPIResult listTask(final String name, final String version); + ApexApiResult listTask(final String name, final String version); /** * Delete a task. @@ -401,7 +401,7 @@ public interface ApexEditorAPI { * @param version version of the task, set to null to use the latest version * @return result of the operation */ - ApexAPIResult deleteTask(final String name, final String version); + ApexApiResult deleteTask(final String name, final String version); /** * Validate tasks. @@ -410,7 +410,7 @@ public interface ApexEditorAPI { * @param version starting version of the task, set to null to list all versions * @return result of the operation */ - ApexAPIResult validateTask(final String name, final String version); + ApexApiResult validateTask(final String name, final String version); /** * Create logic for a task. @@ -422,7 +422,7 @@ public interface ApexEditorAPI { * @param logic the source code for the logic of the task * @return result of the operation */ - ApexAPIResult createTaskLogic(final String name, final String version, final String logicFlavour, + ApexApiResult createTaskLogic(final String name, final String version, final String logicFlavour, final String logic); /** @@ -434,7 +434,7 @@ public interface ApexEditorAPI { * @param logic the source code for the logic of the task, set to null to not update * @return result of the operation */ - ApexAPIResult updateTaskLogic(final String name, final String version, final String logicFlavour, + ApexApiResult updateTaskLogic(final String name, final String version, final String logicFlavour, final String logic); /** @@ -444,7 +444,7 @@ public interface ApexEditorAPI { * @param version version of the task, set to null to list the latest version * @return result of the operation */ - ApexAPIResult listTaskLogic(final String name, final String version); + ApexApiResult listTaskLogic(final String name, final String version); /** * Delete logic for a task. @@ -453,7 +453,7 @@ public interface ApexEditorAPI { * @param version version of the task, set to null to use the latest version * @return result of the operation */ - ApexAPIResult deleteTaskLogic(final String name, final String version); + ApexApiResult deleteTaskLogic(final String name, final String version); /** * Create a task input field. @@ -467,7 +467,7 @@ public interface ApexEditorAPI { * @param optional true if the task field is optional, false otherwise * @return result of the operation */ - ApexAPIResult createTaskInputField(final String name, final String version, final String fieldName, + ApexApiResult createTaskInputField(final String name, final String version, final String fieldName, final String contextSchemaName, final String contextSchemaVersion, boolean optional); /** @@ -479,7 +479,7 @@ public interface ApexEditorAPI { * task * @return result of the operation */ - ApexAPIResult listTaskInputField(final String name, final String version, final String fieldName); + ApexApiResult listTaskInputField(final String name, final String version, final String fieldName); /** * Delete a task input field. @@ -489,7 +489,7 @@ public interface ApexEditorAPI { * @param fieldName of the input field, set to null to delete all input fields * @return result of the operation */ - ApexAPIResult deleteTaskInputField(final String name, final String version, final String fieldName); + ApexApiResult deleteTaskInputField(final String name, final String version, final String fieldName); /** * Create a task output field. @@ -503,7 +503,7 @@ public interface ApexEditorAPI { * @param optional true if the task field is optional, false otherwise * @return result of the operation */ - ApexAPIResult createTaskOutputField(final String name, final String version, final String fieldName, + ApexApiResult createTaskOutputField(final String name, final String version, final String fieldName, final String contextSchemaName, final String contextSchemaVersion, boolean optional); /** @@ -515,7 +515,7 @@ public interface ApexEditorAPI { * task * @return result of the operation */ - ApexAPIResult listTaskOutputField(final String name, final String version, final String fieldName); + ApexApiResult listTaskOutputField(final String name, final String version, final String fieldName); /** * Delete a task output field. @@ -525,7 +525,7 @@ public interface ApexEditorAPI { * @param fieldName of the output field, set to null to delete all output fields * @return result of the operation */ - ApexAPIResult deleteTaskOutputField(final String name, final String version, final String fieldName); + ApexApiResult deleteTaskOutputField(final String name, final String version, final String fieldName); /** * Create a task parameter. @@ -536,7 +536,7 @@ public interface ApexEditorAPI { * @param defaultValue of the parameter * @return result of the operation */ - ApexAPIResult createTaskParameter(final String name, final String version, final String parName, + ApexApiResult createTaskParameter(final String name, final String version, final String parName, final String defaultValue); /** @@ -547,7 +547,7 @@ public interface ApexEditorAPI { * @param parName name of the parameter, set to null to list all parameters of the task * @return result of the operation */ - ApexAPIResult listTaskParameter(final String name, final String version, final String parName); + ApexApiResult listTaskParameter(final String name, final String version, final String parName); /** * Delete a task parameter. @@ -557,7 +557,7 @@ public interface ApexEditorAPI { * @param parName of the parameter, set to null to delete all task parameters * @return result of the operation */ - ApexAPIResult deleteTaskParameter(final String name, final String version, final String parName); + ApexApiResult deleteTaskParameter(final String name, final String version, final String parName); /** * Create a task context album reference. @@ -569,7 +569,7 @@ public interface ApexEditorAPI { * to null to use the latest version * @return result of the operation */ - ApexAPIResult createTaskContextRef(final String name, final String version, final String contextAlbumName, + ApexApiResult createTaskContextRef(final String name, final String version, final String contextAlbumName, final String contextAlbumVersion); /** @@ -583,7 +583,7 @@ public interface ApexEditorAPI { * to null to use the latest version * @return result of the operation */ - ApexAPIResult listTaskContextRef(final String name, final String version, final String contextAlbumName, + ApexApiResult listTaskContextRef(final String name, final String version, final String contextAlbumName, final String contextAlbumVersion); /** @@ -597,7 +597,7 @@ public interface ApexEditorAPI { * to null to use the latest version * @return result of the operation */ - ApexAPIResult deleteTaskContextRef(final String name, final String version, final String contextAlbumName, + ApexApiResult deleteTaskContextRef(final String name, final String version, final String contextAlbumName, final String contextAlbumVersion); /* @@ -615,7 +615,7 @@ public interface ApexEditorAPI { * @param description policy description, set to null to generate a description * @return result of the operation */ - ApexAPIResult createPolicy(final String name, final String version, final String template, final String firstState, + ApexApiResult createPolicy(final String name, final String version, final String template, final String firstState, final String uuid, final String description); /** @@ -629,7 +629,7 @@ public interface ApexEditorAPI { * @param description policy description, set to null to not update * @return result of the operation */ - ApexAPIResult updatePolicy(final String name, final String version, final String template, final String firstState, + ApexApiResult updatePolicy(final String name, final String version, final String template, final String firstState, final String uuid, final String description); /** @@ -639,7 +639,7 @@ public interface ApexEditorAPI { * @param version starting version of the policy, set to null to list all versions * @return result of the operation */ - ApexAPIResult listPolicy(final String name, final String version); + ApexApiResult listPolicy(final String name, final String version); /** * Delete a policy. @@ -648,7 +648,7 @@ public interface ApexEditorAPI { * @param version version of the policy, set to null to use the latest version * @return result of the operation */ - ApexAPIResult deletePolicy(final String name, final String version); + ApexApiResult deletePolicy(final String name, final String version); /** * Validate policies. @@ -657,7 +657,7 @@ public interface ApexEditorAPI { * @param version starting version of the policy, set to null to list all versions * @return result of the operation */ - ApexAPIResult validatePolicy(final String name, final String version); + ApexApiResult validatePolicy(final String name, final String version); /** * Create a policy state. @@ -672,7 +672,7 @@ public interface ApexEditorAPI { * @param defaltTaskVersion the default task version, set to null to use the latest version * @return result of the operation */ - ApexAPIResult createPolicyState(final String name, final String version, final String stateName, + ApexApiResult createPolicyState(final String name, final String version, final String stateName, final String triggerName, final String triggerVersion, final String defaultTaskName, final String defaltTaskVersion); @@ -689,7 +689,7 @@ public interface ApexEditorAPI { * @param defaltTaskVersion the default task version, set to use latest version of default task * @return result of the operation */ - ApexAPIResult updatePolicyState(final String name, final String version, final String stateName, + ApexApiResult updatePolicyState(final String name, final String version, final String stateName, final String triggerName, final String triggerVersion, final String defaultTaskName, final String defaltTaskVersion); @@ -701,7 +701,7 @@ public interface ApexEditorAPI { * @param stateName of the state, set to null to list all states of the policy * @return result of the operation */ - ApexAPIResult listPolicyState(final String name, final String version, final String stateName); + ApexApiResult listPolicyState(final String name, final String version, final String stateName); /** * Delete a policy state. @@ -711,7 +711,7 @@ public interface ApexEditorAPI { * @param stateName of the state, set to null to delete all states * @return result of the operation */ - ApexAPIResult deletePolicyState(final String name, final String version, final String stateName); + ApexApiResult deletePolicyState(final String name, final String version, final String stateName); /** * Create task selection logic for a state. @@ -724,7 +724,7 @@ public interface ApexEditorAPI { * @param logic the source code for the logic of the state * @return result of the operation */ - ApexAPIResult createPolicyStateTaskSelectionLogic(final String name, final String version, final String stateName, + ApexApiResult createPolicyStateTaskSelectionLogic(final String name, final String version, final String stateName, final String logicFlavour, final String logic); /** @@ -737,7 +737,7 @@ public interface ApexEditorAPI { * @param logic the source code for the logic of the state, set to null to not update * @return result of the operation */ - ApexAPIResult updatePolicyStateTaskSelectionLogic(final String name, final String version, final String stateName, + ApexApiResult updatePolicyStateTaskSelectionLogic(final String name, final String version, final String stateName, final String logicFlavour, final String logic); /** @@ -748,7 +748,7 @@ public interface ApexEditorAPI { * @param stateName of the state * @return result of the operation */ - ApexAPIResult listPolicyStateTaskSelectionLogic(final String name, final String version, final String stateName); + ApexApiResult listPolicyStateTaskSelectionLogic(final String name, final String version, final String stateName); /** * Delete task selection logic for a state. @@ -758,7 +758,7 @@ public interface ApexEditorAPI { * @param stateName of the state * @return result of the operation */ - ApexAPIResult deletePolicyStateTaskSelectionLogic(final String name, final String version, final String stateName); + ApexApiResult deletePolicyStateTaskSelectionLogic(final String name, final String version, final String stateName); /** * Create a policy state output. @@ -774,7 +774,7 @@ public interface ApexEditorAPI { * the policy transitions to on this branch * @return result of the operation */ - ApexAPIResult createPolicyStateOutput(final String name, final String version, final String stateName, + ApexApiResult createPolicyStateOutput(final String name, final String version, final String stateName, final String outputName, final String eventName, final String eventVersion, final String nextState); /** @@ -786,7 +786,7 @@ public interface ApexEditorAPI { * @param outputName of the state output, set to null to list all outputs of the state * @return result of the operation */ - ApexAPIResult listPolicyStateOutput(final String name, final String version, final String stateName, + ApexApiResult listPolicyStateOutput(final String name, final String version, final String stateName, final String outputName); /** @@ -798,7 +798,7 @@ public interface ApexEditorAPI { * @param outputName of the state output, set to null to delete all state outputs * @return result of the operation */ - ApexAPIResult deletePolicyStateOutput(final String name, final String version, final String stateName, + ApexApiResult deletePolicyStateOutput(final String name, final String version, final String stateName, final String outputName); /** @@ -813,7 +813,7 @@ public interface ApexEditorAPI { * @param logic the source code for the logic of the state * @return result of the operation */ - ApexAPIResult createPolicyStateFinalizerLogic(final String name, final String version, final String stateName, + ApexApiResult createPolicyStateFinalizerLogic(final String name, final String version, final String stateName, final String finalizerLogicName, final String logicFlavour, final String logic); /** @@ -828,7 +828,7 @@ public interface ApexEditorAPI { * @param logic the source code for the logic of the state, set to null to not update * @return result of the operation */ - ApexAPIResult updatePolicyStateFinalizerLogic(final String name, final String version, final String stateName, + ApexApiResult updatePolicyStateFinalizerLogic(final String name, final String version, final String stateName, final String finalizerLogicName, final String logicFlavour, final String logic); /** @@ -840,7 +840,7 @@ public interface ApexEditorAPI { * @param finalizerLogicName name of the state finalizer logic * @return result of the operation */ - ApexAPIResult listPolicyStateFinalizerLogic(final String name, final String version, final String stateName, + ApexApiResult listPolicyStateFinalizerLogic(final String name, final String version, final String stateName, final String finalizerLogicName); /** @@ -852,7 +852,7 @@ public interface ApexEditorAPI { * @param finalizerLogicName name of the state finalizer logic * @return result of the operation */ - ApexAPIResult deletePolicyStateFinalizerLogic(final String name, final String version, final String stateName, + ApexApiResult deletePolicyStateFinalizerLogic(final String name, final String version, final String stateName, final String finalizerLogicName); /** @@ -871,7 +871,7 @@ public interface ApexEditorAPI { * @return result of the operation */ // CHECKSTYLE:OFF: checkstyle:parameterNumber - ApexAPIResult createPolicyStateTaskRef(final String name, final String version, final String stateName, + ApexApiResult createPolicyStateTaskRef(final String name, final String version, final String stateName, final String taskLocalName, final String taskName, final String taskVersion, final String outputType, final String outputName); // CHECKSTYLE:ON: checkstyle:parameterNumber @@ -886,7 +886,7 @@ public interface ApexEditorAPI { * @param taskVersion version of the task, set to null to use the latest version * @return result of the operation */ - ApexAPIResult listPolicyStateTaskRef(final String name, final String version, final String stateName, + ApexApiResult listPolicyStateTaskRef(final String name, final String version, final String stateName, final String taskName, final String taskVersion); /** @@ -899,7 +899,7 @@ public interface ApexEditorAPI { * @param taskVersion version of the task, set to null to use the latest version * @return result of the operation */ - ApexAPIResult deletePolicyStateTaskRef(final String name, final String version, final String stateName, + ApexApiResult deletePolicyStateTaskRef(final String name, final String version, final String stateName, final String taskName, final String taskVersion); /** @@ -913,7 +913,7 @@ public interface ApexEditorAPI { * to null to use the latest version * @return result of the operation */ - ApexAPIResult createPolicyStateContextRef(final String name, final String version, final String stateName, + ApexApiResult createPolicyStateContextRef(final String name, final String version, final String stateName, final String contextAlbumName, final String contextAlbumVersion); /** @@ -928,7 +928,7 @@ public interface ApexEditorAPI { * to null to use the latest version * @return result of the operation */ - ApexAPIResult listPolicyStateContextRef(final String name, final String version, final String stateName, + ApexApiResult listPolicyStateContextRef(final String name, final String version, final String stateName, final String contextAlbumName, final String contextAlbumVersion); /** @@ -943,6 +943,6 @@ public interface ApexEditorAPI { * to null to use the latest version * @return result of the operation */ - ApexAPIResult deletePolicyStateContextRef(final String name, final String version, final String stateName, + ApexApiResult deletePolicyStateContextRef(final String name, final String version, final String stateName, final String contextAlbumName, final String contextAlbumVersion); } diff --git a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/ApexModel.java b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/ApexModel.java index 8b4d4a91b..9771b6186 100644 --- a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/ApexModel.java +++ b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/ApexModel.java @@ -28,7 +28,7 @@ import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel; * * @author Liam Fallon (liam.fallon@ericsson.com) */ -public interface ApexModel extends ApexEditorAPI { +public interface ApexModel extends ApexEditorApi { /** * Make a deep copy of the Model. * @@ -42,7 +42,7 @@ public interface ApexModel extends ApexEditorAPI { * @param modelString the string with the model * @return the result of the operation */ - ApexAPIResult loadFromString(String modelString); + ApexApiResult loadFromString(String modelString); /** * Load an Apex model from a file. @@ -50,7 +50,7 @@ public interface ApexModel extends ApexEditorAPI { * @param fileName the file name of the file with the model * @return the result of the operation */ - ApexAPIResult loadFromFile(String fileName); + ApexApiResult loadFromFile(String fileName); /** * Save an Apex model to a file. @@ -59,26 +59,26 @@ public interface ApexModel extends ApexEditorAPI { * @param xmlFlag if true, save the file in XML format, otherwise save the file in the default JSON format * @return the result of the operation */ - ApexAPIResult saveToFile(String fileName, boolean xmlFlag); + ApexApiResult saveToFile(String fileName, boolean xmlFlag); /** * Load an Apex model from a database. * * @param modelName the name of the model to load - * @param modelVersion the version of the model to load, loads the policy model from the database with this name, if more than one exist, an exception is - * thrown - * @param DaoParameters the parameters to use to access the database over JDBC + * @param modelVersion the version of the model to load, loads the policy model from the database with this name, if + * more than one exist, an exception is thrown + * @param daoParameters the parameters to use to access the database over JDBC * @return the result of the operation */ - ApexAPIResult loadFromDatabase(String modelName, String modelVersion, DaoParameters DaoParameters); + ApexApiResult loadFromDatabase(String modelName, String modelVersion, DaoParameters daoParameters); /** * Save an Apex model to a database. * - * @param DaoParameters the parameters to use to access the database over JDBC + * @param daoParameters the parameters to use to access the database over JDBC * @return the result of the operation */ - ApexAPIResult saveToDatabase(DaoParameters DaoParameters); + ApexApiResult saveToDatabase(DaoParameters daoParameters); /** * Read an APEX model from a location identified by a URL. @@ -86,7 +86,7 @@ public interface ApexModel extends ApexEditorAPI { * @param urlString the url string * @return the result of the operation */ - ApexAPIResult readFromURL(String urlString); + ApexApiResult readFromUrl(String urlString); /** * Write an APEX model to a location identified by a URL. @@ -95,21 +95,21 @@ public interface ApexModel extends ApexEditorAPI { * @param xmlFlag if true, save the file in XML format, otherwise save the file in the default JSON format * @return the result of the operation */ - ApexAPIResult writeToURL(String urlString, boolean xmlFlag); + ApexApiResult writeToUrl(String urlString, boolean xmlFlag); /** * Analyse an Apex model that shows the concept usage references of a policy model. * * @return the result of the operation */ - ApexAPIResult analyse(); + ApexApiResult analyse(); /** * Validate an Apex model, checking all concepts and references in the model. * * @return the result of the operation */ - ApexAPIResult validate(); + ApexApiResult validate(); /** * Compare to Apex models, returning the differences between the models. @@ -119,7 +119,7 @@ public interface ApexModel extends ApexEditorAPI { * @param keysOnly only returns the keys that are different when set, when not set values are also returned * @return the result of the operation */ - ApexAPIResult compare(String otherModelFileName, boolean diffsOnly, boolean keysOnly); + ApexApiResult compare(String otherModelFileName, boolean diffsOnly, boolean keysOnly); /** * Compare two Apex models, returning the differences between the models. @@ -129,45 +129,50 @@ public interface ApexModel extends ApexEditorAPI { * @param keysOnly only returns the keys that are different when set, when not set values are also returned * @return the result of the operation */ - ApexAPIResult compareWithString(String otherModelString, boolean diffsOnly, boolean keysOnly); + ApexApiResult compareWithString(String otherModelString, boolean diffsOnly, boolean keysOnly); /** * Split out a sub model from an Apex model that contains a given subset of the policies in the original model. * - * @param targetModelName the file name of the target model in which to store the model split out from the original model - * @param splitOutPolicies the policies form the original model to include in the split out model, specified as a comma delimited list of policy names + * @param targetModelName the file name of the target model in which to store the model split out from the original + * model + * @param splitOutPolicies the policies form the original model to include in the split out model, specified as a + * comma delimited list of policy names * @return the result of the operation */ - ApexAPIResult split(String targetModelName, String splitOutPolicies); + ApexApiResult split(String targetModelName, String splitOutPolicies); /** - * Split out a sub model from an Apex model that contains a given subset of the policies in the original model, return the split model in the result as a - * string. + * Split out a sub model from an Apex model that contains a given subset of the policies in the original model, + * return the split model in the result as a string. * - * @param splitOutPolicies the policies form the original model to include in the split out model, specified as a comma delimited list of policy names + * @param splitOutPolicies the policies form the original model to include in the split out model, specified as a + * comma delimited list of policy names * @return the result of the operation */ - ApexAPIResult split(String splitOutPolicies); + ApexApiResult split(String splitOutPolicies); /** * Merge two Apex models together. * * @param mergeInModelName the file name of the model to merge into the current model - * @param keepOriginal if this flag is set to true, if a concept exists in both models, the original model copy of that concept is kept, if the flag is set - * to false, then the copy of the concept from the mergeInModel overwrites the concept in the original model + * @param keepOriginal if this flag is set to true, if a concept exists in both models, the original model copy of + * that concept is kept, if the flag is set to false, then the copy of the concept from the mergeInModel + * overwrites the concept in the original model * @return the result of the operation */ - ApexAPIResult merge(String mergeInModelName, boolean keepOriginal); + ApexApiResult merge(String mergeInModelName, boolean keepOriginal); /** * Merge two Apex models together. * * @param otherModelString the model to merge as a string - * @param keepOriginal if this flag is set to true, if a concept exists in both models, the original model copy of that concept is kept, if the flag is set - * to false, then the copy of the concept from the mergeInModel overwrites the concept in the original model + * @param keepOriginal if this flag is set to true, if a concept exists in both models, the original model copy of + * that concept is kept, if the flag is set to false, then the copy of the concept from the mergeInModel + * overwrites the concept in the original model * @return the result of the operation */ - ApexAPIResult mergeWithString(String otherModelString, boolean keepOriginal); + ApexApiResult mergeWithString(String otherModelString, boolean keepOriginal); /** * Get the raw policy model being used by this model. @@ -182,7 +187,7 @@ public interface ApexModel extends ApexEditorAPI { * @param policyModel the policy model */ void setPolicyModel(AxPolicyModel policyModel); - + /** * Builds the raw policy model being used by this model. * diff --git a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ApexModelImpl.java b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ApexModelImpl.java index 429d3c66f..c15eadc7d 100644 --- a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ApexModelImpl.java +++ b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ApexModelImpl.java @@ -23,7 +23,7 @@ package org.onap.policy.apex.model.modelapi.impl; import java.util.Properties; import org.onap.policy.apex.model.basicmodel.dao.DaoParameters; -import org.onap.policy.apex.model.modelapi.ApexAPIResult; +import org.onap.policy.apex.model.modelapi.ApexApiResult; import org.onap.policy.apex.model.modelapi.ApexModel; import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel; @@ -114,7 +114,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, java.lang.String, java.lang.String) */ @Override - public ApexAPIResult createModel(final String name, final String version, final String uuid, + public ApexApiResult createModel(final String name, final String version, final String uuid, final String description) { return modelFacade.createModel(name, version, uuid, description); } @@ -126,7 +126,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, java.lang.String, java.lang.String) */ @Override - public ApexAPIResult updateModel(final String name, final String version, final String uuid, + public ApexApiResult updateModel(final String name, final String version, final String uuid, final String description) { return modelFacade.updateModel(name, version, uuid, description); } @@ -137,7 +137,7 @@ public final class ApexModelImpl implements ApexModel { * @see org.onap.policy.apex.core.modelapi.ApexEditorAPI#getModelKey() */ @Override - public ApexAPIResult getModelKey() { + public ApexApiResult getModelKey() { return modelFacade.getModelKey(); } @@ -147,7 +147,7 @@ public final class ApexModelImpl implements ApexModel { * @see org.onap.policy.apex.auth.api.ApexEditorAPI#listModel() */ @Override - public ApexAPIResult listModel() { + public ApexApiResult listModel() { return modelFacade.listModel(); } @@ -157,7 +157,7 @@ public final class ApexModelImpl implements ApexModel { * @see org.onap.policy.apex.auth.api.ApexEditorAPI#deleteModel() */ @Override - public ApexAPIResult deleteModel() { + public ApexApiResult deleteModel() { return modelFacade.deleteModel(); } @@ -168,7 +168,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, java.lang.String, java.lang.String) */ @Override - public ApexAPIResult createKeyInformation(final String name, final String version, final String uuid, + public ApexApiResult createKeyInformation(final String name, final String version, final String uuid, final String description) { return keyInformationFacade.createKeyInformation(name, version, uuid, description); } @@ -180,7 +180,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, java.lang.String, java.lang.String) */ @Override - public ApexAPIResult updateKeyInformation(final String name, final String version, final String uuid, + public ApexApiResult updateKeyInformation(final String name, final String version, final String uuid, final String description) { return keyInformationFacade.updateKeyInformation(name, version, uuid, description); } @@ -192,7 +192,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String) */ @Override - public ApexAPIResult listKeyInformation(final String name, final String version) { + public ApexApiResult listKeyInformation(final String name, final String version) { return keyInformationFacade.listKeyInformation(name, version); } @@ -203,7 +203,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String) */ @Override - public ApexAPIResult deleteKeyInformation(final String name, final String version) { + public ApexApiResult deleteKeyInformation(final String name, final String version) { return keyInformationFacade.deleteKeyInformation(name, version); } @@ -214,7 +214,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String) */ @Override - public ApexAPIResult validateKeyInformation(final String name, final String version) { + public ApexApiResult validateKeyInformation(final String name, final String version) { return keyInformationFacade.validateKeyInformation(name, version); } @@ -225,7 +225,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) */ @Override - public ApexAPIResult createContextSchema(final String name, final String version, final String schemaFlavour, + public ApexApiResult createContextSchema(final String name, final String version, final String schemaFlavour, final String schemaDefinition, final String uuid, final String description) { return contextSchemaFacade.createContextSchema(name, version, schemaFlavour, schemaDefinition, uuid, description); @@ -238,7 +238,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) */ @Override - public ApexAPIResult updateContextSchema(final String name, final String version, final String schemaFlavour, + public ApexApiResult updateContextSchema(final String name, final String version, final String schemaFlavour, final String schemaDefinition, final String uuid, final String description) { return contextSchemaFacade.updateContextSchema(name, version, schemaFlavour, schemaDefinition, uuid, description); @@ -251,7 +251,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String) */ @Override - public ApexAPIResult listContextSchemas(final String name, final String version) { + public ApexApiResult listContextSchemas(final String name, final String version) { return contextSchemaFacade.listContextSchemas(name, version); } @@ -262,7 +262,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String) */ @Override - public ApexAPIResult deleteContextSchema(final String name, final String version) { + public ApexApiResult deleteContextSchema(final String name, final String version) { return contextSchemaFacade.deleteContextSchema(name, version); } @@ -273,7 +273,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String) */ @Override - public ApexAPIResult validateContextSchemas(final String name, final String version) { + public ApexApiResult validateContextSchemas(final String name, final String version) { return contextSchemaFacade.validateContextSchemas(name, version); } @@ -285,7 +285,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String) */ @Override - public ApexAPIResult createEvent(final String name, final String version, final String nameSpace, + public ApexApiResult createEvent(final String name, final String version, final String nameSpace, final String source, final String target, final String uuid, final String description) { return eventFacade.createEvent(name, version, nameSpace, source, target, uuid, description); } @@ -298,7 +298,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String) */ @Override - public ApexAPIResult updateEvent(final String name, final String version, final String nameSpace, + public ApexApiResult updateEvent(final String name, final String version, final String nameSpace, final String source, final String target, final String uuid, final String description) { return eventFacade.updateEvent(name, version, nameSpace, source, target, uuid, description); } @@ -310,7 +310,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String) */ @Override - public ApexAPIResult listEvent(final String name, final String version) { + public ApexApiResult listEvent(final String name, final String version) { return eventFacade.listEvent(name, version); } @@ -321,7 +321,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String) */ @Override - public ApexAPIResult deleteEvent(final String name, final String version) { + public ApexApiResult deleteEvent(final String name, final String version) { return eventFacade.deleteEvent(name, version); } @@ -332,7 +332,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String) */ @Override - public ApexAPIResult validateEvent(final String name, final String version) { + public ApexApiResult validateEvent(final String name, final String version) { return eventFacade.validateEvent(name, version); } @@ -343,7 +343,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, java.lang.String, java.lang.String, java.lang.String, boolean) */ @Override - public ApexAPIResult createEventPar(final String name, final String version, final String parName, + public ApexApiResult createEventPar(final String name, final String version, final String parName, final String contextSchemaName, final String contextSchemaVersion, final boolean optional) { return eventFacade.createEventPar(name, version, parName, contextSchemaName, contextSchemaVersion, optional); } @@ -355,7 +355,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, java.lang.String) */ @Override - public ApexAPIResult listEventPar(final String name, final String version, final String parName) { + public ApexApiResult listEventPar(final String name, final String version, final String parName) { return eventFacade.listEventPar(name, version, parName); } @@ -366,7 +366,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, java.lang.String) */ @Override - public ApexAPIResult deleteEventPar(final String name, final String version, final String parName) { + public ApexApiResult deleteEventPar(final String name, final String version, final String parName) { return eventFacade.deleteEventPar(name, version, parName); } @@ -379,7 +379,7 @@ public final class ApexModelImpl implements ApexModel { */ @Override // CHECKSTYLE:OFF: checkstyle:parameterNumber - public ApexAPIResult createContextAlbum(final String name, final String version, final String scope, + public ApexApiResult createContextAlbum(final String name, final String version, final String scope, final String writable, final String contextSchemaName, final String contextSchemaVersion, final String uuid, final String description) { return contextAlbumFacade.createContextAlbum(name, version, scope, writable, contextSchemaName, @@ -396,7 +396,7 @@ public final class ApexModelImpl implements ApexModel { */ // CHECKSTYLE:OFF: checkstyle:parameterNumber @Override - public ApexAPIResult updateContextAlbum(final String name, final String version, final String scope, + public ApexApiResult updateContextAlbum(final String name, final String version, final String scope, final String writable, final String contextSchemaName, final String contextSchemaVersion, final String uuid, final String description) { return contextAlbumFacade.updateContextAlbum(name, version, scope, writable, contextSchemaName, @@ -411,7 +411,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String) */ @Override - public ApexAPIResult listContextAlbum(final String name, final String version) { + public ApexApiResult listContextAlbum(final String name, final String version) { return contextAlbumFacade.listContextAlbum(name, version); } @@ -422,7 +422,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String) */ @Override - public ApexAPIResult deleteContextAlbum(final String name, final String version) { + public ApexApiResult deleteContextAlbum(final String name, final String version) { return contextAlbumFacade.deleteContextAlbum(name, version); } @@ -433,7 +433,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String) */ @Override - public ApexAPIResult validateContextAlbum(final String name, final String version) { + public ApexApiResult validateContextAlbum(final String name, final String version) { return contextAlbumFacade.validateContextAlbum(name, version); } @@ -444,7 +444,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, java.lang.String, java.lang.String) */ @Override - public ApexAPIResult createTask(final String name, final String version, final String uuid, + public ApexApiResult createTask(final String name, final String version, final String uuid, final String description) { return taskFacade.createTask(name, version, uuid, description); } @@ -456,7 +456,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, java.lang.String, java.lang.String) */ @Override - public ApexAPIResult updateTask(final String name, final String version, final String uuid, + public ApexApiResult updateTask(final String name, final String version, final String uuid, final String description) { return taskFacade.updateTask(name, version, uuid, description); } @@ -467,7 +467,7 @@ public final class ApexModelImpl implements ApexModel { * @see org.onap.policy.apex.auth.api.ApexEditorAPI#listTask(java.lang.String, java.lang.String) */ @Override - public ApexAPIResult listTask(final String name, final String version) { + public ApexApiResult listTask(final String name, final String version) { return taskFacade.listTask(name, version); } @@ -478,7 +478,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String) */ @Override - public ApexAPIResult deleteTask(final String name, final String version) { + public ApexApiResult deleteTask(final String name, final String version) { return taskFacade.deleteTask(name, version); } @@ -489,7 +489,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String) */ @Override - public ApexAPIResult validateTask(final String name, final String version) { + public ApexApiResult validateTask(final String name, final String version) { return taskFacade.validateTask(name, version); } @@ -500,7 +500,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, java.lang.String, java.lang.String) */ @Override - public ApexAPIResult createTaskLogic(final String name, final String version, final String logicFlavour, + public ApexApiResult createTaskLogic(final String name, final String version, final String logicFlavour, final String logic) { return taskFacade.createTaskLogic(name, version, logicFlavour, logic); } @@ -512,7 +512,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, java.lang.String, java.lang.String) */ @Override - public ApexAPIResult updateTaskLogic(final String name, final String version, final String logicFlavour, + public ApexApiResult updateTaskLogic(final String name, final String version, final String logicFlavour, final String logic) { return taskFacade.updateTaskLogic(name, version, logicFlavour, logic); } @@ -524,7 +524,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String) */ @Override - public ApexAPIResult listTaskLogic(final String name, final String version) { + public ApexApiResult listTaskLogic(final String name, final String version) { return taskFacade.listTaskLogic(name, version); } @@ -535,7 +535,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String) */ @Override - public ApexAPIResult deleteTaskLogic(final String name, final String version) { + public ApexApiResult deleteTaskLogic(final String name, final String version) { return taskFacade.deleteTaskLogic(name, version); } @@ -546,7 +546,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.boolean) */ @Override - public ApexAPIResult createTaskInputField(final String name, final String version, final String fieldName, + public ApexApiResult createTaskInputField(final String name, final String version, final String fieldName, final String dataTypeName, final String dataTypeVersion, final boolean optional) { return taskFacade.createTaskInputField(name, version, fieldName, dataTypeName, dataTypeVersion, optional); } @@ -558,7 +558,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, java.lang.String) */ @Override - public ApexAPIResult listTaskInputField(final String name, final String version, final String fieldName) { + public ApexApiResult listTaskInputField(final String name, final String version, final String fieldName) { return taskFacade.listTaskInputField(name, version, fieldName); } @@ -569,7 +569,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, java.lang.String) */ @Override - public ApexAPIResult deleteTaskInputField(final String name, final String version, final String fieldName) { + public ApexApiResult deleteTaskInputField(final String name, final String version, final String fieldName) { return taskFacade.deleteTaskInputField(name, version, fieldName); } @@ -580,7 +580,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.boolean) */ @Override - public ApexAPIResult createTaskOutputField(final String name, final String version, final String fieldName, + public ApexApiResult createTaskOutputField(final String name, final String version, final String fieldName, final String dataTypeName, final String dataTypeVersion, final boolean optional) { return taskFacade.createTaskOutputField(name, version, fieldName, dataTypeName, dataTypeVersion, optional); } @@ -592,7 +592,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, java.lang.String) */ @Override - public ApexAPIResult listTaskOutputField(final String name, final String version, final String fieldName) { + public ApexApiResult listTaskOutputField(final String name, final String version, final String fieldName) { return taskFacade.listTaskOutputField(name, version, fieldName); } @@ -603,7 +603,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, java.lang.String) */ @Override - public ApexAPIResult deleteTaskOutputField(final String name, final String version, final String fieldName) { + public ApexApiResult deleteTaskOutputField(final String name, final String version, final String fieldName) { return taskFacade.deleteTaskOutputField(name, version, fieldName); } @@ -614,7 +614,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, java.lang.String, java.lang.String) */ @Override - public ApexAPIResult createTaskParameter(final String name, final String version, final String parName, + public ApexApiResult createTaskParameter(final String name, final String version, final String parName, final String defaultValue) { return taskFacade.createTaskParameter(name, version, parName, defaultValue); } @@ -626,7 +626,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, java.lang.String) */ @Override - public ApexAPIResult listTaskParameter(final String name, final String version, final String parName) { + public ApexApiResult listTaskParameter(final String name, final String version, final String parName) { return taskFacade.listTaskParameter(name, version, parName); } @@ -637,7 +637,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, java.lang.String) */ @Override - public ApexAPIResult deleteTaskParameter(final String name, final String version, final String parName) { + public ApexApiResult deleteTaskParameter(final String name, final String version, final String parName) { return taskFacade.deleteTaskParameter(name, version, parName); } @@ -648,7 +648,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, java.lang.String, java.lang.String) */ @Override - public ApexAPIResult createTaskContextRef(final String name, final String version, final String contextAlbumName, + public ApexApiResult createTaskContextRef(final String name, final String version, final String contextAlbumName, final String contextAlbumVersion) { return taskFacade.createTaskContextRef(name, version, contextAlbumName, contextAlbumVersion); } @@ -660,7 +660,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, java.lang.String, java.lang.String) */ @Override - public ApexAPIResult listTaskContextRef(final String name, final String version, final String contextAlbumName, + public ApexApiResult listTaskContextRef(final String name, final String version, final String contextAlbumName, final String contextAlbumVersion) { return taskFacade.listTaskContextRef(name, version, contextAlbumName, contextAlbumVersion); } @@ -672,7 +672,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, java.lang.String, java.lang.String) */ @Override - public ApexAPIResult deleteTaskContextRef(final String name, final String version, final String contextAlbumName, + public ApexApiResult deleteTaskContextRef(final String name, final String version, final String contextAlbumName, final String contextAlbumVersion) { return taskFacade.deleteTaskContextRef(name, version, contextAlbumName, contextAlbumVersion); } @@ -684,7 +684,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) */ @Override - public ApexAPIResult createPolicy(final String name, final String version, final String template, + public ApexApiResult createPolicy(final String name, final String version, final String template, final String firstState, final String uuid, final String description) { return policyFacade.createPolicy(name, version, template, firstState, uuid, description); } @@ -696,7 +696,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) */ @Override - public ApexAPIResult updatePolicy(final String name, final String version, final String template, + public ApexApiResult updatePolicy(final String name, final String version, final String template, final String firstState, final String uuid, final String description) { return policyFacade.updatePolicy(name, version, template, firstState, uuid, description); } @@ -708,7 +708,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String) */ @Override - public ApexAPIResult listPolicy(final String name, final String version) { + public ApexApiResult listPolicy(final String name, final String version) { return policyFacade.listPolicy(name, version); } @@ -719,7 +719,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String) */ @Override - public ApexAPIResult deletePolicy(final String name, final String version) { + public ApexApiResult deletePolicy(final String name, final String version) { return policyFacade.deletePolicy(name, version); } @@ -730,7 +730,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String) */ @Override - public ApexAPIResult validatePolicy(final String name, final String version) { + public ApexApiResult validatePolicy(final String name, final String version) { return policyFacade.validatePolicy(name, version); } @@ -742,7 +742,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String) */ @Override - public ApexAPIResult createPolicyState(final String name, final String version, final String stateName, + public ApexApiResult createPolicyState(final String name, final String version, final String stateName, final String triggerName, final String triggerVersion, final String defaultTaskName, final String defaltTaskVersion) { return policyFacade.createPolicyState(name, version, stateName, triggerName, triggerVersion, defaultTaskName, @@ -757,7 +757,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String) */ @Override - public ApexAPIResult updatePolicyState(final String name, final String version, final String stateName, + public ApexApiResult updatePolicyState(final String name, final String version, final String stateName, final String triggerName, final String triggerVersion, final String defaultTaskName, final String defaltTaskVersion) { return policyFacade.updatePolicyState(name, version, stateName, triggerName, triggerVersion, defaultTaskName, @@ -771,7 +771,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, java.lang.String) */ @Override - public ApexAPIResult listPolicyState(final String name, final String version, final String stateName) { + public ApexApiResult listPolicyState(final String name, final String version, final String stateName) { return policyFacade.listPolicyState(name, version, stateName); } @@ -782,7 +782,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, java.lang.String) */ @Override - public ApexAPIResult deletePolicyState(final String name, final String version, final String stateName) { + public ApexApiResult deletePolicyState(final String name, final String version, final String stateName) { return policyFacade.deletePolicyState(name, version, stateName); } @@ -794,7 +794,7 @@ public final class ApexModelImpl implements ApexModel { * String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) */ @Override - public ApexAPIResult createPolicyStateTaskSelectionLogic(final String name, final String version, + public ApexApiResult createPolicyStateTaskSelectionLogic(final String name, final String version, final String stateName, final String logicFlavour, final String logic) { return policyFacade.createPolicyStateTaskSelectionLogic(name, version, stateName, logicFlavour, logic); } @@ -807,7 +807,7 @@ public final class ApexModelImpl implements ApexModel { * String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) */ @Override - public ApexAPIResult updatePolicyStateTaskSelectionLogic(final String name, final String version, + public ApexApiResult updatePolicyStateTaskSelectionLogic(final String name, final String version, final String stateName, final String logicFlavour, final String logic) { return policyFacade.updatePolicyStateTaskSelectionLogic(name, version, stateName, logicFlavour, logic); } @@ -819,7 +819,7 @@ public final class ApexModelImpl implements ApexModel { * String, java.lang.String, java.lang.String) */ @Override - public ApexAPIResult listPolicyStateTaskSelectionLogic(final String name, final String version, + public ApexApiResult listPolicyStateTaskSelectionLogic(final String name, final String version, final String stateName) { return policyFacade.listPolicyStateTaskSelectionLogic(name, version, stateName); } @@ -832,7 +832,7 @@ public final class ApexModelImpl implements ApexModel { * String, java.lang.String, java.lang.String) */ @Override - public ApexAPIResult deletePolicyStateTaskSelectionLogic(final String name, final String version, + public ApexApiResult deletePolicyStateTaskSelectionLogic(final String name, final String version, final String stateName) { return policyFacade.deletePolicyStateTaskSelectionLogic(name, version, stateName); } @@ -845,7 +845,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String) */ @Override - public ApexAPIResult createPolicyStateOutput(final String name, final String version, final String stateName, + public ApexApiResult createPolicyStateOutput(final String name, final String version, final String stateName, final String outputName, final String eventName, final String eventVersion, final String nextState) { return policyFacade.createPolicyStateOutput(name, version, stateName, outputName, eventName, eventVersion, nextState); @@ -858,7 +858,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, java.lang.String, java.lang.String) */ @Override - public ApexAPIResult listPolicyStateOutput(final String name, final String version, final String stateName, + public ApexApiResult listPolicyStateOutput(final String name, final String version, final String stateName, final String outputName) { return policyFacade.listPolicyStateOutput(name, version, stateName, outputName); } @@ -870,7 +870,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, java.lang.String, java.lang.String) */ @Override - public ApexAPIResult deletePolicyStateOutput(final String name, final String version, final String stateName, + public ApexApiResult deletePolicyStateOutput(final String name, final String version, final String stateName, final String outputName) { return policyFacade.deletePolicyStateOutput(name, version, stateName, outputName); } @@ -884,7 +884,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String) */ @Override - public ApexAPIResult createPolicyStateFinalizerLogic(final String name, final String version, + public ApexApiResult createPolicyStateFinalizerLogic(final String name, final String version, final String stateName, final String finalizerLogicName, final String logicFlavour, final String logic) { return policyFacade.createPolicyStateFinalizerLogic(name, version, stateName, finalizerLogicName, logicFlavour, logic); @@ -899,7 +899,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String) */ @Override - public ApexAPIResult updatePolicyStateFinalizerLogic(final String name, final String version, + public ApexApiResult updatePolicyStateFinalizerLogic(final String name, final String version, final String stateName, final String finalizerLogicName, final String logicFlavour, final String logic) { return policyFacade.updatePolicyStateFinalizerLogic(name, version, stateName, finalizerLogicName, logicFlavour, logic); @@ -913,7 +913,7 @@ public final class ApexModelImpl implements ApexModel { * String, java.lang.String, java.lang.String, java.lang.String) */ @Override - public ApexAPIResult listPolicyStateFinalizerLogic(final String name, final String version, final String stateName, + public ApexApiResult listPolicyStateFinalizerLogic(final String name, final String version, final String stateName, final String finalizerLogicName) { return policyFacade.listPolicyStateFinalizerLogic(name, version, stateName, finalizerLogicName); } @@ -926,7 +926,7 @@ public final class ApexModelImpl implements ApexModel { * String, java.lang.String, java.lang.String, java.lang.String) */ @Override - public ApexAPIResult deletePolicyStateFinalizerLogic(final String name, final String version, + public ApexApiResult deletePolicyStateFinalizerLogic(final String name, final String version, final String stateName, final String finalizerLogicName) { return policyFacade.deletePolicyStateFinalizerLogic(name, version, stateName, finalizerLogicName); } @@ -941,7 +941,7 @@ public final class ApexModelImpl implements ApexModel { */ @Override // CHECKSTYLE:OFF: checkstyle:parameterNumber - public ApexAPIResult createPolicyStateTaskRef(final String name, final String version, final String stateName, + public ApexApiResult createPolicyStateTaskRef(final String name, final String version, final String stateName, final String taskLocalName, final String taskName, final String taskVersion, final String outputType, final String outputName) { return policyFacade.createPolicyStateTaskRef(name, version, stateName, taskLocalName, taskName, taskVersion, @@ -956,7 +956,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, java.lang.String, java.lang.String, java.lang.String) */ @Override - public ApexAPIResult listPolicyStateTaskRef(final String name, final String version, final String stateName, + public ApexApiResult listPolicyStateTaskRef(final String name, final String version, final String stateName, final String taskName, final String taskVersion) { return policyFacade.listPolicyStateTaskRef(name, version, stateName, taskName, taskVersion); } @@ -968,7 +968,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, java.lang.String, java.lang.String, java.lang.String) */ @Override - public ApexAPIResult deletePolicyStateTaskRef(final String name, final String version, final String stateName, + public ApexApiResult deletePolicyStateTaskRef(final String name, final String version, final String stateName, final String taskName, final String taskVersion) { return policyFacade.deletePolicyStateTaskRef(name, version, stateName, taskName, taskVersion); } @@ -981,7 +981,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, java.lang.String, java.lang.String, java.lang.String) */ @Override - public ApexAPIResult createPolicyStateContextRef(final String name, final String version, final String stateName, + public ApexApiResult createPolicyStateContextRef(final String name, final String version, final String stateName, final String contextAlbumName, final String contextAlbumVersion) { return policyFacade.createPolicyStateContextRef(name, version, stateName, contextAlbumName, contextAlbumVersion); @@ -994,7 +994,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, java.lang.String, java.lang.String, java.lang.String) */ @Override - public ApexAPIResult listPolicyStateContextRef(final String name, final String version, final String stateName, + public ApexApiResult listPolicyStateContextRef(final String name, final String version, final String stateName, final String contextAlbumName, final String contextAlbumVersion) { return policyFacade.listPolicyStateContextRef(name, version, stateName, contextAlbumName, contextAlbumVersion); } @@ -1007,7 +1007,7 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, java.lang.String, java.lang.String, java.lang.String) */ @Override - public ApexAPIResult deletePolicyStateContextRef(final String name, final String version, final String stateName, + public ApexApiResult deletePolicyStateContextRef(final String name, final String version, final String stateName, final String contextAlbumName, final String contextAlbumVersion) { return policyFacade.deletePolicyStateContextRef(name, version, stateName, contextAlbumName, contextAlbumVersion); @@ -1019,7 +1019,7 @@ public final class ApexModelImpl implements ApexModel { * @see org.onap.policy.apex.core.modelapi.ApexModel#loadFromString(java.lang.String) */ @Override - public ApexAPIResult loadFromString(final String modelString) { + public ApexApiResult loadFromString(final String modelString) { return modelHandlerFacade.loadFromString(modelString); } @@ -1030,7 +1030,7 @@ public final class ApexModelImpl implements ApexModel { */ @Override // CHECKSTYLE:OFF: checkstyle:HiddenField - public ApexAPIResult loadFromFile(final String fileName) { + public ApexApiResult loadFromFile(final String fileName) { this.fileName = fileName; return modelHandlerFacade.loadFromFile(fileName); } @@ -1042,7 +1042,7 @@ public final class ApexModelImpl implements ApexModel { * @see org.onap.policy.apex.auth.api.ApexModel#saveToFile(java.lang.String, boolean) */ @Override - public ApexAPIResult saveToFile(final String saveFileName, final boolean xmlFlag) { + public ApexApiResult saveToFile(final String saveFileName, final boolean xmlFlag) { if (saveFileName == null) { return modelHandlerFacade.saveToFile(fileName, xmlFlag); } else { @@ -1057,9 +1057,9 @@ public final class ApexModelImpl implements ApexModel { * java.lang.String, org.onap.policy.apex.model.basicmodel.dao.DaoParameters) */ @Override - public ApexAPIResult loadFromDatabase(final String modelName, final String modelVersion, - final DaoParameters DaoParameters) { - return modelHandlerFacade.loadFromDatabase(modelName, modelVersion, DaoParameters); + public ApexApiResult loadFromDatabase(final String modelName, final String modelVersion, + final DaoParameters daoParameters) { + return modelHandlerFacade.loadFromDatabase(modelName, modelVersion, daoParameters); } /* @@ -1069,8 +1069,8 @@ public final class ApexModelImpl implements ApexModel { * basicmodel. dao.DaoParameters) */ @Override - public ApexAPIResult saveToDatabase(final DaoParameters DaoParameters) { - return modelHandlerFacade.saveToDatabase(DaoParameters); + public ApexApiResult saveToDatabase(final DaoParameters daoParameters) { + return modelHandlerFacade.saveToDatabase(daoParameters); } /* @@ -1079,8 +1079,8 @@ public final class ApexModelImpl implements ApexModel { * @see org.onap.policy.apex.auth.api.ApexModel#readFromURL(java.lang.String) */ @Override - public ApexAPIResult readFromURL(final String urlString) { - return modelHandlerFacade.readFromURL(urlString); + public ApexApiResult readFromUrl(final String urlString) { + return modelHandlerFacade.readFromUrl(urlString); } /* @@ -1089,8 +1089,8 @@ public final class ApexModelImpl implements ApexModel { * @see org.onap.policy.apex.auth.api.ApexModel#writeToURL(java.lang.String, boolean) */ @Override - public ApexAPIResult writeToURL(final String urlString, final boolean xmlFlag) { - return modelHandlerFacade.writeToURL(urlString, xmlFlag); + public ApexApiResult writeToUrl(final String urlString, final boolean xmlFlag) { + return modelHandlerFacade.writeToUrl(urlString, xmlFlag); } /* @@ -1099,7 +1099,7 @@ public final class ApexModelImpl implements ApexModel { * @see org.onap.policy.apex.auth.api.ApexModel#analyse() */ @Override - public ApexAPIResult analyse() { + public ApexApiResult analyse() { return modelHandlerFacade.analyse(); } @@ -1109,7 +1109,7 @@ public final class ApexModelImpl implements ApexModel { * @see org.onap.policy.apex.auth.api.ApexModel#validate() */ @Override - public ApexAPIResult validate() { + public ApexApiResult validate() { return modelHandlerFacade.validate(); } @@ -1119,7 +1119,7 @@ public final class ApexModelImpl implements ApexModel { * @see org.onap.policy.apex.auth.api.ApexModel#compare(java.lang.String, boolean, boolean) */ @Override - public ApexAPIResult compare(final String otherModelFileName, final boolean diffsOnly, final boolean keysOnly) { + public ApexApiResult compare(final String otherModelFileName, final boolean diffsOnly, final boolean keysOnly) { return modelHandlerFacade.compare(otherModelFileName, diffsOnly, keysOnly); } @@ -1130,7 +1130,7 @@ public final class ApexModelImpl implements ApexModel { * boolean, boolean) */ @Override - public ApexAPIResult compareWithString(final String otherModelString, final boolean diffsOnly, + public ApexApiResult compareWithString(final String otherModelString, final boolean diffsOnly, final boolean keysOnly) { return modelHandlerFacade.compareWithString(otherModelString, diffsOnly, keysOnly); } @@ -1141,7 +1141,7 @@ public final class ApexModelImpl implements ApexModel { * @see org.onap.policy.apex.auth.api.ApexModel#split(java.lang.String, java.lang.String) */ @Override - public ApexAPIResult split(final String targetModelFileName, final String splitOutPolicies) { + public ApexApiResult split(final String targetModelFileName, final String splitOutPolicies) { return modelHandlerFacade.split(targetModelFileName, splitOutPolicies); } @@ -1151,7 +1151,7 @@ public final class ApexModelImpl implements ApexModel { * @see org.onap.policy.apex.core.modelapi.ApexModel#split(java.lang.String) */ @Override - public ApexAPIResult split(final String splitOutPolicies) { + public ApexApiResult split(final String splitOutPolicies) { return modelHandlerFacade.split(splitOutPolicies); } @@ -1161,7 +1161,7 @@ public final class ApexModelImpl implements ApexModel { * @see org.onap.policy.apex.auth.api.ApexModel#merge(java.lang.String, boolean) */ @Override - public ApexAPIResult merge(final String mergeInModelFileName, final boolean keepOriginal) { + public ApexApiResult merge(final String mergeInModelFileName, final boolean keepOriginal) { return modelHandlerFacade.merge(mergeInModelFileName, keepOriginal); } @@ -1171,7 +1171,7 @@ public final class ApexModelImpl implements ApexModel { * @see org.onap.policy.apex.core.modelapi.ApexModel#mergeWithString(java.lang.String, boolean) */ @Override - public ApexAPIResult mergeWithString(final String otherModelString, final boolean keepOriginal) { + public ApexApiResult mergeWithString(final String otherModelString, final boolean keepOriginal) { return modelHandlerFacade.mergeWithString(otherModelString, keepOriginal); } diff --git a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ContextAlbumFacade.java b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ContextAlbumFacade.java index 840242569..ad5b74c3a 100644 --- a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ContextAlbumFacade.java +++ b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ContextAlbumFacade.java @@ -28,7 +28,7 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult; import org.onap.policy.apex.model.basicmodel.handling.ApexModelStringWriter; import org.onap.policy.apex.model.contextmodel.concepts.AxContextAlbum; import org.onap.policy.apex.model.contextmodel.concepts.AxContextSchema; -import org.onap.policy.apex.model.modelapi.ApexAPIResult; +import org.onap.policy.apex.model.modelapi.ApexApiResult; import org.onap.policy.apex.model.modelapi.ApexModel; /** @@ -86,7 +86,7 @@ public class ContextAlbumFacade { * @return result of the operation */ // CHECKSTYLE:OFF: checkstyle:parameterNumber - public ApexAPIResult createContextAlbum(final String name, final String version, final String scope, + public ApexApiResult createContextAlbum(final String name, final String version, final String scope, final String writable, final String contextSchemaName, final String contextSchemaVersion, final String uuid, final String description) { try { @@ -99,14 +99,14 @@ public class ContextAlbumFacade { } if (apexModel.getPolicyModel().getAlbums().getAlbumsMap().containsKey(key)) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_EXISTS, CONCEPT + key.getId() + " already exists"); } final AxContextSchema schema = apexModel.getPolicyModel().getSchemas().get(contextSchemaName, contextSchemaVersion); if (schema == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + contextSchemaName + ':' + contextSchemaVersion + DOES_NOT_EXIST); } @@ -129,7 +129,7 @@ public class ContextAlbumFacade { return keyInformationFacade.createKeyInformation(name, version, uuid, description); } } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } // CHECKSTYLE:ON: checkstyle:parameterNumber @@ -150,13 +150,13 @@ public class ContextAlbumFacade { * @return result of the operation */ // CHECKSTYLE:OFF: checkstyle:parameterNumber - public ApexAPIResult updateContextAlbum(final String name, final String version, final String scope, + public ApexApiResult updateContextAlbum(final String name, final String version, final String scope, final String writable, final String contextSchemaName, final String contextSchemaVersion, final String uuid, final String description) { try { final AxContextAlbum contextAlbum = apexModel.getPolicyModel().getAlbums().get(name, version); if (contextAlbum == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } @@ -175,7 +175,7 @@ public class ContextAlbumFacade { final AxContextSchema schema = apexModel.getPolicyModel().getSchemas().get(contextSchemaName, contextSchemaVersion); if (schema == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + contextSchemaName + ':' + contextSchemaVersion + DOES_NOT_EXIST); } contextAlbum.setItemSchema(schema.getKey()); @@ -183,7 +183,7 @@ public class ContextAlbumFacade { return keyInformationFacade.updateKeyInformation(name, version, uuid, description); } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } // CHECKSTYLE:ON: checkstyle:parameterNumber @@ -195,22 +195,22 @@ public class ContextAlbumFacade { * @param version starting version of the context album, set to null to list all versions * @return result of the operation */ - public ApexAPIResult listContextAlbum(final String name, final String version) { + public ApexApiResult listContextAlbum(final String name, final String version) { try { final Set<AxContextAlbum> contextAlbumSet = apexModel.getPolicyModel().getAlbums().getAll(name, version); if (name != null && contextAlbumSet.isEmpty()) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT_S + name + ':' + version + DO_ES_NOT_EXIST); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); for (final AxContextAlbum contextAlbum : contextAlbumSet) { result.addMessage(new ApexModelStringWriter<AxContextAlbum>(false).writeString(contextAlbum, AxContextAlbum.class, jsonMode)); } return result; } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -221,25 +221,25 @@ public class ContextAlbumFacade { * @param version version of the context album, set to null to delete versions * @return result of the operation */ - public ApexAPIResult deleteContextAlbum(final String name, final String version) { + public ApexApiResult deleteContextAlbum(final String name, final String version) { try { if (version != null) { final AxArtifactKey key = new AxArtifactKey(name, version); if (apexModel.getPolicyModel().getAlbums().getAlbumsMap().remove(key) != null) { - return new ApexAPIResult(); + return new ApexApiResult(); } else { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + key.getId() + DOES_NOT_EXIST); } } final Set<AxContextAlbum> contextAlbumSet = apexModel.getPolicyModel().getAlbums().getAll(name, version); if (contextAlbumSet.isEmpty()) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT_S + name + ':' + version + DO_ES_NOT_EXIST); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); for (final AxContextAlbum contextAlbum : contextAlbumSet) { result.addMessage(new ApexModelStringWriter<AxContextAlbum>(false).writeString(contextAlbum, AxContextAlbum.class, jsonMode)); @@ -248,7 +248,7 @@ public class ContextAlbumFacade { } return result; } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -259,15 +259,15 @@ public class ContextAlbumFacade { * @param version starting version of the context album, set to null to list all versions * @return result of the operation */ - public ApexAPIResult validateContextAlbum(final String name, final String version) { + public ApexApiResult validateContextAlbum(final String name, final String version) { try { final Set<AxContextAlbum> contextAlbumSet = apexModel.getPolicyModel().getAlbums().getAll(name, version); if (contextAlbumSet.isEmpty()) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT_S + name + ':' + version + DO_ES_NOT_EXIST); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); for (final AxContextAlbum contextAlbum : contextAlbumSet) { final AxValidationResult validationResult = contextAlbum.validate(new AxValidationResult()); result.addMessage(new ApexModelStringWriter<AxArtifactKey>(false).writeString(contextAlbum.getKey(), @@ -276,7 +276,7 @@ public class ContextAlbumFacade { } return result; } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } } diff --git a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ContextSchemaFacade.java b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ContextSchemaFacade.java index 620f229f1..6bcf8ecbf 100644 --- a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ContextSchemaFacade.java +++ b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ContextSchemaFacade.java @@ -27,7 +27,7 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult; import org.onap.policy.apex.model.basicmodel.handling.ApexModelStringWriter; import org.onap.policy.apex.model.contextmodel.concepts.AxContextSchema; -import org.onap.policy.apex.model.modelapi.ApexAPIResult; +import org.onap.policy.apex.model.modelapi.ApexApiResult; import org.onap.policy.apex.model.modelapi.ApexModel; import org.onap.policy.apex.model.utilities.Assertions; @@ -37,13 +37,13 @@ import org.onap.policy.apex.model.utilities.Assertions; * @author Liam Fallon (liam.fallon@ericsson.com) */ public class ContextSchemaFacade { - private static final String CONCEPT = "concept "; - private static final String CONCEPT_S = "concept(s) "; + private static final String CONCEPT = "concept "; + private static final String CONCEPT_S = "concept(s) "; private static final String DOES_NOT_EXIST = " does not exist"; - private static final String DO_ES_NOT_EXIST = " do(es) not exist"; - private static final String ALREADY_EXISTS = " already exists"; + private static final String DO_ES_NOT_EXIST = " do(es) not exist"; + private static final String ALREADY_EXISTS = " already exists"; - // Apex model we're working towards + // Apex model we're working towards private final ApexModel apexModel; // Properties to use for the model @@ -81,8 +81,8 @@ public class ContextSchemaFacade { * @param description context schema description, set to null to generate a description * @return result of the operation */ - public ApexAPIResult createContextSchema(final String name, final String version, final String schemaFlavour, final String schemaDefinition, - final String uuid, final String description) { + public ApexApiResult createContextSchema(final String name, final String version, final String schemaFlavour, + final String schemaDefinition, final String uuid, final String description) { try { Assertions.argumentNotNull(schemaFlavour, "schemaFlavour may not be null"); @@ -90,26 +90,24 @@ public class ContextSchemaFacade { key.setName(name); if (version != null) { key.setVersion(version); - } - else { + } else { key.setVersion(apexProperties.getProperty("DEFAULT_CONCEPT_VERSION")); } if (apexModel.getPolicyModel().getSchemas().getSchemasMap().containsKey(key)) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, CONCEPT + key.getId() + ALREADY_EXISTS); + return new ApexApiResult(ApexApiResult.Result.CONCEPT_EXISTS, CONCEPT + key.getId() + ALREADY_EXISTS); } - apexModel.getPolicyModel().getSchemas().getSchemasMap().put(key, new AxContextSchema(key, schemaFlavour, schemaDefinition)); + apexModel.getPolicyModel().getSchemas().getSchemasMap().put(key, + new AxContextSchema(key, schemaFlavour, schemaDefinition)); if (apexModel.getPolicyModel().getKeyInformation().getKeyInfoMap().containsKey(key)) { return keyInformationFacade.updateKeyInformation(name, version, uuid, description); - } - else { + } else { return keyInformationFacade.createKeyInformation(name, version, uuid, description); } - } - catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + } catch (final Exception e) { + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -124,12 +122,13 @@ public class ContextSchemaFacade { * @param description context schema description, set to null to not update * @return result of the operation */ - public ApexAPIResult updateContextSchema(final String name, final String version, final String schemaFlavour, final String schemaDefinition, - final String uuid, final String description) { + public ApexApiResult updateContextSchema(final String name, final String version, final String schemaFlavour, + final String schemaDefinition, final String uuid, final String description) { try { final AxContextSchema schema = apexModel.getPolicyModel().getSchemas().get(name, version); if (schema == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, + CONCEPT + name + ':' + version + DOES_NOT_EXIST); } if (schemaFlavour != null) { @@ -141,9 +140,8 @@ public class ContextSchemaFacade { } return keyInformationFacade.updateKeyInformation(name, version, uuid, description); - } - catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + } catch (final Exception e) { + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -154,21 +152,22 @@ public class ContextSchemaFacade { * @param version starting version of the context schema, set to null to list all versions * @return result of the operation */ - public ApexAPIResult listContextSchemas(final String name, final String version) { + public ApexApiResult listContextSchemas(final String name, final String version) { try { final Set<AxContextSchema> schemaSet = apexModel.getPolicyModel().getSchemas().getAll(name, version); if (name != null && schemaSet.isEmpty()) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, CONCEPT_S + name + ':' + version + DO_ES_NOT_EXIST); + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, + CONCEPT_S + name + ':' + version + DO_ES_NOT_EXIST); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); for (final AxContextSchema schema : schemaSet) { - result.addMessage(new ApexModelStringWriter<AxContextSchema>(false).writeString(schema, AxContextSchema.class, jsonMode)); + result.addMessage(new ApexModelStringWriter<AxContextSchema>(false).writeString(schema, + AxContextSchema.class, jsonMode)); } return result; - } - catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + } catch (final Exception e) { + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -179,35 +178,38 @@ public class ContextSchemaFacade { * @param version version of the context schema, set to null to delete all versions * @return result of the operation */ - public ApexAPIResult deleteContextSchema(final String name, final String version) { + public ApexApiResult deleteContextSchema(final String name, final String version) { try { if (version != null) { final AxArtifactKey key = new AxArtifactKey(name, version); - final AxContextSchema removedSchema = apexModel.getPolicyModel().getSchemas().getSchemasMap().remove(key); + final AxContextSchema removedSchema = apexModel.getPolicyModel().getSchemas().getSchemasMap() + .remove(key); if (removedSchema != null) { - return new ApexAPIResult(ApexAPIResult.RESULT.SUCCESS, - new ApexModelStringWriter<AxContextSchema>(false).writeString(removedSchema, AxContextSchema.class, jsonMode)); - } - else { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, CONCEPT + key.getId() + DOES_NOT_EXIST); + return new ApexApiResult(ApexApiResult.Result.SUCCESS, + new ApexModelStringWriter<AxContextSchema>(false).writeString(removedSchema, + AxContextSchema.class, jsonMode)); + } else { + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, + CONCEPT + key.getId() + DOES_NOT_EXIST); } } final Set<AxContextSchema> schemaSet = apexModel.getPolicyModel().getSchemas().getAll(name, version); if (schemaSet.isEmpty()) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, CONCEPT_S + name + ':' + version + DO_ES_NOT_EXIST); + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, + CONCEPT_S + name + ':' + version + DO_ES_NOT_EXIST); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); for (final AxContextSchema schema : schemaSet) { - result.addMessage(new ApexModelStringWriter<AxContextSchema>(false).writeString(schema, AxContextSchema.class, jsonMode)); + result.addMessage(new ApexModelStringWriter<AxContextSchema>(false).writeString(schema, + AxContextSchema.class, jsonMode)); apexModel.getPolicyModel().getSchemas().getSchemasMap().remove(schema.getKey()); keyInformationFacade.deleteKeyInformation(name, version); } return result; - } - catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + } catch (final Exception e) { + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -218,23 +220,24 @@ public class ContextSchemaFacade { * @param version starting version of the context schema, set to null to list all versions * @return result of the operation */ - public ApexAPIResult validateContextSchemas(final String name, final String version) { + public ApexApiResult validateContextSchemas(final String name, final String version) { try { final Set<AxContextSchema> schemaSet = apexModel.getPolicyModel().getSchemas().getAll(name, version); if (schemaSet.isEmpty()) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, CONCEPT_S + name + ':' + version + DO_ES_NOT_EXIST); + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, + CONCEPT_S + name + ':' + version + DO_ES_NOT_EXIST); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); for (final AxContextSchema schema : schemaSet) { final AxValidationResult validationResult = schema.validate(new AxValidationResult()); - result.addMessage(new ApexModelStringWriter<AxArtifactKey>(false).writeString(schema.getKey(), AxArtifactKey.class, jsonMode)); + result.addMessage(new ApexModelStringWriter<AxArtifactKey>(false).writeString(schema.getKey(), + AxArtifactKey.class, jsonMode)); result.addMessage(validationResult.toString()); } return result; - } - catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + } catch (final Exception e) { + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } } diff --git a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/EventFacade.java b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/EventFacade.java index 4706ff70a..645ad9a08 100644 --- a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/EventFacade.java +++ b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/EventFacade.java @@ -30,7 +30,7 @@ import org.onap.policy.apex.model.basicmodel.handling.ApexModelStringWriter; import org.onap.policy.apex.model.contextmodel.concepts.AxContextSchema; import org.onap.policy.apex.model.eventmodel.concepts.AxEvent; import org.onap.policy.apex.model.eventmodel.concepts.AxField; -import org.onap.policy.apex.model.modelapi.ApexAPIResult; +import org.onap.policy.apex.model.modelapi.ApexApiResult; import org.onap.policy.apex.model.modelapi.ApexModel; import org.onap.policy.apex.model.utilities.Assertions; @@ -87,7 +87,7 @@ public class EventFacade { * @param description event description, set to null to generate a description * @return result of the operation */ - public ApexAPIResult createEvent(final String name, final String version, final String nameSpace, + public ApexApiResult createEvent(final String name, final String version, final String nameSpace, final String source, final String target, final String uuid, final String description) { try { final AxArtifactKey key = new AxArtifactKey(); @@ -99,7 +99,7 @@ public class EventFacade { } if (apexModel.getPolicyModel().getEvents().getEventMap().containsKey(key)) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, CONCEPT + key.getId() + ALREADY_EXISTS); + return new ApexApiResult(ApexApiResult.Result.CONCEPT_EXISTS, CONCEPT + key.getId() + ALREADY_EXISTS); } final AxEvent event = new AxEvent(key); @@ -116,7 +116,7 @@ public class EventFacade { return keyInformationFacade.createKeyInformation(name, version, uuid, description); } } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -132,12 +132,12 @@ public class EventFacade { * @param description event description, set to null to not update * @return result of the operation */ - public ApexAPIResult updateEvent(final String name, final String version, final String nameSpace, + public ApexApiResult updateEvent(final String name, final String version, final String nameSpace, final String source, final String target, final String uuid, final String description) { try { final AxEvent event = apexModel.getPolicyModel().getEvents().get(name, version); if (event == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } @@ -153,7 +153,7 @@ public class EventFacade { return keyInformationFacade.updateKeyInformation(name, version, uuid, description); } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -164,22 +164,22 @@ public class EventFacade { * @param version starting version of the event, set to null to list all versions * @return result of the operation */ - public ApexAPIResult listEvent(final String name, final String version) { + public ApexApiResult listEvent(final String name, final String version) { try { final Set<AxEvent> eventSet = apexModel.getPolicyModel().getEvents().getAll(name, version); if (name != null && eventSet.isEmpty()) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT_S + name + ':' + version + DO_ES_NOT_EXIST); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); for (final AxEvent event : eventSet) { result.addMessage( new ApexModelStringWriter<AxEvent>(false).writeString(event, AxEvent.class, jsonMode)); } return result; } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -190,27 +190,27 @@ public class EventFacade { * @param version version of the event, set to null to delete all versions * @return result of the operation */ - public ApexAPIResult deleteEvent(final String name, final String version) { + public ApexApiResult deleteEvent(final String name, final String version) { try { if (version != null) { final AxArtifactKey key = new AxArtifactKey(name, version); final AxEvent removedEvent = apexModel.getPolicyModel().getEvents().getEventMap().remove(key); if (removedEvent != null) { - return new ApexAPIResult(ApexAPIResult.RESULT.SUCCESS, new ApexModelStringWriter<AxEvent>(false) + return new ApexApiResult(ApexApiResult.Result.SUCCESS, new ApexModelStringWriter<AxEvent>(false) .writeString(removedEvent, AxEvent.class, jsonMode)); } else { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + key.getId() + DOES_NOT_EXIST); } } final Set<AxEvent> eventSet = apexModel.getPolicyModel().getEvents().getAll(name, version); if (eventSet.isEmpty()) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT_S + name + ':' + version + DO_ES_NOT_EXIST); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); for (final AxEvent event : eventSet) { result.addMessage( new ApexModelStringWriter<AxEvent>(false).writeString(event, AxEvent.class, jsonMode)); @@ -219,7 +219,7 @@ public class EventFacade { } return result; } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -230,15 +230,15 @@ public class EventFacade { * @param version starting version of the event, set to null to list all versions * @return result of the operation */ - public ApexAPIResult validateEvent(final String name, final String version) { + public ApexApiResult validateEvent(final String name, final String version) { try { final Set<AxEvent> eventSet = apexModel.getPolicyModel().getEvents().getAll(name, version); if (eventSet.isEmpty()) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT_S + name + ':' + version + DO_ES_NOT_EXIST); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); for (final AxEvent event : eventSet) { final AxValidationResult validationResult = event.validate(new AxValidationResult()); result.addMessage(new ApexModelStringWriter<AxArtifactKey>(false).writeString(event.getKey(), @@ -247,7 +247,7 @@ public class EventFacade { } return result; } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -263,35 +263,35 @@ public class EventFacade { * @param optional true if the event parameter is optional, false otherwise * @return result of the operation */ - public ApexAPIResult createEventPar(final String name, final String version, final String parName, + public ApexApiResult createEventPar(final String name, final String version, final String parName, final String contextSchemaName, final String contextSchemaVersion, final boolean optional) { try { Assertions.argumentNotNull(parName, "parName may not be null"); final AxEvent event = apexModel.getPolicyModel().getEvents().get(name, version); if (event == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } final AxReferenceKey refKey = new AxReferenceKey(event.getKey(), parName); if (event.getParameterMap().containsKey(refKey.getLocalName())) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_EXISTS, CONCEPT + refKey.getId() + ALREADY_EXISTS); } final AxContextSchema schema = apexModel.getPolicyModel().getSchemas().get(contextSchemaName, contextSchemaVersion); if (schema == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + contextSchemaName + ':' + contextSchemaVersion + DOES_NOT_EXIST); } event.getParameterMap().put(refKey.getLocalName(), new AxField(refKey, schema.getKey(), optional)); - return new ApexAPIResult(); + return new ApexApiResult(); } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -303,30 +303,30 @@ public class EventFacade { * @param parName name of the parameter, set to null to list all parameters of the event * @return result of the operation */ - public ApexAPIResult listEventPar(final String name, final String version, final String parName) { + public ApexApiResult listEventPar(final String name, final String version, final String parName) { try { final AxEvent event = apexModel.getPolicyModel().getEvents().get(name, version); if (event == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } if (parName != null) { final AxField eventField = event.getParameterMap().get(parName); if (eventField != null) { - return new ApexAPIResult(ApexAPIResult.RESULT.SUCCESS, + return new ApexApiResult(ApexApiResult.Result.SUCCESS, new ApexModelStringWriter<AxField>(false).writeString(eventField, AxField.class, jsonMode)); } else { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + ':' + parName + DOES_NOT_EXIST); } } else { if (event.getParameterMap().size() == 0) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, "no parameters defined on event " + event.getKey().getId()); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); for (final AxField eventPar : event.getParameterMap().values()) { result.addMessage( new ApexModelStringWriter<AxField>(false).writeString(eventPar, AxField.class, jsonMode)); @@ -334,7 +334,7 @@ public class EventFacade { return result; } } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -346,15 +346,15 @@ public class EventFacade { * @param parName of the parameter, set to null to delete all parameters * @return result of the operation */ - public ApexAPIResult deleteEventPar(final String name, final String version, final String parName) { + public ApexApiResult deleteEventPar(final String name, final String version, final String parName) { try { final AxEvent event = apexModel.getPolicyModel().getEvents().get(name, version); if (event == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); if (parName != null) { if (event.getParameterMap().containsKey(parName)) { result.addMessage(new ApexModelStringWriter<AxField>(false) @@ -362,12 +362,12 @@ public class EventFacade { event.getParameterMap().remove(parName); return result; } else { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + ':' + parName + DOES_NOT_EXIST); } } else { if (event.getParameterMap().size() == 0) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, "no parameters defined on event " + event.getKey().getId()); } @@ -379,7 +379,7 @@ public class EventFacade { return result; } } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } } diff --git a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/KeyInformationFacade.java b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/KeyInformationFacade.java index e3e3db0c9..7cbcfc713 100644 --- a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/KeyInformationFacade.java +++ b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/KeyInformationFacade.java @@ -28,7 +28,7 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; import org.onap.policy.apex.model.basicmodel.concepts.AxKeyInfo; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult; import org.onap.policy.apex.model.basicmodel.handling.ApexModelStringWriter; -import org.onap.policy.apex.model.modelapi.ApexAPIResult; +import org.onap.policy.apex.model.modelapi.ApexApiResult; import org.onap.policy.apex.model.modelapi.ApexModel; /** @@ -76,7 +76,7 @@ public class KeyInformationFacade { * @param description key information description, set to null to generate a description * @return result of the operation */ - public ApexAPIResult createKeyInformation(final String name, final String version, final String uuid, + public ApexApiResult createKeyInformation(final String name, final String version, final String uuid, final String description) { try { final AxArtifactKey key = new AxArtifactKey(); @@ -88,7 +88,7 @@ public class KeyInformationFacade { } if (apexModel.getPolicyModel().getKeyInformation().getKeyInfoMap().containsKey(key)) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, CONCEPT + key.getId() + ALREADY_EXISTS); + return new ApexApiResult(ApexApiResult.Result.CONCEPT_EXISTS, CONCEPT + key.getId() + ALREADY_EXISTS); } final AxKeyInfo keyInfo = new AxKeyInfo(key); @@ -102,9 +102,9 @@ public class KeyInformationFacade { keyInfo.setUuid(AxKeyInfo.generateReproducibleUuid(keyInfo.getId() + keyInfo.getDescription())); } apexModel.getPolicyModel().getKeyInformation().getKeyInfoMap().put(key, keyInfo); - return new ApexAPIResult(); + return new ApexApiResult(); } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -118,12 +118,12 @@ public class KeyInformationFacade { * @param description key information description, set to null to not update * @return result of the operation */ - public ApexAPIResult updateKeyInformation(final String name, final String version, final String uuid, + public ApexApiResult updateKeyInformation(final String name, final String version, final String uuid, final String description) { try { final AxKeyInfo keyInfo = apexModel.getPolicyModel().getKeyInformation().get(name, version); if (keyInfo == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ":" + version + DOES_NOT_EXIST); } @@ -138,9 +138,9 @@ public class KeyInformationFacade { keyInfo.setUuid(AxKeyInfo.generateReproducibleUuid(keyInfo.getId() + keyInfo.getDescription())); } - return new ApexAPIResult(); + return new ApexApiResult(); } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -152,22 +152,22 @@ public class KeyInformationFacade { * all versions * @return result of the operation */ - public ApexAPIResult listKeyInformation(final String name, final String version) { + public ApexApiResult listKeyInformation(final String name, final String version) { try { final Set<AxKeyInfo> keyInfoSet = apexModel.getPolicyModel().getKeyInformation().getAll(name, version); if (name != null && keyInfoSet.isEmpty()) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT_S + name + ':' + version + DO_ES_NOT_EXIST); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); for (final AxKeyInfo keyInfo : keyInfoSet) { result.addMessage( new ApexModelStringWriter<AxKeyInfo>(false).writeString(keyInfo, AxKeyInfo.class, jsonMode)); } return result; } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -179,28 +179,28 @@ public class KeyInformationFacade { * versions * @return result of the operation */ - public ApexAPIResult deleteKeyInformation(final String name, final String version) { + public ApexApiResult deleteKeyInformation(final String name, final String version) { try { if (version != null) { final AxArtifactKey key = new AxArtifactKey(name, version); final AxKeyInfo removedKeyInfo = apexModel.getPolicyModel().getKeyInformation().getKeyInfoMap().remove(key); if (removedKeyInfo != null) { - return new ApexAPIResult(ApexAPIResult.RESULT.SUCCESS, new ApexModelStringWriter<AxKeyInfo>(false) + return new ApexApiResult(ApexApiResult.Result.SUCCESS, new ApexModelStringWriter<AxKeyInfo>(false) .writeString(removedKeyInfo, AxKeyInfo.class, jsonMode)); } else { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + key.getId() + DOES_NOT_EXIST); } } final Set<AxKeyInfo> keyInfoSet = apexModel.getPolicyModel().getKeyInformation().getAll(name, version); if (keyInfoSet.isEmpty()) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT_S + name + ':' + version + DO_ES_NOT_EXIST); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); for (final AxKeyInfo keyInfo : keyInfoSet) { result.addMessage( new ApexModelStringWriter<AxKeyInfo>(false).writeString(keyInfo, AxKeyInfo.class, jsonMode)); @@ -208,7 +208,7 @@ public class KeyInformationFacade { } return result; } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -220,15 +220,15 @@ public class KeyInformationFacade { * versions * @return result of the operation */ - public ApexAPIResult validateKeyInformation(final String name, final String version) { + public ApexApiResult validateKeyInformation(final String name, final String version) { try { final Set<AxKeyInfo> keyInfoSet = apexModel.getPolicyModel().getKeyInformation().getAll(name, version); if (keyInfoSet.isEmpty()) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT_S + name + ':' + version + DO_ES_NOT_EXIST); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); for (final AxKeyInfo keyInfo : keyInfoSet) { final AxValidationResult validationResult = keyInfo.validate(new AxValidationResult()); result.addMessage(new ApexModelStringWriter<AxArtifactKey>(false).writeString(keyInfo.getKey(), @@ -237,7 +237,7 @@ public class KeyInformationFacade { } return result; } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } diff --git a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ModelFacade.java b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ModelFacade.java index 65be2ae82..a44032634 100644 --- a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ModelFacade.java +++ b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ModelFacade.java @@ -24,7 +24,7 @@ import java.util.Properties; import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; import org.onap.policy.apex.model.basicmodel.handling.ApexModelStringWriter; -import org.onap.policy.apex.model.modelapi.ApexAPIResult; +import org.onap.policy.apex.model.modelapi.ApexApiResult; import org.onap.policy.apex.model.modelapi.ApexModel; import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel; import org.onap.policy.apex.model.utilities.Assertions; @@ -80,7 +80,7 @@ public class ModelFacade { * @param description model description, set to null to generate a description * @return result of the operation */ - public ApexAPIResult createModel(final String name, final String version, final String uuid, + public ApexApiResult createModel(final String name, final String version, final String uuid, final String description) { try { final AxArtifactKey key = new AxArtifactKey(); @@ -92,26 +92,26 @@ public class ModelFacade { if (defaultVersion != null) { key.setVersion(defaultVersion); } else { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, CONCEPT + name + NO_VERSION_SPECIFIED); + return new ApexApiResult(ApexApiResult.Result.FAILED, CONCEPT + name + NO_VERSION_SPECIFIED); } } if (!apexModel.getPolicyModel().getKey().equals(AxArtifactKey.getNullKey())) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_EXISTS, CONCEPT + apexModel.getPolicyModel().getKey().getId() + ALREADY_CREATED); } apexModel.setPolicyModel(new AxPolicyModel(key)); - ApexAPIResult result; + ApexApiResult result; result = keyInformationFacade.createKeyInformation(name, version, uuid, description); - if (result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)) { + if (result.getResult().equals(ApexApiResult.Result.SUCCESS)) { apexModel.getPolicyModel().getKeyInformation().generateKeyInfo(apexModel.getPolicyModel()); } return result; } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -124,7 +124,7 @@ public class ModelFacade { * @param description policy description, set to null to not update * @return result of the operation */ - public ApexAPIResult updateModel(final String name, final String version, final String uuid, + public ApexApiResult updateModel(final String name, final String version, final String uuid, final String description) { try { final AxArtifactKey key = new AxArtifactKey(); @@ -136,19 +136,19 @@ public class ModelFacade { if (defaultVersion != null) { key.setVersion(defaultVersion); } else { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, + return new ApexApiResult(ApexApiResult.Result.FAILED, CONCEPT + apexModel.getPolicyModel().getKey().getId() + NO_VERSION_SPECIFIED); } } if (apexModel.getPolicyModel().getKey().equals(AxArtifactKey.getNullKey())) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + apexModel.getPolicyModel().getKey().getId() + DOES_NOT_EXIST); } return keyInformationFacade.updateKeyInformation(name, version, uuid, description); } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -157,15 +157,15 @@ public class ModelFacade { * * @return the result of the operation */ - public ApexAPIResult getModelKey() { + public ApexApiResult getModelKey() { try { - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); final AxArtifactKey modelkey = apexModel.getPolicyModel().getKey(); result.addMessage(new ApexModelStringWriter<AxArtifactKey>(false).writeString(modelkey, AxArtifactKey.class, jsonMode)); return result; } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -174,14 +174,14 @@ public class ModelFacade { * * @return the result of the operation */ - public ApexAPIResult listModel() { + public ApexApiResult listModel() { try { - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); result.addMessage(new ApexModelStringWriter<AxPolicyModel>(false).writeString(apexModel.getPolicyModel(), AxPolicyModel.class, jsonMode)); return result; } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -190,7 +190,7 @@ public class ModelFacade { * * @return the result of the operation */ - public ApexAPIResult deleteModel() { + public ApexApiResult deleteModel() { // @formatter:off apexModel.getPolicyModel().getSchemas() .getSchemasMap() .clear(); apexModel.getPolicyModel().getEvents() .getEventMap() .clear(); @@ -202,6 +202,6 @@ public class ModelFacade { apexModel.setPolicyModel(new AxPolicyModel()); - return new ApexAPIResult(); + return new ApexApiResult(); } } diff --git a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ModelHandlerFacade.java b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ModelHandlerFacade.java index 5e54744d5..0f6bd0830 100644 --- a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ModelHandlerFacade.java +++ b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ModelHandlerFacade.java @@ -45,7 +45,7 @@ import org.onap.policy.apex.model.basicmodel.handling.ApexModelFileWriter; import org.onap.policy.apex.model.basicmodel.handling.ApexModelReader; import org.onap.policy.apex.model.basicmodel.handling.ApexModelStringWriter; import org.onap.policy.apex.model.basicmodel.handling.ApexModelWriter; -import org.onap.policy.apex.model.modelapi.ApexAPIResult; +import org.onap.policy.apex.model.modelapi.ApexApiResult; import org.onap.policy.apex.model.modelapi.ApexModel; import org.onap.policy.apex.model.policymodel.concepts.AxPolicy; import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel; @@ -84,8 +84,7 @@ public class ModelHandlerFacade { * * @param apexModel the apex model to manipulate * @param apexProperties properties for the model - * @param jsonMode set to true to return JSON strings in list and delete operations, otherwise - * set to false + * @param jsonMode set to true to return JSON strings in list and delete operations, otherwise set to false */ public ModelHandlerFacade(final ApexModel apexModel, final Properties apexProperties, final boolean jsonMode) { Assertions.argumentNotNull(apexModel, "apexModel may not be null"); @@ -101,15 +100,15 @@ public class ModelHandlerFacade { * @param modelString the string with the model * @return the result of the operation */ - public ApexAPIResult loadFromString(final String modelString) { + public ApexApiResult loadFromString(final String modelString) { Assertions.argumentNotNull(modelString, "modelString may not be null"); if (!apexModel.getPolicyModel().getKey().equals(AxArtifactKey.getNullKey())) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, - MODEL + apexModel.getPolicyModel().getKey().getId() + ALREADY_LOADED); + return new ApexApiResult(ApexApiResult.Result.CONCEPT_EXISTS, + MODEL + apexModel.getPolicyModel().getKey().getId() + ALREADY_LOADED); } - ApexAPIResult result = new ApexAPIResult(); + ApexApiResult result = new ApexApiResult(); AxPolicyModel newPolicyModel = loadModelFromString(modelString, result); apexModel.setPolicyModel(newPolicyModel != null ? newPolicyModel : new AxPolicyModel()); @@ -122,15 +121,15 @@ public class ModelHandlerFacade { * @param fileName the file name of the file with the model * @return the result of the operation */ - public ApexAPIResult loadFromFile(final String fileName) { + public ApexApiResult loadFromFile(final String fileName) { Assertions.argumentNotNull(fileName, FILE_NAME_MAY_NOT_BE_NULL); if (!apexModel.getPolicyModel().getKey().equals(AxArtifactKey.getNullKey())) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, - MODEL + apexModel.getPolicyModel().getKey().getId() + ALREADY_LOADED); + return new ApexApiResult(ApexApiResult.Result.CONCEPT_EXISTS, + MODEL + apexModel.getPolicyModel().getKey().getId() + ALREADY_LOADED); } - ApexAPIResult result = new ApexAPIResult(); + ApexApiResult result = new ApexApiResult(); AxPolicyModel newPolicyModel = loadModelFromFile(fileName, result); apexModel.setPolicyModel(newPolicyModel != null ? newPolicyModel : new AxPolicyModel()); @@ -141,11 +140,10 @@ public class ModelHandlerFacade { * Save an Apex model to a file. * * @param fileName the file name - * @param xmlFlag if true, save the file in XML format, otherwise save the file in the default - * JSON format + * @param xmlFlag if true, save the file in XML format, otherwise save the file in the default JSON format * @return the result of the operation */ - public ApexAPIResult saveToFile(final String fileName, final boolean xmlFlag) { + public ApexApiResult saveToFile(final String fileName, final boolean xmlFlag) { Assertions.argumentNotNull(fileName, FILE_NAME_MAY_NOT_BE_NULL); ApexModelFileWriter<AxPolicyModel> apexModelFileWriter = new ApexModelFileWriter<>(false); @@ -156,9 +154,9 @@ public class ModelHandlerFacade { } else { apexModelFileWriter.apexModelWriteJsonFile(apexModel.getPolicyModel(), AxPolicyModel.class, fileName); } - return new ApexAPIResult(); + return new ApexApiResult(); } catch (ApexException e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -166,38 +164,38 @@ public class ModelHandlerFacade { * Load an Apex model from a database. * * @param modelName the name of the model to load - * @param modelVersion the version of the model to load, loads the policy model from the - * database with this name, if more than one exist, an exception is thrown - * @param DaoParameters the parameters to use to access the database over JDBC + * @param modelVersion the version of the model to load, loads the policy model from the database with this name, if + * more than one exist, an exception is thrown + * @param daoParameters the parameters to use to access the database over JDBC * @return the result of the operation */ - public ApexAPIResult loadFromDatabase(final String modelName, final String modelVersion, - final DaoParameters DaoParameters) { + public ApexApiResult loadFromDatabase(final String modelName, final String modelVersion, + final DaoParameters daoParameters) { Assertions.argumentNotNull(modelName, "modelName may not be null"); - Assertions.argumentNotNull(DaoParameters, "DaoParameters may not be null"); + Assertions.argumentNotNull(daoParameters, "DaoParameters may not be null"); if (!apexModel.getPolicyModel().getKey().equals(AxArtifactKey.getNullKey())) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, - MODEL + apexModel.getPolicyModel().getKey().getId() + ALREADY_LOADED); + return new ApexApiResult(ApexApiResult.Result.CONCEPT_EXISTS, + MODEL + apexModel.getPolicyModel().getKey().getId() + ALREADY_LOADED); } ApexDao apexDao = null; try { - apexDao = new ApexDaoFactory().createApexDao(DaoParameters); - apexDao.init(DaoParameters); + apexDao = new ApexDaoFactory().createApexDao(daoParameters); + apexDao.init(daoParameters); // Single specific model requested if (modelVersion != null) { - AxPolicyModel daoPolicyModel = - apexDao.get(AxPolicyModel.class, new AxArtifactKey(modelName, modelVersion)); + AxPolicyModel daoPolicyModel = apexDao.get(AxPolicyModel.class, + new AxArtifactKey(modelName, modelVersion)); if (daoPolicyModel != null) { apexModel.setPolicyModel(daoPolicyModel); - return new ApexAPIResult(); + return new ApexApiResult(); } else { apexModel.setPolicyModel(new AxPolicyModel()); - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, "no policy model with name " + modelName - + " and version " + modelVersion + FOUND_IN_DATABASE); + return new ApexApiResult(ApexApiResult.Result.FAILED, "no policy model with name " + modelName + + " and version " + modelVersion + FOUND_IN_DATABASE); } } // Fishing expedition @@ -205,7 +203,7 @@ public class ModelHandlerFacade { return searchInDatabase(modelName, apexDao, apexModel); } } catch (ApexException | ApexRuntimeException e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } finally { if (apexDao != null) { apexDao.close(); @@ -221,7 +219,7 @@ public class ModelHandlerFacade { * @param apexModel the APEX model we are loading the found model into * @return the result of the operation */ - private ApexAPIResult searchInDatabase(String modelName, ApexDao apexDao, ApexModel apexModel) { + private ApexApiResult searchInDatabase(String modelName, ApexDao apexDao, ApexModel apexModel) { AxPolicyModel foundPolicyModel = null; List<AxPolicyModel> policyModelList = apexDao.getAll(AxPolicyModel.class); @@ -230,39 +228,39 @@ public class ModelHandlerFacade { if (foundPolicyModel == null) { foundPolicyModel = dbPolicyModel; } else { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, - "more than one policy model with name " + modelName + FOUND_IN_DATABASE); + return new ApexApiResult(ApexApiResult.Result.FAILED, + "more than one policy model with name " + modelName + FOUND_IN_DATABASE); } } } if (foundPolicyModel != null) { apexModel.setPolicyModel(foundPolicyModel); - return new ApexAPIResult(); + return new ApexApiResult(); } else { apexModel.setPolicyModel(new AxPolicyModel()); - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, - "no policy model with name " + modelName + FOUND_IN_DATABASE); + return new ApexApiResult(ApexApiResult.Result.FAILED, + "no policy model with name " + modelName + FOUND_IN_DATABASE); } } /** * Save an Apex model to a database. * - * @param DaoParameters the parameters to use to access the database over JDBC + * @param daoParameters the parameters to use to access the database over JDBC * @return the result of the operation */ - public ApexAPIResult saveToDatabase(final DaoParameters DaoParameters) { + public ApexApiResult saveToDatabase(final DaoParameters daoParameters) { ApexDao apexDao = null; try { - apexDao = new ApexDaoFactory().createApexDao(DaoParameters); - apexDao.init(DaoParameters); + apexDao = new ApexDaoFactory().createApexDao(daoParameters); + apexDao.init(daoParameters); apexDao.create(apexModel.getPolicyModel()); - return new ApexAPIResult(); + return new ApexApiResult(); } catch (ApexException e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } finally { if (apexDao != null) { apexDao.close(); @@ -276,19 +274,19 @@ public class ModelHandlerFacade { * @param urlString the url string * @return the result of the operation */ - public ApexAPIResult readFromURL(final String urlString) { + public ApexApiResult readFromUrl(final String urlString) { Assertions.argumentNotNull(urlString, "urlString may not be null"); if (!apexModel.getPolicyModel().getKey().equals(AxArtifactKey.getNullKey())) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, - MODEL + apexModel.getPolicyModel().getKey().getId() + ALREADY_LOADED); + return new ApexApiResult(ApexApiResult.Result.CONCEPT_EXISTS, + MODEL + apexModel.getPolicyModel().getKey().getId() + ALREADY_LOADED); } - URL apexModelURL; + URL apexModelUrl; try { - apexModelURL = new URL(urlString); + apexModelUrl = new URL(urlString); } catch (MalformedURLException e) { - ApexAPIResult result = new ApexAPIResult(ApexAPIResult.RESULT.FAILED); + ApexApiResult result = new ApexApiResult(ApexApiResult.Result.FAILED); result.addMessage("URL string " + urlString + " is not a valid URL"); result.addThrowable(e); return result; @@ -297,12 +295,12 @@ public class ModelHandlerFacade { try { ApexModelReader<AxPolicyModel> apexModelReader = new ApexModelReader<>(AxPolicyModel.class); apexModelReader.setValidateFlag(false); - AxPolicyModel newPolicyModel = apexModelReader.read(apexModelURL.openStream()); + AxPolicyModel newPolicyModel = apexModelReader.read(apexModelUrl.openStream()); apexModel.setPolicyModel(newPolicyModel != null ? newPolicyModel : new AxPolicyModel()); - return new ApexAPIResult(); + return new ApexApiResult(); } catch (ApexModelException | IOException e) { apexModel.setPolicyModel(new AxPolicyModel()); - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -310,18 +308,17 @@ public class ModelHandlerFacade { * Write an APEX model to a location identified by a URL. * * @param urlString the URL to read the model from - * @param xmlFlag if true, save the file in XML format, otherwise save the file in the default - * JSON format + * @param xmlFlag if true, save the file in XML format, otherwise save the file in the default JSON format * @return the result of the operation */ - public ApexAPIResult writeToURL(final String urlString, final boolean xmlFlag) { + public ApexApiResult writeToUrl(final String urlString, final boolean xmlFlag) { Assertions.argumentNotNull(urlString, "urlString may not be null"); - URL apexModelURL; + URL apexModelUrl; try { - apexModelURL = new URL(urlString); + apexModelUrl = new URL(urlString); } catch (MalformedURLException e) { - ApexAPIResult result = new ApexAPIResult(ApexAPIResult.RESULT.FAILED); + ApexApiResult result = new ApexApiResult(ApexApiResult.Result.FAILED); result.addMessage("URL string " + urlString + " is not a valid URL"); result.addThrowable(e); return result; @@ -333,13 +330,13 @@ public class ModelHandlerFacade { apexModelWriter.setJsonOutput(!xmlFlag); // Open the URL for output and write the model - URLConnection urlConnection = apexModelURL.openConnection(); + URLConnection urlConnection = apexModelUrl.openConnection(); urlConnection.setDoOutput(true); apexModelWriter.write(apexModel.getPolicyModel(), urlConnection.getOutputStream()); - return new ApexAPIResult(); + return new ApexApiResult(); } catch (ApexModelException | IOException e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -348,9 +345,9 @@ public class ModelHandlerFacade { * * @return the result of the operation */ - public ApexAPIResult analyse() { + public ApexApiResult analyse() { PolicyAnalysisResult analysisResult = new PolicyAnalyser().analyse(apexModel.getPolicyModel()); - return new ApexAPIResult(ApexAPIResult.RESULT.SUCCESS, analysisResult.toString()); + return new ApexApiResult(ApexApiResult.Result.SUCCESS, analysisResult.toString()); } /** @@ -358,20 +355,20 @@ public class ModelHandlerFacade { * * @return the result of the operation */ - public ApexAPIResult validate() { - ApexAPIResult result = new ApexAPIResult(); + public ApexApiResult validate() { + ApexApiResult result = new ApexApiResult(); try { AxValidationResult validationResult = apexModel.getPolicyModel().validate(new AxValidationResult()); if (!validationResult.isValid()) { - result.setResult(ApexAPIResult.RESULT.FAILED); + result.setResult(ApexApiResult.Result.FAILED); } result.addMessage(new ApexModelStringWriter<AxArtifactKey>(false) - .writeString(apexModel.getPolicyModel().getKey(), AxArtifactKey.class, jsonMode)); + .writeString(apexModel.getPolicyModel().getKey(), AxArtifactKey.class, jsonMode)); result.addMessage(validationResult.toString()); return result; } catch (Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -380,27 +377,26 @@ public class ModelHandlerFacade { * * @param otherModelFileName the file name of the other model * @param diffsOnly only returns differences between the model when set - * @param keysOnly only returns the keys that are different when set, when not set values are - * also returned + * @param keysOnly only returns the keys that are different when set, when not set values are also returned * @return the result of the operation */ - public ApexAPIResult compare(final String otherModelFileName, final boolean diffsOnly, final boolean keysOnly) { - ApexAPIResult result = new ApexAPIResult(); + public ApexApiResult compare(final String otherModelFileName, final boolean diffsOnly, final boolean keysOnly) { + ApexApiResult result = new ApexApiResult(); try { AxPolicyModel otherPolicyModel = loadModelFromFile(otherModelFileName, result); - if (!result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)) { + if (!result.getResult().equals(ApexApiResult.Result.SUCCESS)) { return result; } - PolicyModelComparer policyModelComparer = - new PolicyModelComparer(apexModel.getPolicyModel(), otherPolicyModel); + PolicyModelComparer policyModelComparer = new PolicyModelComparer(apexModel.getPolicyModel(), + otherPolicyModel); result.addMessage(new ApexModelStringWriter<AxArtifactKey>(false) - .writeString(apexModel.getPolicyModel().getKey(), AxArtifactKey.class, jsonMode)); + .writeString(apexModel.getPolicyModel().getKey(), AxArtifactKey.class, jsonMode)); result.addMessage(policyModelComparer.toString()); return result; } catch (Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -409,42 +405,40 @@ public class ModelHandlerFacade { * * @param otherModelString the other model as a string * @param diffsOnly only returns differences between the model when set - * @param keysOnly only returns the keys that are different when set, when not set values are - * also returned + * @param keysOnly only returns the keys that are different when set, when not set values are also returned * @return the result of the operation */ - public ApexAPIResult compareWithString(final String otherModelString, final boolean diffsOnly, - final boolean keysOnly) { - ApexAPIResult result = new ApexAPIResult(); + public ApexApiResult compareWithString(final String otherModelString, final boolean diffsOnly, + final boolean keysOnly) { + ApexApiResult result = new ApexApiResult(); try { AxPolicyModel otherPolicyModel = loadModelFromString(otherModelString, result); - if (!result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)) { + if (!result.getResult().equals(ApexApiResult.Result.SUCCESS)) { return result; } - PolicyModelComparer policyModelComparer = - new PolicyModelComparer(apexModel.getPolicyModel(), otherPolicyModel); + PolicyModelComparer policyModelComparer = new PolicyModelComparer(apexModel.getPolicyModel(), + otherPolicyModel); result.addMessage(new ApexModelStringWriter<AxArtifactKey>(false) - .writeString(apexModel.getPolicyModel().getKey(), AxArtifactKey.class, jsonMode)); + .writeString(apexModel.getPolicyModel().getKey(), AxArtifactKey.class, jsonMode)); result.addMessage(policyModelComparer.toString()); return result; } catch (Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } /** - * Split out a sub model from an Apex model that contains a given subset of the policies in the - * original model. + * Split out a sub model from an Apex model that contains a given subset of the policies in the original model. * - * @param targetModelName the file name of the target model in which to store the model split - * out from the original model - * @param splitOutPolicies the policies form the original model to include in the split out - * model, specified as a comma delimited list of policy names + * @param targetModelName the file name of the target model in which to store the model split out from the original + * model + * @param splitOutPolicies the policies form the original model to include in the split out model, specified as a + * comma delimited list of policy names * @return the result of the operation */ - public ApexAPIResult split(final String targetModelName, final String splitOutPolicies) { + public ApexApiResult split(final String targetModelName, final String splitOutPolicies) { Set<AxArtifactKey> requiredPolicySet = new LinkedHashSet<>(); // Split the policy names on comma @@ -458,40 +452,40 @@ public class ModelHandlerFacade { if (requiredPolicy != null) { requiredPolicySet.add(requiredPolicy.getKey()); } else { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, - "policy for policy name " + policyName + " not found in model"); + return new ApexApiResult(ApexApiResult.Result.FAILED, + "policy for policy name " + policyName + " not found in model"); } } try { - AxPolicyModel splitPolicyModel = - PolicyModelSplitter.getSubPolicyModel(apexModel.getPolicyModel(), requiredPolicySet, false); + AxPolicyModel splitPolicyModel = PolicyModelSplitter.getSubPolicyModel(apexModel.getPolicyModel(), + requiredPolicySet, false); ApexModelFileWriter<AxPolicyModel> apexModelFileWriter = new ApexModelFileWriter<>(false); apexModelFileWriter.apexModelWriteJsonFile(splitPolicyModel, AxPolicyModel.class, targetModelName); - return new ApexAPIResult(); + return new ApexApiResult(); } catch (ApexException e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } /** - * Split out a sub model from an Apex model that contains a given subset of the policies in the - * original model, return the split model in the result as a string. + * Split out a sub model from an Apex model that contains a given subset of the policies in the original model, + * return the split model in the result as a string. * - * @param splitOutPolicies the policies form the original model to include in the split out - * model, specified as a comma delimited list of policy names + * @param splitOutPolicies the policies form the original model to include in the split out model, specified as a + * comma delimited list of policy names * @return the result of the operation */ - public ApexAPIResult split(final String splitOutPolicies) { - ApexAPIResult splitResult = new ApexAPIResult(); + public ApexApiResult split(final String splitOutPolicies) { + ApexApiResult splitResult = new ApexApiResult(); File tempSplitPolicyFile = null; try { tempSplitPolicyFile = File.createTempFile("ApexTempPolicy", null); // Split the policy into a temporary file splitResult = split(tempSplitPolicyFile.getCanonicalPath(), splitOutPolicies); - if (splitResult.isNOK()) { + if (splitResult.isNok()) { return splitResult; } @@ -502,8 +496,8 @@ public class ModelHandlerFacade { splitResult.addMessage(splitPolicyModelString); return splitResult; } catch (Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, - "split of policy model " + apexModel.getPolicyModel().getId() + " failed", e); + return new ApexApiResult(ApexApiResult.Result.FAILED, + "split of policy model " + apexModel.getPolicyModel().getId() + " failed", e); } finally { if (tempSplitPolicyFile != null) { try { @@ -519,26 +513,26 @@ public class ModelHandlerFacade { * Merge two Apex models together. * * @param mergeInModelName the file name of the model to merge into the current model - * @param keepOriginal if this flag is set to true, if a concept exists in both models, the - * original model copy of that concept is kept, if the flag is set to false, then the - * copy of the concept from the mergeInModel overwrites the concept in the original model + * @param keepOriginal if this flag is set to true, if a concept exists in both models, the original model copy of + * that concept is kept, if the flag is set to false, then the copy of the concept from the mergeInModel + * overwrites the concept in the original model * @return the result of the operation */ - public ApexAPIResult merge(final String mergeInModelName, final boolean keepOriginal) { - ApexAPIResult result = new ApexAPIResult(); + public ApexApiResult merge(final String mergeInModelName, final boolean keepOriginal) { + ApexApiResult result = new ApexApiResult(); AxPolicyModel mergeInPolicyModel = loadModelFromFile(mergeInModelName, result); - if (!result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)) { + if (!result.getResult().equals(ApexApiResult.Result.SUCCESS)) { return result; } try { AxPolicyModel mergedPolicyModel = PolicyModelMerger.getMergedPolicyModel(apexModel.getPolicyModel(), - mergeInPolicyModel, keepOriginal, false); + mergeInPolicyModel, keepOriginal, false); apexModel.setPolicyModel(mergedPolicyModel != null ? mergedPolicyModel : new AxPolicyModel()); - return new ApexAPIResult(); + return new ApexApiResult(); } catch (ApexModelException e) { apexModel.setPolicyModel(new AxPolicyModel()); - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -546,26 +540,26 @@ public class ModelHandlerFacade { * Merge two Apex models together. * * @param otherModelString the model to merge as a string - * @param keepOriginal if this flag is set to true, if a concept exists in both models, the - * original model copy of that concept is kept, if the flag is set to false, then the - * copy of the concept from the mergeInModel overwrites the concept in the original model + * @param keepOriginal if this flag is set to true, if a concept exists in both models, the original model copy of + * that concept is kept, if the flag is set to false, then the copy of the concept from the mergeInModel + * overwrites the concept in the original model * @return the result of the operation */ - public ApexAPIResult mergeWithString(final String otherModelString, final boolean keepOriginal) { - ApexAPIResult result = new ApexAPIResult(); + public ApexApiResult mergeWithString(final String otherModelString, final boolean keepOriginal) { + ApexApiResult result = new ApexApiResult(); AxPolicyModel mergeInPolicyModel = loadModelFromString(otherModelString, result); - if (!result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)) { + if (!result.getResult().equals(ApexApiResult.Result.SUCCESS)) { return result; } try { AxPolicyModel mergedPolicyModel = PolicyModelMerger.getMergedPolicyModel(apexModel.getPolicyModel(), - mergeInPolicyModel, keepOriginal, false); + mergeInPolicyModel, keepOriginal, false); apexModel.setPolicyModel(mergedPolicyModel != null ? mergedPolicyModel : new AxPolicyModel()); - return new ApexAPIResult(); + return new ApexApiResult(); } catch (ApexModelException e) { apexModel.setPolicyModel(new AxPolicyModel()); - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -576,14 +570,14 @@ public class ModelHandlerFacade { * @param result the result of the operation * @return the model */ - private AxPolicyModel loadModelFromFile(final String fileName, final ApexAPIResult result) { + private AxPolicyModel loadModelFromFile(final String fileName, final ApexApiResult result) { Assertions.argumentNotNull(fileName, FILE_NAME_MAY_NOT_BE_NULL); AxPolicyModel readModel = null; - final URL apexModelURL = ResourceUtils.getLocalFile(fileName); - if (apexModelURL == null) { - result.setResult(ApexAPIResult.RESULT.FAILED); + final URL apexModelUrl = ResourceUtils.getLocalFile(fileName); + if (apexModelUrl == null) { + result.setResult(ApexApiResult.Result.FAILED); result.addMessage("file " + fileName + " not found"); return null; } @@ -591,11 +585,11 @@ public class ModelHandlerFacade { try { ApexModelReader<AxPolicyModel> apexModelReader = new ApexModelReader<>(AxPolicyModel.class); apexModelReader.setValidateFlag(false); - readModel = apexModelReader.read(apexModelURL.openStream()); - result.setResult(ApexAPIResult.RESULT.SUCCESS); + readModel = apexModelReader.read(apexModelUrl.openStream()); + result.setResult(ApexApiResult.Result.SUCCESS); return readModel; } catch (Exception e) { - result.setResult(ApexAPIResult.RESULT.FAILED); + result.setResult(ApexApiResult.Result.FAILED); result.addThrowable(e); return null; } @@ -608,7 +602,7 @@ public class ModelHandlerFacade { * @param result the result of the operation * @return the model */ - private AxPolicyModel loadModelFromString(final String modelString, final ApexAPIResult result) { + private AxPolicyModel loadModelFromString(final String modelString, final ApexApiResult result) { Assertions.argumentNotNull(modelString, "modelString may not be null"); AxPolicyModel readModel = null; @@ -619,10 +613,10 @@ public class ModelHandlerFacade { ApexModelReader<AxPolicyModel> apexModelReader = new ApexModelReader<>(AxPolicyModel.class); apexModelReader.setValidateFlag(false); readModel = apexModelReader.read(modelStringStream); - result.setResult(ApexAPIResult.RESULT.SUCCESS); + result.setResult(ApexApiResult.Result.SUCCESS); return readModel; } catch (Exception e) { - result.setResult(ApexAPIResult.RESULT.FAILED); + result.setResult(ApexApiResult.Result.FAILED); result.addThrowable(e); return null; } diff --git a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/PolicyFacade.java b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/PolicyFacade.java index 1fe6d3599..1d07b2e8c 100644 --- a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/PolicyFacade.java +++ b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/PolicyFacade.java @@ -33,7 +33,7 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult; import org.onap.policy.apex.model.basicmodel.handling.ApexModelStringWriter; import org.onap.policy.apex.model.contextmodel.concepts.AxContextAlbum; import org.onap.policy.apex.model.eventmodel.concepts.AxEvent; -import org.onap.policy.apex.model.modelapi.ApexAPIResult; +import org.onap.policy.apex.model.modelapi.ApexApiResult; import org.onap.policy.apex.model.modelapi.ApexModel; import org.onap.policy.apex.model.policymodel.concepts.AxPolicy; import org.onap.policy.apex.model.policymodel.concepts.AxState; @@ -99,7 +99,7 @@ public class PolicyFacade { * @param description policy description, set to null to generate a description * @return result of the operation */ - public ApexAPIResult createPolicy(final String name, final String version, final String template, + public ApexApiResult createPolicy(final String name, final String version, final String template, final String firstState, final String uuid, final String description) { try { final AxArtifactKey key = new AxArtifactKey(); @@ -110,17 +110,17 @@ public class PolicyFacade { key.setVersion(apexProperties.getProperty("DEFAULT_CONCEPT_VERSION")); } - String t = template; - if (t == null) { - t = apexProperties.getProperty("DEFAULT_POLICY_TEMPLATE"); + String templateString = template; + if (templateString == null) { + templateString = apexProperties.getProperty("DEFAULT_POLICY_TEMPLATE"); } if (apexModel.getPolicyModel().getPolicies().getPolicyMap().containsKey(key)) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, CONCEPT + key.getId() + ALREADY_EXISTS); + return new ApexApiResult(ApexApiResult.Result.CONCEPT_EXISTS, CONCEPT + key.getId() + ALREADY_EXISTS); } final AxPolicy policy = new AxPolicy(key); - policy.setTemplate(t); + policy.setTemplate(templateString); policy.setFirstState(firstState); apexModel.getPolicyModel().getPolicies().getPolicyMap().put(key, policy); @@ -131,7 +131,7 @@ public class PolicyFacade { return keyInformationFacade.createKeyInformation(name, version, uuid, description); } } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -146,12 +146,12 @@ public class PolicyFacade { * @param description policy description, set to null to not update * @return result of the operation */ - public ApexAPIResult updatePolicy(final String name, final String version, final String template, + public ApexApiResult updatePolicy(final String name, final String version, final String template, final String firstState, final String uuid, final String description) { try { final AxPolicy policy = apexModel.getPolicyModel().getPolicies().get(name, version); if (policy == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } @@ -164,7 +164,7 @@ public class PolicyFacade { return keyInformationFacade.updateKeyInformation(name, version, uuid, description); } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -175,22 +175,22 @@ public class PolicyFacade { * @param version starting version of the policy, set to null to list all versions * @return result of the operation */ - public ApexAPIResult listPolicy(final String name, final String version) { + public ApexApiResult listPolicy(final String name, final String version) { try { final Set<AxPolicy> policySet = apexModel.getPolicyModel().getPolicies().getAll(name, version); if (name != null && policySet.isEmpty()) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT_S + name + ':' + version + DO_ES_NOT_EXIST); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); for (final AxPolicy policy : policySet) { result.addMessage( new ApexModelStringWriter<AxPolicy>(false).writeString(policy, AxPolicy.class, jsonMode)); } return result; } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -201,27 +201,27 @@ public class PolicyFacade { * @param version version of the policy, set to null to use the latest version * @return result of the operation */ - public ApexAPIResult deletePolicy(final String name, final String version) { + public ApexApiResult deletePolicy(final String name, final String version) { try { if (version != null) { final AxArtifactKey key = new AxArtifactKey(name, version); final AxPolicy removedPolicy = apexModel.getPolicyModel().getPolicies().getPolicyMap().remove(key); if (removedPolicy != null) { - return new ApexAPIResult(ApexAPIResult.RESULT.SUCCESS, new ApexModelStringWriter<AxPolicy>(false) + return new ApexApiResult(ApexApiResult.Result.SUCCESS, new ApexModelStringWriter<AxPolicy>(false) .writeString(removedPolicy, AxPolicy.class, jsonMode)); } else { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + key.getId() + DOES_NOT_EXIST); } } final Set<AxPolicy> policySet = apexModel.getPolicyModel().getPolicies().getAll(name, version); if (policySet.isEmpty()) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT_S + name + ':' + version + DO_ES_NOT_EXIST); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); for (final AxPolicy policy : policySet) { result.addMessage( new ApexModelStringWriter<AxPolicy>(false).writeString(policy, AxPolicy.class, jsonMode)); @@ -230,7 +230,7 @@ public class PolicyFacade { } return result; } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -241,15 +241,15 @@ public class PolicyFacade { * @param version starting version of the policy, set to null to list all versions * @return result of the operation */ - public ApexAPIResult validatePolicy(final String name, final String version) { + public ApexApiResult validatePolicy(final String name, final String version) { try { final Set<AxPolicy> policySet = apexModel.getPolicyModel().getPolicies().getAll(name, version); if (policySet.isEmpty()) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT_S + name + ':' + version + DO_ES_NOT_EXIST); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); for (final AxPolicy policy : policySet) { final AxValidationResult validationResult = policy.validate(new AxValidationResult()); result.addMessage(new ApexModelStringWriter<AxArtifactKey>(false).writeString(policy.getKey(), @@ -258,7 +258,7 @@ public class PolicyFacade { } return result; } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -275,7 +275,7 @@ public class PolicyFacade { * @param defaltTaskVersion the default task version, set to null to use the latest version * @return result of the operation */ - public ApexAPIResult createPolicyState(final String name, final String version, final String stateName, + public ApexApiResult createPolicyState(final String name, final String version, final String stateName, final String triggerName, final String triggerVersion, final String defaultTaskName, final String defaltTaskVersion) { try { @@ -283,26 +283,26 @@ public class PolicyFacade { final AxPolicy policy = apexModel.getPolicyModel().getPolicies().get(name, version); if (policy == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } final AxReferenceKey refKey = new AxReferenceKey(policy.getKey(), stateName); if (policy.getStateMap().containsKey(refKey.getLocalName())) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_EXISTS, CONCEPT + refKey.getId() + ALREADY_EXISTS); } final AxEvent triggerEvent = apexModel.getPolicyModel().getEvents().get(triggerName, triggerVersion); if (triggerEvent == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + triggerName + ':' + triggerVersion + DOES_NOT_EXIST); } final AxTask defaultTask = apexModel.getPolicyModel().getTasks().get(defaultTaskName, defaltTaskVersion); if (defaultTask == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + defaultTaskName + ':' + defaltTaskVersion + DOES_NOT_EXIST); } @@ -311,9 +311,9 @@ public class PolicyFacade { state.setDefaultTask(defaultTask.getKey()); policy.getStateMap().put(state.getKey().getLocalName(), state); - return new ApexAPIResult(); + return new ApexApiResult(); } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -330,7 +330,7 @@ public class PolicyFacade { * @param defaltTaskVersion the default task version, set to use latest version of default task * @return result of the operation */ - public ApexAPIResult updatePolicyState(final String name, final String version, final String stateName, + public ApexApiResult updatePolicyState(final String name, final String version, final String stateName, final String triggerName, final String triggerVersion, final String defaultTaskName, final String defaltTaskVersion) { try { @@ -338,20 +338,20 @@ public class PolicyFacade { final AxPolicy policy = apexModel.getPolicyModel().getPolicies().get(name, version); if (policy == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } final AxState state = policy.getStateMap().get(stateName); if (state == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + policy.getKey().getId() + ':' + stateName + DOES_NOT_EXIST); } if (triggerName != null) { final AxEvent triggerEvent = apexModel.getPolicyModel().getEvents().get(triggerName, triggerVersion); if (triggerEvent == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + triggerName + ':' + triggerVersion + DOES_NOT_EXIST); } state.setTrigger(triggerEvent.getKey()); @@ -361,15 +361,15 @@ public class PolicyFacade { final AxTask defaultTask = apexModel.getPolicyModel().getTasks().get(defaultTaskName, defaltTaskVersion); if (defaultTask == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + defaultTaskName + ':' + defaltTaskVersion + DOES_NOT_EXIST); } state.setDefaultTask(defaultTask.getKey()); } - return new ApexAPIResult(); + return new ApexApiResult(); } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -381,29 +381,29 @@ public class PolicyFacade { * @param stateName of the state, set to null to list all states of the policy * @return result of the operation */ - public ApexAPIResult listPolicyState(final String name, final String version, final String stateName) { + public ApexApiResult listPolicyState(final String name, final String version, final String stateName) { try { final AxPolicy policy = apexModel.getPolicyModel().getPolicies().get(name, version); if (policy == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } if (stateName != null) { final AxState state = policy.getStateMap().get(stateName); if (state != null) { - return new ApexAPIResult(ApexAPIResult.RESULT.SUCCESS, + return new ApexApiResult(ApexApiResult.Result.SUCCESS, new ApexModelStringWriter<AxState>(false).writeString(state, AxState.class, jsonMode)); } else { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + ':' + state + DOES_NOT_EXIST); } } else { if (policy.getStateMap().size() == 0) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, "no states defined on policy " + policy.getKey().getId()); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); for (final AxState state : policy.getStateMap().values()) { result.addMessage( new ApexModelStringWriter<AxState>(false).writeString(state, AxState.class, jsonMode)); @@ -411,7 +411,7 @@ public class PolicyFacade { return result; } } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -423,15 +423,15 @@ public class PolicyFacade { * @param stateName of the state, set to null to delete all states * @return result of the operation */ - public ApexAPIResult deletePolicyState(final String name, final String version, final String stateName) { + public ApexApiResult deletePolicyState(final String name, final String version, final String stateName) { try { final AxPolicy policy = apexModel.getPolicyModel().getPolicies().get(name, version); if (policy == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); if (stateName != null) { if (policy.getStateMap().containsKey(stateName)) { result.addMessage(new ApexModelStringWriter<AxState>(false) @@ -439,12 +439,12 @@ public class PolicyFacade { policy.getStateMap().remove(stateName); return result; } else { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + ':' + stateName + DOES_NOT_EXIST); } } else { if (policy.getStateMap().size() == 0) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, "no states defined on policy " + policy.getKey().getId()); } for (final AxState state : policy.getStateMap().values()) { @@ -455,7 +455,7 @@ public class PolicyFacade { return result; } } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -470,20 +470,20 @@ public class PolicyFacade { * @param logic the source code for the logic of the state * @return result of the operation */ - public ApexAPIResult createPolicyStateTaskSelectionLogic(final String name, final String version, + public ApexApiResult createPolicyStateTaskSelectionLogic(final String name, final String version, final String stateName, final String logicFlavour, final String logic) { try { Assertions.argumentNotNull(stateName, STATE_NAME_MAY_NOT_BE_NULL); final AxPolicy policy = apexModel.getPolicyModel().getPolicies().get(name, version); if (policy == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } final AxState state = policy.getStateMap().get(stateName); if (state == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + policy.getKey().getId() + ':' + stateName + DOES_NOT_EXIST); } @@ -492,14 +492,14 @@ public class PolicyFacade { final AxReferenceKey refKey = new AxReferenceKey(state.getKey(), "TaskSelectionLogic"); if (!state.getTaskSelectionLogic().getKey().getLocalName().equals(AxKey.NULL_KEY_NAME)) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_EXISTS, CONCEPT + refKey.getId() + ALREADY_EXISTS); } state.setTaskSelectionLogic(new AxTaskSelectionLogic(refKey, logicFlavour, logic)); - return new ApexAPIResult(); + return new ApexApiResult(); } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -513,25 +513,25 @@ public class PolicyFacade { * @param logic the source code for the logic of the state, set to null to not update * @return result of the operation */ - public ApexAPIResult updatePolicyStateTaskSelectionLogic(final String name, final String version, + public ApexApiResult updatePolicyStateTaskSelectionLogic(final String name, final String version, final String stateName, final String logicFlavour, final String logic) { try { Assertions.argumentNotNull(stateName, STATE_NAME_MAY_NOT_BE_NULL); final AxPolicy policy = apexModel.getPolicyModel().getPolicies().get(name, version); if (policy == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } final AxState state = policy.getStateMap().get(stateName); if (state == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + policy.getKey().getId() + ':' + stateName + DOES_NOT_EXIST); } if (state.getTaskSelectionLogic().getKey().getLocalName().equals(AxKey.NULL_KEY_NAME)) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + state.getTaskSelectionLogic().getKey().getId() + DOES_NOT_EXIST); } @@ -543,9 +543,9 @@ public class PolicyFacade { taskSelectionLogic.setLogic(logic); } - return new ApexAPIResult(); + return new ApexApiResult(); } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -557,28 +557,28 @@ public class PolicyFacade { * @param stateName of the state * @return result of the operation */ - public ApexAPIResult listPolicyStateTaskSelectionLogic(final String name, final String version, + public ApexApiResult listPolicyStateTaskSelectionLogic(final String name, final String version, final String stateName) { try { Assertions.argumentNotNull(stateName, STATE_NAME_MAY_NOT_BE_NULL); final AxPolicy policy = apexModel.getPolicyModel().getPolicies().get(name, version); if (policy == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } final AxState state = policy.getStateMap().get(stateName); if (state == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + policy.getKey().getId() + ':' + stateName + DOES_NOT_EXIST); } - return new ApexAPIResult(ApexAPIResult.RESULT.SUCCESS, + return new ApexApiResult(ApexApiResult.Result.SUCCESS, new ApexModelStringWriter<AxTaskSelectionLogic>(false).writeString(state.getTaskSelectionLogic(), AxTaskSelectionLogic.class, jsonMode)); } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -590,35 +590,35 @@ public class PolicyFacade { * @param stateName of the state * @return result of the operation */ - public ApexAPIResult deletePolicyStateTaskSelectionLogic(final String name, final String version, + public ApexApiResult deletePolicyStateTaskSelectionLogic(final String name, final String version, final String stateName) { try { Assertions.argumentNotNull(stateName, STATE_NAME_MAY_NOT_BE_NULL); final AxPolicy policy = apexModel.getPolicyModel().getPolicies().get(name, version); if (policy == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } final AxState state = policy.getStateMap().get(stateName); if (state == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + policy.getKey().getId() + ':' + stateName + DOES_NOT_EXIST); } if (state.getTaskSelectionLogic().getKey().getLocalName().equals(AxKey.NULL_KEY_NAME)) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + state.getTaskSelectionLogic().getKey().getId() + DOES_NOT_EXIST); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); result.addMessage(new ApexModelStringWriter<AxTaskSelectionLogic>(false) .writeString(state.getTaskSelectionLogic(), AxTaskSelectionLogic.class, jsonMode)); state.setTaskSelectionLogic(new AxTaskSelectionLogic()); return result; } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -636,7 +636,7 @@ public class PolicyFacade { * the policy transitions to on this branch * @return result of the operation */ - public ApexAPIResult createPolicyStateOutput(final String name, final String version, final String stateName, + public ApexApiResult createPolicyStateOutput(final String name, final String version, final String stateName, final String outputName, final String eventName, final String eventVersion, final String nextState) { try { Assertions.argumentNotNull(stateName, STATE_NAME_MAY_NOT_BE_NULL); @@ -644,46 +644,46 @@ public class PolicyFacade { final AxPolicy policy = apexModel.getPolicyModel().getPolicies().get(name, version); if (policy == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, "Policy concept " + name + ':' + version + DOES_NOT_EXIST); } final AxState state = policy.getStateMap().get(stateName); if (state == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, "State concept " + policy.getKey().getId() + ':' + stateName + DOES_NOT_EXIST); } final AxReferenceKey refKey = new AxReferenceKey(state.getKey(), outputName); if (state.getStateOutputs().containsKey(refKey.getLocalName())) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_EXISTS, "Output concept " + refKey.getId() + ALREADY_EXISTS); } final AxEvent event = apexModel.getPolicyModel().getEvents().get(eventName, eventVersion); if (event == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, "Event concept " + eventName + ':' + eventVersion + DOES_NOT_EXIST); } AxReferenceKey nextStateKey = AxReferenceKey.getNullKey(); if (nextState != null && !(AxReferenceKey.getNullKey().getLocalName().equals(nextState))) { if (state.getKey().getLocalName().equals(nextState)) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, + return new ApexApiResult(ApexApiResult.Result.FAILED, "next state " + nextState + " of a state cannot be the state itself"); } nextStateKey = new AxReferenceKey(state.getKey().getParentArtifactKey(), nextState); if (!policy.getStateMap().containsKey(nextState)) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, "Next state concept " + nextStateKey.getId() + DOES_NOT_EXIST); } } state.getStateOutputs().put(refKey.getLocalName(), new AxStateOutput(refKey, event.getKey(), nextStateKey)); - return new ApexAPIResult(); + return new ApexApiResult(); } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -696,40 +696,40 @@ public class PolicyFacade { * @param outputName of the state output, set to null to list all outputs of the state * @return result of the operation */ - public ApexAPIResult listPolicyStateOutput(final String name, final String version, final String stateName, + public ApexApiResult listPolicyStateOutput(final String name, final String version, final String stateName, final String outputName) { try { Assertions.argumentNotNull(stateName, STATE_NAME_MAY_NOT_BE_NULL); final AxPolicy policy = apexModel.getPolicyModel().getPolicies().get(name, version); if (policy == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } final AxState state = policy.getStateMap().get(stateName); if (state == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + policy.getKey().getId() + ':' + stateName + DOES_NOT_EXIST); } if (outputName != null) { final AxStateOutput stateOutput = state.getStateOutputs().get(outputName); if (stateOutput != null) { - return new ApexAPIResult(ApexAPIResult.RESULT.SUCCESS, + return new ApexApiResult(ApexApiResult.Result.SUCCESS, new ApexModelStringWriter<AxStateOutput>(false).writeString(stateOutput, AxStateOutput.class, jsonMode)); } else { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + state.getKey().getId() + ':' + outputName + DOES_NOT_EXIST); } } else { if (state.getStateOutputs().size() == 0) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, "no state output concepts exist for state " + state.getKey().getId()); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); for (final AxStateOutput stateOutput : state.getStateOutputs().values()) { result.addMessage(new ApexModelStringWriter<AxStateOutput>(false).writeString(stateOutput, @@ -738,7 +738,7 @@ public class PolicyFacade { return result; } } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -751,42 +751,42 @@ public class PolicyFacade { * @param outputName of the state output, set to null to delete all state outputs * @return result of the operation */ - public ApexAPIResult deletePolicyStateOutput(final String name, final String version, final String stateName, + public ApexApiResult deletePolicyStateOutput(final String name, final String version, final String stateName, final String outputName) { try { Assertions.argumentNotNull(stateName, STATE_NAME_MAY_NOT_BE_NULL); final AxPolicy policy = apexModel.getPolicyModel().getPolicies().get(name, version); if (policy == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } final AxState state = policy.getStateMap().get(stateName); if (state == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + policy.getKey().getId() + ':' + stateName + DOES_NOT_EXIST); } if (outputName != null) { final AxStateOutput stateOutput = state.getStateOutputs().get(outputName); if (stateOutput != null) { - final ApexAPIResult result = new ApexAPIResult(ApexAPIResult.RESULT.SUCCESS, + final ApexApiResult result = new ApexApiResult(ApexApiResult.Result.SUCCESS, new ApexModelStringWriter<AxStateOutput>(false).writeString(stateOutput, AxStateOutput.class, jsonMode)); state.getStateOutputs().remove(outputName); return result; } else { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + state.getKey().getId() + ':' + outputName + DOES_NOT_EXIST); } } else { if (state.getStateOutputs().size() == 0) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, "no state output concepts exist for state " + state.getKey().getId()); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); for (final Entry<String, AxStateOutput> stateOutputEntry : state.getStateOutputs().entrySet()) { result.addMessage(new ApexModelStringWriter<AxStateOutput>(false) @@ -796,7 +796,7 @@ public class PolicyFacade { return result; } } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -812,7 +812,7 @@ public class PolicyFacade { * @param logic the source code for the logic of the state * @return result of the operation */ - public ApexAPIResult createPolicyStateFinalizerLogic(final String name, final String version, + public ApexApiResult createPolicyStateFinalizerLogic(final String name, final String version, final String stateName, final String finalizerLogicName, final String logicFlavour, final String logic) { try { Assertions.argumentNotNull(stateName, STATE_NAME_MAY_NOT_BE_NULL); @@ -820,28 +820,28 @@ public class PolicyFacade { final AxPolicy policy = apexModel.getPolicyModel().getPolicies().get(name, version); if (policy == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } final AxState state = policy.getStateMap().get(stateName); if (state == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + policy.getKey().getId() + ':' + stateName + DOES_NOT_EXIST); } final AxReferenceKey refKey = new AxReferenceKey(state.getKey(), finalizerLogicName); if (state.getStateFinalizerLogicMap().containsKey(refKey.getLocalName())) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_EXISTS, CONCEPT + refKey.getId() + ALREADY_EXISTS); } state.getStateFinalizerLogicMap().put(finalizerLogicName, new AxStateFinalizerLogic(refKey, logicFlavour, logic)); - return new ApexAPIResult(); + return new ApexApiResult(); } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -857,7 +857,7 @@ public class PolicyFacade { * @param logic the source code for the logic of the state, set to null to not update * @return result of the operation */ - public ApexAPIResult updatePolicyStateFinalizerLogic(final String name, final String version, + public ApexApiResult updatePolicyStateFinalizerLogic(final String name, final String version, final String stateName, final String finalizerLogicName, final String logicFlavour, final String logic) { try { Assertions.argumentNotNull(stateName, STATE_NAME_MAY_NOT_BE_NULL); @@ -865,13 +865,13 @@ public class PolicyFacade { final AxPolicy policy = apexModel.getPolicyModel().getPolicies().get(name, version); if (policy == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } final AxState state = policy.getStateMap().get(stateName); if (state == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + policy.getKey().getId() + ':' + stateName + DOES_NOT_EXIST); } @@ -879,7 +879,7 @@ public class PolicyFacade { final AxStateFinalizerLogic stateFinalizerLogic = state.getStateFinalizerLogicMap().get(refKey.getKey().getLocalName()); if (stateFinalizerLogic == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, STATE_FINALIZER_LOGIC + refKey.getId() + DOES_NOT_EXIST); } @@ -890,9 +890,9 @@ public class PolicyFacade { stateFinalizerLogic.setLogic(logic); } - return new ApexAPIResult(); + return new ApexApiResult(); } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -905,20 +905,20 @@ public class PolicyFacade { * @param finalizerLogicName name of the state finalizer logic * @return result of the operation */ - public ApexAPIResult listPolicyStateFinalizerLogic(final String name, final String version, final String stateName, + public ApexApiResult listPolicyStateFinalizerLogic(final String name, final String version, final String stateName, final String finalizerLogicName) { try { Assertions.argumentNotNull(stateName, STATE_NAME_MAY_NOT_BE_NULL); final AxPolicy policy = apexModel.getPolicyModel().getPolicies().get(name, version); if (policy == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } final AxState state = policy.getStateMap().get(stateName); if (state == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + policy.getKey().getId() + ':' + stateName + DOES_NOT_EXIST); } @@ -927,19 +927,19 @@ public class PolicyFacade { final AxStateFinalizerLogic stateFinalizerLogic = state.getStateFinalizerLogicMap().get(refKey.getKey().getLocalName()); if (stateFinalizerLogic == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, STATE_FINALIZER_LOGIC + refKey.getId() + DOES_NOT_EXIST); } - return new ApexAPIResult(ApexAPIResult.RESULT.SUCCESS, + return new ApexApiResult(ApexApiResult.Result.SUCCESS, new ApexModelStringWriter<AxStateFinalizerLogic>(false).writeString(stateFinalizerLogic, AxStateFinalizerLogic.class, jsonMode)); } else { if (state.getStateFinalizerLogicMap().size() == 0) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, "no state finalizer logic defined on state " + state.getKey().getId()); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); for (final AxStateFinalizerLogic stateFinalizerLogic : state.getStateFinalizerLogicMap().values()) { result.addMessage(new ApexModelStringWriter<AxStateFinalizerLogic>(false) .writeString(stateFinalizerLogic, AxStateFinalizerLogic.class, jsonMode)); @@ -947,7 +947,7 @@ public class PolicyFacade { return result; } } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -960,20 +960,20 @@ public class PolicyFacade { * @param finalizerLogicName name of the state finalizer logic * @return result of the operation */ - public ApexAPIResult deletePolicyStateFinalizerLogic(final String name, final String version, + public ApexApiResult deletePolicyStateFinalizerLogic(final String name, final String version, final String stateName, final String finalizerLogicName) { try { Assertions.argumentNotNull(stateName, STATE_NAME_MAY_NOT_BE_NULL); final AxPolicy policy = apexModel.getPolicyModel().getPolicies().get(name, version); if (policy == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } final AxState state = policy.getStateMap().get(stateName); if (state == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + policy.getKey().getId() + ':' + stateName + DOES_NOT_EXIST); } @@ -982,22 +982,22 @@ public class PolicyFacade { final AxStateFinalizerLogic stateFinalizerLogic = state.getStateFinalizerLogicMap().get(refKey.getKey().getLocalName()); if (stateFinalizerLogic == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, STATE_FINALIZER_LOGIC + refKey.getId() + DOES_NOT_EXIST); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); result.addMessage(new ApexModelStringWriter<AxStateFinalizerLogic>(false) .writeString(stateFinalizerLogic, AxStateFinalizerLogic.class, jsonMode)); state.getStateFinalizerLogicMap().remove(refKey.getLocalName()); return result; } else { if (state.getStateFinalizerLogicMap().size() == 0) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, "no state finalizer logic defined on state " + state.getKey().getId()); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); for (final AxStateFinalizerLogic stateFinalizerLogic : state.getStateFinalizerLogicMap().values()) { result.addMessage(new ApexModelStringWriter<AxStateFinalizerLogic>(false) .writeString(stateFinalizerLogic, AxStateFinalizerLogic.class, jsonMode)); @@ -1006,7 +1006,7 @@ public class PolicyFacade { return result; } } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -1026,7 +1026,7 @@ public class PolicyFacade { * @return result of the operation */ // CHECKSTYLE:OFF: checkstyle:parameterNumber - public ApexAPIResult createPolicyStateTaskRef(final String name, final String version, final String stateName, + public ApexApiResult createPolicyStateTaskRef(final String name, final String version, final String stateName, final String taskLocalName, final String taskName, final String taskVersion, final String outputType, final String outputName) { try { @@ -1035,24 +1035,24 @@ public class PolicyFacade { final AxPolicy policy = apexModel.getPolicyModel().getPolicies().get(name, version); if (policy == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } final AxState state = policy.getStateMap().get(stateName); if (state == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + policy.getKey().getId() + ':' + stateName + DOES_NOT_EXIST); } final AxTask task = apexModel.getPolicyModel().getTasks().get(taskName, taskVersion); if (task == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + taskName + ':' + taskVersion + DOES_NOT_EXIST); } if (state.getTaskReferences().containsKey(task.getKey())) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, "task " + task.getKey().getId() + return new ApexApiResult(ApexApiResult.Result.CONCEPT_EXISTS, "task " + task.getKey().getId() + " already has reference with output " + state.getTaskReferences().get(task.getKey())); } @@ -1069,23 +1069,23 @@ public class PolicyFacade { final AxStateTaskOutputType stateTaskOutputType = AxStateTaskOutputType.valueOf(outputType); if (stateTaskOutputType.equals(AxStateTaskOutputType.DIRECT)) { if (!state.getStateOutputs().containsKey(outputRefKey.getLocalName())) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, "state output concept " + outputRefKey.getId() + DOES_NOT_EXIST); } } else if (stateTaskOutputType.equals(AxStateTaskOutputType.LOGIC)) { if (!state.getStateFinalizerLogicMap().containsKey(outputRefKey.getLocalName())) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, "state finalizer logic concept " + outputRefKey.getId() + DOES_NOT_EXIST); } } else { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, "output type " + outputType + " invalid"); + return new ApexApiResult(ApexApiResult.Result.FAILED, "output type " + outputType + " invalid"); } state.getTaskReferences().put(task.getKey(), new AxStateTaskReference(refKey, stateTaskOutputType, outputRefKey)); - return new ApexAPIResult(); + return new ApexApiResult(); } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } // CHECKSTYLE:ON: checkstyle:parameterNumber @@ -1100,24 +1100,24 @@ public class PolicyFacade { * @param taskVersion version of the task, set to null to use the latest version * @return result of the operation */ - public ApexAPIResult listPolicyStateTaskRef(final String name, final String version, final String stateName, + public ApexApiResult listPolicyStateTaskRef(final String name, final String version, final String stateName, final String taskName, final String taskVersion) { try { Assertions.argumentNotNull(stateName, STATE_NAME_MAY_NOT_BE_NULL); final AxPolicy policy = apexModel.getPolicyModel().getPolicies().get(name, version); if (policy == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } final AxState state = policy.getStateMap().get(stateName); if (state == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + policy.getKey().getId() + ':' + stateName + DOES_NOT_EXIST); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); boolean found = false; final Map<AxArtifactKey, AxStateTaskReference> taskReferences = state.getTaskReferences(); for (final Entry<AxArtifactKey, AxStateTaskReference> taskReferenceEntry : taskReferences.entrySet()) { @@ -1137,11 +1137,11 @@ public class PolicyFacade { if (found) { return result; } else { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, "no task references found for state " + state.getKey().getId()); } } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -1155,20 +1155,20 @@ public class PolicyFacade { * @param taskVersion version of the task, set to null to use the latest version * @return result of the operation */ - public ApexAPIResult deletePolicyStateTaskRef(final String name, final String version, final String stateName, + public ApexApiResult deletePolicyStateTaskRef(final String name, final String version, final String stateName, final String taskName, final String taskVersion) { try { Assertions.argumentNotNull(stateName, STATE_NAME_MAY_NOT_BE_NULL); final AxPolicy policy = apexModel.getPolicyModel().getPolicies().get(name, version); if (policy == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } final AxState state = policy.getStateMap().get(stateName); if (state == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + policy.getKey().getId() + ':' + stateName + DOES_NOT_EXIST); } @@ -1182,11 +1182,11 @@ public class PolicyFacade { deleteSet.add(taskReferenceKey); } if (deleteSet.isEmpty()) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + taskName + ':' + taskVersion + DOES_NOT_EXIST_ON_STATE + state.getKey().getId()); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); for (final AxArtifactKey keyToDelete : deleteSet) { state.getTaskReferences().remove(keyToDelete); result.addMessage(new ApexModelStringWriter<AxArtifactKey>(false).writeString(keyToDelete, @@ -1194,7 +1194,7 @@ public class PolicyFacade { } return result; } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -1209,39 +1209,39 @@ public class PolicyFacade { * to null to use the latest version * @return result of the operation */ - public ApexAPIResult createPolicyStateContextRef(final String name, final String version, final String stateName, + public ApexApiResult createPolicyStateContextRef(final String name, final String version, final String stateName, final String contextAlbumName, final String contextAlbumVersion) { try { Assertions.argumentNotNull(stateName, STATE_NAME_MAY_NOT_BE_NULL); final AxPolicy policy = apexModel.getPolicyModel().getPolicies().get(name, version); if (policy == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } final AxState state = policy.getStateMap().get(stateName); if (state == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + policy.getKey().getId() + ':' + stateName + DOES_NOT_EXIST); } final AxContextAlbum contextAlbum = apexModel.getPolicyModel().getAlbums().get(contextAlbumName, contextAlbumVersion); if (contextAlbum == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + contextAlbumName + ':' + contextAlbumVersion + DOES_NOT_EXIST); } if (state.getContextAlbumReferences().contains(contextAlbum.getKey())) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, "concept album reference for concept " + return new ApexApiResult(ApexApiResult.Result.CONCEPT_EXISTS, "concept album reference for concept " + contextAlbum.getKey().getId() + " already exists in state"); } state.getContextAlbumReferences().add(contextAlbum.getKey()); - return new ApexAPIResult(); + return new ApexApiResult(); } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -1257,24 +1257,24 @@ public class PolicyFacade { * to null to use the latest version * @return result of the operation */ - public ApexAPIResult listPolicyStateContextRef(final String name, final String version, final String stateName, + public ApexApiResult listPolicyStateContextRef(final String name, final String version, final String stateName, final String contextAlbumName, final String contextAlbumVersion) { try { Assertions.argumentNotNull(stateName, STATE_NAME_MAY_NOT_BE_NULL); final AxPolicy policy = apexModel.getPolicyModel().getPolicies().get(name, version); if (policy == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } final AxState state = policy.getStateMap().get(stateName); if (state == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + policy.getKey().getId() + ':' + stateName + DOES_NOT_EXIST); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); boolean found = false; for (final AxArtifactKey albumKey : state.getContextAlbumReferences()) { if ((contextAlbumName != null && !albumKey.getName().equals(contextAlbumName)) @@ -1286,12 +1286,12 @@ public class PolicyFacade { found = true; } if (!found) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, CONCEPT + contextAlbumName + ':' + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + contextAlbumName + ':' + contextAlbumVersion + DOES_NOT_EXIST_ON_STATE + state.getKey().getId()); } return result; } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -1307,20 +1307,20 @@ public class PolicyFacade { * to null to use the latest version * @return result of the operation */ - public ApexAPIResult deletePolicyStateContextRef(final String name, final String version, final String stateName, + public ApexApiResult deletePolicyStateContextRef(final String name, final String version, final String stateName, final String contextAlbumName, final String contextAlbumVersion) { try { Assertions.argumentNotNull(stateName, STATE_NAME_MAY_NOT_BE_NULL); final AxPolicy policy = apexModel.getPolicyModel().getPolicies().get(name, version); if (policy == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } final AxState state = policy.getStateMap().get(stateName); if (state == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + policy.getKey().getId() + ':' + stateName + DOES_NOT_EXIST); } @@ -1336,11 +1336,11 @@ public class PolicyFacade { deleteSet.add(albumKey); } if (deleteSet.isEmpty()) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, CONCEPT + contextAlbumName + ':' + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + contextAlbumName + ':' + contextAlbumVersion + DOES_NOT_EXIST_ON_STATE + state.getKey().getId()); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); for (final AxArtifactKey keyToDelete : deleteSet) { state.getContextAlbumReferences().remove(keyToDelete); result.addMessage(new ApexModelStringWriter<AxArtifactKey>(false).writeString(keyToDelete, @@ -1348,7 +1348,7 @@ public class PolicyFacade { } return result; } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } } diff --git a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/TaskFacade.java b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/TaskFacade.java index 5cb2e7475..77bb22d52 100644 --- a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/TaskFacade.java +++ b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/TaskFacade.java @@ -33,7 +33,7 @@ import org.onap.policy.apex.model.contextmodel.concepts.AxContextAlbum; import org.onap.policy.apex.model.contextmodel.concepts.AxContextSchema; import org.onap.policy.apex.model.eventmodel.concepts.AxInputField; import org.onap.policy.apex.model.eventmodel.concepts.AxOutputField; -import org.onap.policy.apex.model.modelapi.ApexAPIResult; +import org.onap.policy.apex.model.modelapi.ApexApiResult; import org.onap.policy.apex.model.modelapi.ApexModel; import org.onap.policy.apex.model.policymodel.concepts.AxTask; import org.onap.policy.apex.model.policymodel.concepts.AxTaskLogic; @@ -89,7 +89,7 @@ public class TaskFacade { * @param description task description, set to null to generate a description * @return result of the operation */ - public ApexAPIResult createTask(final String name, final String version, final String uuid, + public ApexApiResult createTask(final String name, final String version, final String uuid, final String description) { try { final AxArtifactKey key = new AxArtifactKey(); @@ -101,7 +101,7 @@ public class TaskFacade { } if (apexModel.getPolicyModel().getTasks().getTaskMap().containsKey(key)) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, CONCEPT + key.getId() + ALREADY_EXISTS); + return new ApexApiResult(ApexApiResult.Result.CONCEPT_EXISTS, CONCEPT + key.getId() + ALREADY_EXISTS); } apexModel.getPolicyModel().getTasks().getTaskMap().put(key, new AxTask(key)); @@ -112,7 +112,7 @@ public class TaskFacade { return keyInformationFacade.createKeyInformation(name, version, uuid, description); } } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -125,18 +125,18 @@ public class TaskFacade { * @param description task description, set to null to not update * @return result of the operation */ - public ApexAPIResult updateTask(final String name, final String version, final String uuid, + public ApexApiResult updateTask(final String name, final String version, final String uuid, final String description) { try { final AxTask task = apexModel.getPolicyModel().getTasks().get(name, version); if (task == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } return keyInformationFacade.updateKeyInformation(name, version, uuid, description); } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -147,21 +147,21 @@ public class TaskFacade { * @param version starting version of the task, set to null to list all versions * @return result of the operation */ - public ApexAPIResult listTask(final String name, final String version) { + public ApexApiResult listTask(final String name, final String version) { try { final Set<AxTask> taskSet = apexModel.getPolicyModel().getTasks().getAll(name, version); if (name != null && taskSet.isEmpty()) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT_S + name + ':' + version + DO_ES_NOT_EXIST); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); for (final AxTask task : taskSet) { result.addMessage(new ApexModelStringWriter<AxTask>(false).writeString(task, AxTask.class, jsonMode)); } return result; } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -172,27 +172,27 @@ public class TaskFacade { * @param version version of the task, set to null to use the latest version * @return result of the operation */ - public ApexAPIResult deleteTask(final String name, final String version) { + public ApexApiResult deleteTask(final String name, final String version) { try { if (version != null) { final AxArtifactKey key = new AxArtifactKey(name, version); final AxTask removedTask = apexModel.getPolicyModel().getTasks().getTaskMap().remove(key); if (removedTask != null) { - return new ApexAPIResult(ApexAPIResult.RESULT.SUCCESS, + return new ApexApiResult(ApexApiResult.Result.SUCCESS, new ApexModelStringWriter<AxTask>(false).writeString(removedTask, AxTask.class, jsonMode)); } else { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + key.getId() + DOES_NOT_EXIST); } } final Set<AxTask> taskSet = apexModel.getPolicyModel().getTasks().getAll(name, version); if (taskSet.isEmpty()) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT_S + name + ':' + version + DO_ES_NOT_EXIST); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); for (final AxTask task : taskSet) { result.addMessage(new ApexModelStringWriter<AxTask>(false).writeString(task, AxTask.class, jsonMode)); apexModel.getPolicyModel().getTasks().getTaskMap().remove(task.getKey()); @@ -200,7 +200,7 @@ public class TaskFacade { } return result; } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -211,15 +211,15 @@ public class TaskFacade { * @param version starting version of the task, set to null to list all versions * @return result of the operation */ - public ApexAPIResult validateTask(final String name, final String version) { + public ApexApiResult validateTask(final String name, final String version) { try { final Set<AxTask> taskSet = apexModel.getPolicyModel().getTasks().getAll(name, version); if (taskSet.isEmpty()) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT_S + name + ':' + version + DO_ES_NOT_EXIST); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); for (final AxTask task : taskSet) { final AxValidationResult validationResult = task.validate(new AxValidationResult()); result.addMessage(new ApexModelStringWriter<AxArtifactKey>(false).writeString(task.getKey(), @@ -228,7 +228,7 @@ public class TaskFacade { } return result; } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -242,12 +242,12 @@ public class TaskFacade { * @param logic the source code for the logic of the task * @return result of the operation */ - public ApexAPIResult createTaskLogic(final String name, final String version, final String logicFlavour, + public ApexApiResult createTaskLogic(final String name, final String version, final String logicFlavour, final String logic) { try { final AxTask task = apexModel.getPolicyModel().getTasks().get(name, version); if (task == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } @@ -255,14 +255,14 @@ public class TaskFacade { final AxReferenceKey refKey = new AxReferenceKey(task.getKey(), "TaskLogic"); if (!task.getTaskLogic().getKey().getLocalName().equals(AxKey.NULL_KEY_NAME)) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_EXISTS, CONCEPT + refKey.getId() + ALREADY_EXISTS); } task.setTaskLogic(new AxTaskLogic(refKey, logicFlavour, logic)); - return new ApexAPIResult(); + return new ApexApiResult(); } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -275,17 +275,17 @@ public class TaskFacade { * @param logic the source code for the logic of the task, set to null to not update * @return result of the operation */ - public ApexAPIResult updateTaskLogic(final String name, final String version, final String logicFlavour, + public ApexApiResult updateTaskLogic(final String name, final String version, final String logicFlavour, final String logic) { try { final AxTask task = apexModel.getPolicyModel().getTasks().get(name, version); if (task == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } if (task.getTaskLogic().getKey().getLocalName().equals(AxKey.NULL_KEY_NAME)) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + task.getTaskLogic().getKey().getId() + DOES_NOT_EXIST); } @@ -297,9 +297,9 @@ public class TaskFacade { taskLogic.setLogic(logic); } - return new ApexAPIResult(); + return new ApexApiResult(); } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -310,18 +310,18 @@ public class TaskFacade { * @param version version of the task, set to null to list the latest version * @return result of the operation */ - public ApexAPIResult listTaskLogic(final String name, final String version) { + public ApexApiResult listTaskLogic(final String name, final String version) { try { final AxTask task = apexModel.getPolicyModel().getTasks().get(name, version); if (task == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } - return new ApexAPIResult(ApexAPIResult.RESULT.SUCCESS, new ApexModelStringWriter<AxTaskLogic>(false) + return new ApexApiResult(ApexApiResult.Result.SUCCESS, new ApexModelStringWriter<AxTaskLogic>(false) .writeString(task.getTaskLogic(), AxTaskLogic.class, jsonMode)); } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -332,26 +332,26 @@ public class TaskFacade { * @param version version of the task, set to null to use the latest version * @return result of the operation */ - public ApexAPIResult deleteTaskLogic(final String name, final String version) { + public ApexApiResult deleteTaskLogic(final String name, final String version) { try { final AxTask task = apexModel.getPolicyModel().getTasks().get(name, version); if (task == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } if (task.getTaskLogic().getKey().getLocalName().equals(AxKey.NULL_KEY_NAME)) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + task.getTaskLogic().getKey().getId() + DOES_NOT_EXIST); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); result.addMessage(new ApexModelStringWriter<AxTaskLogic>(false).writeString(task.getTaskLogic(), AxTaskLogic.class, jsonMode)); task.setTaskLogic(new AxTaskLogic()); return result; } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -367,14 +367,14 @@ public class TaskFacade { * @param optional true if the task field is optional, false otherwise * @return result of the operation */ - public ApexAPIResult createTaskInputField(final String name, final String version, final String fieldName, + public ApexApiResult createTaskInputField(final String name, final String version, final String fieldName, final String contextSchemaName, final String contextSchemaVersion, final boolean optional) { try { Assertions.argumentNotNull(fieldName, "fieldName may not be null"); final AxTask task = apexModel.getPolicyModel().getTasks().get(name, version); if (task == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } @@ -382,21 +382,21 @@ public class TaskFacade { new AxReferenceKey(task.getKey().getName(), task.getKey().getVersion(), "inputFields", fieldName); if (task.getInputFields().containsKey(refKey.getLocalName())) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_EXISTS, CONCEPT + refKey.getId() + ALREADY_EXISTS); } final AxContextSchema schema = apexModel.getPolicyModel().getSchemas().get(contextSchemaName, contextSchemaVersion); if (schema == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + contextSchemaName + ':' + contextSchemaVersion + DOES_NOT_EXIST); } task.getInputFields().put(refKey.getLocalName(), new AxInputField(refKey, schema.getKey(), optional)); - return new ApexAPIResult(); + return new ApexApiResult(); } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -409,31 +409,31 @@ public class TaskFacade { * task * @return result of the operation */ - public ApexAPIResult listTaskInputField(final String name, final String version, final String fieldName) { + public ApexApiResult listTaskInputField(final String name, final String version, final String fieldName) { try { final AxTask task = apexModel.getPolicyModel().getTasks().get(name, version); if (task == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } if (fieldName != null) { final AxInputField inputField = task.getInputFields().get(fieldName); if (inputField != null) { - return new ApexAPIResult(ApexAPIResult.RESULT.SUCCESS, + return new ApexApiResult(ApexApiResult.Result.SUCCESS, new ApexModelStringWriter<AxInputField>(false).writeString(inputField, AxInputField.class, jsonMode)); } else { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + ':' + inputField + DOES_NOT_EXIST); } } else { if (task.getInputFields().size() == 0) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, "no input fields defined on task " + task.getKey().getId()); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); for (final AxInputField field : task.getInputFields().values()) { result.addMessage(new ApexModelStringWriter<AxInputField>(false).writeString(field, AxInputField.class, jsonMode)); @@ -441,7 +441,7 @@ public class TaskFacade { return result; } } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -454,15 +454,15 @@ public class TaskFacade { * @param fieldName of the input field, set to null to delete all input fields * @return result of the operation */ - public ApexAPIResult deleteTaskInputField(final String name, final String version, final String fieldName) { + public ApexApiResult deleteTaskInputField(final String name, final String version, final String fieldName) { try { final AxTask task = apexModel.getPolicyModel().getTasks().get(name, version); if (task == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); if (fieldName != null) { if (task.getInputFields().containsKey(fieldName)) { result.addMessage(new ApexModelStringWriter<AxInputField>(false) @@ -470,12 +470,12 @@ public class TaskFacade { task.getInputFields().remove(fieldName); return result; } else { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + ':' + fieldName + DOES_NOT_EXIST); } } else { if (task.getInputFields().size() == 0) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, "no input fields defined on task " + task.getKey().getId()); } @@ -487,7 +487,7 @@ public class TaskFacade { return result; } } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -504,14 +504,14 @@ public class TaskFacade { * @param optional true if the task field is optional, false otherwise * @return result of the operation */ - public ApexAPIResult createTaskOutputField(final String name, final String version, final String fieldName, + public ApexApiResult createTaskOutputField(final String name, final String version, final String fieldName, final String contextSchemaName, final String contextSchemaVersion, final boolean optional) { try { Assertions.argumentNotNull(fieldName, "fieldName may not be null"); final AxTask task = apexModel.getPolicyModel().getTasks().get(name, version); if (task == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } @@ -519,21 +519,21 @@ public class TaskFacade { new AxReferenceKey(task.getKey().getName(), task.getKey().getVersion(), "outputFields", fieldName); if (task.getOutputFields().containsKey(refKey.getLocalName())) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_EXISTS, CONCEPT + refKey.getId() + ALREADY_EXISTS); } final AxContextSchema schema = apexModel.getPolicyModel().getSchemas().get(contextSchemaName, contextSchemaVersion); if (schema == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + contextSchemaName + ':' + contextSchemaVersion + DOES_NOT_EXIST); } task.getOutputFields().put(refKey.getLocalName(), new AxOutputField(refKey, schema.getKey(), optional)); - return new ApexAPIResult(); + return new ApexApiResult(); } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -546,31 +546,31 @@ public class TaskFacade { * task * @return result of the operation */ - public ApexAPIResult listTaskOutputField(final String name, final String version, final String fieldName) { + public ApexApiResult listTaskOutputField(final String name, final String version, final String fieldName) { try { final AxTask task = apexModel.getPolicyModel().getTasks().get(name, version); if (task == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } if (fieldName != null) { final AxOutputField outputField = task.getOutputFields().get(fieldName); if (outputField != null) { - return new ApexAPIResult(ApexAPIResult.RESULT.SUCCESS, + return new ApexApiResult(ApexApiResult.Result.SUCCESS, new ApexModelStringWriter<AxOutputField>(false).writeString(outputField, AxOutputField.class, jsonMode)); } else { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + ':' + outputField + DOES_NOT_EXIST); } } else { if (task.getOutputFields().size() == 0) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, "no output fields defined on task " + task.getKey().getId()); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); for (final AxOutputField field : task.getOutputFields().values()) { result.addMessage(new ApexModelStringWriter<AxOutputField>(false).writeString(field, AxOutputField.class, jsonMode)); @@ -578,7 +578,7 @@ public class TaskFacade { return result; } } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -590,15 +590,15 @@ public class TaskFacade { * @param fieldName of the output field, set to null to delete all output fields * @return result of the operation */ - public ApexAPIResult deleteTaskOutputField(final String name, final String version, final String fieldName) { + public ApexApiResult deleteTaskOutputField(final String name, final String version, final String fieldName) { try { final AxTask task = apexModel.getPolicyModel().getTasks().get(name, version); if (task == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); if (fieldName != null) { if (task.getOutputFields().containsKey(fieldName)) { result.addMessage(new ApexModelStringWriter<AxOutputField>(false) @@ -606,12 +606,12 @@ public class TaskFacade { task.getOutputFields().remove(fieldName); return result; } else { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + ':' + fieldName + DOES_NOT_EXIST); } } else { if (task.getOutputFields().size() == 0) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, "no output fields defined on task " + task.getKey().getId()); } @@ -623,7 +623,7 @@ public class TaskFacade { return result; } } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -636,28 +636,28 @@ public class TaskFacade { * @param defaultValue of the parameter * @return result of the operation */ - public ApexAPIResult createTaskParameter(final String name, final String version, final String parName, + public ApexApiResult createTaskParameter(final String name, final String version, final String parName, final String defaultValue) { try { Assertions.argumentNotNull(parName, "parName may not be null"); final AxTask task = apexModel.getPolicyModel().getTasks().get(name, version); if (task == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } final AxReferenceKey refKey = new AxReferenceKey(task.getKey(), parName); if (task.getTaskParameters().containsKey(refKey.getLocalName())) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_EXISTS, CONCEPT + refKey.getId() + ALREADY_EXISTS); } task.getTaskParameters().put(refKey.getLocalName(), new AxTaskParameter(refKey, defaultValue)); - return new ApexAPIResult(); + return new ApexApiResult(); } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -669,31 +669,31 @@ public class TaskFacade { * @param parName name of the parameter, set to null to list all parameters of the task * @return result of the operation */ - public ApexAPIResult listTaskParameter(final String name, final String version, final String parName) { + public ApexApiResult listTaskParameter(final String name, final String version, final String parName) { try { final AxTask task = apexModel.getPolicyModel().getTasks().get(name, version); if (task == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } if (parName != null) { final AxTaskParameter taskParameter = task.getTaskParameters().get(parName); if (taskParameter != null) { - return new ApexAPIResult(ApexAPIResult.RESULT.SUCCESS, + return new ApexApiResult(ApexApiResult.Result.SUCCESS, new ApexModelStringWriter<AxTaskParameter>(false).writeString(taskParameter, AxTaskParameter.class, jsonMode)); } else { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + ':' + taskParameter + DOES_NOT_EXIST); } } else { if (task.getTaskParameters().size() == 0) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, "no task parameters defined on task " + task.getKey().getId()); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); for (final AxTaskParameter parameter : task.getTaskParameters().values()) { result.addMessage(new ApexModelStringWriter<AxTaskParameter>(false).writeString(parameter, AxTaskParameter.class, jsonMode)); @@ -701,7 +701,7 @@ public class TaskFacade { return result; } } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -713,15 +713,15 @@ public class TaskFacade { * @param parName of the parameter, set to null to delete all task parameters * @return result of the operation */ - public ApexAPIResult deleteTaskParameter(final String name, final String version, final String parName) { + public ApexApiResult deleteTaskParameter(final String name, final String version, final String parName) { try { final AxTask task = apexModel.getPolicyModel().getTasks().get(name, version); if (task == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); if (parName != null) { if (task.getTaskParameters().containsKey(parName)) { result.addMessage(new ApexModelStringWriter<AxTaskParameter>(false) @@ -729,12 +729,12 @@ public class TaskFacade { task.getTaskParameters().remove(parName); return result; } else { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + ':' + parName + DOES_NOT_EXIST); } } else { if (task.getTaskParameters().size() == 0) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, "no task parameters defined on task " + task.getKey().getId()); } @@ -746,7 +746,7 @@ public class TaskFacade { return result; } } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -760,31 +760,31 @@ public class TaskFacade { * to null to use the latest version * @return result of the operation */ - public ApexAPIResult createTaskContextRef(final String name, final String version, final String contextAlbumName, + public ApexApiResult createTaskContextRef(final String name, final String version, final String contextAlbumName, final String contextAlbumVersion) { try { final AxTask task = apexModel.getPolicyModel().getTasks().get(name, version); if (task == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } final AxContextAlbum contextAlbum = apexModel.getPolicyModel().getAlbums().get(contextAlbumName, contextAlbumVersion); if (contextAlbum == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + contextAlbumName + ':' + contextAlbumVersion + DOES_NOT_EXIST); } if (task.getContextAlbumReferences().contains(contextAlbum.getKey())) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, "context album reference for concept " + return new ApexApiResult(ApexApiResult.Result.CONCEPT_EXISTS, "context album reference for concept " + contextAlbum.getKey().getId() + " already exists in task"); } task.getContextAlbumReferences().add(contextAlbum.getKey()); - return new ApexAPIResult(); + return new ApexApiResult(); } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -799,16 +799,16 @@ public class TaskFacade { * to null to use the latest version * @return result of the operation */ - public ApexAPIResult listTaskContextRef(final String name, final String version, final String contextAlbumName, + public ApexApiResult listTaskContextRef(final String name, final String version, final String contextAlbumName, final String contextAlbumVersion) { try { final AxTask task = apexModel.getPolicyModel().getTasks().get(name, version); if (task == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); boolean found = false; for (final AxArtifactKey albumKey : task.getContextAlbumReferences()) { if ((contextAlbumName != null && !albumKey.getName().equals(contextAlbumName)) @@ -820,12 +820,12 @@ public class TaskFacade { found = true; } if (!found) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + contextAlbumName + ':' + contextAlbumVersion + DOES_NOT_EXIST); } return result; } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } @@ -840,12 +840,12 @@ public class TaskFacade { * to null to use the latest version * @return result of the operation */ - public ApexAPIResult deleteTaskContextRef(final String name, final String version, final String contextAlbumName, + public ApexApiResult deleteTaskContextRef(final String name, final String version, final String contextAlbumName, final String contextAlbumVersion) { try { final AxTask task = apexModel.getPolicyModel().getTasks().get(name, version); if (task == null) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + name + ':' + version + DOES_NOT_EXIST); } @@ -860,10 +860,10 @@ public class TaskFacade { } if (deleteSet.isEmpty()) { - return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, + return new ApexApiResult(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, CONCEPT + contextAlbumName + ':' + contextAlbumVersion + DOES_NOT_EXIST); } - final ApexAPIResult result = new ApexAPIResult(); + final ApexApiResult result = new ApexApiResult(); for (final AxArtifactKey keyToDelete : deleteSet) { task.getContextAlbumReferences().remove(keyToDelete); result.addMessage(new ApexModelStringWriter<AxArtifactKey>(false).writeString(keyToDelete, @@ -871,7 +871,7 @@ public class TaskFacade { } return result; } catch (final Exception e) { - return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e); + return new ApexApiResult(ApexApiResult.Result.FAILED, e); } } } diff --git a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestApexEditorAPIContextAlbum.java b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestApexEditorApiContextAlbum.java index ad464b187..f1b8fc84b 100644 --- a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestApexEditorAPIContextAlbum.java +++ b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestApexEditorApiContextAlbum.java @@ -26,148 +26,149 @@ import static org.junit.Assert.assertTrue; import org.junit.Test; /** + * Context album for API tests. * @author Liam Fallon (liam.fallon@ericsson.com) */ -public class TestApexEditorAPIContextAlbum { +public class TestApexEditorApiContextAlbum { @Test - public void testContextAlbumCRUD() { + public void testContextAlbumCrud() { final ApexModel apexModel = new ApexModelFactory().createApexModel(null, false); - ApexAPIResult result = apexModel.validateContextAlbum(null, null); - assertEquals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, result.getResult()); + ApexApiResult result = apexModel.validateContextAlbum(null, null); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.validateContextAlbum("%%%$£", null); - assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.loadFromFile("src/test/resources/models/PolicyModel.json"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createContextAlbum("MyMap002", "0.0.2", "APPLICATION", "true", "MapType", "0.0.1", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createContextAlbum("MyMap012", "0.1.2", "ZOOBY", "false", "MapType", "0.0.1", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 012"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createContextAlbum("MyMap012", "0.1.4", "UNDEFINED", null, "MapType", "0.0.1", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 014"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createContextAlbum("MyMap012", null, null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createContextAlbum("MyMap012", null, "EPHEMERAL", null, null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createContextAlbum("MyMap012", null, "EPHEMERAL", "false", null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createContextAlbum("MyMap012", null, "EPHEMERAL", "false", "", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createContextAlbum("MyMap012", null, "EPHEMERAL", "false", "+++", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createContextAlbum("MyMap012", null, "EPHEMERAL", "false", "MapZooby", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createContextAlbum("MyMap012", null, "EPHEMERAL", "false", "MapType", "--++", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createContextAlbum("MyMap012", null, "EPHEMERAL", "false", "MapType", "0.0.2", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createContextAlbum("MyMap012", null, "EPHEMERAL", "false", "MapType", "0.0.1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createContextAlbum("MyMap012", null, "EPHEMERAL", "false", "MapType", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_EXISTS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); result = apexModel.createContextAlbum("MyMap002", "0.0.2", "APPLICATION", "true", "MapType", null, "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_EXISTS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); result = apexModel.createContextAlbum("MyMap011", "0.1.2", "APPLICATION", "true", "MapType", "0.0.1", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.deleteContextAlbum("MyMap012", "0.1.2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createContextAlbum("MyMap012", "0.1.2", "ZOOBY", "false", "MapType", "0.0.1", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 012"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.validateContextAlbum(null, null); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updateContextAlbum(null, null, null, null, null, null, null, null); - assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.updateContextAlbum("MyMap002", "0.0.2", null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updateContextAlbum("MyMap002", "0.0.2", "ZOOBY", "true", null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updateContextAlbum("MyMap002", "0.0.2", null, null, null, null, "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updateContextAlbum("MyMap012", null, null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updateContextAlbum("MyMap012", null, null, "true", null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updateContextAlbum("MyMap012", null, "APPLICATION", null, null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updateContextAlbum("MyMap015", null, null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.updateContextAlbum("MyMap014", "0.1.5", null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.updateContextAlbum("MyMap012", null, "APPLICATION", "false", null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updateContextAlbum("MyMap012", null, "APPLICATION", "false", "StringType", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updateContextAlbum("MyMap012", null, "APPLICATION", "false", "String", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.updateContextAlbum("MyMap012", null, "APPLICATION", "false", "StringType", "0.0.2", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.updateContextAlbum("MyMap012", null, "APPLICATION", "false", "StringType", "0.0.1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updateContextAlbum("MyMap012", null, "APPLICATION", "Hello", "StringType", "0.0.1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listContextAlbum("@£%%$", null); - assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listContextAlbum(null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listContextAlbum("MyMap012", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listContextAlbum("MyMap012", "0.0.2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listContextAlbum("MyMap012", "0.2.5"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listContextAlbum("MyMap014", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deleteContextAlbum("@£%%$", null); - assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deleteContextAlbum("MyMap012", "0.1.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deleteContextAlbum("MyMap012oooo", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listContextAlbum("MyMap012", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertTrue(result.getMessages().size() == 3); result = apexModel.deleteContextAlbum("MyMap012", "0.1.2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listContextAlbum("MyMap012", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertTrue(result.getMessages().size() == 2); result = apexModel.deleteContextAlbum("MyMap012", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listContextAlbum("MyMap012", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deleteContextAlbum(null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(4, result.getMessages().size()); result = apexModel.listContextAlbum(null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(0, result.getMessages().size()); } } diff --git a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestApexEditorAPIContextSchema.java b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestApexEditorApiContextSchema.java index 7eb85da98..25ab6df6b 100644 --- a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestApexEditorAPIContextSchema.java +++ b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestApexEditorApiContextSchema.java @@ -26,127 +26,128 @@ import static org.junit.Assert.assertTrue; import org.junit.Test; /** + * Context schema for API tests. * @author Liam Fallon (liam.fallon@ericsson.com) */ -public class TestApexEditorAPIContextSchema { +public class TestApexEditorApiContextSchema { @Test - public void testContextSchemaCRUD() { + public void testContextSchemaCrud() { final ApexModel apexModel = new ApexModelFactory().createApexModel(null, false); - ApexAPIResult result = apexModel.validateContextSchemas(null, null); - assertEquals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, result.getResult()); + ApexApiResult result = apexModel.validateContextSchemas(null, null); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.validateContextSchemas("%%%$£", null); - assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.loadFromFile("src/test/resources/models/PolicyModel.json"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listContextSchemas(null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createContextSchema("Hello", "0.0.2", "Java", "java.lang.String", "1fa2e430-f2b2-11e6-bc64-92361f002671", "A description of hello"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createContextSchema("Hello", "0.1.2", "Java", "java.lang.String", "1fa2e430-f2b2-11e6-bc64-92361f002672", "A description of hola"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createContextSchema("Hello", "0.1.4", "Java", "java.lang.String", "1fa2e430-f2b2-11e6-bc64-92361f002672", "A description of connichi wa"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createContextSchema("Hello", null, "Java", "java.lang.String", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createContextSchema("Hello", null, "Java", "java.lang.String", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_EXISTS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); result = apexModel.deleteContextSchema("Hello", "0.1.4"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createContextSchema("Hello", "0.1.4", "Java", "java.lang.String", "1fa2e430-f2b2-11e6-bc64-92361f002672", "A description of connichi wa"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createContextSchema("Hello2", null, null, "java.lang.String", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createContextSchema("Hello2", null, null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createContextSchema("Hello2", null, "Java", "java.lang.String", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createContextSchema("Hello", "0.1.2", "Java", "java.lang.Float", "1fa2e430-f2b2-11e6-bc64-92361f002672", "A description of hola"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_EXISTS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); result = apexModel.deleteContextSchema("Hello", "0.1.4"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createContextSchema("Hello", "0.1.4", "Java", "java.lang.String", "1fa2e430-f2b2-11e6-bc64-92361f002672", "A description of connichi wa"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.validateContextSchemas(null, null); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updateContextSchema(null, null, null, null, null, null); - assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.updateContextSchema("Hello", "0.0.2", null, null, null, "An updated description of hello"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updateContextSchema("Hello", "0.0.2", null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updateContextSchema("Hello", "0.1.2", "Java", "java.lang.Integer", "1fa2e430-f2b2-11e6-bc64-92361f002673", "A further updated description of hola"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updateContextSchema("Hello2", "0.0.2", null, null, null, "An updated description of hello"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listContextSchemas("@£%%$", null); - assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listContextSchemas("Hello", "0.1.2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertTrue(result.getMessages().size() == 2); result = apexModel.listContextSchemas("Hello", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertTrue(result.getMessages().size() == 4); result = apexModel.listContextSchemas(null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertTrue(result.getMessages().size() == 9); result = apexModel.deleteContextSchema("@£%%$", null); - assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deleteContextSchema("Hello", "0.1.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deleteContextSchema("Hellooooo", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listContextSchemas("Hello", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertTrue(result.getMessages().size() == 4); result = apexModel.deleteContextSchema("Hello", "0.1.2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listContextSchemas("Hello", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertTrue(result.getMessages().size() == 3); result = apexModel.deleteContextSchema("Hello", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listContextSchemas("Hello", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listContextSchemas(null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.deleteContextSchema(null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(5, result.getMessages().size()); result = apexModel.listContextSchemas(null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(0, result.getMessages().size()); } } diff --git a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestApexEditorAPIEvent.java b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestApexEditorApiEvent.java index da9f48c25..b25c52c9c 100644 --- a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestApexEditorAPIEvent.java +++ b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestApexEditorApiEvent.java @@ -26,171 +26,172 @@ import static org.junit.Assert.assertTrue; import org.junit.Test; /** + * Test events for API tests. * @author Liam Fallon (liam.fallon@ericsson.com) */ -public class TestApexEditorAPIEvent { +public class TestApexEditorApiEvent { @Test - public void testEventCRUD() { + public void testEventCrud() { final ApexModel apexModel = new ApexModelFactory().createApexModel(null, false); - ApexAPIResult result = apexModel.validateEvent(null, null); - assertEquals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, result.getResult()); + ApexApiResult result = apexModel.validateEvent(null, null); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.validateEvent("%%%$£", null); - assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.loadFromFile("src/test/resources/models/PolicyModel.json"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createEvent("MyEvent002", "0.0.2", "My Namespace", "My Source", "my target", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createEvent("MyEvent012", "0.1.2", "My Namespace", "My Source", "my target", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 012"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createEvent("MyEvent012", "0.1.4", "My Namespace", "My Source", "my target", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 014"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createEvent("MyEvent012", null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createEvent("MyEvent012", null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_EXISTS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); result = apexModel.createEvent("MyEvent002", "0.0.2", "My Namespace", "My Source", "my target", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_EXISTS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); result = apexModel.createEvent("@£$%^", "0.2.5", "My Namespace", "My Source", "my target", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.deleteEvent("MyEvent012", "0.1.4"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createEvent("MyEvent012", "0.1.4", "My Namespace", "My Source", "my target", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 014"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.validateEvent(null, null); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updateContextSchema(null, null, null, null, null, null); - assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.updateEvent("MyEvent012", "0.1.2", "Another Namespace", null, "Another target", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updateEvent("MyEvent002", "0.0.2", "My Namespace", "My Source", "my target", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updateEvent("MyEvent012", null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updateEvent("MyEvent015", null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.updateEvent("MyEvent014", "0.1.5", null, null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.updateEvent("@£$%^^", "0.6.9", null, null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.listEvent("@£$%", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.listEvent(null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listEvent("MyEvent012", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listEvent("MyEvent012", "0.0.2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listEvent("MyEvent012", "0.2.5"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listEvent("MyEvent123", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deleteEvent("@£$%^", "0.1.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.deleteEvent("MyEvent012", "0.1.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deleteEvent("MyEvent012oooo", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listEvent("MyEvent012", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertTrue(result.getMessages().size() == 3); result = apexModel.deleteEvent("MyEvent012", "0.1.2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listEvent("MyEvent012", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertTrue(result.getMessages().size() == 2); result = apexModel.deleteEvent("MyEvent012", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listEvent("MyEvent012", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createEventPar("MyEvent123", null, "NewPar00", null, null, false); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createEventPar("MyEvent002", "4.5.6", "NewPar00", null, null, true); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createEventPar("MyEvent002", "0.1.4", "NewPar00", null, null, false); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createEventPar("MyEvent002", "0.0.2", "NewPar00", null, null, true); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createEventPar("MyEvent002", "0.0.2", "NewPar00", "eventContextItem0", null, false); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createEventPar("MyEvent002", "0.0.2", "NewPar00", "eventContextItem0", null, true); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_EXISTS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); result = apexModel.createEventPar("MyEvent002", "0.0.2", "NewPar01", "eventContextItem0", "0.0.1", false); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createEventPar("MyEvent002", "0.0.2", "NewPar02", "eventContextItem0", "0.0.2", true); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createEventPar("MyEvent002", null, "NewPar02", "eventContextItem0", null, false); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createEventPar("MyEvent002", null, "NewPar03", "eventContextItem0", null, true); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listEventPar("@£%%$", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.listEventPar("MyEvent002", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listEventPar("MyEvent002", "0.0.1", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listEventPar("MyEvent002", "0.0.2", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listEventPar("MyEvent002", "0.0.2", "NewPar01"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listEventPar("MyEvent002", "0.0.2", "NewPar02"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listEventPar("MyEvent002", "0.0.2", "NewPar04"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deleteEventPar("@££%%%", "0.0.2", "NewPar04"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.deleteEventPar("NonExistantEvent", "0.0.2", "NewPar04"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); assertEquals(4, apexModel.listEventPar("MyEvent002", null, null).getMessages().size()); result = apexModel.deleteEventPar("MyEvent002", "0.0.2", "NewPar04"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); assertEquals(4, apexModel.listEventPar("MyEvent002", null, null).getMessages().size()); result = apexModel.deleteEventPar("MyEvent002", null, "NewPar02"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(3, apexModel.listEventPar("MyEvent002", null, null).getMessages().size()); result = apexModel.deleteEventPar("MyEvent002", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listEventPar("MyEvent002", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deleteEventPar("MyEvent002", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listEventPar("MyEvent002", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deleteEvent(null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(4, result.getMessages().size()); result = apexModel.listEvent(null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(0, result.getMessages().size()); } } diff --git a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestApexEditorAPIKeyInfo.java b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestApexEditorApiKeyInfo.java index c755b9064..9dae13272 100644 --- a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestApexEditorAPIKeyInfo.java +++ b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestApexEditorApiKeyInfo.java @@ -26,111 +26,112 @@ import static org.junit.Assert.assertTrue; import org.junit.Test; /** + * Key information for API tests. * @author Liam Fallon (liam.fallon@ericsson.com) */ -public class TestApexEditorAPIKeyInfo { +public class TestApexEditorApiKeyInfo { @Test - public void testKeyInfoCRUD() { + public void testKeyInfoCrud() { final ApexModel apexModel = new ApexModelFactory().createApexModel(null, false); - ApexAPIResult result = apexModel.validateKeyInformation(null, null); - assertEquals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, result.getResult()); + ApexApiResult result = apexModel.validateKeyInformation(null, null); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.validateKeyInformation("%%%$£", null); - assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.loadFromFile("src/test/resources/models/PolicyModel.json"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createKeyInformation(null, null, null, null); - assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createKeyInformation("Hello", "0.0.2", "1fa2e430-f2b2-11e6-bc64-92361f002671", "A description of hello"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createKeyInformation("Hello", "0.1.2", "1fa2e430-f2b2-11e6-bc64-92361f002672", "A description of hola"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createKeyInformation("Hello", "0.1.4", "1fa2e430-f2b2-11e6-bc64-92361f002672", "A description of connichi wa"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createKeyInformation("Hello", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createKeyInformation("Hello", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_EXISTS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); result = apexModel.createKeyInformation("Hello", "0.1.2", "1fa2e430-f2b2-11e6-bc64-92361f002672", "A description of hola"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_EXISTS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); result = apexModel.validateKeyInformation(null, null); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updateKeyInformation(null, null, null, null); - assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.updateKeyInformation("Hello", "0.0.2", null, "An updated description of hello"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updateKeyInformation("Hello", "0.0.2", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updateKeyInformation("Hello", "0.1.2", "1fa2e430-f2b2-11e6-bc64-92361f002673", "A further updated description of hola"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updateKeyInformation("Hello2", "0.0.2", null, "An updated description of hello"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listKeyInformation(null, null); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listKeyInformation("%%%$$", null); - assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listKeyInformation("Hello", "0.1.2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertTrue(result.getMessages().size() == 2); result = apexModel.listKeyInformation("Hello", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertTrue(result.getMessages().size() == 4); result = apexModel.deleteKeyInformation("Hello", "0.1.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deleteKeyInformation("Hellooooo", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listKeyInformation("Hello", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertTrue(result.getMessages().size() == 4); result = apexModel.listKeyInformation(null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertTrue(result.getMessages().size() == 22); result = apexModel.deleteKeyInformation("%%%$$", null); - assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deleteKeyInformation("Hello", "0.1.2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listKeyInformation("Hello", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertTrue(result.getMessages().size() == 3); result = apexModel.deleteKeyInformation("Hello", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listKeyInformation("Hello", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deleteKeyInformation(null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(18, result.getMessages().size()); result = apexModel.listKeyInformation(null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(0, result.getMessages().size()); } } diff --git a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestApexEditorAPIPolicy.java b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestApexEditorApiPolicy.java index 94861f9d4..9295ffa5f 100644 --- a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestApexEditorAPIPolicy.java +++ b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestApexEditorApiPolicy.java @@ -26,997 +26,998 @@ import static org.junit.Assert.assertTrue; import org.junit.Test; /** + * Test policies for API tests. * @author Liam Fallon (liam.fallon@ericsson.com) */ -public class TestApexEditorAPIPolicy { +public class TestApexEditorApiPolicy { @Test - public void MyTestPolicyCRUD() { + public void myTestPolicyCrud() { final ApexModel apexModel = new ApexModelFactory().createApexModel(null, false); - ApexAPIResult result = apexModel.validatePolicy(null, null); - assertEquals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, result.getResult()); + ApexApiResult result = apexModel.validatePolicy(null, null); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.validatePolicy("%%%$£", null); - assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.loadFromFile("src/test/resources/models/PolicyModel.json"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicy("MyPolicy002", "0.0.2", "SomeTemplate", "AState", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicy("MyPolicy002", "0.0.2", "SomeTemplate", "AState", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_EXISTS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); result = apexModel.createPolicy("MyPolicy012", null, null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createPolicy("MyPolicy012", null, "SomeTemplate", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createPolicy("MyPolicy013", null, null, "AState", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicy("MyPolicy012", null, "SomeTemplate", "AState", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicy("MyPolicy002", "0.0.2", "SomeTemplate", "AState", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_EXISTS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); result = apexModel.createPolicy("MyPolicy012", "0.1.2", "SomeTemplate", "AState", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicy("MyTestPolicy", "0.0.1", "SomeTemplate", "TestState", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.deletePolicy("MyPolicy002", "0.0.2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicy("MyPolicy002", "0.0.2", "SomeTemplate", "AState", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.validatePolicy(null, null); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updatePolicy("@£$$", "0.0.2", null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.updatePolicy("MyPolicy002", "0.0.2", null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updatePolicy("MyPolicy002", "0.0.1", null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.updatePolicy("MyPolicy002", "0.0.2", "SomeOtherTemplate", "BState", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updatePolicy("MyPolicy012", null, "SomeOtherTemplate", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updatePolicy("MyPolicy012", null, null, "CState", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updatePolicy("MyPolicy012", null, "SomeOtherTemplate", "BState", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updatePolicy("MyPolicy015", null, "SomeOtherTemplate", "DState", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.updatePolicy("MyPolicy014", "0.1.5", "SomeOtherTemplate", "EState", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicy("@£$%%", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.listPolicy(null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(6, result.getMessages().size()); result = apexModel.listPolicy("MyPolicy012", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(2, result.getMessages().size()); result = apexModel.listPolicy("MyPolicy012", "0.0.2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(1, result.getMessages().size()); result = apexModel.listPolicy("MyPolicy012", "0.2.5"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicy("MyPolicy014", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicy("@£$%", "0.1.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.deletePolicy("MyPolicy012", "0.1.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicy("MyPolicy012oooo", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicy("MyPolicy012", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertTrue(result.getMessages().size() == 2); result = apexModel.deletePolicy("MyPolicy002", "0.0.2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertTrue(result.getMessages().size() == 1); result = apexModel.listPolicy("MyPolicy012", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertTrue(result.getMessages().size() == 2); result = apexModel.deletePolicy("MyPolicy012", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertTrue(result.getMessages().size() == 2); result = apexModel.createPolicyState(null, null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createPolicyState("MyPolicy123", null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createPolicyState("MyPolicy123", null, "AState", null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyState("MyTestPolicy", "0.0.2", "AState", null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyState("MyTestPolicy", null, "AState", null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createPolicyState("MyTestPolicy", null, "AState", "ATrigger", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyState("MyTestPolicy", null, "AState", "inEvent", "0.0.2", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyState("MyTestPolicy", null, "AState", "inEvent", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createPolicyState("MyTestPolicy", null, "AState", "inEvent", "0.0.1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createPolicyState("MyTestPolicy", null, "AState", "inEvent", null, "ATask", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyState("MyTestPolicy", null, "AState", "inEvent", null, "task", "0.0.2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyState("MyTestPolicy", null, "AState", "inEvent", null, "task", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyState("MyTestPolicy", null, "AState", "inEvent", null, "task", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_EXISTS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); result = apexModel.createPolicyState("MyTestPolicy", "0.0.1", "AState", "inEvent", "0.0.1", "task", "0.0.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_EXISTS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); result = apexModel.createPolicyState("MyTestPolicy", "0.0.1", "BState", "inEvent", "0.0.1", "task", "0.0.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyState("MyTestPolicy", "0.0.1", "CState", "inEvent", "0.0.1", "task", "0.0.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyState("MyTestPolicy", "0.0.1", "DState", "inEvent", "0.0.1", "task", "0.0.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updatePolicyState(null, null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.updatePolicyState("MyPolicy123", null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.updatePolicyState("MyPolicy123", null, "AState", null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.updatePolicyState("MyTestPolicy", "0.0.2", "AState", null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.updatePolicyState("MyTestPolicy", null, "AState", null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updatePolicyState("MyTestPolicy", null, "ZState", null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.updatePolicyState("MyTestPolicy", null, "AState", "ATrigger", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.updatePolicyState("MyTestPolicy", null, "AState", "inEvent", "0.0.2", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.updatePolicyState("MyTestPolicy", null, "AState", "inEvent", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updatePolicyState("MyTestPolicy", null, "AState", "inEvent", "0.0.2", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.updatePolicyState("MyTestPolicy", null, "AState", "inEvent", null, "ATask", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.updatePolicyState("MyTestPolicy", null, "AState", "inEvent", null, "task", "0.0.2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.updatePolicyState("MyTestPolicy", null, "AState", "inEvent", null, "task", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updatePolicyState("MyTestPolicy", null, "AState", "inEvent", null, "task", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updatePolicyState("MyTestPolicy", "0.0.1", "AState", "inEvent", "0.0.1", "task", "0.0.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updatePolicyState("MyTestPolicy", "0.0.1", "BState", "inEvent", "0.0.1", "task", "0.0.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updatePolicyState("MyTestPolicy", "0.0.1", "CState", "inEvent", "0.0.1", "task", "0.0.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updatePolicyState("MyTestPolicy", "0.0.1", "DState", "inEvent", "0.0.1", "task", "0.0.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listPolicyState("MyTestPolicy", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(4, result.getMessages().size()); result = apexModel.listPolicyState(null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.listPolicyState("SomeOtherPolicy", "0.0.1", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyState("SomeOtherPolicy", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyState("MyTestPolicy", "0.0.2", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyState("MyTestPolicy", "0.0.1", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(4, result.getMessages().size()); result = apexModel.listPolicyState("MyTestPolicy", "0.0.1", "CState"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(1, result.getMessages().size()); result = apexModel.listPolicyState("MyTestPolicy", null, "CState"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(1, result.getMessages().size()); result = apexModel.listPolicyState("MyTestPolicy", "0.0.1", "AState"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(1, result.getMessages().size()); result = apexModel.listPolicyState("MyTestPolicy", "0.0.1", "EState"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicyState("@£$$", "0.0.2", "Trigger04"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); assertEquals(4, apexModel.listPolicyState("MyTestPolicy", null, null).getMessages().size()); result = apexModel.deletePolicyState("MyTestPolicy", "0.0.2", "Trigger04"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); assertEquals(4, apexModel.listPolicyState("MyTestPolicy", null, null).getMessages().size()); result = apexModel.deletePolicyState("MyTestPolicy", null, "CState"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.deletePolicyState("MyTestPolicy", null, "ZState"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); assertEquals(3, apexModel.listPolicyState("MyTestPolicy", null, null).getMessages().size()); result = apexModel.deletePolicyState("MyTestPolicy", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listPolicyState("MyTestPolicy", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicyState("MyTestPolicy", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyState("MyTestPolicy", "0.0.1", "TestState1", "inEvent", "0.0.1", "task", "0.0.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyState("MyTestPolicy", "0.0.1", "TestState2", "outEvent0", "0.0.1", "task", "0.0.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyState("MyTestPolicy", "0.0.1", "TestState3", "outEvent1", "0.0.1", "task", "0.0.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyStateTaskSelectionLogic(null, null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createPolicyStateTaskSelectionLogic("MyTestPolicy", null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createPolicyStateTaskSelectionLogic("MyTestPolicy", null, "SomeState", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyStateTaskSelectionLogic("MyTestPolicy", "1.2.3", "TestState1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.1", "TestState1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createPolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.1", "TestState1", "NewTSL00", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createPolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.1", "TestState1", "UNDEFINED", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.1", "TestState1", "MVEL", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_EXISTS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); result = apexModel.deletePolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.1", "TestState1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.1", "TestState1", "JAVA", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.1", "TestState1", "JYTHON", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_EXISTS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); result = apexModel.deletePolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.1", "TestState1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyStateTaskSelectionLogic("MyTestPolicy", null, "TestState1", "JAVASCRIPT", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.deletePolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.1", "TestState1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyStateTaskSelectionLogic("MyTestPolicy", null, "TestState1", "JRUBY", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updatePolicyStateTaskSelectionLogic(null, null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.updatePolicyStateTaskSelectionLogic("MyTestPolicy", null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.updatePolicyStateTaskSelectionLogic("MyTestPolicy", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updatePolicyStateTaskSelectionLogic("MyTestPolicy", null, "TestState99", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.updatePolicyStateTaskSelectionLogic("MyTestPolicy2", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.updatePolicyStateTaskSelectionLogic("MyTestPolicy1", "0.0.2", "TestState1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.updatePolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.1", "TestState1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updatePolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.1", "NonExistantState", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.updatePolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.1", "TestState1", "", "Some Other Policy Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.updatePolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.1", "TestState1", "MVEL", "Some Other Policy Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updatePolicyStateTaskSelectionLogic("MyPolicy012", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.updatePolicyStateTaskSelectionLogic("MyTestPolicy", null, "TestState1", null, "Some Other Policy Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updatePolicyStateTaskSelectionLogic("MyTestPolicy", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updatePolicyStateTaskSelectionLogic("MyPolicy015", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.updatePolicyStateTaskSelectionLogic("MyPolicy014", "0.1.5", "TestState1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateTaskSelectionLogic(null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.listPolicyStateTaskSelectionLogic("zooby", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.listPolicyStateTaskSelectionLogic("zooby", null, "looby"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateTaskSelectionLogic("zooby", null, "TestState1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateTaskSelectionLogic("MyTestPolicy", null, "looby"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.2", "TestState1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateTaskSelectionLogic("MyTestPolicy", null, "TestState1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(1, result.getMessages().size()); result = apexModel.deletePolicyStateTaskSelectionLogic(null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.deletePolicyStateTaskSelectionLogic("zooby", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.deletePolicyStateTaskSelectionLogic("zooby", null, "looby"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicyStateTaskSelectionLogic("zooby", null, "TestState1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicyStateTaskSelectionLogic("MyTestPolicy", null, "looby"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.2", "TestState1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.1", "TestState1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listPolicyStateTaskSelectionLogic("MyTestPolicy", null, "TestState1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.deletePolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.1", "TestState1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.updatePolicyStateTaskSelectionLogic("MyTestPolicy", null, "TestState1", null, "Some Other Policy Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateTaskSelectionLogic("MyTestPolicy", null, "TestState1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(1, result.getMessages().size()); result = apexModel.createPolicyStateTaskSelectionLogic("MyTestPolicy", null, "TestState1", "JRUBY", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listPolicyStateTaskSelectionLogic("MyTestPolicy", null, "TestState1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.deletePolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.1", "TestState1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.deletePolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.1", "TestState1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyStateOutput(null, null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createPolicyStateOutput("MyTestPolicy", null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createPolicyStateOutput("MyTestPolicy", null, "SomeState", null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createPolicyStateOutput("MyTestPolicy", null, "SomeState", "SomeOutput", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyStateOutput("MyTestPolicy", "1.2.3", "TestState1", "SomeOutput", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState1", "SomeOutput", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState1", "SomeOutput", "SomeDummyEvent", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState1", "SomeOutput", "inEvent", "1.2.3", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState1", "SomeOutput", "inEvent", "0.0.1", "SomeDummyNextState"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState1", "SomeOutput", "inEvent", "0.0.1", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState1", "SomeOtherOutput", "inEvent", "0.0.1", "TestState1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState1", "SomeOtherOutput", "inEvent", "0.0.1", "TestState2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState1", "SomeOtherOutput", "inEvent", "0.0.1", "TestState2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_EXISTS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); result = apexModel.createPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState2", "AnotherOtherOutput", "outEvent0", "0.0.1", "TestState3"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState2", "YetAnotherOtherOutput", "outEvent0", "0.0.1", "TestState3"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listPolicyStateOutput(null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.listPolicyStateOutput("MyTestPolicy", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.listPolicyStateOutput("MyTestPolicy", "0.0.1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.listPolicyStateOutput("MyTestPolicy", "0.0.2", "TestState1", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateOutput("MyTestPolicy", null, "SomeState", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateOutput("MyTestPolicy", "0.0.1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.listPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState1", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(2, result.getMessages().size()); result = apexModel.listPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState2", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(2, result.getMessages().size()); result = apexModel.listPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState1", "YetAnotherOtherOutput"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState2", "YetAnotherOtherOutput"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(1, result.getMessages().size()); result = apexModel.listPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState3", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicyStateOutput(null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.deletePolicyStateOutput("MyTestPolicy", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.deletePolicyStateOutput("MyTestPolicy", "0.0.1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.deletePolicyStateOutput("MyTestPolicy", "0.0.2", "TestState1", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicyStateOutput("MyTestPolicy", null, "SomeState", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicyStateOutput("MyTestPolicy", "0.0.1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.deletePolicyStateOutput("MyTestPolicy", "0.0.1", "TestState3", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicyStateOutput("MyTestPolicy", "0.0.1", "TestState3", "DummyOutput"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateOutput("MyTestPolicy", null, "TestState1", null); assertEquals(2, result.getMessages().size()); result = apexModel.deletePolicyStateOutput("MyTestPolicy", null, "TestState1", "SomeOutput"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(1, result.getMessages().size()); result = apexModel.listPolicyStateOutput("MyTestPolicy", null, "TestState1", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(1, result.getMessages().size()); result = apexModel.deletePolicyStateOutput("MyTestPolicy", null, "TestState1", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(1, result.getMessages().size()); result = apexModel.listPolicyStateOutput("MyTestPolicy", null, "TestState1", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateOutput("MyTestPolicy", null, "TestState2", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(2, result.getMessages().size()); result = apexModel.deletePolicyStateOutput("MyTestPolicy", null, "TestState2", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(2, result.getMessages().size()); result = apexModel.listPolicyStateOutput("MyTestPolicy", null, "TestState2", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState1", "SomeOutput", "inEvent", "0.0.1", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState1", "SomeOtherOutput", "inEvent", "0.0.1", "TestState1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState1", "SomeOtherOutput", "inEvent", "0.0.1", "TestState2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState2", "AnotherOtherOutput", "outEvent0", "0.0.1", "TestState3"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState2", "YetAnotherOtherOutput", "outEvent0", "0.0.1", "TestState3"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyStateFinalizerLogic(null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", null, null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", null, "SomeState", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", null, "SomeState", "SFLName01", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", "1.2.3", "TestState1", "SFLName01", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "SFLName01", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "SFLName01", "NewTSL00", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "SFLName02", "UNDEFINED", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "SFLName03", "MVEL", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "SFLName03", "MVEL", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_EXISTS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "SFLName04", "JAVA", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "SFLName05", "JYTHON", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", null, "TestState1", "SFLName06", "JAVASCRIPT", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", null, "TestState1", "SFLName07", "JRUBY", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updatePolicyStateFinalizerLogic(null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.updatePolicyStateFinalizerLogic("MyTestPolicy", null, null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.updatePolicyStateFinalizerLogic("MyTestPolicy", null, "TestState1", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.updatePolicyStateFinalizerLogic("MyTestPolicy", null, "TestState99", "SomeSFLName", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.updatePolicyStateFinalizerLogic("MyTestPolicy2", null, "TestState1", "SomeSFLName", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.updatePolicyStateFinalizerLogic("MyTestPolicy1", "0.0.2", "TestState1", "SomeSFLName", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.updatePolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "NonEistantSFL", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.updatePolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "SFLName06", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updatePolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "SFLName06", "", "Some Other Policy Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.updatePolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "SFLName06", "MVEL", "Some Other Policy Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updatePolicyStateFinalizerLogic("MyPolicy012", null, "TestState1", "SFLName06", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.updatePolicyStateFinalizerLogic("MyTestPolicy", null, "TestState1", "SFLName06", null, "Some Other Policy Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updatePolicyStateFinalizerLogic("MyTestPolicy", null, "TestState1", "SFLName06", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updatePolicyStateFinalizerLogic("MyPolicy015", null, "TestState1", "SFLName06", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.updatePolicyStateFinalizerLogic("MyPolicy014", "0.1.5", "TestState1", "SFLName06", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateFinalizerLogic(null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.listPolicyStateFinalizerLogic("MyTestPolicy", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.listPolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.listPolicyStateFinalizerLogic("MyTestPolicy", "0.0.2", "TestState1", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateFinalizerLogic("MyTestPolicy", null, "SomeState", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.listPolicyStateFinalizerLogic("zooby", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.listPolicyStateFinalizerLogic("zooby", null, "looby", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateFinalizerLogic("zooby", null, "TestState1", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateFinalizerLogic("MyTestPolicy", null, "looby", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateFinalizerLogic("MyTestPolicy", "0.0.2", "TestState1", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateFinalizerLogic("MyTestPolicy", null, "TestState1", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(6, result.getMessages().size()); result = apexModel.listPolicyStateFinalizerLogic("MyTestPolicy", null, "TestState1", "SFLName06"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(1, result.getMessages().size()); result = apexModel.deletePolicyStateFinalizerLogic(null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.deletePolicyStateFinalizerLogic("MyTestPolicy", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.deletePolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.deletePolicyStateFinalizerLogic("MyTestPolicy", "0.0.2", "TestState1", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicyStateFinalizerLogic("MyTestPolicy", null, "SomeState", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.deletePolicyStateFinalizerLogic("zooby", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.deletePolicyStateFinalizerLogic("zooby", null, "looby", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicyStateFinalizerLogic("zooby", null, "TestState1", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicyStateFinalizerLogic("MyTestPolicy", null, "looby", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicyStateFinalizerLogic("MyTestPolicy", "0.0.2", "TestState1", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "SFLName06"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.deletePolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "SFLName06"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); assertEquals(1, result.getMessages().size()); result = apexModel.listPolicyStateFinalizerLogic("MyTestPolicy", null, "TestState1", "SFLName06"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateFinalizerLogic("MyTestPolicy", null, "TestState1", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(5, result.getMessages().size()); result = apexModel.deletePolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "SFLName02"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.deletePolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "SFLName02"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); assertEquals(1, result.getMessages().size()); result = apexModel.listPolicyStateFinalizerLogic("MyTestPolicy", null, "TestState1", "SFLName02"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateFinalizerLogic("MyTestPolicy", null, "TestState1", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(4, result.getMessages().size()); result = apexModel.deletePolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(4, result.getMessages().size()); result = apexModel.deletePolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateFinalizerLogic("MyTestPolicy", null, "TestState1", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "SFLName02", "UNDEFINED", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "SFLName03", "MVEL", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "SFLName04", "JAVA", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "SFLName05", "JYTHON", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", null, "TestState1", "SFLName06", "JAVASCRIPT", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", null, "TestState1", "SFLName07", "JRUBY", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createTask("TestTask0", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createTask("TestTask1", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createTask("TestTask2", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createTask("TestTask3", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createTask("TestTask4", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyStateTaskRef(null, null, null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", null, null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", null, "SomeState", null, null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", null, "SomeState", null, null, null, null, "DummyOutput"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", "1.2.3", "SomeState", null, null, null, null, "DummyOutput"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyStateTaskRef("AnyOldPolicy", "1.2.3", "SomeState", null, null, null, null, "DummyOutput"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", "0.0.1", "TestState1", "SomeTaskLocalName", null, null, null, "DummyOutput"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", "0.0.1", "TestState1", "SomeTaskLocalName", "SomeTask", "Zooby|", null, "DummyOutput"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", "0.0.1", "TestState1", "SomeTaskLocalName", "SomeTask", "0.0.1", null, "DummyOutput"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", "0.0.1", "TestState1", "SomeTaskLocalName", "task", "0.0.1", null, "DummyOutput"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", "0.0.1", "TestState1", "SomeTaskLocalName", "task", "0.0.1", "Some Policy Logic", "DummyOutput"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", "0.0.1", "TestState1", "SomeTaskLocalName", "task", "0.0.1", "DIRECT", "DummyOutput"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", "0.0.1", "TestState1", "SomeTaskLocalName", "task", "0.0.1", "LOGIC", "DummyOutput"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", null, "TestState1", "SomeTaskLocalName", "task", "0.0.1", "DIRECT", "SFLName07"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", null, "TestState1", "SomeTaskLocalName", "task", "0.0.1", "LOGIC", "SomeOutput"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", null, "TestState1", "SomeTaskLocalName", "task", "0.0.1", "DIRECT", "SomeOutput"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", null, "TestState1", "SomeTaskLocalName", "NonExistantTask", "0.0.1", "DIRECT", "SomeOutput"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", null, "TestState1", "SomeTaskLocalName", "task", "0.0.1", "LOGIC", "SFLName07"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_EXISTS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", null, "TestState1", "SomeTaskLocalName", "TestTask0", "0.0.1", "LOGIC", "SFLName07"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", null, "TestState1", "SomeTaskLocalName", "TestTask1", "0.0.1", "DIRECT", "SomeOtherOutput"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", null, "TestState1", "SomeTaskLocalName", "TestTask2", "0.0.1", "LOGIC", "SFLName07"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", null, "TestState1", "SomeTaskLocalName", "TestTask3", "0.0.1", "DIRECT", "SomeOtherOutput"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", null, "TestState1", null, "TestTask4", "0.0.1", "LOGIC", "SFLName07"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", null, "TestState1", null, "TestTask4", "0.0.1", "LOGIC", "SFLName07"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_EXISTS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); result = apexModel.deletePolicyStateTaskRef("MyTestPolicy", null, "TestState1", "TestTask4", "0.0.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", null, "TestState1", "SomeTaskLocalName", "TestTask4", "0.0.1", "FUNKY", "SFLName07"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", null, "TestState1", "SomeTaskLocalName", "TestTask4", "0.0.1", "UNDEFINED", "SFLName07"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", null, "TestState1", "SomeTaskLocalName", "TestTask4", "0.0.1", "LOGIC", "SFLName07"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", null, "TestState1", null, "TestTask0", "0.0.1", "LOGIC", "SFLName07"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_EXISTS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); result = apexModel.listPolicyStateTaskRef(null, null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.listPolicyStateTaskRef("MyTestPolicy", null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.listPolicyStateTaskRef("MyTestPolicy", "0.0.1", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.listPolicyStateTaskRef("MyTestPolicy", "0.0.2", "TestState1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateTaskRef("MyTestPolicy", null, "SomeState", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateTaskRef("MyTestPolicy", "0.0.1", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.listPolicyStateTaskRef("zooby", null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.listPolicyStateTaskRef("zooby", null, "looby", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateTaskRef("zooby", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateTaskRef("MyTestPolicy", null, "looby", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateTaskRef("MyTestPolicy", "0.0.2", "TestState1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateTaskRef("MyTestPolicy", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(12, result.getMessages().size()); result = apexModel.listPolicyStateTaskRef("MyTestPolicy", null, "TestState1", "SomeOldTask", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateTaskRef("MyTestPolicy", null, "TestState1", "task", "1.0.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); assertEquals(1, result.getMessages().size()); result = apexModel.listPolicyStateTaskRef("MyTestPolicy", null, "TestState1", "task", "0.0.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(2, result.getMessages().size()); result = apexModel.listPolicyStateTaskRef("MyTestPolicy", null, "TestState1", "task", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(2, result.getMessages().size()); result = apexModel.deletePolicyStateTaskRef(null, null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.deletePolicyStateTaskRef("MyTestPolicy", null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.deletePolicyStateTaskRef("MyTestPolicy", "0.0.1", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.deletePolicyStateTaskRef("MyTestPolicy", "0.0.2", "TestState1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicyStateTaskRef("MyTestPolicy", null, "SomeState", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicyStateTaskRef("MyTestPolicy", "0.0.1", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.deletePolicyStateTaskRef("zooby", null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.deletePolicyStateTaskRef("zooby", null, "looby", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicyStateTaskRef("zooby", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicyStateTaskRef("MyTestPolicy", null, "looby", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicyStateTaskRef("MyTestPolicy", "0.0.2", "TestState1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicyStateTaskRef("MyTestPolicy", "0.0.2", "TestState1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicyStateTaskRef("MyTestPolicy", "0.0.1", "TestState1", "ADummyTask", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicyStateTaskRef("MyTestPolicy", "0.0.1", "TestState1", "task", "0.0.2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateTaskRef("MyTestPolicy", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(12, result.getMessages().size()); result = apexModel.deletePolicyStateTaskRef("MyTestPolicy", null, "TestState1", "TestTask0", "0.0.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(1, result.getMessages().size()); result = apexModel.listPolicyStateTaskRef("MyTestPolicy", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(10, result.getMessages().size()); result = apexModel.deletePolicyStateTaskRef("MyTestPolicy", null, "TestState1", "TestTask2", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(1, result.getMessages().size()); result = apexModel.listPolicyStateTaskRef("MyTestPolicy", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(8, result.getMessages().size()); result = apexModel.deletePolicyStateTaskRef("MyTestPolicy", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(4, result.getMessages().size()); result = apexModel.listPolicyStateTaskRef("MyTestPolicy", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyStateContextRef(null, null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createPolicyStateContextRef("MyTestPolicy", null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createPolicyStateContextRef("MyTestPolicy", null, "SomeState", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyStateContextRef("MyTestPolicy", null, "SomeState", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyStateContextRef("MyTestPolicy", "1.2.3", "SomeState", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyStateContextRef("AnyOldPolicy", "1.2.3", "SomeState", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "SomeTask", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "SomeTask", "Zooby|"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "SomeTask", "0.0.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "task", "0.0.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyStateContextRef("MyPolicy123", null, null, "AContextMap00", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createPolicyStateContextRef("MyPolicy123", null, "TestState1", "AContextMap00", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyStateContextRef("MyTestPolicy", "4.5.6", "TestState1", "AContextMap00", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyStateContextRef("MyTestPolicy", "0.1.4", "TestState1", "AContextMap00", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "AContextMap00", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "contextAlbum0", ""); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "contextAlbum0", "0.0.2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "contextAlbum0", "0.0.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "contextAlbum0", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_EXISTS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); result = apexModel.createPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "contextAlbum0", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_EXISTS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); result = apexModel.createPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "contextAlbum1", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "contextAlbum0", "0.0.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_EXISTS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); result = apexModel.createPolicyStateContextRef("MyTestPolicy", null, "TestState1", "contextAlbum0", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_EXISTS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); result = apexModel.listPolicyStateContextRef(null, null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.listPolicyStateContextRef("MyTestPolicy", null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.listPolicyStateContextRef("MyTestPolicy", "0.0.1", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.listPolicyStateContextRef("MyTestPolicy", "0.0.2", "TestState1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateContextRef("MyTestPolicy", null, "SomeState", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateContextRef("MyTestPolicy", "0.0.1", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.listPolicyStateContextRef("zooby", null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.listPolicyStateContextRef("zooby", null, "looby", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateContextRef("zooby", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateContextRef("MyTestPolicy", null, "looby", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateContextRef("MyTestPolicy", "0.0.2", "TestState1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateContextRef("MyTestPolicy", null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.listPolicyStateContextRef("MyTestPolicy", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(2, result.getMessages().size()); result = apexModel.listPolicyStateContextRef("MyTestPolicy", "0.0.2", "TestState1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(2, result.getMessages().size()); result = apexModel.listPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "contextAlbum0", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(1, result.getMessages().size()); result = apexModel.listPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "contextAlbum0", "0.0.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(1, result.getMessages().size()); result = apexModel.listPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "contextAlbum0", "0.0.2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "AContextMap04", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "contextAlbum0", "0.0.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(1, result.getMessages().size()); result = apexModel.listPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "contextAlbum0", "1.0.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicyStateContextRef(null, null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.deletePolicyStateContextRef("MyTestPolicy", null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.deletePolicyStateContextRef("MyTestPolicy", "0.0.1", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.deletePolicyStateContextRef("MyTestPolicy", "0.0.2", "TestState1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicyStateContextRef("MyTestPolicy", null, "SomeState", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicyStateContextRef("MyTestPolicy", "0.0.1", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.deletePolicyStateContextRef("zooby", null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.deletePolicyStateContextRef("zooby", null, "looby", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicyStateContextRef("zooby", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicyStateContextRef("MyTestPolicy", null, "looby", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicyStateContextRef("MyTestPolicy", "0.0.2", "TestState1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicyStateContextRef("MyTestPolicy", "0.0.2", "TestState1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "ADummyContextMap", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "contextAlbum0", "0.0.2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listPolicyStateContextRef("MyTestPolicy", null, null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.deletePolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "AContextMap04", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicyStateContextRef("MyTestPolicy", null, "TestState1", "contextAlbum0", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.deletePolicyStateContextRef("MyTestPolicy", null, "TestState1", "contextAlbum0", "0.1.5"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicyStateContextRef("MyTestPolicy", null, "TestState1", "contextAlbum1", "0.0.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(1, result.getMessages().size()); result = apexModel.createPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "contextAlbum0", "0.0.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.deletePolicyStateContextRef("MyTestPolicy", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.deletePolicyStateContextRef("MyTestPolicy", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); assertEquals(1, result.getMessages().size()); result = apexModel.listPolicyStateContextRef("MyTestPolicy", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deletePolicy(null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(3, result.getMessages().size()); result = apexModel.listPolicy(null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(0, result.getMessages().size()); } } diff --git a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestApexEditorAPITask.java b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestApexEditorApiTask.java index e39da2876..9faa3653c 100644 --- a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestApexEditorAPITask.java +++ b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestApexEditorApiTask.java @@ -26,459 +26,460 @@ import static org.junit.Assert.assertTrue; import org.junit.Test; /** + * Test tasks for API tests. * @author Liam Fallon (liam.fallon@ericsson.com) */ -public class TestApexEditorAPITask { +public class TestApexEditorApiTask { @Test - public void testTaskCRUD() { + public void testTaskCrud() { final ApexModel apexModel = new ApexModelFactory().createApexModel(null, false); - ApexAPIResult result = apexModel.validateTask(null, null); - assertEquals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, result.getResult()); + ApexApiResult result = apexModel.validateTask(null, null); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.validateTask("%%%$£", null); - assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.loadFromFile("src/test/resources/models/PolicyModel.json"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createTask("@^^$^^$", "0.0.2", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createTask("MyTask002", "0.0.2", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createTask("MyTask002", "0.0.2", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_EXISTS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); result = apexModel.createTask("MyTask012", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createTask("MyTask012", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_EXISTS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); result = apexModel.listTask(null, null); result = apexModel.createTask("MyTask002", "0.0.2", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_EXISTS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); result = apexModel.createTask("MyTask012", "0.1.2", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.deleteTask("MyTask002", "0.0.2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createTask("MyTask002", "0.0.2", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.validateTask(null, null); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updateTask("@$$$£", "0.0.2", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.updateTask("MyTask002", "0.0.2", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updateTask("MyTask002", "0.0.1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.updateTask("MyTask002", "0.0.2", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updateTask("MyTask012", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updateTask("MyTask012", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updateTask("MyTask012", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updateTask("MyTask015", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.updateTask("MyTask014", "0.1.5", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listTask("£@£@@£@£", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.listTask(null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listTask("MyTask012", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listTask("MyTask012", "0.0.2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listTask("MyTask012", "0.2.5"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listTask("MyTask014", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deleteTask("@£££@", "0.1.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.deleteTask("MyTask012", "0.1.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deleteTask("MyTask012oooo", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listTask("MyTask012", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertTrue(result.getMessages().size() == 2); result = apexModel.deleteTask("MyTask012", "0.1.2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listTask("MyTask012", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertTrue(result.getMessages().size() == 1); result = apexModel.deleteTask("MyTask012", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listTask("MyTask012", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.updateTaskLogic("MyTask002", null, "NewLogic00", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createTaskLogic("MyTask123", null, "NewLogic00", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createTaskLogic("MyTask002", "4.5.6", "NewLogic00", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createTaskLogic("MyTask002", "0.1.4", "NewLogic00", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createTaskLogic("MyTask002", "0.0.2", "NewLogic00", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createTaskLogic("MyTask002", "0.0.2", "UNDEFINED", "Some Task Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createTaskLogic("MyTask002", "0.0.2", "MVEL", "Some Task Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_EXISTS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); result = apexModel.deleteTaskLogic("MyTask002", "0.0.2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createTaskLogic("MyTask002", "0.0.2", "JAVA", "Some Task Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createTaskLogic("MyTask002", "0.0.2", "JYTHON", "Some Task Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_EXISTS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); result = apexModel.deleteTaskLogic("MyTask002", "0.0.2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createTaskLogic("MyTask002", null, "JAVASCRIPT", "Some Task Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.deleteTaskLogic("MyTask002", "0.0.2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createTaskLogic("MyTask002", null, "JRUBY", "Some Task Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updateTaskLogic("MyTask002", "0.0.2", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updateTaskLogic("MyTask002", "0.0.1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.updateTaskLogic("MyTask002", "0.0.2", "", "Some Other Task Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.updateTaskLogic("MyTask002", "0.0.2", "MVEL", "Some Other Task Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updateTaskLogic("MyTask012", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.updateTaskLogic("MyTask002", null, null, "Some Other Task Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updateTaskLogic("MyTask002", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.updateTaskLogic("MyTask015", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.updateTaskLogic("MyTask014", "0.1.5", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listTaskLogic("MyTask002", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listTaskLogic("MyTask002", "0.0.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listTaskLogic("MyTask002", "0.0.2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listTaskLogic("MyTask002", "0.0.2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listTaskLogic("MyTask002", "0.0.2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listTaskLogic(null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.deleteTaskLogic("@£@£@£", "0.0.2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.deleteTaskLogic("NonExistantTask", "0.0.2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); assertEquals(1, apexModel.listTaskLogic("MyTask002", null).getMessages().size()); result = apexModel.deleteTaskLogic("MyTask002", "0.0.2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listTaskLogic("MyTask002", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.deleteTaskLogic("MyTask002", "0.0.2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); assertEquals(1, apexModel.listTaskLogic("MyTask002", null).getMessages().size()); result = apexModel.createTaskLogic("MyTask002", null, "JRUBY", "Some Task Logic"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listTaskLogic("MyTask002", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.deleteTaskLogic("MyTask002", "0.0.2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.deleteTaskLogic("MyTask002", "0.0.2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createTaskInputField("MyTask123", null, "NewField00", null, null, false); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createTaskInputField("MyTask002", "4.5.6", "NewField00", null, null, true); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createTaskInputField("MyTask002", "0.1.4", "NewField00", null, null, false); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createTaskInputField("MyTask002", "0.0.2", "NewField00", null, null, true); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createTaskInputField("MyTask002", "0.0.2", "NewField00", "eventContextItem0", null, false); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createTaskInputField("MyTask002", "0.0.2", "NewField00", "eventContextItem0", null, true); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_EXISTS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); result = apexModel.createTaskInputField("MyTask002", "0.0.2", "NewField01", "eventContextItem0", "0.0.1", false); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createTaskInputField("MyTask002", "0.0.2", "NewField02", "eventContextItem0", "0.0.2", true); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createTaskInputField("MyTask002", null, "NewField02", "eventContextItem0", null, false); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createTaskInputField("MyTask002", null, "NewField03", "eventContextItem0", null, true); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listTaskInputField("@£$%", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.listTaskInputField("MyTask002", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listTaskInputField("MyTask002", "0.0.1", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listTaskInputField("MyTask002", "0.0.2", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listTaskInputField("MyTask002", "0.0.2", "NewField01"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listTaskInputField("MyTask002", "0.0.2", "NewField02"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listTaskInputField("MyTask002", "0.0.2", "NewField04"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deleteTaskInputField("@£$%", "0.0.2", "NewField04"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.deleteTaskInputField("NonExistantTask", "0.0.2", "NewField04"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); assertEquals(4, apexModel.listTaskInputField("MyTask002", null, null).getMessages().size()); result = apexModel.deleteTaskInputField("MyTask002", "0.0.2", "NewField04"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); assertEquals(4, apexModel.listTaskInputField("MyTask002", null, null).getMessages().size()); result = apexModel.deleteTaskInputField("MyTask002", null, "NewField02"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(3, apexModel.listTaskInputField("MyTask002", null, null).getMessages().size()); result = apexModel.deleteTaskInputField("MyTask002", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listTaskInputField("MyTask002", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deleteTaskInputField("MyTask002", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createTaskOutputField("MyTask123", null, "NewField00", null, null, false); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createTaskOutputField("MyTask002", "4.5.6", "NewField00", null, null, false); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createTaskOutputField("MyTask002", "0.1.4", "NewField00", null, null, false); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createTaskOutputField("MyTask002", "0.0.2", "NewField00", null, null, false); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createTaskOutputField("MyTask002", "0.0.2", "NewField00", "eventContextItem0", null, false); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createTaskOutputField("MyTask002", "0.0.2", "NewField00", "eventContextItem0", null, false); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_EXISTS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); result = apexModel.createTaskOutputField("MyTask002", "0.0.2", "NewField01", "eventContextItem0", "0.0.1", false); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createTaskOutputField("MyTask002", "0.0.2", "NewField02", "eventContextItem0", "0.0.2", false); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createTaskOutputField("MyTask002", null, "NewField02", "eventContextItem0", null, false); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createTaskOutputField("MyTask002", null, "NewField03", "eventContextItem0", null, false); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listTaskOutputField("@£$%", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.listTaskOutputField("MyTask002", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listTaskOutputField("MyTask002", "0.0.1", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listTaskOutputField("MyTask002", "0.0.2", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listTaskOutputField("MyTask002", "0.0.2", "NewField01"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listTaskOutputField("MyTask002", "0.0.2", "NewField02"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listTaskOutputField("MyTask002", "0.0.2", "NewField04"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deleteTaskOutputField("@£$%", "0.0.2", "NewField04"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.deleteTaskOutputField("NonExistantTask", "0.0.2", "NewField04"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); assertEquals(4, apexModel.listTaskOutputField("MyTask002", null, null).getMessages().size()); result = apexModel.deleteTaskOutputField("MyTask002", "0.0.2", "NewField04"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); assertEquals(4, apexModel.listTaskOutputField("MyTask002", null, null).getMessages().size()); result = apexModel.deleteTaskOutputField("MyTask002", null, "NewField02"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(3, apexModel.listTaskOutputField("MyTask002", null, null).getMessages().size()); result = apexModel.deleteTaskOutputField("MyTask002", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listTaskOutputField("MyTask002", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deleteTaskOutputField("MyTask002", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createTaskParameter("MyTask123", null, "NewPar00", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createTaskParameter("MyTask002", "4.5.6", "NewPar00", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createTaskParameter("MyTask002", "0.1.4", "NewPar00", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createTaskParameter("MyTask002", "0.0.2", "NewPar00", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createTaskParameter("MyTask002", "0.0.2", "NewPar00", "eventContextItem0"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createTaskParameter("MyTask002", "0.0.2", "NewPar00", "eventContextItem0"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_EXISTS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); result = apexModel.createTaskParameter("MyTask002", "0.0.2", "NewPar01", "eventContextItem0"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createTaskParameter("MyTask002", "0.0.2", "NewPar02", "eventContextItem0"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createTaskParameter("MyTask002", "0.0.2", "NewPar02", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_EXISTS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); result = apexModel.createTaskParameter("MyTask002", "0.0.2", "NewPar03", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createTaskParameter("MyTask002", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createTaskParameter("MyTask002", null, null, "Default value"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.listTaskParameter("@£$%", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.listTaskParameter("MyTask002", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listTaskParameter("MyTask002", "0.0.3", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listTaskParameter("MyTask002", "0.0.2", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listTaskParameter("MyTask002", "0.0.2", "NewPar01"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listTaskParameter("MyTask002", "0.0.2", "NewPar02"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listTaskParameter("MyTask002", "0.0.2", "NewPar04"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deleteTaskParameter("@£$%", "0.0.2", "NewPar04"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.deleteTaskParameter("NonExistantTask", "0.0.2", "NewPar04"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); assertEquals(3, apexModel.listTaskParameter("MyTask002", null, null).getMessages().size()); result = apexModel.deleteTaskParameter("MyTask002", "0.0.2", "NewPar04"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); assertEquals(3, apexModel.listTaskParameter("MyTask002", null, null).getMessages().size()); result = apexModel.deleteTaskParameter("MyTask002", null, "NewPar02"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(2, apexModel.listTaskParameter("MyTask002", null, null).getMessages().size()); result = apexModel.deleteTaskParameter("MyTask002", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.listTaskParameter("MyTask002", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deleteTaskParameter("MyTask002", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createTaskContextRef("@£$$", null, "AContextMap00", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.createTaskContextRef("MyTask123", null, "AContextMap00", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createTaskContextRef("MyTask123", null, "AContextMap00", "0.0.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createTaskContextRef("MyTask123", null, "AContextMap00", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createTaskContextRef("MyTask002", "4.5.6", "AContextMap00", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createTaskContextRef("MyTask002", "0.1.4", "AContextMap00", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createTaskContextRef("MyTask002", "0.0.2", "AContextMap00", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createTaskContextRef("MyTask002", "0.0.2", "contextAlbum2", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createTaskContextRef("MyTask002", "0.0.2", "contextAlbum0", "0.0.2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.createTaskContextRef("MyTask002", "0.0.2", "contextAlbum0", "0.0.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createTaskContextRef("MyTask002", "0.0.2", "contextAlbum0", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_EXISTS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); result = apexModel.createTaskContextRef("MyTask002", "0.0.2", "contextAlbum1", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.createTaskContextRef("MyTask002", "0.0.2", "contextAlbum0", "0.0.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_EXISTS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); result = apexModel.createTaskContextRef("MyTask002", null, "contextAlbum0", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_EXISTS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); result = apexModel.listTaskContextRef("@£$%", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.listTaskContextRef("MyTask002", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(2, result.getMessages().size()); result = apexModel.listTaskContextRef("MyTask002", "0.0.1", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listTaskContextRef("MyTask002", "0.0.2", null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(2, result.getMessages().size()); result = apexModel.listTaskContextRef("MyTask002", "0.0.2", "contextAlbum0", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(1, result.getMessages().size()); result = apexModel.listTaskContextRef("MyTask002", "0.0.2", "contextAlbum0", "0.0.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(1, result.getMessages().size()); result = apexModel.listTaskContextRef("MyTask002", "0.0.2", "contextAlbum0", "0.0.2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listTaskContextRef("MyTask002", "0.0.2", "AContextMap04", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.listTaskContextRef("MyTask002", "0.0.2", "contextAlbum0", "0.0.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(1, result.getMessages().size()); result = apexModel.listTaskContextRef("MyTask002", "0.0.2", "contextAlbum1", "0.0.1"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(1, result.getMessages().size()); result = apexModel.listTaskContextRef("MyTask002", "0.0.2", "contextAlbum1", "0.0.2"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deleteTaskContextRef("@£$%", "0.0.2", "AContextMap04", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.deleteTaskContextRef("NonExistantTask", "0.0.2", "AContextMap04", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); assertEquals(2, apexModel.listTaskContextRef("MyTask002", null, null, null).getMessages().size()); result = apexModel.deleteTaskContextRef("MyTask002", "0.0.2", "AContextMap04", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deleteTaskContextRef("MyTask002", null, "contextAlbum0", "0.0.3"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deleteTaskContextRef("MyTask002", null, "contextAlbum0", "0.1.5"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deleteTaskContextRef("MyTask002", null, "contextAlbum0", null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(1, result.getMessages().size()); result = apexModel.deleteTaskContextRef("MyTask002", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(1, result.getMessages().size()); result = apexModel.listTaskContextRef("MyTask002", null, null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST)); + assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); result = apexModel.deleteTask(null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(2, result.getMessages().size()); result = apexModel.listTask(null, null); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); assertEquals(0, result.getMessages().size()); } } diff --git a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestApexModelAPI.java b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestApexModelApi.java index c3521d307..9e2e1ce56 100644 --- a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestApexModelAPI.java +++ b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestApexModelApi.java @@ -40,9 +40,10 @@ import org.onap.policy.apex.model.modelapi.impl.ApexModelImpl; import org.onap.policy.apex.model.utilities.TextFileUtils; /** + * Test the apex model API. * @author Liam Fallon (liam.fallon@ericsson.com) */ -public class TestApexModelAPI { +public class TestApexModelApi { private Connection connection; @Before @@ -61,23 +62,23 @@ public class TestApexModelAPI { public void testApexModelLoadFromFile() { final ApexModel apexModel = new ApexModelFactory().createApexModel(null, false); - ApexAPIResult result = apexModel.loadFromFile("src/main/resources/models/PolicyModel.json"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + ApexApiResult result = apexModel.loadFromFile("src/main/resources/models/PolicyModel.json"); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); result = apexModel.loadFromFile("src/test/resources/models/PolicyModel.json"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.deleteModel(); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.loadFromFile("src/test/resources/models/PolicyModel.xml"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.deleteModel(); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.loadFromFile("src/test/resources/models/PolicyModel.junk"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); assertTrue(result.getMessages().get(0).equals("format of input for Apex concept is neither JSON nor XML")); } @@ -85,105 +86,105 @@ public class TestApexModelAPI { public void testApexModelSaveToFile() throws IOException { final ApexModel apexModel = new ApexModelFactory().createApexModel(null, false); - ApexAPIResult result = apexModel.loadFromFile("src/test/resources/models/PolicyModel.json"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + ApexApiResult result = apexModel.loadFromFile("src/test/resources/models/PolicyModel.json"); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); final File tempJsonModelFile = File.createTempFile("ApexModelTest", ".json"); result = apexModel.saveToFile(tempJsonModelFile.getCanonicalPath(), false); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); final ApexModel jsonApexModel = new ApexModelFactory().createApexModel(null, false); result = jsonApexModel.loadFromFile(tempJsonModelFile.getCanonicalPath()); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); tempJsonModelFile.delete(); - final File tempXMLModelFile = File.createTempFile("ApexModelTest", ".xml"); - result = apexModel.saveToFile(tempXMLModelFile.getCanonicalPath(), true); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + final File tempXmlModelFile = File.createTempFile("ApexModelTest", ".xml"); + result = apexModel.saveToFile(tempXmlModelFile.getCanonicalPath(), true); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); final ApexModel xmlApexModel = new ApexModelFactory().createApexModel(null, false); - result = xmlApexModel.loadFromFile(tempXMLModelFile.getCanonicalPath()); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); - tempXMLModelFile.delete(); + result = xmlApexModel.loadFromFile(tempXmlModelFile.getCanonicalPath()); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + tempXmlModelFile.delete(); } @Test public void testApexModelDatabase() throws IOException { final ApexModel apexModel = new ApexModelFactory().createApexModel(null, false); - ApexAPIResult result = apexModel.loadFromFile("src/test/resources/models/PolicyModel.json"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + ApexApiResult result = apexModel.loadFromFile("src/test/resources/models/PolicyModel.json"); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); final DaoParameters DaoParameters = new DaoParameters(); DaoParameters.setPluginClass("org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao"); DaoParameters.setPersistenceUnit("DAOTest"); result = apexModel.saveToDatabase(DaoParameters); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.deleteModel(); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.loadFromDatabase("PolicyModel", "0.0.1", DaoParameters); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.deleteModel(); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.loadFromDatabase("PolicyModel", null, DaoParameters); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.deleteModel(); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); result = apexModel.loadFromDatabase("VPNPolicyModel", "0.0.1", DaoParameters); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); } @Test - public void testApexModelURL() throws IOException { + public void testApexModelUrl() throws IOException { ApexModel apexModel = new ApexModelFactory().createApexModel(null, false); - ApexAPIResult result = null; + ApexApiResult result = null; try { - result = apexModel.readFromURL(null); + result = apexModel.readFromUrl(null); fail("expecting an IllegalArgumentException"); } catch (final Exception e) { assertTrue(e instanceof IllegalArgumentException); } try { - result = apexModel.writeToURL(null, true); + result = apexModel.writeToUrl(null, true); fail("expecting an IllegalArgumentException"); } catch (final Exception e) { assertTrue(e instanceof IllegalArgumentException); } - result = apexModel.readFromURL("zooby/looby"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + result = apexModel.readFromUrl("zooby/looby"); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); - result = apexModel.writeToURL("zooby/looby", true); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + result = apexModel.writeToUrl("zooby/looby", true); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); - result = apexModel.readFromURL("zooby://zooby/looby"); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + result = apexModel.readFromUrl("zooby://zooby/looby"); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); - result = apexModel.writeToURL("zooby://zooby/looby", false); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + result = apexModel.writeToUrl("zooby://zooby/looby", false); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); apexModel = new ApexModelFactory().createApexModel(null, false); final File tempJsonModelFile = File.createTempFile("ApexModelTest", ".json"); result = apexModel.saveToFile(tempJsonModelFile.getCanonicalPath(), false); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); - final String tempFileURLString = tempJsonModelFile.toURI().toString(); - result = apexModel.readFromURL(tempFileURLString); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS)); + final String tempFileUrlString = tempJsonModelFile.toURI().toString(); + result = apexModel.readFromUrl(tempFileUrlString); + assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); - result = apexModel.writeToURL(tempFileURLString, false); - assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED)); + result = apexModel.writeToUrl(tempFileUrlString, false); + assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); assertTrue(result.getMessages().get(0).equals("protocol doesn't support output")); tempJsonModelFile.delete(); @@ -193,63 +194,63 @@ public class TestApexModelAPI { public void testApexModelMisc() throws IOException { final ApexModelImpl apexModelImpl = (ApexModelImpl) new ApexModelFactory().createApexModel(null, false); - ApexAPIResult result = null; + ApexApiResult result = null; result = apexModelImpl.getModelKey(); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModelImpl.listModel(); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModelImpl.createModel("ModelName", "0.0.1", null, null); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModelImpl.updateModel("ModelName", "0.0.1", UUID.randomUUID().toString(), "Model Description"); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); apexModelImpl.deleteModel(); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); final String modelString = TextFileUtils.getTextFileAsString("src/test/resources/models/PolicyModel.json"); result = apexModelImpl.loadFromString(modelString); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); final File tempFile = File.createTempFile("ApexModel", "json"); tempFile.deleteOnExit(); TextFileUtils.putStringAsFile(modelString, tempFile); apexModelImpl.deleteModel(); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModelImpl.loadFromFile(tempFile.getCanonicalPath()); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModelImpl.saveToFile(null, false); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModelImpl.analyse(); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModelImpl.validate(); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModelImpl.compare(tempFile.getCanonicalPath(), true, true); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModelImpl.compareWithString(modelString, true, true); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModelImpl.split("policy"); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModelImpl.split(tempFile.getCanonicalPath(), "policy"); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModelImpl.merge(tempFile.getCanonicalPath(), true); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModelImpl.mergeWithString(modelString, true); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertNotEquals(0, apexModelImpl.hashCode()); assertNotNull(apexModelImpl.clone()); diff --git a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestAPIResult.java b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestApiResult.java index e85357fbf..e2717e542 100644 --- a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestAPIResult.java +++ b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestApiResult.java @@ -29,34 +29,35 @@ import java.io.IOException; import java.util.Arrays; import org.junit.Test; -import org.onap.policy.apex.model.modelapi.ApexAPIResult.RESULT; +import org.onap.policy.apex.model.modelapi.ApexApiResult.Result; /** + * Test API results. * @author Liam Fallon (liam.fallon@ericsson.com) */ -public class TestAPIResult { +public class TestApiResult { @Test - public void testAPIResult() { - assertNotNull(new ApexAPIResult()); + public void testApiResult() { + assertNotNull(new ApexApiResult()); - for (final RESULT result : RESULT.values()) { - assertNotNull(new ApexAPIResult(result)); + for (final Result result : Result.values()) { + assertNotNull(new ApexApiResult(result)); } - assertNotNull(new ApexAPIResult(RESULT.SUCCESS, "Result Message")); - assertNotNull(new ApexAPIResult(RESULT.FAILED, new IOException("IO Exception message"))); - assertNotNull(new ApexAPIResult(RESULT.FAILED, "Result Message", new IOException("IO Exception message"))); + assertNotNull(new ApexApiResult(Result.SUCCESS, "Result Message")); + assertNotNull(new ApexApiResult(Result.FAILED, new IOException("IO Exception message"))); + assertNotNull(new ApexApiResult(Result.FAILED, "Result Message", new IOException("IO Exception message"))); - final ApexAPIResult result = - new ApexAPIResult(RESULT.FAILED, "Result Message", new IOException("IO Exception message")); + final ApexApiResult result = + new ApexApiResult(Result.FAILED, "Result Message", new IOException("IO Exception message")); - assertFalse(result.isOK()); - assertTrue(result.isNOK()); - assertEquals(RESULT.FAILED, result.getResult()); + assertFalse(result.isOk()); + assertTrue(result.isNok()); + assertEquals(Result.FAILED, result.getResult()); assertEquals("Result Message\nIO Exception message\njava.io.IOExce", result.getMessage().substring(0, 50)); - final ApexAPIResult result2 = new ApexAPIResult(RESULT.SUCCESS); + final ApexApiResult result2 = new ApexApiResult(Result.SUCCESS); result2.addMessage(null); assertEquals("", result2.getMessage()); result2.addMessage(""); @@ -64,8 +65,8 @@ public class TestAPIResult { result2.addMessage("funky message"); assertEquals("funky message\n", result2.getMessage()); - result2.setResult(RESULT.OTHER_ERROR); - assertEquals(RESULT.OTHER_ERROR, result2.getResult()); + result2.setResult(Result.OTHER_ERROR); + assertEquals(Result.OTHER_ERROR, result2.getResult()); final String[] messages = {"First Message", "Second Message", "Third Message"}; result2.setMessages(Arrays.asList(messages)); @@ -75,6 +76,6 @@ public class TestAPIResult { assertEquals("result: OTHER_ERROR\nFirst Message\nSecond Message\nThird Message\n", result2.toString()); assertEquals("{\n" + "\"result\": \"OTHER_ERROR\",\n" + "\"messages\": [\n" + "\"First Message\",\n" - + "\"Second Message\",\n" + "\"Third Message\"]\n" + "}\n", result2.toJSON()); + + "\"Second Message\",\n" + "\"Third Message\"]\n" + "}\n", result2.toJson()); } } diff --git a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestModelFacade.java b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestModelFacade.java index 7f946f5d3..2c937e175 100644 --- a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestModelFacade.java +++ b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestModelFacade.java @@ -53,58 +53,58 @@ public class TestModelFacade { final Properties modelProperties = new Properties(); final ModelFacade mf = new ModelFacade(apexModel, modelProperties, false); - ApexAPIResult result = mf.createModel(null, null, null, null); - assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); + ApexApiResult result = mf.createModel(null, null, null, null); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = mf.createModel("ModelName", null, null, null); - assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = mf.createModel("ModelName", "0.0.1", null, null); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); modelProperties.setProperty("DEFAULT_CONCEPT_VERSION", ""); result = mf.createModel("ModelName", null, null, null); - assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); modelProperties.setProperty("DEFAULT_CONCEPT_VERSION", "£$£$£$"); result = mf.createModel("ModelName", null, null, null); - assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); modelProperties.setProperty("DEFAULT_CONCEPT_VERSION", "0.0.1"); result = mf.createModel("ModelName", null, null, null); - assertEquals(ApexAPIResult.RESULT.CONCEPT_EXISTS, result.getResult()); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = mf.deleteModel(); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = mf.createModel("ModelName", null, null, null); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = mf.updateModel("ModelName", null, UUID.randomUUID().toString(), "New Description"); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = mf.updateModel("ModelName", "0.0.1", UUID.randomUUID().toString(), "New Description"); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); modelProperties.remove("DEFAULT_CONCEPT_VERSION"); result = mf.updateModel("ModelName", null, UUID.randomUUID().toString(), "New Description"); - assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = mf.updateModel(null, null, UUID.randomUUID().toString(), "New Description"); - assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = mf.deleteModel(); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = mf.updateModel("name", "0.0.1", UUID.randomUUID().toString(), "New Description"); - assertEquals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, result.getResult()); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = mf.getModelKey(); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = mf.listModel(); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals("AxPolicyModel:(AxPolicyModel:(key=AxArtifactKey:(n", result.getMessage().substring(0, 50)); result = mf.deleteModel(); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertNotNull(mf); } } diff --git a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestModelHandlerFacade.java b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestModelHandlerFacade.java index 7439cd328..22ecaf631 100644 --- a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestModelHandlerFacade.java +++ b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestModelHandlerFacade.java @@ -34,6 +34,7 @@ import org.onap.policy.apex.model.modelapi.impl.ModelHandlerFacade; import org.onap.policy.apex.model.utilities.TextFileUtils; /** + * Test the model handler facade. * @author Liam Fallon (liam.fallon@ericsson.com) */ public class TestModelHandlerFacade { @@ -60,88 +61,88 @@ public class TestModelHandlerFacade { final ModelHandlerFacade mhf = new ModelHandlerFacade(apexModel, modelProperties, false); assertNotNull(mhf); - ApexAPIResult result = mhf.loadFromFile("src/test/resources/models/PolicyModel.json"); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + ApexApiResult result = mhf.loadFromFile("src/test/resources/models/PolicyModel.json"); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = mhf.loadFromFile("src/test/resources/models/PolicyModel.json"); - assertEquals(ApexAPIResult.RESULT.CONCEPT_EXISTS, result.getResult()); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); final String modelString = TextFileUtils.getTextFileAsString("src/test/resources/models/PolicyModel.json"); result = apexModel.deleteModel(); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = mhf.loadFromString(modelString); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = mhf.loadFromString(modelString); - assertEquals(ApexAPIResult.RESULT.CONCEPT_EXISTS, result.getResult()); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); final DaoParameters DaoParameters = new DaoParameters(); result = mhf.loadFromDatabase("SomeModel", null, DaoParameters); - assertEquals(ApexAPIResult.RESULT.CONCEPT_EXISTS, result.getResult()); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.deleteModel(); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = mhf.loadFromDatabase("SomeModel", null, DaoParameters); - assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = mhf.saveToDatabase(DaoParameters); - assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); - result = mhf.readFromURL("blah://somewhere/over/the/rainbow"); - assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); + result = mhf.readFromUrl("blah://somewhere/over/the/rainbow"); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = mhf.loadFromString(modelString); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); - result = mhf.readFromURL("http://somewhere/over/the/rainbow"); - assertEquals(ApexAPIResult.RESULT.CONCEPT_EXISTS, result.getResult()); + result = mhf.readFromUrl("http://somewhere/over/the/rainbow"); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); final File tempFile = File.createTempFile("ApexModel", "json"); tempFile.deleteOnExit(); - result = mhf.writeToURL("File:///" + tempFile.getCanonicalPath(), false); - assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); + result = mhf.writeToUrl("File:///" + tempFile.getCanonicalPath(), false); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = mhf.validate(); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.deleteModel(); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = mhf.validate(); - assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = mhf.compare("src/test/resources/models/NonExistant.json", true, true); - assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = mhf.compareWithString("zooby", true, true); - assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = mhf.split("FailSplit", "NonExistantPolicy"); - assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = mhf.split("NonExistantPolicy"); - assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = mhf.merge("src/test/resources/models/NonExistant.json", false); - assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deleteModel(); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = mhf.merge("src/test/resources/models/PolicyModel.json", false); - assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = mhf.loadFromFile("src/test/resources/models/PolicyModel.json"); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = mhf.mergeWithString("@£@$@£", true); - assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deleteModel(); - assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = mhf.mergeWithString(modelString, false); - assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); } } |