aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-be/lib')
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/test/java/org/openecomp/sdc/heat/datatypes/model/HeatOrchestrationTemplateTest.java34
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/util/ValidationUtil.java40
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/XmlArtifact.java23
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/schemagenerator/SchemaGenerator.java25
4 files changed, 56 insertions, 66 deletions
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/test/java/org/openecomp/sdc/heat/datatypes/model/HeatOrchestrationTemplateTest.java b/openecomp-be/lib/openecomp-heat-lib/src/test/java/org/openecomp/sdc/heat/datatypes/model/HeatOrchestrationTemplateTest.java
index af8ce15c41..bc4bb63e89 100644
--- a/openecomp-be/lib/openecomp-heat-lib/src/test/java/org/openecomp/sdc/heat/datatypes/model/HeatOrchestrationTemplateTest.java
+++ b/openecomp-be/lib/openecomp-heat-lib/src/test/java/org/openecomp/sdc/heat/datatypes/model/HeatOrchestrationTemplateTest.java
@@ -1,31 +1,25 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
+/*
+ * Copyright © 2018 European Support Limited
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ============LICENSE_END=========================================================
- */
+*/
package org.openecomp.sdc.heat.datatypes.model;
import org.junit.Assert;
import org.junit.Test;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.onap.sdc.tosca.services.YamlUtil;
+import org.onap.sdc.tosca.services.YamlUtil;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
@@ -34,9 +28,6 @@ import java.util.List;
import java.util.Map;
public class HeatOrchestrationTemplateTest {
-
- private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName());
-
@Test
public void testYamlToServiceTemplateObj() throws IOException {
YamlUtil yamlUtil = new YamlUtil();
@@ -48,7 +39,7 @@ public class HeatOrchestrationTemplateTest {
}
@Test
- public void createHotTemplate() {
+ public void createHotTemplate() throws Exception{
HeatOrchestrationTemplate template = new HeatOrchestrationTemplate();
template.setHeat_template_version("2016-04-14");
template.setDescription("test description for hot template");
@@ -100,13 +91,10 @@ public class HeatOrchestrationTemplateTest {
YamlUtil yamlUtil = new YamlUtil();
String yml = yamlUtil.objectToYaml(template);
Assert.assertNotNull(yml);
- try {
- HeatOrchestrationTemplate heatOrchestrationTemplate =
+ HeatOrchestrationTemplate heatOrchestrationTemplate;
+ heatOrchestrationTemplate =
yamlUtil.yamlToObject(yml, HeatOrchestrationTemplate.class);
- Assert.assertNotNull(heatOrchestrationTemplate);
- } catch (Exception ignored) {
- log.debug("",ignored);
- }
+ Assert.assertNotNull(heatOrchestrationTemplate);
}
private Map<String, Parameter> createParameters() {
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/util/ValidationUtil.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/util/ValidationUtil.java
index ef72c0886a..6635604a39 100644
--- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/util/ValidationUtil.java
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/util/ValidationUtil.java
@@ -1,7 +1,32 @@
+/*
+ * Copyright © 2018 European Support Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
package org.openecomp.sdc.validation.util;
+import static java.util.Objects.nonNull;
+import java.io.InputStream;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.Set;
+import java.util.regex.Pattern;
import org.apache.commons.collections4.CollectionUtils;
+
+import org.onap.sdc.tosca.services.YamlUtil;
import org.openecomp.core.utilities.json.JsonUtil;
import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder;
import org.openecomp.core.validation.types.GlobalValidationContext;
@@ -18,16 +43,6 @@ import org.openecomp.sdc.heat.datatypes.model.ResourceReferenceFunctions;
import org.openecomp.sdc.heat.services.HeatStructureUtil;
import org.openecomp.sdc.logging.api.Logger;
import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.onap.sdc.tosca.services.YamlUtil;
-
-import java.io.InputStream;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.Set;
-import java.util.regex.Pattern;
-
-import static java.util.Objects.nonNull;
public class ValidationUtil {
private static final Logger LOG = LoggerFactory.getLogger(ValidationUtil.class.getName());
@@ -126,7 +141,7 @@ public class ValidationUtil {
throw new Exception("The file '" + envFileName + "' has no content");
}
} catch (Exception exception) {
- LOG.debug("",exception);
+ LOG.error("Invalid envFile name : " + envFileName, exception);
return null;
}
return envContent;
@@ -160,8 +175,7 @@ public class ValidationUtil {
try {
manifestContent = JsonUtil.json2Object(manifest.get(), ManifestContent.class);
} catch (Exception exception) {
- LOG.debug("",exception);
- throw new SdcRuntimeException("Can't load manifest file for Heat Validator");
+ throw new SdcRuntimeException("Can't load manifest file for Heat Validator", exception);
}
return manifestContent;
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/XmlArtifact.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/XmlArtifact.java
index ec2ebf4173..7052d6afb6 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/XmlArtifact.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/XmlArtifact.java
@@ -1,36 +1,29 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
+/*
+ * Copyright © 2018 European Support Limited
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ============LICENSE_END=========================================================
- */
+*/
package org.openecomp.sdc.vendorlicense.licenseartifacts.impl.types;
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
import org.openecomp.sdc.common.errors.CoreException;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
import org.openecomp.sdc.vendorlicense.VendorLicenseConstants;
import org.openecomp.sdc.vendorlicense.errors.JsonErrorBuilder;
public abstract class XmlArtifact {
XmlMapper xmlMapper = new XmlMapper();
- private final Logger log = LoggerFactory.getLogger(this.getClass().getName());
abstract void initMapper();
@@ -46,8 +39,8 @@ public abstract class XmlArtifact {
try {
xml = xmlMapper.writeValueAsString(this);
} catch (com.fasterxml.jackson.core.JsonProcessingException exception) {
- log.debug("",exception);
- throw new CoreException(new JsonErrorBuilder(exception.getMessage()).build());
+ throw new CoreException(new JsonErrorBuilder("Failed to write xml value as string ")
+ .build(), exception);
}
return xml.replaceAll(VendorLicenseConstants.VENDOR_LICENSE_MODEL_ARTIFACT_REGEX_REMOVE, "");
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/schemagenerator/SchemaGenerator.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/schemagenerator/SchemaGenerator.java
index edfbd8c94f..4aaa9a8a03 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/schemagenerator/SchemaGenerator.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/schemagenerator/SchemaGenerator.java
@@ -1,22 +1,18 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
+/*
+ * Copyright © 2018 European Support Limited
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ============LICENSE_END=========================================================
- */
+*/
package org.openecomp.sdc.vendorsoftwareproduct.services.schemagenerator;
@@ -25,8 +21,6 @@ import freemarker.template.TemplateException;
import org.openecomp.sdc.common.errors.CoreException;
import org.openecomp.sdc.common.errors.ErrorCategory;
import org.openecomp.sdc.common.errors.ErrorCode;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType;
import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTemplateContext;
import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTemplateInput;
@@ -37,7 +31,9 @@ import java.io.Writer;
public class SchemaGenerator {
public static final String SCHEMA_GENERATION_ERROR = "SCHEMA_GENERATION_ERROR";
- private final static Logger log = (Logger) LoggerFactory.getLogger(SchemaGenerator.class.getName());
+ private SchemaGenerator() {
+ // Utility classes, which are a collection of static members, are not meant to be instantiated
+ }
/**
* Generate string.
@@ -59,10 +55,9 @@ public class SchemaGenerator {
schemaTemplate.process(input, writer);
return writer.toString();
} catch (IOException | TemplateException exception) {
- log.debug("",exception);
throw new CoreException(
new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION)
- .withId(SCHEMA_GENERATION_ERROR).withMessage(exception.getMessage()).build());
+ .withId(SCHEMA_GENERATION_ERROR).withMessage(exception.getMessage()).build(), exception);
}
}
}