Create UTs for APPC

It was created the Unit Tests for APPC which modified the code of
SDNC.

Change-Id: Ica033e8a94f545e148f321c388bee981abadc4af
Signed-off-by: Victor Morales <victor.morales@intel.com>
Issue-Id: INT-24
diff --git a/bootstrap/vagrant-onap/tests/test_appc b/bootstrap/vagrant-onap/tests/test_appc
new file mode 100644
index 0000000..0d46ef4
--- /dev/null
+++ b/bootstrap/vagrant-onap/tests/test_appc
@@ -0,0 +1,97 @@
+#!/bin/bash
+
+source /var/onap_tests/_test_base
+source /var/onap/appc
+
+covered_functions=(
+"clone_all_appc_repos" "compile_all_appc_repos" "get_appc_images" "install_appc"
+)
+
+# test_clone_all_appc_repos() - Verify that the APPC source code is cloned
+function test_clone_all_appc_repos {
+    clone_all_appc_repos
+
+    asserts_file_exist $appc_src_folder/pom.xml
+    asserts_file_exist $appc_src_folder/deployment/pom.xml
+}
+
+# test_compile_all_appc_repos() - Verify that the APPC source code is compiled properly
+function test_compile_all_appc_repos {
+    clone_all_appc_repos
+    compile_all_appc_repos
+
+    for adapter in appc-ansible-adapter appc-chef-adapter appc-dmaap-adapter appc-iaas-adapter appc-netconf-adapter appc-rest-adapter appc-rest-healthcheck-adapter; do
+        asserts_file_exist $appc_src_folder/appc-adapters/$adapter/$adapter-bundle/target/$adapter-bundle-1.1.0-SNAPSHOT.jar
+        asserts_file_exist $appc_src_folder/appc-adapters/$adapter/$adapter-features/target/$adapter-features-1.1.0-SNAPSHOT.jar
+        if [[ "$adapter" == "appc-netconf-adapter" ]]; then
+            asserts_file_exist $appc_src_folder/appc-adapters/$adapter/appc-netconf-installer/target/$adapter-1.1.0-SNAPSHOT.zip
+        else
+            asserts_file_exist $appc_src_folder/appc-adapters/$adapter/$adapter-installer/target/$adapter-1.1.0-SNAPSHOT.zip
+        fi
+    done
+    asserts_file_exist $appc_src_folder/appc-adapters/appc-dmaap-adapter/appc-message-adapter-api/target/appc-message-adapter-api-1.1.0-SNAPSHOT.jar
+    asserts_file_exist $appc_src_folder/appc-adapters/appc-dmaap-adapter/appc-message-adapter-factory/target/appc-message-adapter-factory-1.1.0-SNAPSHOT.jar
+    asserts_file_exist $appc_src_folder/appc-adapters/appc-ssh-adapter/appc-ssh-adapter-api/target/appc-ssh-adapter-api-1.1.0-SNAPSHOT.jar
+    asserts_file_exist $appc_src_folder/appc-adapters/appc-ssh-adapter/appc-ssh-adapter-features/target/appc-ssh-adapter-features-1.1.0-SNAPSHOT.jar
+    asserts_file_exist $appc_src_folder/appc-adapters/appc-ssh-adapter/appc-ssh-adapter-sshd/target/appc-ssh-adapter-sshd-1.1.0-SNAPSHOT.jar
+    asserts_file_exist $appc_src_folder/appc-adapters/appc-ssh-adapter/appc-ssh-adapter-tests/target/appc-ssh-adapter-tests-1.1.0-SNAPSHOT.jar
+
+    for component in appc-asdc-listener appc-event-listener appc-oam appc-provider; do
+        asserts_file_exist $appc_src_folder/$component/$component-bundle/target/$component-bundle-1.1.0-SNAPSHOT.jar
+        asserts_file_exist $appc_src_folder/$component/$component-features/target/$component-features-1.1.0-SNAPSHOT.jar
+        asserts_file_exist $appc_src_folder/$component/$component-installer/target/$component-1.1.0-SNAPSHOT.zip
+    done
+    for component in appc-oam appc-provider; do
+        asserts_file_exist $appc_src_folder/$component/$component-model/target/$component-model-1.1.0-SNAPSHOT.jar
+    done
+
+    asserts_file_exist $appc_src_folder/appc-asdc-listener/appc-yang-generator/target/appc-yang-generator-1.1.0-SNAPSHOT.jar
+
+    asserts_file_exist $appc_src_folder/appc-common/target/appc-common-1.1.0-SNAPSHOT.jar
+
+    asserts_file_exist $appc_src_folder/appc-dg/appc-dg-shared/appc-dg-dependency-model/target/appc-dg-dependency-model-1.1.0-SNAPSHOT.jar
+    asserts_file_exist $appc_src_folder/appc-dg/appc-dg-shared/appc-dg-domain-model-lib/target/appc-dg-domain-model-lib-1.1.0-SNAPSHOT.jar
+
+    asserts_file_exist $appc_src_folder/appc-dispatcher/appc-command-executor/appc-command-executor-api/target/appc-command-executor-api-1.1.0-SNAPSHOT.jar
+    asserts_file_exist $appc_src_folder/appc-dispatcher/appc-dispatcher-common/appc-data-access-lib/target/appc-data-access-lib-1.1.0-SNAPSHOT.jar
+    asserts_file_exist $appc_src_folder/appc-dispatcher/appc-dispatcher-common/domain-model-lib/target/domain-model-lib-1.1.0-SNAPSHOT.jar
+    asserts_file_exist $appc_src_folder/appc-dispatcher/appc-dispatcher-common/execution-queue-management-lib/target/execution-queue-management-lib-1.1.0-SNAPSHOT.jar
+    asserts_file_exist $appc_src_folder/appc-dispatcher/appc-license-manager/appc-license-manager-api/target/appc-license-manager-api-1.1.0-SNAPSHOT.jar
+    asserts_file_exist $appc_src_folder/appc-dispatcher/appc-request-handler/appc-request-handler-api/target/appc-request-handler-api-1.1.0-SNAPSHOT.jar
+
+
+    asserts_file_exist $appc_src_folder/appc-lifecycle-management/appc-lifecycle-management-api/target/appc-lifecycle-management-api-1.1.0-SNAPSHOT.jar
+    asserts_file_exist $appc_src_folder/appc-lifecycle-management/appc-lifecycle-management-core/target/appc-lifecycle-management-core-1.1.0-SNAPSHOT.jar
+    asserts_file_exist $appc_src_folder/appc-lifecycle-management/appc-lifecycle-management-features/target/appc-lifecycle-management-features-1.1.0-SNAPSHOT.jar
+    asserts_file_exist $appc_src_folder/appc-lifecycle-management/appc-lifecycle-management-installer/target/appc-lifecycle-management-1.1.0-SNAPSHOT.zip
+    asserts_file_exist $appc_src_folder/appc-lifecycle-management/state-machine-lib/target/state-machine-lib-1.1.0-SNAPSHOT.jar
+
+    asserts_file_exist $appc_src_folder/appc-metric/appc-metric-bundle/target/appc-metric-bundle-1.1.0-SNAPSHOT.jar
+
+    asserts_file_exist $appc_src_folder/deployment/platform-logic/installer/target/platform-logic-installer-1.1.0-SNAPSHOT.zip
+}
+
+# test_get_appc_images() - Verify that APPC Docker images can be retrieved
+function test_get_appc_images {
+    clone_all_appc_repo
+    get_appc_images
+
+    asserts_image openecomp/appc-image
+}
+
+# test_install_appc() - Verify that the APPC Docker images are up and running
+function test_install_appc {
+    clone_all_appc_repos
+    get_appc_images
+    install_appc
+
+    asserts_image_running openecomp/dgbuilder-sdnc-image
+    asserts_image_running openecomp/appc-image
+    asserts_image_running mysql/mysql-server:5.6
+}
+
+if [ "$1" != '*' ]; then
+    unset covered_functions
+    covered_functions=$1
+fi
+main "${covered_functions[@]}"
diff --git a/bootstrap/vagrant-onap/tests/test_sdnc b/bootstrap/vagrant-onap/tests/test_sdnc
index 93110a3..a60145f 100644
--- a/bootstrap/vagrant-onap/tests/test_sdnc
+++ b/bootstrap/vagrant-onap/tests/test_sdnc
@@ -11,11 +11,11 @@
 function test_clone_all_sdnc_repos {
     clone_all_sdnc_repos
 
-    asserts_file_exist $src_folder/core/pom.xml
-    asserts_file_exist $src_folder/adaptors/pom.xml
-    asserts_file_exist $src_folder/northbound/pom.xml
-    asserts_file_exist $src_folder/plugins/pom.xml
-    asserts_file_exist $src_folder/oam/pom.xml
+    asserts_file_exist $sdnc_src_folder/core/pom.xml
+    asserts_file_exist $sdnc_src_folder/adaptors/pom.xml
+    asserts_file_exist $sdnc_src_folder/northbound/pom.xml
+    asserts_file_exist $sdnc_src_folder/plugins/pom.xml
+    asserts_file_exist $sdnc_src_folder/oam/pom.xml
 }
 
 # test_compile_all_sdnc_repos() - Verify the correct compilation of SDNC projects
