From 8bec4a04cffac2ba03af3078d090c0b9466d78d7 Mon Sep 17 00:00:00 2001 From: "Muthuramalingam, Brinda Santh" Date: Tue, 8 Jan 2019 11:17:05 -0500 Subject: Add relationships type files load structure. Change-Id: I1be3ba493956674b476058094e05d681ce358711 Issue-ID: CCSDK-746 Signed-off-by: Muthuramalingam, Brinda Santh --- .../enhancer/BluePrintEnhancerServiceImplTest.java | 73 ---------------------- .../service/validator/ModelTypeValidatorTest.java | 56 ----------------- 2 files changed, 129 deletions(-) delete mode 100644 ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/enhancer/BluePrintEnhancerServiceImplTest.java delete mode 100644 ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ModelTypeValidatorTest.java (limited to 'ms/controllerblueprints/modules/service/src/test/java') diff --git a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/enhancer/BluePrintEnhancerServiceImplTest.java b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/enhancer/BluePrintEnhancerServiceImplTest.java deleted file mode 100644 index 23e5294f..00000000 --- a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/enhancer/BluePrintEnhancerServiceImplTest.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright © 2017-2018 AT&T Intellectual Property. - * - * 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.onap.ccsdk.apps.controllerblueprints.service.enhancer; - -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.onap.ccsdk.apps.controllerblueprints.TestApplication; -import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.BluePrintEnhancerService; -import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.BluePrintValidatorService; -import org.onap.ccsdk.apps.controllerblueprints.core.service.BluePrintContext; -import org.onap.ccsdk.apps.controllerblueprints.service.load.ModelTypeLoadService; -import org.onap.ccsdk.apps.controllerblueprints.service.load.ResourceDictionaryLoadService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import java.nio.file.Paths; - -@RunWith(SpringRunner.class) -@ContextConfiguration(classes = {TestApplication.class}) -@TestPropertySource(locations = {"classpath:application.properties"}) -public class BluePrintEnhancerServiceImplTest { - - @Autowired - private ModelTypeLoadService modelTypeLoadService; - - @Autowired - private ResourceDictionaryLoadService resourceDictionaryLoadService; - - @Autowired - private BluePrintEnhancerService bluePrintEnhancerService; - - @Autowired - private BluePrintValidatorService bluePrintValidatorService; - - @Before - public void init() { - modelTypeLoadService.loadPathModelType("./../../../../components/model-catalog/definition-type/starter-type"); - resourceDictionaryLoadService.loadPathResourceDictionary("./../../../../components/model-catalog/resource-dictionary/starter-dictionary"); - } - - @Test - public void testEnhancementAndValidation() throws Exception { - - String basePath = "./../../../../components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration"; - - String targetPath = Paths.get("target", "bp-enhance").toUri().getPath(); - - BluePrintContext bluePrintContext = bluePrintEnhancerService.enhance(basePath, targetPath); - Assert.assertNotNull("failed to get blueprintContext ", bluePrintContext); - - // Validate the Generated BluePrints - Boolean valid = bluePrintValidatorService.validateBluePrints(targetPath); - Assert.assertTrue("blueprint validation failed ", valid); - } -} \ No newline at end of file diff --git a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ModelTypeValidatorTest.java b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ModelTypeValidatorTest.java deleted file mode 100644 index 16b2bc81..00000000 --- a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ModelTypeValidatorTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright © 2018 IBM. - * - * 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.onap.ccsdk.apps.controllerblueprints.service.validator; - -import com.fasterxml.jackson.databind.JsonNode; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException; -import org.onap.ccsdk.apps.controllerblueprints.service.domain.ModelType; - -public class ModelTypeValidatorTest { - - @Before - public void setup(){ - ModelTypeValidator modelTypeValidator; - } - - @Test - public void testGetValidModelDefinitionType_definitionContentNULL() throws Exception{ - String definitionType=null; - JsonNode definitionContent=null; - boolean valid= ModelTypeValidator.validateModelTypeDefinition(definitionType, definitionContent); - Assert.assertTrue(valid); - - } - - @Test(expected=BluePrintException.class) - public void testvalidateModelType() throws Exception{ - ModelType modelType = new ModelType(); - modelType.setDefinitionType(""); - modelType.setDerivedFrom(""); - modelType.setDescription(""); - JsonNode definitionContent=null; - modelType.setDefinition(definitionContent); - modelType.setModelName(""); - modelType.setVersion(""); - modelType.setTags(""); - modelType.setUpdatedBy(""); - ModelTypeValidator.validateModelType(modelType); - } -} -- cgit 1.2.3-korg