diff options
Diffstat (limited to 'csarvalidation/src/main/java/org/onap/cvc/csar')
9 files changed, 88 insertions, 99 deletions
diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/CSARArchive.java b/csarvalidation/src/main/java/org/onap/cvc/csar/CSARArchive.java index 180dadd..7311e87 100644 --- a/csarvalidation/src/main/java/org/onap/cvc/csar/CSARArchive.java +++ b/csarvalidation/src/main/java/org/onap/cvc/csar/CSARArchive.java @@ -98,6 +98,8 @@ public class CSARArchive implements AutoCloseable { public static final String CSAR_ARCHIVE = "CSAR Archive"; + public static final String DOESS_NOT_EXIST = " does not exist"; + public enum Mode { WITH_TOSCA_META_DIR, WITHOUT_TOSCA_META_DIR @@ -348,7 +350,7 @@ public class CSARArchive implements AutoCloseable { super(TOSCA_METADATA_TOSCA_META_ENTRY_DEFINITIONS, TOSCA_METADATA_TOSCA_META, lineNo, - definitionYaml + " does not exist", + definitionYaml + DOESS_NOT_EXIST, null); this.setCode("0x0006"); @@ -360,7 +362,7 @@ public class CSARArchive implements AutoCloseable { super(entryManifestArgumentName, TOSCA_METADATA_TOSCA_META, lineNo, - manifest + " does not exist", + manifest + DOESS_NOT_EXIST, null); this.setCode("0x0007"); @@ -372,7 +374,7 @@ public class CSARArchive implements AutoCloseable { super(entryChangeLogArgumentName, TOSCA_METADATA_TOSCA_META, lineNo, - logs + " does not exist", + logs + DOESS_NOT_EXIST, null); this.setCode("0x0008"); @@ -396,7 +398,7 @@ public class CSARArchive implements AutoCloseable { super(TOSCA_METADATA_TOSCA_META_ENTRY_LICENSES, TOSCA_METADATA_TOSCA_META, lineNo, - license + " does not exist", + license + DOESS_NOT_EXIST, null); this.setCode("0x000a"); @@ -408,7 +410,7 @@ public class CSARArchive implements AutoCloseable { super(TOSCA_METADATA_TOSCA_META_ENTRY_CERTIFICATE, TOSCA_METADATA_TOSCA_META, lineNo, - certificate + " does not exist", + certificate + DOESS_NOT_EXIST, null); this.setCode("0x000b"); @@ -661,6 +663,8 @@ public class CSARArchive implements AutoCloseable { public static class Definition { private String toscaDefinitionVersion; + private Definition.Metadata metadata = new Metadata(); + public String getToscaDefinitionVersion() { return toscaDefinitionVersion; } @@ -701,8 +705,6 @@ public class CSARArchive implements AutoCloseable { } } - private Definition.Metadata metadata = new Metadata(); - public Definition.Metadata getMetadata() { return metadata; } @@ -1024,9 +1026,7 @@ public class CSARArchive implements AutoCloseable { lineNo ++; line = line.trim(); - if (line.startsWith("#")) { - continue; - } else if (line.trim().isEmpty()) { + if (line.startsWith("#") || line.trim().isEmpty()) { continue; } @@ -1131,13 +1131,7 @@ public class CSARArchive implements AutoCloseable { } else { //definition files - File []files = this.tempDir.toFile().listFiles(new FilenameFilter() { - - @Override - public boolean accept(File dir, String name) { - return name.endsWith(".yaml"); - } - }); + File []files = this.tempDir.toFile().listFiles((dir, name) -> name.endsWith(".yaml")); if (files.length == 0) { errors.add( @@ -1154,13 +1148,7 @@ public class CSARArchive implements AutoCloseable { this.toscaMeta.setEntryDefinitionYaml(this.definitionYamlFile.getName()); //manifest - files = this.tempDir.toFile().listFiles(new FilenameFilter() { - - @Override - public boolean accept(File dir, String name) { - return name.endsWith(".mf"); - } - }); + files = this.tempDir.toFile().listFiles((dir, name) -> name.endsWith(".mf")); if (files.length > 1) { List<String> fileNames = new ArrayList<>(); @@ -1187,13 +1175,7 @@ public class CSARArchive implements AutoCloseable { } //certificate - files = this.tempDir.toFile().listFiles(new FilenameFilter() { - - @Override - public boolean accept(File dir, String name) { - return name.endsWith(".cert"); - } - }); + files = this.tempDir.toFile().listFiles((dir, name) -> name.endsWith(".cert")); if (files.length > 1) { List<String> fileNames = new ArrayList<>(); diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/VTPValidateCSAR.java b/csarvalidation/src/main/java/org/onap/cvc/csar/VTPValidateCSAR.java index a852d78..20700ac 100644 --- a/csarvalidation/src/main/java/org/onap/cvc/csar/VTPValidateCSAR.java +++ b/csarvalidation/src/main/java/org/onap/cvc/csar/VTPValidateCSAR.java @@ -291,7 +291,9 @@ public class VTPValidateCSAR extends OnapCommand { String[] enabledReqs = properties.getProperty(key, "").split(","); List<String> list = new ArrayList<>(); for(String req: enabledReqs) { - if (!req.isEmpty()) list.add(req); + if (!req.isEmpty()) { + list.add(req); + } } return list; } diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/VTPValidateCSARBase.java b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/VTPValidateCSARBase.java index 6e67df9..3fee188 100644 --- a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/VTPValidateCSARBase.java +++ b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/VTPValidateCSARBase.java @@ -32,11 +32,13 @@ import java.util.List; public abstract class VTPValidateCSARBase extends OnapCommand { protected static final Logger LOG = LoggerFactory.getLogger(VTPValidateCSARBase.class); + protected List<CSARError> errors = new ArrayList<>(); + protected abstract void validateCSAR(CSARArchive csar) throws Exception; protected abstract String getVnfReqsNo(); - protected List<CSARError> errors = new ArrayList<>(); + @Override protected void run() throws OnapCommandException { diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR09467.java b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR09467.java index 407d872..4ffe003 100644 --- a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR09467.java +++ b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR09467.java @@ -56,12 +56,12 @@ public class VTPValidateCSARR09467 extends VTPValidateCSARBase { Map<String, ?> node = (Map<String, ?>) nodeO; if (node.containsKey("type")) { String type = (String)node.get("type"); - if (type.equalsIgnoreCase("tosca.nodes.nfv.VDU.Compute")) { + if ("tosca.nodes.nfv.VDU.Compute".equalsIgnoreCase(type)) { computeExist = true; } - if (type.equalsIgnoreCase("tosca.nodes.nfv.VDU.VirtualStorage")) { + if ("tosca.nodes.nfv.VDU.VirtualStorage".equalsIgnoreCase(type)) { storageExist = true; } diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR32155.java b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR32155.java index c5f6319..12fcf28 100644 --- a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR32155.java +++ b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR32155.java @@ -43,7 +43,7 @@ public class VTPValidateCSARR32155 extends VTPValidateCSARBase { yaml = (Map<String, ?>) yaml.get("topology_template"); Map<String, ?> yamlTmpls = (Map<String, ?>) yaml.get("node_templates"); - boolean vlExist[] = new boolean[2]; + boolean []vlExist = new boolean[2]; for (Object node0 : yamlTmpls.values()) { @@ -52,12 +52,12 @@ public class VTPValidateCSARR32155 extends VTPValidateCSARBase { if (node.containsKey("type")) { String type = (String) node.get("type"); - if (type.equalsIgnoreCase("tosca.nodes.nfv.VnfVirtualLinkDesc")) { + if ("tosca.nodes.nfv.VnfVirtualLinkDesc".equalsIgnoreCase(type)) { vlExist[0] = true; } - if (type.equalsIgnoreCase("tosca.capabilities.nfv.VirtualLinkable")) { + if ("tosca.capabilities.nfv.VirtualLinkable".equalsIgnoreCase(type)) { vlExist[1] = true; } diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR35851.java b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR35851.java index f25afd7..52582a6 100644 --- a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR35851.java +++ b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR35851.java @@ -28,10 +28,12 @@ import org.yaml.snakeyaml.Yaml; @OnapCommandSchema(schema = "vtp-validate-csar-r35851.yaml") public class VTPValidateCSARR35851 extends VTPValidateCSARBase { + private static final String SET_CODE = "0x1000"; + public static class CSARErrorEntryMissingDefinitionYamlVnfVirtualLink extends CSARErrorEntryMissing { public CSARErrorEntryMissingDefinitionYamlVnfVirtualLink(String defYaml, String entry) { super(entry, defYaml); - this.setCode("0x1000"); + this.setCode(SET_CODE); } } @@ -39,14 +41,14 @@ public class VTPValidateCSARR35851 extends VTPValidateCSARBase { public static class CSARErrorEntryMissingDefinitionYamlVduCp extends CSARErrorEntryMissing { public CSARErrorEntryMissingDefinitionYamlVduCp(String defYaml, String entry) { super(entry, defYaml); - this.setCode("0x1000"); + this.setCode(SET_CODE); } } public static class CSARErrorEntryMissingDefinitionYamlVnfExtCp extends CSARErrorEntryMissing { public CSARErrorEntryMissingDefinitionYamlVnfExtCp(String defYaml, String entry) { super(entry, defYaml); - this.setCode("0x1000"); + this.setCode(SET_CODE); } } @@ -63,17 +65,17 @@ public class VTPValidateCSARR35851 extends VTPValidateCSARBase { Map<String, ?> node = (Map<String, ?>) nodeO; if (node.containsKey("type")) { String type = (String)node.get("type"); - if (type.equalsIgnoreCase("tosca.nodes.nfv.VnfVirtualLink")) { + if ("tosca.nodes.nfv.VnfVirtualLink".equalsIgnoreCase(type)) { vlExist[0] = true; } - if (type.equalsIgnoreCase("tosca.nodes.nfv.VduCp")) { + if ("tosca.nodes.nfv.VduCp".equalsIgnoreCase(type)) { vlExist[1] = true; } - if (type.equalsIgnoreCase("tosca.nodes.nfv.VnfExtCp")) { + if ("tosca.nodes.nfv.VnfExtCp".equalsIgnoreCase(type)) { vlExist[2] = true; } diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR54356.java b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR54356.java index eaf9ad9..334d4ff 100644 --- a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR54356.java +++ b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR54356.java @@ -26,171 +26,172 @@ import java.util.Map; @OnapCommandSchema(schema = "vtp-validate-csar-r54356.yaml") public class VTPValidateCSARR54356 extends VTPValidateCSARBase { + private static final String SET_CODE = "0x1000"; public static class CSARErrorEntryMissingDefinitionYamldatatypesL3AddressData extends CSARArchive.CSARErrorEntryMissing { public CSARErrorEntryMissingDefinitionYamldatatypesL3AddressData(String defYaml, String entry) { super(entry, defYaml); - this.setCode("0x1000"); + this.setCode( SET_CODE); } } public static class CSARErrorEntryMissingDefinitionYamldatatypesAddressData extends CSARArchive.CSARErrorEntryMissing { public CSARErrorEntryMissingDefinitionYamldatatypesAddressData(String defYaml, String entry) { super(entry, defYaml); - this.setCode("0x1000"); + this.setCode( SET_CODE); } } public static class CSARErrorEntryMissingDefinitionYamldatatypesVirtualNetworkInterfaceRequirements extends CSARArchive.CSARErrorEntryMissing { public CSARErrorEntryMissingDefinitionYamldatatypesVirtualNetworkInterfaceRequirements(String defYaml, String entry) { super(entry, defYaml); - this.setCode("0x1000"); + this.setCode( SET_CODE); } } public static class CSARErrorEntryMissingDefinitionYamldatatypesConnectivityType extends CSARArchive.CSARErrorEntryMissing { public CSARErrorEntryMissingDefinitionYamldatatypesConnectivityType(String defYaml, String entry) { super(entry, defYaml); - this.setCode("0x1000"); + this.setCode( SET_CODE); } } public static class CSARErrorEntryMissingDefinitionYamldatatypesRequestedAdditionalCapability extends CSARArchive.CSARErrorEntryMissing { public CSARErrorEntryMissingDefinitionYamldatatypesRequestedAdditionalCapability(String defYaml, String entry) { super(entry, defYaml); - this.setCode("0x1000"); + this.setCode( SET_CODE); } } public static class CSARErrorEntryMissingDefinitionYamldatatypesVirtualMemory extends CSARArchive.CSARErrorEntryMissing { public CSARErrorEntryMissingDefinitionYamldatatypesVirtualMemory(String defYaml, String entry) { super(entry, defYaml); - this.setCode("0x1000"); + this.setCode( SET_CODE); } } public static class CSARErrorEntryMissingDefinitionYamldatatypesVirtualCpu extends CSARArchive.CSARErrorEntryMissing { public CSARErrorEntryMissingDefinitionYamldatatypesVirtualCpu(String defYaml, String entry) { super(entry, defYaml); - this.setCode("0x1000"); + this.setCode( SET_CODE); } } public static class CSARErrorEntryMissingDefinitionYamldatatypesVirtualCpuPinning extends CSARArchive.CSARErrorEntryMissing { public CSARErrorEntryMissingDefinitionYamldatatypesVirtualCpuPinning(String defYaml, String entry) { super(entry, defYaml); - this.setCode("0x1000"); + this.setCode( SET_CODE); } } public static class CSARErrorEntryMissingDefinitionYamldatatypesVnfcConfigurableProperties extends CSARArchive.CSARErrorEntryMissing { public CSARErrorEntryMissingDefinitionYamldatatypesVnfcConfigurableProperties(String defYaml, String entry) { super(entry, defYaml); - this.setCode("0x1000"); + this.setCode( SET_CODE); } } public static class CSARErrorEntryMissingDefinitionYamldatatypesVduProfile extends CSARArchive.CSARErrorEntryMissing { public CSARErrorEntryMissingDefinitionYamldatatypesVduProfile(String defYaml, String entry) { super(entry, defYaml); - this.setCode("0x1000"); + this.setCode( SET_CODE); } } public static class CSARErrorEntryMissingDefinitionYamldatatypesVlProfile extends CSARArchive.CSARErrorEntryMissing { public CSARErrorEntryMissingDefinitionYamldatatypesVlProfile(String defYaml, String entry) { super(entry, defYaml); - this.setCode("0x1000"); + this.setCode( SET_CODE); } } public static class CSARErrorEntryMissingDefinitionYamldatatypesInstantiationLevel extends CSARArchive.CSARErrorEntryMissing { public CSARErrorEntryMissingDefinitionYamldatatypesInstantiationLevel(String defYaml, String entry) { super(entry, defYaml); - this.setCode("0x1000"); + this.setCode( SET_CODE); } } public static class CSARErrorEntryMissingDefinitionYamldatatypesVduLevel extends CSARArchive.CSARErrorEntryMissing { public CSARErrorEntryMissingDefinitionYamldatatypesVduLevel(String defYaml, String entry) { super(entry, defYaml); - this.setCode("0x1000"); + this.setCode( SET_CODE); } } public static class CSARErrorEntryMissingDefinitionYamldatatypesScaleInfo extends CSARArchive.CSARErrorEntryMissing { public CSARErrorEntryMissingDefinitionYamldatatypesScaleInfo(String defYaml, String entry) { super(entry, defYaml); - this.setCode("0x1000"); + this.setCode( SET_CODE); } } public static class CSARErrorEntryMissingDefinitionYamldatatypesinjectFile extends CSARArchive.CSARErrorEntryMissing { public CSARErrorEntryMissingDefinitionYamldatatypesinjectFile(String defYaml, String entry) { super(entry, defYaml); - this.setCode("0x1000"); + this.setCode( SET_CODE); } } public static class CSARErrorEntryMissingDefinitionYamldatatypesScalingAspect extends CSARArchive.CSARErrorEntryMissing { public CSARErrorEntryMissingDefinitionYamldatatypesScalingAspect(String defYaml, String entry) { super(entry, defYaml); - this.setCode("0x1000"); + this.setCode( SET_CODE); } } public static class CSARErrorEntryMissingDefinitionYamldatatypesLinkBitRateRequirements extends CSARArchive.CSARErrorEntryMissing { public CSARErrorEntryMissingDefinitionYamldatatypesLinkBitRateRequirements(String defYaml, String entry) { super(entry, defYaml); - this.setCode("0x1000"); + this.setCode( SET_CODE); } } public static class CSARErrorEntryMissingDefinitionYamldatatypesQos extends CSARArchive.CSARErrorEntryMissing { public CSARErrorEntryMissingDefinitionYamldatatypesQos(String defYaml, String entry) { super(entry, defYaml); - this.setCode("0x1000"); + this.setCode( SET_CODE); } } public static class CSARErrorEntryMissingDefinitionYamldatatypesCpProtocolData extends CSARArchive.CSARErrorEntryMissing { public CSARErrorEntryMissingDefinitionYamldatatypesCpProtocolData(String defYaml, String entry) { super(entry, defYaml); - this.setCode("0x1000"); + this.setCode( SET_CODE); } } public static class CSARErrorEntryMissingDefinitionYamldatatypesVnfConfigurableProperties extends CSARArchive.CSARErrorEntryMissing { public CSARErrorEntryMissingDefinitionYamldatatypesVnfConfigurableProperties(String defYaml, String entry) { super(entry, defYaml); - this.setCode("0x1000"); + this.setCode( SET_CODE); } } public static class CSARErrorEntryMissingDefinitionYamldatatypesVnfAdditionalConfigurableProperties extends CSARArchive.CSARErrorEntryMissing { public CSARErrorEntryMissingDefinitionYamldatatypesVnfAdditionalConfigurableProperties(String defYaml, String entry) { super(entry, defYaml); - this.setCode("0x1000"); + this.setCode( SET_CODE); } } public static class CSARErrorEntryMissingDefinitionYamldatatypesVnfInfoModifiableAttributes extends CSARArchive.CSARErrorEntryMissing { public CSARErrorEntryMissingDefinitionYamldatatypesVnfInfoModifiableAttributes(String defYaml, String entry) { super(entry, defYaml); - this.setCode("0x1000"); + this.setCode( SET_CODE); } } public static class CSARErrorEntryMissingDefinitionYamldatatypesVnfInfoModifiableAttributesExtensions extends CSARArchive.CSARErrorEntryMissing { public CSARErrorEntryMissingDefinitionYamldatatypesVnfInfoModifiableAttributesExtensions(String defYaml, String entry) { super(entry, defYaml); - this.setCode("0x1000"); + this.setCode( SET_CODE); } } public static class CSARErrorEntryMissingDefinitionYamldatatypesVnfInfoModifiableAttributesMetadata extends CSARArchive.CSARErrorEntryMissing { public CSARErrorEntryMissingDefinitionYamldatatypesVnfInfoModifiableAttributesMetadata(String defYaml, String entry) { super(entry, defYaml); - this.setCode("0x1000"); + this.setCode( SET_CODE); } } @@ -201,125 +202,125 @@ public class VTPValidateCSARR54356 extends VTPValidateCSARBase { yaml = (Map<String, ?>) yaml.get("topology_template"); Map<String, ?> nodeTmpls = (Map<String, ?>) yaml.get("node_templates"); - boolean vlExist[] = new boolean[30]; + boolean []vlExist = new boolean[30]; for (Object nodeO : nodeTmpls.values()) { Map<String, ?> node = (Map<String, ?>) nodeO; if (node.containsKey("type")) { String type = (String) node.get("type"); - if (type.equalsIgnoreCase("tosca.datatypes.nfv.L3AddressData")) { + if ("tosca.datatypes.nfv.L3AddressData".equalsIgnoreCase(type)) { vlExist[0] = true; } - if (type.equalsIgnoreCase("tosca.datatypes.nfv.AddressData")) { + if ("tosca.datatypes.nfv.AddressData".equalsIgnoreCase(type)) { vlExist[1] = true; } - if (type.equalsIgnoreCase("tosca.datatypes.nfv.VirtualNetworkInterfaceRequirements")) { + if ("tosca.datatypes.nfv.VirtualNetworkInterfaceRequirements".equalsIgnoreCase(type)) { vlExist[2] = true; } - if (type.equalsIgnoreCase("tosca.datatypes.nfv.ConnectivityType")) { + if ("tosca.datatypes.nfv.ConnectivityType".equalsIgnoreCase(type)) { vlExist[3] = true; } - if (type.equalsIgnoreCase("tosca.datatypes.nfv.RequestedAdditionalCapability")) { + if ("tosca.datatypes.nfv.RequestedAdditionalCapability".equalsIgnoreCase(type)) { vlExist[4] = true; } - if (type.equalsIgnoreCase("tosca.datatypes.nfv.VirtualMemory")) { + if ("tosca.datatypes.nfv.VirtualMemory".equalsIgnoreCase(type)) { vlExist[5] = true; } - if (type.equalsIgnoreCase("tosca.datatypes.nfv.VirtualCpu")) { + if ("tosca.datatypes.nfv.VirtualCpu".equalsIgnoreCase(type)) { vlExist[6] = true; } - if (type.equalsIgnoreCase("tosca.datatypes.nfv.VirtualCpuPinning")) { + if ("tosca.datatypes.nfv.VirtualCpuPinning".equalsIgnoreCase(type)) { vlExist[7] = true; } - if (type.equalsIgnoreCase("tosca.datatypes.nfv.VnfcConfigurableProperties")) { + if ("tosca.datatypes.nfv.VnfcConfigurableProperties".equalsIgnoreCase(type)) { vlExist[8] = true; } - if (type.equalsIgnoreCase("tosca.datatypes.nfv.VduProfile")) { + if ("tosca.datatypes.nfv.VduProfile".equalsIgnoreCase(type)) { vlExist[9] = true; } - if (type.equalsIgnoreCase("tosca.datatypes.nfv.VlProfile")) { + if ("tosca.datatypes.nfv.VlProfile".equalsIgnoreCase(type)) { vlExist[10] = true; } - if (type.equalsIgnoreCase("tosca.datatypes.nfv.InstantiationLevel")) { + if ("tosca.datatypes.nfv.InstantiationLevel".equalsIgnoreCase(type)) { vlExist[11] = true; } - if (type.equalsIgnoreCase("tosca.datatypes.nfv.VduLevel")) { + if ("tosca.datatypes.nfv.VduLevel".equalsIgnoreCase(type)) { vlExist[12] = true; } - if (type.equalsIgnoreCase("tosca.datatypes.nfv.ScaleInfo")) { + if ("tosca.datatypes.nfv.ScaleInfo".equalsIgnoreCase(type)) { vlExist[13] = true; } - if (type.equalsIgnoreCase("tosca.datatypes.nfv.injectFile")) { + if ("tosca.datatypes.nfv.injectFile".equalsIgnoreCase(type)) { vlExist[14] = true; } - if (type.equalsIgnoreCase("tosca.datatypes.nfv.ScalingAspect")) { + if ("tosca.datatypes.nfv.ScalingAspect".equalsIgnoreCase(type)) { vlExist[15] = true; } - if (type.equalsIgnoreCase("tosca.datatypes.nfv.LinkBitRateRequirements")) { + if ("tosca.datatypes.nfv.LinkBitRateRequirements".equalsIgnoreCase(type)) { vlExist[16] = true; } - if (type.equalsIgnoreCase("tosca.datatypes.nfv.Qos")) { + if ("tosca.datatypes.nfv.Qos".equalsIgnoreCase(type)) { vlExist[17] = true; } - if (type.equalsIgnoreCase("tosca.datatypes.nfv.CpProtocolData")) { + if ("tosca.datatypes.nfv.CpProtocolData".equalsIgnoreCase(type)) { vlExist[18] = true; } - if (type.equalsIgnoreCase("tosca.datatypes.nfv.VnfConfigurableProperties")) { + if ("tosca.datatypes.nfv.VnfConfigurableProperties".equalsIgnoreCase(type)) { vlExist[19] = true; } - if (type.equalsIgnoreCase("tosca.datatypes.nfv.VnfAdditionalConfigurableProperties")) { + if ("tosca.datatypes.nfv.VnfAdditionalConfigurableProperties".equalsIgnoreCase(type)) { vlExist[20] = true; } - if (type.equalsIgnoreCase("tosca.datatypes.nfv.VnfInfoModifiableAttributes")) { + if ("tosca.datatypes.nfv.VnfInfoModifiableAttributes".equalsIgnoreCase(type)) { vlExist[21] = true; } - if (type.equalsIgnoreCase("tosca.datatypes.nfv.VnfInfoModifiableAttributesExtensions")) { + if ("tosca.datatypes.nfv.VnfInfoModifiableAttributesExtensions".equalsIgnoreCase(type)) { vlExist[22] = true; } - if (type.equalsIgnoreCase("tosca.datatypes.nfv.VnfInfoModifiableAttributesMetadata")) { + if ("tosca.datatypes.nfv.VnfInfoModifiableAttributesMetadata".equalsIgnoreCase(type)) { vlExist[23] = true; } diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR67895.java b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR67895.java index c6075bc..19cb518 100644 --- a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR67895.java +++ b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR67895.java @@ -48,18 +48,18 @@ public class VTPValidateCSARR67895 extends VTPValidateCSARBase { yaml = (Map<String, ?>) yaml.get("topology_template"); Map<String, ?> nodeTmpls = (Map<String, ?>) yaml.get("node_templates"); - boolean vlExist[] = new boolean[2]; + boolean []vlExist = new boolean[2]; for (Object nodeO : nodeTmpls.values()) { Map<String, ?> node = (Map<String, ?>) nodeO; if (node.containsKey("type")) { String type = (String) node.get("type"); - if (type.equalsIgnoreCase("tosca.capabilities.nfv.VirtualBindable")) { + if ("tosca.capabilities.nfv.VirtualBindable".equalsIgnoreCase(type)) { vlExist[0] = true; } - if (type.equalsIgnoreCase("tosca.capabilities.nfv.VirtualLinkable")) { + if ("tosca.capabilities.nfv.VirtualLinkable".equalsIgnoreCase(type)) { vlExist[1] = true; } diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR95321.java b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR95321.java index c7daafe..47eed83 100644 --- a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR95321.java +++ b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR95321.java @@ -49,18 +49,18 @@ public class VTPValidateCSARR95321 extends VTPValidateCSARBase { yaml = (Map<String, ?>) yaml.get("topology_template"); Map<String, ?> nodeTmpls = (Map<String, ?>) yaml.get("node_templates"); - boolean vlExist[] = new boolean[2]; + boolean []vlExist = new boolean[2]; for (Object nodeO : nodeTmpls.values()) { Map<String, ?> node = (Map<String, ?>) nodeO; if (node.containsKey("type")) { String type = (String) node.get("type"); - if (type.equalsIgnoreCase("tosca.relationships.nfv.VirtualBindsTo")) { + if ("tosca.relationships.nfv.VirtualBindsTo".equalsIgnoreCase(type)) { vlExist[0] = true; } - if (type.equalsIgnoreCase("tosca.relationships.nfv.VirtualLinksTo")) { + if ("tosca.relationships.nfv.VirtualLinksTo".equalsIgnoreCase(type)) { vlExist[1] = true; } |