@@ -24,34 +24,34 @@
     compile_all_sdnc_repos
 
     for adaptor in aai-service mdsal-resource resource-assignment sql-resource; do
-        asserts_file_exist $src_folder/adaptors/$adaptor/features/target/$adaptor-features-1.1.2-SNAPSHOT.jar
-        asserts_file_exist $src_folder/adaptors/$adaptor/installer/target/sdnc-$adaptor-1.1.2-SNAPSHOT-installer.zip
-        asserts_file_exist $src_folder/adaptors/$adaptor/provider/target/$adaptor-provider-1.1.2-SNAPSHOT.jar
+        asserts_file_exist $sdnc_src_folder/adaptors/$adaptor/features/target/$adaptor-features-1.1.2-SNAPSHOT.jar
+        asserts_file_exist $sdnc_src_folder/adaptors/$adaptor/installer/target/sdnc-$adaptor-1.1.2-SNAPSHOT-installer.zip
+        asserts_file_exist $sdnc_src_folder/adaptors/$adaptor/provider/target/$adaptor-provider-1.1.2-SNAPSHOT.jar
     done
 
-    asserts_file_exist $src_folder/core/dblib/provider/target/dblib-provider-1.1.2-SNAPSHOT.jar
-    asserts_file_exist $src_folder/core/rootpom/target/rootpom-1.1.0-site_en.xml
-    asserts_file_exist $src_folder/core/target/sdnc-core-1.1.2-SNAPSHOT-site.xml
+    asserts_file_exist $sdnc_src_folder/core/dblib/provider/target/dblib-provider-1.1.2-SNAPSHOT.jar
+    asserts_file_exist $sdnc_src_folder/core/rootpom/target/rootpom-1.1.0-site_en.xml
+    asserts_file_exist $sdnc_src_folder/core/target/sdnc-core-1.1.2-SNAPSHOT-site.xml
 
     for component in asdcApi dataChange vnfapi vnftools; do
