summaryrefslogtreecommitdiffstats
path: root/gui-editors/gui-editor-apex/src
diff options
context:
space:
mode:
authorRam Krishna Verma <ram_krishna.verma@bell.ca>2020-09-08 17:26:13 +0000
committerGerrit Code Review <gerrit@onap.org>2020-09-08 17:26:13 +0000
commitafcf92da0d813028b48ea781df33148bc6f000b6 (patch)
treede0bd73b31cea9119278c7a44d210581f8dff28c /gui-editors/gui-editor-apex/src
parent02dae1dfb56aea5facb7700b4933d6b6710fdc16 (diff)
parent24a28ea3ae18dff5adf0db4cfa7afc3ee1945edf (diff)
Merge "Cosmetic changes to the apex-editor GUI"
Diffstat (limited to 'gui-editors/gui-editor-apex/src')
-rw-r--r--gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/UploadPluginConfigParameters.java1
-rw-r--r--gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/handling/converter/tosca/exception/PolicyToscaConverterException.java1
-rw-r--r--gui-editors/gui-editor-apex/src/main/resources/webapp/close.html11
-rw-r--r--gui-editors/gui-editor-apex/src/test/java/org/onap/policy/gui/editors/apex/rest/handling/converter/tosca/ApexConfigProcessorTest.java24
-rw-r--r--gui-editors/gui-editor-apex/src/test/java/org/onap/policy/gui/editors/apex/rest/handling/converter/tosca/ToscaTemplateProcessorTest.java52
-rw-r--r--gui-editors/gui-editor-apex/src/test/resources/processor/ApexConfig-invalid.jsonbad (renamed from gui-editors/gui-editor-apex/src/test/resources/processor/ApexConfig-invalid.json)0
-rw-r--r--gui-editors/gui-editor-apex/src/test/resources/processor/ToscaTemplate-invalid.jsonbad (renamed from gui-editors/gui-editor-apex/src/test/resources/processor/ToscaTemplate-invalid.json)0
7 files changed, 38 insertions, 51 deletions
diff --git a/gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/UploadPluginConfigParameters.java b/gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/UploadPluginConfigParameters.java
index e330af7..e056339 100644
--- a/gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/UploadPluginConfigParameters.java
+++ b/gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/UploadPluginConfigParameters.java
@@ -32,6 +32,7 @@ import org.onap.policy.gui.editors.apex.rest.handling.config.PolicyUploadPluginC
public class UploadPluginConfigParameters implements ParameterGroup {
public static final String GROUP_NAME = "UploadParameters";
+
@Setter
private String name;
private boolean isEnabled;
diff --git a/gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/handling/converter/tosca/exception/PolicyToscaConverterException.java b/gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/handling/converter/tosca/exception/PolicyToscaConverterException.java
index a24c393..6b4eff1 100644
--- a/gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/handling/converter/tosca/exception/PolicyToscaConverterException.java
+++ b/gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/handling/converter/tosca/exception/PolicyToscaConverterException.java
@@ -20,6 +20,7 @@
package org.onap.policy.gui.editors.apex.rest.handling.converter.tosca.exception;
public class PolicyToscaConverterException extends Exception {
+ private static final long serialVersionUID = -7263407816909492236L;
public PolicyToscaConverterException(final String message, final Throwable cause) {
super(message, cause);
diff --git a/gui-editors/gui-editor-apex/src/main/resources/webapp/close.html b/gui-editors/gui-editor-apex/src/main/resources/webapp/close.html
index 4ecd386..60c43a5 100644
--- a/gui-editors/gui-editor-apex/src/main/resources/webapp/close.html
+++ b/gui-editors/gui-editor-apex/src/main/resources/webapp/close.html
@@ -23,7 +23,6 @@
<head>
<meta charset="utf-8" />
<title>Apex Editor</title>
-<link rel="stylesheet" type="text/css" href="css/close.css" />
<link rel="stylesheet" type="text/css" href="css/interfaceAssets.css">
</head>
<body>
@@ -32,13 +31,13 @@
</div>
<div class="placeholder">
- <img class="onapLogo placeholderLogo" src="images/logo_onap.png"
- alt="ONAP"> <img class="apexLogo placeholderLogo"
- src="images/Apex.png" alt="Apex">
+ <img class="onapLogo placeholderLogo" src="images/logo_onap.png" alt="ONAP"> <img
+ class="apexLogo placeholderLogo" src="images/Apex.png" alt="Apex" height="200">
<p>Thanks for using the Apex editor :-)
<p>
- For more information, see <a href="we need apex document link here">the
- Apex confluence page.</a>
+ For more information, see <a
+ href="https://docs.onap.org/projects/onap-policy-parent/en/latest/apex/apex.html">the APEX-PDP
+ documentation.</a>
</div>
</body>
diff --git a/gui-editors/gui-editor-apex/src/test/java/org/onap/policy/gui/editors/apex/rest/handling/converter/tosca/ApexConfigProcessorTest.java b/gui-editors/gui-editor-apex/src/test/java/org/onap/policy/gui/editors/apex/rest/handling/converter/tosca/ApexConfigProcessorTest.java
index a12f7e1..0842b1b 100644
--- a/gui-editors/gui-editor-apex/src/test/java/org/onap/policy/gui/editors/apex/rest/handling/converter/tosca/ApexConfigProcessorTest.java
+++ b/gui-editors/gui-editor-apex/src/test/java/org/onap/policy/gui/editors/apex/rest/handling/converter/tosca/ApexConfigProcessorTest.java
@@ -57,8 +57,8 @@ public class ApexConfigProcessorTest {
@Test
public void testProcessMissingPoliciesEntry() throws IOException {
final ProcessedTemplate processedTemplate;
- try (final FileInputStream fileInputStream =
- readFileAsStream("ApexConfig-missing-engineServiceParameters.json")) {
+ try (final FileInputStream fileInputStream = readFileAsStream(
+ "ApexConfig-missing-engineServiceParameters.json")) {
processedTemplate = apexConfigProcessor.process(fileInputStream);
}
assertProcessedTemplate(processedTemplate, false,
@@ -68,18 +68,17 @@ public class ApexConfigProcessorTest {
@Test
public void testProcessInvalidToscaTemplate() throws IOException {
final ProcessedTemplate processedTemplate;
- try (final FileInputStream fileInputStream = readFileAsStream("ApexConfig-invalid.json")) {
+ try (final FileInputStream fileInputStream = readFileAsStream("ApexConfig-invalid.jsonbad")) {
processedTemplate = apexConfigProcessor.process(fileInputStream);
}
- assertProcessedTemplate(processedTemplate, false,
- List.of(INVALID_APEX_CONFIG.getMessage()));
+ assertProcessedTemplate(processedTemplate, false, List.of(INVALID_APEX_CONFIG.getMessage()));
}
@Test
public void testProcessInvalidEngineServiceParameters() throws IOException {
final ProcessedTemplate processedTemplate;
- try (final FileInputStream fileInputStream =
- readFileAsStream("ApexConfig-invalid-engineServiceParameters.json")) {
+ try (final FileInputStream fileInputStream = readFileAsStream(
+ "ApexConfig-invalid-engineServiceParameters.json")) {
processedTemplate = apexConfigProcessor.process(fileInputStream);
}
assertProcessedTemplate(processedTemplate, false,
@@ -87,17 +86,16 @@ public class ApexConfigProcessorTest {
}
private void assertProcessedTemplate(final ProcessedTemplate process, boolean isValid,
- final List<String> expectedErrorList) {
+ final List<String> expectedErrorList) {
assertThat("Template should be valid", process.isValid(), is(isValid));
if (isValid || expectedErrorList == null) {
return;
}
- assertThat("Should contains the expected quantity of errors",
- process.getErrorSet().size(), is(expectedErrorList.size()));
- expectedErrorList
- .forEach(errorMsg -> assertThat("Should contains a specific error message", process.getErrorSet(),
- contains(errorMsg)));
+ assertThat("Should contains the expected quantity of errors", process.getErrorSet().size(),
+ is(expectedErrorList.size()));
+ expectedErrorList.forEach(errorMsg -> assertThat("Should contains a specific error message",
+ process.getErrorSet(), contains(errorMsg)));
}
private FileInputStream readFileAsStream(final String fileName) throws FileNotFoundException {
diff --git a/gui-editors/gui-editor-apex/src/test/java/org/onap/policy/gui/editors/apex/rest/handling/converter/tosca/ToscaTemplateProcessorTest.java b/gui-editors/gui-editor-apex/src/test/java/org/onap/policy/gui/editors/apex/rest/handling/converter/tosca/ToscaTemplateProcessorTest.java
index 461b26e..7166621 100644
--- a/gui-editors/gui-editor-apex/src/test/java/org/onap/policy/gui/editors/apex/rest/handling/converter/tosca/ToscaTemplateProcessorTest.java
+++ b/gui-editors/gui-editor-apex/src/test/java/org/onap/policy/gui/editors/apex/rest/handling/converter/tosca/ToscaTemplateProcessorTest.java
@@ -91,8 +91,8 @@ public class ToscaTemplateProcessorTest {
@Test
public void testProcessMissingToscaDefinitionsVersion() throws IOException {
final ProcessedTemplate processedTemplate;
- try (final FileInputStream fileInputStream =
- readFileAsStream("ToscaTemplate-missing-tosca-definitions-version.json")) {
+ try (final FileInputStream fileInputStream = readFileAsStream(
+ "ToscaTemplate-missing-tosca-definitions-version.json")) {
processedTemplate = toscaTemplateProcessor.process(fileInputStream);
}
assertProcessedTemplate(processedTemplate, false,
@@ -105,8 +105,7 @@ public class ToscaTemplateProcessorTest {
try (final FileInputStream fileInputStream = readFileAsStream("ToscaTemplate-missing-properties.json")) {
processedTemplate = toscaTemplateProcessor.process(fileInputStream);
}
- assertProcessedTemplate(processedTemplate, false,
- List.of(MISSING_ENTRY.getMessage(PROPERTIES.getKey())));
+ assertProcessedTemplate(processedTemplate, false, List.of(MISSING_ENTRY.getMessage(PROPERTIES.getKey())));
}
@Test
@@ -115,25 +114,22 @@ public class ToscaTemplateProcessorTest {
try (final FileInputStream fileInputStream = readFileAsStream("ToscaTemplate-more-than-one-policy.json")) {
processedTemplate = toscaTemplateProcessor.process(fileInputStream);
}
- assertProcessedTemplate(processedTemplate, false,
- List.of(ONLY_ONE_POLICY_ALLOWED.getMessage()));
+ assertProcessedTemplate(processedTemplate, false, List.of(ONLY_ONE_POLICY_ALLOWED.getMessage()));
}
@Test
public void testProcessInvalidToscaTemplate() throws IOException {
final ProcessedTemplate processedTemplate;
- try (final FileInputStream fileInputStream = readFileAsStream("ToscaTemplate-invalid.json")) {
+ try (final FileInputStream fileInputStream = readFileAsStream("ToscaTemplate-invalid.jsonbad")) {
processedTemplate = toscaTemplateProcessor.process(fileInputStream);
}
- assertProcessedTemplate(processedTemplate, false,
- List.of(INVALID_TOSCA_TEMPLATE.getMessage()));
+ assertProcessedTemplate(processedTemplate, false, List.of(INVALID_TOSCA_TEMPLATE.getMessage()));
}
@Test
public void testProcessInvalidEntryToscaDefinitionsVersion() throws IOException {
final ProcessedTemplate processedTemplate;
- try (final FileInputStream fileInputStream =
- readFileAsStream("ToscaTemplate-invalid-toscaDefinitions.json")) {
+ try (final FileInputStream fileInputStream = readFileAsStream("ToscaTemplate-invalid-toscaDefinitions.json")) {
processedTemplate = toscaTemplateProcessor.process(fileInputStream);
}
assertProcessedTemplate(processedTemplate, false,
@@ -143,8 +139,8 @@ public class ToscaTemplateProcessorTest {
@Test
public void testProcessInvalidEntryTopologyTemplate() throws IOException {
final ProcessedTemplate processedTemplate;
- try (final FileInputStream fileInputStream =
- readFileAsStream("ToscaTemplate-invalidEntry-topologyTemplate.json")) {
+ try (final FileInputStream fileInputStream = readFileAsStream(
+ "ToscaTemplate-invalidEntry-topologyTemplate.json")) {
processedTemplate = toscaTemplateProcessor.process(fileInputStream);
}
assertProcessedTemplate(processedTemplate, false,
@@ -154,12 +150,10 @@ public class ToscaTemplateProcessorTest {
@Test
public void testProcessInvalidEntryPolicies() throws IOException {
final ProcessedTemplate processedTemplate;
- try (final FileInputStream fileInputStream =
- readFileAsStream("ToscaTemplate-invalidEntry-policies.json")) {
+ try (final FileInputStream fileInputStream = readFileAsStream("ToscaTemplate-invalidEntry-policies.json")) {
processedTemplate = toscaTemplateProcessor.process(fileInputStream);
}
- assertProcessedTemplate(processedTemplate, false,
- List.of(INVALID_ENTRY.getMessage(POLICIES.getKey())));
+ assertProcessedTemplate(processedTemplate, false, List.of(INVALID_ENTRY.getMessage(POLICIES.getKey())));
}
@Test
@@ -168,39 +162,33 @@ public class ToscaTemplateProcessorTest {
try (final FileInputStream fileInputStream = readFileAsStream("ToscaTemplate-invalidPolicy1.json")) {
processedTemplate = toscaTemplateProcessor.process(fileInputStream);
}
- assertProcessedTemplate(processedTemplate, false,
- List.of(INVALID_POLICY.getMessage()));
+ assertProcessedTemplate(processedTemplate, false, List.of(INVALID_POLICY.getMessage()));
try (final FileInputStream fileInputStream = readFileAsStream("ToscaTemplate-invalidPolicy2.json")) {
processedTemplate = toscaTemplateProcessor.process(fileInputStream);
}
- assertProcessedTemplate(processedTemplate, false,
- List.of(INVALID_POLICY.getMessage()));
+ assertProcessedTemplate(processedTemplate, false, List.of(INVALID_POLICY.getMessage()));
}
@Test
public void testProcessInvalidEntryProperties() throws IOException {
final ProcessedTemplate processedTemplate;
- try (final FileInputStream fileInputStream =
- readFileAsStream("ToscaTemplate-invalidEntry-properties.json")) {
+ try (final FileInputStream fileInputStream = readFileAsStream("ToscaTemplate-invalidEntry-properties.json")) {
processedTemplate = toscaTemplateProcessor.process(fileInputStream);
}
- assertProcessedTemplate(processedTemplate, false,
- List.of(INVALID_ENTRY.getMessage(PROPERTIES.getKey())));
+ assertProcessedTemplate(processedTemplate, false, List.of(INVALID_ENTRY.getMessage(PROPERTIES.getKey())));
}
-
private void assertProcessedTemplate(final ProcessedTemplate process, boolean isValid,
- final List<String> expectedErrorList) {
+ final List<String> expectedErrorList) {
assertThat("Template should be valid", process.isValid(), is(isValid));
if (isValid || expectedErrorList == null) {
return;
}
- assertThat("Should contains the expected quantity of errors",
- process.getErrorSet().size(), is(expectedErrorList.size()));
- expectedErrorList
- .forEach(errorMsg -> assertThat("Should contains a specific error message", process.getErrorSet(),
- contains(errorMsg)));
+ assertThat("Should contains the expected quantity of errors", process.getErrorSet().size(),
+ is(expectedErrorList.size()));
+ expectedErrorList.forEach(errorMsg -> assertThat("Should contains a specific error message",
+ process.getErrorSet(), contains(errorMsg)));
}
private FileInputStream readFileAsStream(final String fileName) throws FileNotFoundException {
diff --git a/gui-editors/gui-editor-apex/src/test/resources/processor/ApexConfig-invalid.json b/gui-editors/gui-editor-apex/src/test/resources/processor/ApexConfig-invalid.jsonbad
index 2517d8b..2517d8b 100644
--- a/gui-editors/gui-editor-apex/src/test/resources/processor/ApexConfig-invalid.json
+++ b/gui-editors/gui-editor-apex/src/test/resources/processor/ApexConfig-invalid.jsonbad
diff --git a/gui-editors/gui-editor-apex/src/test/resources/processor/ToscaTemplate-invalid.json b/gui-editors/gui-editor-apex/src/test/resources/processor/ToscaTemplate-invalid.jsonbad
index 0705d6b..0705d6b 100644
--- a/gui-editors/gui-editor-apex/src/test/resources/processor/ToscaTemplate-invalid.json
+++ b/gui-editors/gui-editor-apex/src/test/resources/processor/ToscaTemplate-invalid.jsonbad