+ /**
+ * Test the launch translation wit operational policies.
+ *
+ * @throws IOException In case of failure
+ * @throws UnknownComponentException In case of failure
+ */
+ public void testLaunchTranslationTca() throws IOException, UnknownComponentException {
+ TemplateManagement templateManagement =
+ new TemplateManagement(
+ ResourceFileUtil.getResourceAsString("http-cache/example/policy/api/v1/policytypes/onap"
+ + ".policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0?"
+ + "connectionTimeToLive=5000/.file"), ResourceFileUtil.getResourceAsString(
+ "clds/tosca_update/defaultToscaTypes.yaml"),
+ ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.properties"));
+ assertNull(templateManagement.getParseToJson());
+ String componentName = "onap.policies.monitoring.cdap.tca.hi.lo.app";
+ templateManagement.launchTranslation(componentName);
+ assertNotNull(templateManagement.getParseToJson());
+ }
+
+ /**
+ * Test the launch translation wit operational policies.
+ *
+ * @throws IOException In case of failure
+ * @throws UnknownComponentException In case of failure
+ */
+ public void testLaunchTranslationFrequencyLimiter() throws IOException, UnknownComponentException {
+ TemplateManagement templateManagement =
+ new TemplateManagement(
+ ResourceFileUtil.getResourceAsString("http-cache/example/policy/api/v1/policytypes/onap"
+ + ".policies.controlloop.guard.common.FrequencyLimiter/versions/1.0.0?"
+ + "connectionTimeToLive=5000/.file"), ResourceFileUtil.getResourceAsString(
+ "clds/tosca_update/defaultToscaTypes.yaml"),
+ ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.properties"));
+ assertNull(templateManagement.getParseToJson());
+ String componentName = "onap.policies.controlloop.guard.common.FrequencyLimiter";
+ templateManagement.launchTranslation(componentName);
+ assertNotNull(templateManagement.getParseToJson());
+ }
+
+ /**
+ * Test the launch translation wit operational policies.
+ *
+ * @throws IOException In case of failure
+ * @throws UnknownComponentException In case of failure
+ */
+ public void testLaunchTranslationApex() throws IOException, UnknownComponentException {
+ TemplateManagement templateManagement =
+ new TemplateManagement(
+ ResourceFileUtil.getResourceAsString("http-cache/example/policy/api/v1/policytypes/onap"
+ + ".policies.controlloop.operational.common.Apex/versions/1.0.0?"
+ + "connectionTimeToLive=5000/.file"), ResourceFileUtil.getResourceAsString(
+ "clds/tosca_update/defaultToscaTypes.yaml"),
+ ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.properties"));
+ assertNull(templateManagement.getParseToJson());
+ String componentName = "onap.policies.controlloop.operational.common.Apex";
+ templateManagement.launchTranslation(componentName);
+ assertNotNull(templateManagement.getParseToJson());
+ }
+
+ /**
+ * Test the launch translation wit operational policies.
+ *
+ * @throws IOException In case of failure
+ * @throws UnknownComponentException In case of failure
+ */
+ public void testLaunchTranslationDrools() throws IOException, UnknownComponentException {
+ TemplateManagement templateManagement =
+ new TemplateManagement(
+ ResourceFileUtil.getResourceAsString("http-cache/example/policy/api/v1/policytypes/onap"
+ + ".policies.controlloop.operational.common.Drools/versions/1.0.0?"
+ + "connectionTimeToLive=5000/.file"), ResourceFileUtil.getResourceAsString(
+ "clds/tosca_update/defaultToscaTypes.yaml"),
+ ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.properties"));
+ assertNull(templateManagement.getParseToJson());
+ String componentName = "onap.policies.controlloop.operational.common.Drools";
+ templateManagement.launchTranslation(componentName);
+ assertNotNull(templateManagement.getParseToJson());
+ }
+