summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/guides/onap-developer/how-to-use-docs/update-review.rst20
1 files changed, 20 insertions, 0 deletions
diff --git a/docs/guides/onap-developer/how-to-use-docs/update-review.rst b/docs/guides/onap-developer/how-to-use-docs/update-review.rst
index 033f2f085..7a0cd39dc 100644
--- a/docs/guides/onap-developer/how-to-use-docs/update-review.rst
+++ b/docs/guides/onap-developer/how-to-use-docs/update-review.rst
@@ -90,6 +90,26 @@ submodules. To pull in the latest changes:
git submodule foreach 'git pull'
+Next, for every submodule, you'll need to rename 'origin' to 'gerrit':
+
+.. code:: bash
+
+ git submodule foreach 'git remote rename origin gerrit'
+
+Finally, for every submodule, you'll have to tell git-review how to find
+Gerrit.
+
+.. code:: bash
+
+ cd doc # Make sure we're in the top level doc repo directory
+ git submodule foreach 'REPO=$(echo $path | sed "s/docs\/submodules\///") ; git remote add gerrit ssh://<LFID>@gerrit.onap.org:29418/$REPO'
+
+Or, if you prefer to do only one at a time:
+
+.. code:: bash
+
+ git remote add gerrit ssh://<LFID>@gerrit.onap.org:29418/repopath/repo.git
+
Requesting Reviews
------------------
='#n27'>27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
/*
 * Copyright © 2017-2018 AT&T Intellectual Property.
 * Modifications 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.enhancer

import kotlinx.coroutines.runBlocking
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.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 = arrayOf(TestApplication::class))
@TestPropertySource(locations = arrayOf("classpath:application.properties"))
class BluePrintEnhancerServiceImplTest {

    @Autowired
    lateinit var modelTypeLoadService: ModelTypeLoadService

    @Autowired
    lateinit var resourceDictionaryLoadService: ResourceDictionaryLoadService

    @Autowired
    lateinit var bluePrintEnhancerService: BluePrintEnhancerService

    @Autowired
    lateinit var bluePrintValidatorService: BluePrintValidatorService

    @Before
    fun init() {
        runBlocking {
            modelTypeLoadService.loadPathModelType("./../../../../components/model-catalog/definition-type/starter-type")
            resourceDictionaryLoadService.loadPathResourceDictionary("./../../../../components/model-catalog/resource-dictionary/starter-dictionary")
            resourceDictionaryLoadService.loadPathResourceDictionary("./../../../../components/model-catalog/resource-dictionary/test-dictionary")
        }
    }

    @Test
    @Throws(Exception::class)
    fun testEnhancementAndValidation() {

        val basePath = "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration"
        testComponentInvokeEnhancementAndValidation(basePath, "base-enhance")
    }

    @Test
    @Throws(Exception::class)
    fun testComponentInvokeEnhancementAndValidation() {
        val basePath = "./../../../../components/model-catalog/blueprint-model/test-blueprint/component_invoke"
        testComponentInvokeEnhancementAndValidation(basePath, "component-enhance")
    }

    @Test
    @Throws(Exception::class)
    fun testGoldenEnhancementAndValidation() {
        val basePath = "./../../../../components/model-catalog/blueprint-model/test-blueprint/golden"
        testComponentInvokeEnhancementAndValidation(basePath, "golden-enhance")
    }


    private fun testComponentInvokeEnhancementAndValidation(basePath: String, targetDirName: String) {

        val targetPath = Paths.get("target", targetDirName).toUri().path

        val bluePrintContext = bluePrintEnhancerService.enhance(basePath, targetPath)
        Assert.assertNotNull("failed to get blueprintContext ", bluePrintContext)

        // Validate the Generated BluePrints
        val valid = bluePrintValidatorService.validateBluePrints(targetPath)
        Assert.assertTrue("blueprint($basePath) validation failed ", valid)
    }

}