-        asserts_file_exist $src_folder/northbound/$component/features/target/$component-features-1.1.2-SNAPSHOT.jar
-        asserts_file_exist $src_folder/northbound/$component/installer/target/sdnc-$component-1.1.2-SNAPSHOT-installer.zip
+        asserts_file_exist $sdnc_src_folder/northbound/$component/features/target/$component-features-1.1.2-SNAPSHOT.jar
+        asserts_file_exist $sdnc_src_folder/northbound/$component/installer/target/sdnc-$component-1.1.2-SNAPSHOT-installer.zip
         if [[ "$component" != "vnftools" ]]; then
-            asserts_file_exist $src_folder/northbound/$component/model/target/$component-model-1.1.2-SNAPSHOT.jar
+            asserts_file_exist $sdnc_src_folder/northbound/$component/model/target/$component-model-1.1.2-SNAPSHOT.jar
         fi
-        asserts_file_exist $src_folder/northbound/$component/provider/target/$component-provider-1.1.2-SNAPSHOT.jar
+        asserts_file_exist $sdnc_src_folder/northbound/$component/provider/target/$component-provider-1.1.2-SNAPSHOT.jar
     done
-    asserts_file_exist $src_folder/northbound/dmaap-listener/target/dmaap-listener-1.1.2-SNAPSHOT.jar
-    asserts_file_exist $src_folder/northbound/ueb-listener/target/ueb-listener-1.1.2-SNAPSHOT.jar
+    asserts_file_exist $sdnc_src_folder/northbound/dmaap-listener/target/dmaap-listener-1.1.2-SNAPSHOT.jar
+    asserts_file_exist $sdnc_src_folder/northbound/ueb-listener/target/ueb-listener-1.1.2-SNAPSHOT.jar
 
-    asserts_file_exist $src_folder/oam/admportal/target/admportal.1.1.2-SNAPSHOT.zip
-    asserts_file_exist $src_folder/oam/dgbuilder/target/dgbuilder.1.1.2-SNAPSHOT.zip
-    asserts_file_exist $src_folder/oam/platform-logic/installer/target/platform-logic-installer-1.1.2-SNAPSHOT.zip
+    asserts_file_exist $sdnc_src_folder/oam/admportal/target/admportal.1.1.2-SNAPSHOT.zip
+    asserts_file_exist $sdnc_src_folder/oam/dgbuilder/target/dgbuilder.1.1.2-SNAPSHOT.zip
+    asserts_file_exist $sdnc_src_folder/oam/platform-logic/installer/target/platform-logic-installer-1.1.2-SNAPSHOT.zip
 
     for plugin in properties-node restapi-call-node; do
-        asserts_file_exist $src_folder/plugins/$plugin/features/target/$plugin-features-1.1.2-SNAPSHOT.jar
-        asserts_file_exist $src_folder/plugins/$plugin/installer/target/sdnc-$plugin-1.1.2-SNAPSHOT-installer.zip
-        asserts_file_exist $src_folder/plugins/$plugin/provider/target/$plugin-provider-1.1.2-SNAPSHOT.jar
+        asserts_file_exist $sdnc_src_folder/plugins/$plugin/features/target/$plugin-features-1.1.2-SNAPSHOT.jar
+        asserts_file_exist $sdnc_src_folder/plugins/$plugin/installer/target/sdnc-$plugin-1.1.2-SNAPSHOT-installer.zip
+        asserts_file_exist $sdnc_src_folder/plugins/$plugin/provider/target/$plugin-provider-1.1.2-SNAPSHOT.jar
     done
 }