diff options
Diffstat (limited to 'openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes')
4 files changed, 110 insertions, 21 deletions
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/PropertyTypeTest.java b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/PropertyTypeTest.java index 470dd9784a..820d79184e 100644 --- a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/PropertyTypeTest.java +++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/PropertyTypeTest.java @@ -1,8 +1,28 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.tosca.datatypes; -import org.openecomp.sdc.tosca.datatypes.model.PropertyType; import org.junit.Assert; import org.junit.Test; +import org.openecomp.sdc.tosca.datatypes.model.PropertyType; public class PropertyTypeTest { @Test @@ -17,4 +37,4 @@ public class PropertyTypeTest { Assert .assertEquals(PropertyType.getPropertyTypeByDisplayName(s), PropertyType.SCALAR_UNIT_SIZE); } -}
\ No newline at end of file +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/ToscaModelTest.java b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/ToscaModelTest.java index 13b05543fb..c7b0659c21 100644 --- a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/ToscaModelTest.java +++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/ToscaModelTest.java @@ -1,5 +1,28 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.tosca.datatypes; +import org.junit.Assert; +import org.junit.Test; +import org.openecomp.core.utilities.yaml.YamlUtil; import org.openecomp.sdc.tosca.datatypes.model.ArtifactType; import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition; import org.openecomp.sdc.tosca.datatypes.model.CapabilityAssignment; @@ -7,7 +30,6 @@ import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition; import org.openecomp.sdc.tosca.datatypes.model.Constraint; import org.openecomp.sdc.tosca.datatypes.model.Directive; import org.openecomp.sdc.tosca.datatypes.model.Import; -import org.openecomp.sdc.tosca.datatypes.model.Metadata; import org.openecomp.sdc.tosca.datatypes.model.NodeFilter; import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; import org.openecomp.sdc.tosca.datatypes.model.NodeType; @@ -23,10 +45,6 @@ import org.openecomp.sdc.tosca.datatypes.model.heatextend.ParameterDefinitionExt import org.openecomp.sdc.tosca.services.DataModelUtil; import org.openecomp.sdc.tosca.services.ToscaConstants; import org.openecomp.sdc.tosca.services.yamlutil.ToscaExtensionYamlUtil; -import org.openecomp.core.utilities.yaml.YamlUtil; -import org.junit.Assert; -import org.junit.Test; - import java.io.InputStream; import java.util.ArrayList; @@ -41,21 +59,24 @@ public class ToscaModelTest { public void testServiceTemplateJavaToYaml() { ServiceTemplate serviceTemplate = new ServiceTemplate(); - Metadata metadata = new Metadata(); - metadata.setTemplate_author("OPENECOMP"); - metadata.setTemplate_name("Test"); - metadata.setTemplate_version("1.0.0"); + Map<String, String> metadata = new HashMap<>(); + metadata.put("Template_author", "OPENECOMP"); + metadata.put(ToscaConstants.ST_METADATA_TEMPLATE_NAME, "Test"); + metadata.put("Template_version", "1.0.0"); serviceTemplate.setTosca_definitions_version("tosca_simple_yaml_1_0_0"); serviceTemplate.setDescription("testing desc tosca service template"); - serviceTemplate.setMetadata(metadata); Import fileImport1 = new Import(); fileImport1.setFile("path1/path2/file1.yaml"); Import fileImport2 = new Import(); fileImport2.setFile("path1/path2/file2.yaml"); - Map<String, Import> imports = new HashMap<>(); - imports.put("myfile1", fileImport1); - imports.put("myfile2", fileImport2); + List<Map<String, Import>> imports = new ArrayList<>(); + Map<String, Import> importsMap = new HashMap<>(); + importsMap.put("myfile1", fileImport1); + imports.add(importsMap); + importsMap = new HashMap<>(); + importsMap.put("myfile2", fileImport2); + imports.add(importsMap); serviceTemplate.setImports(imports); ArtifactType artifact = new ArtifactType(); diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityDefinitionTest.java b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityDefinitionTest.java index 2b0f88fdea..4cd76ce6ec 100644 --- a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityDefinitionTest.java +++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityDefinitionTest.java @@ -1,15 +1,39 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.tosca.datatypes.model; -import org.openecomp.sdc.tosca.services.ToscaConstants; -import org.openecomp.core.utilities.yaml.YamlUtil; import org.junit.Assert; import org.junit.Test; +import org.openecomp.core.utilities.yaml.YamlUtil; +import org.openecomp.sdc.tosca.services.ToscaConstants; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +/** + * @author shiria + * @since September 06, 2016. + */ public class CapabilityDefinitionTest { @Test @@ -64,7 +88,7 @@ public class CapabilityDefinitionTest { private ArtifactDefinition getMockArtifactDefinition() { ArtifactDefinition artifactDefinition = new ArtifactDefinition(); artifactDefinition.setType("type1"); - artifactDefinition.setDescription("description of OPENECOMP def"); + artifactDefinition.setDescription("description of openecomp def"); artifactDefinition.setDeploy_path("my deployment path"); artifactDefinition.setFile("my file"); artifactDefinition.setRepository("my repository"); @@ -98,4 +122,4 @@ public class CapabilityDefinitionTest { return constraints; } -}
\ No newline at end of file +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/model/RequirementDefinitionTest.java b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/model/RequirementDefinitionTest.java index 3109a8abff..38d8aba3ec 100644 --- a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/model/RequirementDefinitionTest.java +++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/model/RequirementDefinitionTest.java @@ -1,14 +1,38 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.tosca.datatypes.model; -import org.openecomp.core.utilities.yaml.YamlUtil; import org.junit.Assert; import org.junit.Test; +import org.openecomp.core.utilities.yaml.YamlUtil; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +/** + * @author shiria + * @since September 07, 2016. + */ public class RequirementDefinitionTest { @Test @@ -37,4 +61,4 @@ public class RequirementDefinitionTest { } -}
\ No newline at end of file +} |