-/*-
- * ============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;
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();
}
@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");
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() {
+/*
+ * 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;
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());
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;
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;
-/*-
- * ============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();
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, "");
-/*-
- * ============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;
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;
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.
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);
}
}
}