nifi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject nifi-minifi-cpp git commit: MINIFICPP-270: Encapsulate extension building into functions that automate the build and test process slightly
Date Tue, 31 Oct 2017 03:38:32 GMT
Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master b9e931b8b -> c12d3b6a8


MINIFICPP-270: Encapsulate extension building into functions that automate the build and test process slightly

Signed-off-by: Bin Qiu <bqiu@apache.org>

This closes #161.


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/c12d3b6a
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/c12d3b6a
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/c12d3b6a

Branch: refs/heads/master
Commit: c12d3b6a8c4c131356bcbfa4edb4b26095fee868
Parents: b9e931b
Author: Marc Parisi <phrocker@apache.org>
Authored: Mon Oct 30 11:03:33 2017 -0400
Committer: Bin Qiu <benqiu2016@gmail.com>
Committed: Mon Oct 30 20:36:01 2017 -0700

----------------------------------------------------------------------
 CMakeLists.txt                                  |  72 ++++----
 Extensions.md                                   |  21 +++
 cmake/BuildTests.cmake                          | 136 +++------------
 cmake/Extensions.cmake                          |  74 +++++++++
 extensions/http-curl/CMakeLists.txt             |   5 +-
 extensions/libarchive/CMakeLists.txt            |   6 +-
 extensions/rocksdb-repos/CMakeLists.txt         |   8 +-
 libminifi/test/archive-tests/CMakeLists.txt     |  37 +++++
 libminifi/test/curl-tests/CMakeLists.txt        |  53 ++++++
 .../ControllerServiceIntegrationTests.cpp       | 165 +++++++++++++++++++
 .../ControllerServiceIntegrationTests.cpp       | 165 -------------------
 libminifi/test/rocksdb-tests/CMakeLists.txt     |  36 ++++
 main/CMakeLists.txt                             |  30 +---
 13 files changed, 469 insertions(+), 339 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c12d3b6a/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 48859f7..51d817f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -25,6 +25,7 @@ set(PROJECT_VERSION_MINOR 3)
 set(PROJECT_VERSION_PATCH 0)
 option(SKIP_TESTS "Skips building all tests." OFF)
 
+
 include(FeatureSummary)
 
 # Use ccache if present
@@ -74,11 +75,13 @@ endif (OPENSSL_FOUND)
 # Provide custom modules for the project
 list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
 
-find_package(UUID REQUIRED)
-file(GLOB SPD_SOURCES "thirdparty/spdlog-20170710/include/spdlog/*")
+SET(TEST_DIR ${CMAKE_SOURCE_DIR}/libminifi/test)
 
+include(Extensions)
 
+find_package(UUID REQUIRED)
 
+file(GLOB SPD_SOURCES "thirdparty/spdlog-20170710/include/spdlog/*")
 
 include(ExternalProject)
 
@@ -105,40 +108,41 @@ add_subdirectory(thirdparty/civetweb-1.9.1 EXCLUDE_FROM_ALL)
 include_directories(thirdparty/concurrentqueue)
 include_directories(thirdparty/yaml-cpp-yaml-cpp-20171024/include)
 add_subdirectory(libminifi)
-if (NOT DISABLE_CURL)
-	find_package(CURL)
-	add_subdirectory(extensions/http-curl)
-	mark_as_advanced(HTTP-CURL)
-	
+#function(createExtension extensionCondition extensionGuard extensionName description dirName)
+
+## Add http-curl extensions
+createExtension(DISABLE_CURL 
+				HTTP-CURL 
+				"HTTP CURL" 
+				"This enables RESTProtocol, InvokeHTTP, and the HTTPClient for Site to Site" 
+				"extensions/http-curl"
+				"${TEST_DIR}/curl-tests")
+
+## Add the rocks DB extension
+if ( NOT ROCKSDB_FOUND OR BUILD_ROCKSDB )
+	set(BUILD_RD "TRUE")
 endif()
-
-if (NOT DISABLE_ROCKSDB)
-	find_package(RocksDB)
-	if (NOT ROCKSDB_FOUND OR BUILD_ROCKSDB)
-		add_subdirectory(thirdparty/rocksdb/)
-		include_directories(thirdparty/rocksdb/include)
-	else()
-		include_directories(${ROCKSDB_INCLUDE_DIR})
-	endif()
-	
-	add_subdirectory(extensions/rocksdb-repos)
-	mark_as_advanced(ROCKSDB-REPOS)
-
+createExtension(DISABLE_ROCKSDB 
+				ROCKSDB-REPOS 
+				"ROCKSDB REPOS" 
+				"This Enables persistent provenance, flowfile, and content repositories using RocksDB" 
+				"extensions/rocksdb-repos"
+				"${TEST_DIR}/rocksdb-tests"
+				BUILD_RD
+				"thirdparty/rocksdb/")
+
+## Create LibArchive Extension
+if ( NOT LibArchive_FOUND OR BUILD_LIBARCHIVE )
+	set(BUILD_TP "TRUE")
 endif()
-
-if (NOT DISABLE_LIBARCHIVE)
-	find_package(LibArchive)
-	if (NOT LibArchive_FOUND OR BUILD_LIBARCHIVE)
-		add_subdirectory(thirdparty/libarchive-3.3.2)
-	endif()
-	add_subdirectory(extensions/libarchive)
-	mark_as_advanced(ARCHIVE-EXTENSIONS)
-endif()
-
-## ENABLE FEATURE INFORMATION
-ADD_FEATURE_INFO("HTTP CURL" HTTP-CURL "This enables RESTProtocol, InvokeHTTP, and the HTTPClient for Site to Site")
-ADD_FEATURE_INFO("ROCKSDB REPOS" ROCKSDB-REPOS "This Enables persistent provenance, flowfile, and content repositories using RocksDB")
-ADD_FEATURE_INFO("ARCHIVE EXTENSIONS" ARCHIVE-EXTENSIONS "This Enables libarchive functionality including MergeContent, CompressContent, and (Un)FocusArchiveEntry")
+createExtension(DISABLE_LIBARCHIVE 
+				ARCHIVE-EXTENSIONS 
+				"ARCHIVE EXTENSIONS" 
+				"This Enables libarchive functionality including MergeContent, CompressContent, and (Un)FocusArchiveEntry" 
+				"extensions/libarchive"
+				"${TEST_DIR}/archive-tests"
+				BUILD_TP
+				"thirdparty/libarchive-3.3.2")
 
 ## NOW WE CAN ADD LIBRARIES AND EXTENSIONS TO MAIN
 

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c12d3b6a/Extensions.md
----------------------------------------------------------------------
diff --git a/Extensions.md b/Extensions.md
index 7e13243..95625c5 100644
--- a/Extensions.md
+++ b/Extensions.md
@@ -27,6 +27,27 @@ This folder contains a CMakeLists file so that we can conditionally build it. In
 
 Your CMAKE file should build a static library, that will be included into the run time. This must be added with your conditional to the libminifi CMAKE, along with a platform specific whole archive inclusion. Note that this will ensure that despite no direct linkage being found by the compiler, we will include the code so that we can dynamically find your code.
 
+# Including your extension in the build
+There is a new function that can be used in the root cmake to build and included your extension. An example is based on the LibArchive extension. The createExtension function has 8 possible arguments. The first five arguments are required.
+The first argument specifies the variable controlling the exclusion of this extension, followed by the variable that
+is used when including it into conditional statements. The third argument is the pretty name followed by the description of the extension and the extension directory. The first optional argument is the test directory, which must also contain a CMakeLists.txt file. The seventh argument can be a conditional variable that tells us whether or not to add a third party subdirectory specified by the final extension.
+
+In the lib archive example, we provide all arguments, but your extension may only need the first five and the the test folder. The seventh and eighth arguments must be included in tandem. 
+
+```cmake
+if ( NOT LibArchive_FOUND OR BUILD_LIBARCHIVE )
+	set(BUILD_TP "TRUE")
+endif()
+createExtension(DISABLE_LIBARCHIVE 
+				ARCHIVE-EXTENSIONS 
+				"ARCHIVE EXTENSIONS" 
+				"This Enables libarchive functionality including MergeContent, CompressContent, and (Un)FocusArchiveEntry" 
+				"extensions/libarchive"
+				"${TEST_DIR}/archive-tests"
+				BUILD_TP
+				"thirdparty/libarchive-3.3.2")
+```
+  
 # C bindings
 To find your classes, you must adhere to a dlsym call back that adheres to the core::ObjectFactory class, like the one below. This object factory will return a list of classes, that we can instantiate through the class loader mechanism. Note that since we are including your code directly into our runtime, we will take care of dlopen and dlsym calls. A map from the class name to the object factory is kept in memory.
 

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c12d3b6a/cmake/BuildTests.cmake
----------------------------------------------------------------------
diff --git a/cmake/BuildTests.cmake b/cmake/BuildTests.cmake
index 89f34fd..918cab7 100644
--- a/cmake/BuildTests.cmake
+++ b/cmake/BuildTests.cmake
@@ -33,55 +33,38 @@ find_package(Boost COMPONENTS system filesystem REQUIRED)
 
 function(createTests testName)
    message ("-- Adding test: ${testName}")
-    target_include_directories(${testName} PRIVATE BEFORE "thirdparty/catch")
-    target_include_directories(${testName} PRIVATE BEFORE "thirdparty/spdlog-20170710/include")
-    target_include_directories(${testName} PRIVATE BEFORE "thirdparty/yaml-cpp-yaml-cpp-0.5.3/include")
-    target_include_directories(${testName} PRIVATE BEFORE "thirdparty/jsoncpp/include")
-    target_include_directories(${testName} PRIVATE BEFORE "thirdparty/civetweb-1.9.1/include")
-    target_include_directories(${testName} PRIVATE BEFORE "thirdparty/libarchive-3.3.2/libarchive")
-    target_include_directories(${testName} PRIVATE BEFORE "include")
-    target_include_directories(${testName} PRIVATE BEFORE "libminifi/include/")
-    target_include_directories(${testName} PRIVATE BEFORE "libminifi/include/c2/protocols")
-    target_include_directories(${testName} PRIVATE BEFORE "libminifi/include/c2")
-    target_include_directories(${testName} PRIVATE BEFORE "libminifi/include/core")
-    target_include_directories(${testName} PRIVATE BEFORE "libminifi/include/core/controller")
-    target_include_directories(${testName} PRIVATE BEFORE "libminifi/include/core/repository")
-    target_include_directories(${testName} PRIVATE BEFORE "libminifi/include/core/yaml")
-    target_include_directories(${testName} PRIVATE BEFORE "libminifi/include/core/statemanagement")
-    target_include_directories(${testName} PRIVATE BEFORE "libminifi/include/core/statemanagement/metrics")
-    target_include_directories(${testName} PRIVATE BEFORE "libminifi/include/io")
-    target_include_directories(${testName} PRIVATE BEFORE "libminifi/include/utils")
-    target_include_directories(${testName} PRIVATE BEFORE "libminifi/include/processors")
-    target_include_directories(${testName} PRIVATE BEFORE "libminifi/include/provenance")
+    target_include_directories(${testName} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/thirdparty/catch")
+    target_include_directories(${testName} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/thirdparty/spdlog-20170710/include")
+    target_include_directories(${testName} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/thirdparty/yaml-cpp-yaml-cpp-0.5.3/include")
+    target_include_directories(${testName} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/thirdparty/jsoncpp/include")
+    target_include_directories(${testName} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/thirdparty/civetweb-1.9.1/include")
+    target_include_directories(${testName} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/thirdparty/libarchive-3.3.2/libarchive")
+    target_include_directories(${testName} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/include")
+    target_include_directories(${testName} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/libminifi/include/")
+    target_include_directories(${testName} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/libminifi/include/c2/protocols")
+    target_include_directories(${testName} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/libminifi/include/c2")
+    target_include_directories(${testName} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/libminifi/include/core")
+    target_include_directories(${testName} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/libminifi/include/core/controller")
+    target_include_directories(${testName} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/libminifi/include/core/repository")
+    target_include_directories(${testName} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/libminifi/include/core/yaml")
+    target_include_directories(${testName} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/libminifi/include/core/statemanagement")
+    target_include_directories(${testName} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/libminifi/include/core/statemanagement/metrics")
+    target_include_directories(${testName} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/libminifi/include/io")
+    target_include_directories(${testName} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/libminifi/include/utils")
+    target_include_directories(${testName} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/libminifi/include/processors")
+    target_include_directories(${testName} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/libminifi/include/provenance")
     target_link_libraries(${testName} ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES} core-minifi minifi yaml-cpp c-library civetweb-cpp ${JSON_CPP_LIB})
     target_link_libraries(${testName} ${Boost_SYSTEM_LIBRARY})
     target_link_libraries(${testName} ${Boost_FILESYSTEM_LIBRARY})
-     if (CURL_FOUND)
-        target_include_directories(${testName} PRIVATE BEFORE ${CURL_INCLUDE_DIRS})
-        target_include_directories(${testName} PRIVATE BEFORE "extensions/http-curl/")
-        target_include_directories(${testName} PRIVATE BEFORE "extensions/http-curl/client/")
-        target_include_directories(${testName} PRIVATE BEFORE "extensions/http-curl/processors/")
-        target_include_directories(${testName} PRIVATE BEFORE "extensions/http-curl/protocols/")
-        target_link_libraries(${testName} ${CURL_LIBRARIES} )
-        if (APPLE)    
-        target_link_libraries (${testName} -Wl,-all_load ${HTTP-CURL})
-    else ()
-      target_link_libraries (${testName} -Wl,--whole-archive ${HTTP-CURL} -Wl,--no-whole-archive)
-    endif ()
-    endif()
 endfunction()
 
 
 enable_testing(test)
 
-SET(TEST_DIR ${CMAKE_SOURCE_DIR}/libminifi/test)
 SET(TEST_RESOURCES ${TEST_DIR}/resources)
 
 GETSOURCEFILES(UNIT_TESTS "${TEST_DIR}/unit/")
 GETSOURCEFILES(INTEGRATION_TESTS "${TEST_DIR}/integration/")
-GETSOURCEFILES(CURL_INTEGRATION_TESTS "${TEST_DIR}/curl-tests/")
-GETSOURCEFILES(ROCKSDB_INTEGRATION_TESTS "${TEST_DIR}/rocksdb-tests/")
-GETSOURCEFILES(ARCHIVE_INTEGRATION_TESTS "${TEST_DIR}/archive-tests/")
 
 SET(UNIT_TEST_COUNT 0)
 FOREACH(testfile ${UNIT_TESTS})
@@ -102,80 +85,11 @@ FOREACH(testfile ${INTEGRATION_TESTS})
 ENDFOREACH()
 message("-- Finished building ${INT_TEST_COUNT} integration test file(s)...")
 
-if (ROCKSDB-REPOS)
-SET(ROCKSDB_TEST_COUNT 0)
-FOREACH(testfile ${ROCKSDB_INTEGRATION_TESTS})
-  get_filename_component(testfilename "${testfile}" NAME_WE)
-  add_executable("${testfilename}" "${TEST_DIR}/rocksdb-tests/${testfile}" ${SPD_SOURCES} "${TEST_DIR}/TestBase.cpp")
-  target_include_directories(${testfilename} PRIVATE BEFORE "extensions/rocksdb-repos/")
-  target_include_directories(${testfilename} PRIVATE BEFORE "thirdparty/rocksdb/include")
-  if (APPLE)
-    target_link_libraries (${testfilename} -Wl,-all_load ${ROCKSDB-REPOS})
-  else ()
-    target_link_libraries (${testfilename} -Wl,--whole-archive ${ROCKSDB-REPOS} -Wl,--no-whole-archive)
-  endif ()
-  createTests("${testfilename}")
-  MATH(EXPR ROCKSDB_TEST_COUNT "${ROCKSDB_TEST_COUNT}+1")
-ENDFOREACH()
-message("-- Finished building ${ROCKSDB_TEST_COUNT} RocksDB related test file(s)...")
-endif(ROCKSDB-REPOS)
-
-if (ARCHIVE-EXTENSIONS)
-SET(EXTENSIONS_TEST_COUNT 0)
-FOREACH(testfile ${ARCHIVE_INTEGRATION_TESTS})
-  get_filename_component(testfilename "${testfile}" NAME_WE)
-  add_executable("${testfilename}" "${TEST_DIR}/archive-tests/${testfile}" ${SPD_SOURCES} "${TEST_DIR}/TestBase.cpp")
-  target_include_directories(${testfilename} PRIVATE BEFORE "extensions/libarchive")
-    target_include_directories(${testfilename} PRIVATE BEFORE "thirdparty/libarchive-3.3.2/libarchive")
-    if (APPLE)
-        target_link_libraries (${testfilename} -Wl,-all_load ${ARCHIVE-EXTENSIONS})
-  else ()
-      target_link_libraries (${testfilename} -Wl,--whole-archive ${ARCHIVE-EXTENSIONS} -Wl,--no-whole-archive)
-  endif ()
-  createTests("${testfilename}")
-  MATH(EXPR EXTENSIONS_TEST_COUNT "${ROCKSDB_TEST_COUNT}+1")
-  add_test(NAME "${testfilename}" COMMAND "${testfilename}" WORKING_DIRECTORY ${TEST_DIR})
-ENDFOREACH()
-message("-- Finished building ${ARCHIVE-EXTENSIONS_TEST_COUNT} Lib Archive related test file(s)...")
-endif(ARCHIVE-EXTENSIONS)
-
-if (HTTP-CURL)
-
-SET(CURL_INT_TEST_COUNT 0)
-FOREACH(testfile ${CURL_INTEGRATION_TESTS})
-  get_filename_component(testfilename "${testfile}" NAME_WE)
-  add_executable("${testfilename}" "${TEST_DIR}/curl-tests/${testfile}" ${SPD_SOURCES} "${TEST_DIR}/TestBase.cpp")
-  createTests("${testfilename}")
-  #message("Adding ${testfilename} from ${testfile}")
-  MATH(EXPR CURL_INT_TEST_COUNT "${CURL_INT_TEST_COUNT}+1")
-ENDFOREACH()
-message("-- Finished building ${CURL_INT_TEST_COUNT} libcURL integration test file(s)...")
-
-
-
-add_test(NAME HttpGetIntegrationTest COMMAND HttpGetIntegrationTest "${TEST_RESOURCES}/TestHTTPGet.yml"  "${TEST_RESOURCES}/")
-
-add_test(NAME C2UpdateTest COMMAND C2UpdateTest "${TEST_RESOURCES}/TestHTTPGet.yml"  "${TEST_RESOURCES}/")
-
-add_test(NAME HttpGetIntegrationTestSecure COMMAND HttpGetIntegrationTest "${TEST_RESOURCES}/TestHTTPGetSecure.yml"  "${TEST_RESOURCES}/")
-
-add_test(NAME HttpPostIntegrationTest COMMAND HttpPostIntegrationTest "${TEST_RESOURCES}/TestHTTPPost.yml" "${TEST_RESOURCES}/")
-
-add_test(NAME HttpPostIntegrationTestChunked COMMAND HttpPostIntegrationTest "${TEST_RESOURCES}/TestHTTPPostChunkedEncoding.yml" "${TEST_RESOURCES}/")
-
-add_test(NAME C2VerifyServeResults COMMAND C2VerifyServeResults "${TEST_RESOURCES}/TestHTTPGet.yml" "${TEST_RESOURCES}/")
-
-add_test(NAME C2VerifyHeartbeatAndStop COMMAND C2VerifyHeartbeatAndStop "${TEST_RESOURCES}/TestHTTPGet.yml" "${TEST_RESOURCES}/")
-
-add_test(NAME SiteToSiteRestTest COMMAND SiteToSiteRestTest "${TEST_RESOURCES}/TestSite2SiteRest.yml" "${TEST_RESOURCES}/" "http://localhost:8082/nifi-api/controller")
-
-## removed due to travis issues with our certs
-#add_test(NAME SiteToSiteRestTestSecure COMMAND SiteToSiteRestTest "${TEST_RESOURCES}/TestSite2SiteRestSecure.yml" "${TEST_RESOURCES}/" "https://localhost:8082/nifi-api/controller")
-
-add_test(NAME ControllerServiceIntegrationTests COMMAND ControllerServiceIntegrationTests "${TEST_RESOURCES}/TestControllerServices.yml" "${TEST_RESOURCES}/")
-
-add_test(NAME ThreadPoolAdjust COMMAND ThreadPoolAdjust "${TEST_RESOURCES}/TestHTTPPostChunkedEncoding.yml" "${TEST_RESOURCES}/")
 
-endif(HTTP-CURL)
+get_property(extensions GLOBAL PROPERTY EXTENSION-TESTS)
+foreach(EXTENSION ${extensions})
+	message("Adding ${EXTENSION} ? ")
+	add_subdirectory(${EXTENSION})
+endforeach()
 
 add_test(NAME TestExecuteProcess COMMAND TestExecuteProcess )

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c12d3b6a/cmake/Extensions.cmake
----------------------------------------------------------------------
diff --git a/cmake/Extensions.cmake b/cmake/Extensions.cmake
new file mode 100644
index 0000000..141ea15
--- /dev/null
+++ b/cmake/Extensions.cmake
@@ -0,0 +1,74 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+
+
+define_property(GLOBAL PROPERTY EXTENSION-OPTIONS
+    BRIEF_DOCS "Global extension list"
+    FULL_DOCS "Global extension list")
+
+set_property(GLOBAL PROPERTY EXTENSION-OPTIONS "")
+
+macro(register_extension extension-name)
+	get_property(extensions GLOBAL PROPERTY EXTENSION-OPTIONS)
+  set_property(GLOBAL APPEND PROPERTY EXTENSION-OPTIONS ${extension-name})
+endmacro()
+
+### TESTING MACROS
+
+define_property(GLOBAL PROPERTY EXTENSION-TESTS
+    BRIEF_DOCS "Global extension tests"
+    FULL_DOCS "Global extension tests")
+
+set_property(GLOBAL PROPERTY EXTENSION-TESTS "")
+
+macro(register_extension_test extension-dir) 
+  if (NOT SKIP_TESTS)
+  	get_property(extensions GLOBAL PROPERTY EXTENSION-TESTS)
+  	set_property(GLOBAL APPEND PROPERTY EXTENSION-TESTS "${extension-dir}")
+  endif()
+endmacro()
+
+function(registerExtension extensionCondition dirName)
+	if (NOT ${extensionCondition})
+		add_subdirectory(${dirName})
+	endif()
+endfunction(registerExtension)
+
+function(registerTest dirName)
+	if (NOT SKIP_TESTS)
+		add_subdirectory(${dirName})
+	endif()
+endfunction(registerTest)
+
+### FUNCTION TO CREATE AN EXTENSION
+
+function(createExtension extensionCondition extensionGuard extensionName description dirName)
+   if (NOT ${extensionCondition})
+		add_subdirectory(${dirName})
+    	ADD_FEATURE_INFO("${extensionName}" ${extensionGuard} "${description}")
+	    mark_as_advanced(${extensionGuard})
+	    if (ARGV5)
+	    	register_extension_test(${ARGV5})
+	    endif(ARGV5)
+	    if (ARGV6 AND ARGV7)
+	    	if (${ARGV6})
+				add_subdirectory(${ARGV7})	
+			endif()
+	    endif()
+    endif()
+endfunction(createExtension)
+

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c12d3b6a/extensions/http-curl/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/extensions/http-curl/CMakeLists.txt b/extensions/http-curl/CMakeLists.txt
index 6989a7d..d851aff 100644
--- a/extensions/http-curl/CMakeLists.txt
+++ b/extensions/http-curl/CMakeLists.txt
@@ -17,8 +17,6 @@
 # under the License.
 #
 
-cmake_minimum_required(VERSION 2.6)
-
 find_package(CURL REQUIRED)
 
 set(CMAKE_EXE_LINKER_FLAGS "-Wl,--export-all-symbols")
@@ -67,7 +65,6 @@ else ()
     )
 endif ()
 
-
 SET (HTTP-CURL minifi-http-curl PARENT_SCOPE)
 
-
+register_extension(minifi-http-curl)

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c12d3b6a/extensions/libarchive/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/extensions/libarchive/CMakeLists.txt b/extensions/libarchive/CMakeLists.txt
index 4050b61..0dd24de 100644
--- a/extensions/libarchive/CMakeLists.txt
+++ b/extensions/libarchive/CMakeLists.txt
@@ -17,14 +17,13 @@
 # under the License.
 #
 
-cmake_minimum_required(VERSION 2.6)
-
-
 set(CMAKE_EXE_LINKER_FLAGS "-Wl,--export-all-symbols")
 set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--export-symbols")
 
 include_directories(../../libminifi/include  ../../libminifi/include/core  ../../thirdparty/spdlog-20170710/include ../../thirdparty/concurrentqueue ../../thirdparty/yaml-cpp-yaml-cpp-0.5.3/include ../../thirdparty/civetweb-1.9.1/include ../../thirdparty/jsoncpp/include  ../../thirdparty/) 
 
+find_package(LibArchive)
+	
 include_directories(../../thirdparty/libarchive-3.3.2/libarchive)
 
 file(GLOB SOURCES  "*.cpp")
@@ -75,4 +74,5 @@ endif ()
 
 SET (ARCHIVE-EXTENSIONS minifi-archive-extensions PARENT_SCOPE)
 
+register_extension(minifi-archive-extensions)
 

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c12d3b6a/extensions/rocksdb-repos/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/extensions/rocksdb-repos/CMakeLists.txt b/extensions/rocksdb-repos/CMakeLists.txt
index 76dd1f2..f169a02 100644
--- a/extensions/rocksdb-repos/CMakeLists.txt
+++ b/extensions/rocksdb-repos/CMakeLists.txt
@@ -24,8 +24,14 @@ set(CMAKE_EXE_LINKER_FLAGS "-Wl,--export-all-symbols")
 set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--export-symbols")
 
 include_directories(../../libminifi/include  ../../libminifi/include/core  ../../thirdparty/spdlog-20170710/include ../../thirdparty/concurrentqueue ../../thirdparty/yaml-cpp-yaml-cpp-0.5.3/include ../../thirdparty/civetweb-1.9.1/include ../../thirdparty/jsoncpp/include ../../thirdparty/rocksdb/include  ../../thirdparty/) 
+
 find_package(RocksDB)
 
+if (NOT ROCKSDB_FOUND OR BUILD_ROCKSDB)
+	include_directories(thirdparty/rocksdb/include)
+else()
+	include_directories(${ROCKSDB_INCLUDE_DIR})
+endif()
 
 
 file(GLOB SOURCES  "*.cpp")
@@ -72,4 +78,4 @@ endif ()
 
 SET (ROCKSDB-REPOS minifi-rocksdb-repos PARENT_SCOPE)
 
-
+register_extension(minifi-rocksdb-repos)

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c12d3b6a/libminifi/test/archive-tests/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/libminifi/test/archive-tests/CMakeLists.txt b/libminifi/test/archive-tests/CMakeLists.txt
new file mode 100644
index 0000000..dc23b1c
--- /dev/null
+++ b/libminifi/test/archive-tests/CMakeLists.txt
@@ -0,0 +1,37 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+#
+
+file(GLOB ARCHIVE_INTEGRATION_TESTS  "*.cpp")
+
+SET(EXTENSIONS_TEST_COUNT 0)
+FOREACH(testfile ${ARCHIVE_INTEGRATION_TESTS})
+	get_filename_component(testfilename "${testfile}" NAME_WE)
+	add_executable("${testfilename}" "${testfile}" ${SPD_SOURCES} "${TEST_DIR}/TestBase.cpp")
+	target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/libarchive")
+	target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/thirdparty/libarchive-3.3.2/libarchive")
+	createTests("${testfilename}")
+	if (APPLE)
+	      target_link_libraries (${testfilename} -Wl,-all_load minifi-archive-extensions)
+	else ()
+	    target_link_libraries (${testfilename} -Wl,--whole-archive minifi-archive-extensions -Wl,--no-whole-archive)
+	endif ()
+	MATH(EXPR EXTENSIONS_TEST_COUNT "${EXTENSIONS_TEST_COUNT}+1")
+	add_test(NAME "${testfilename}" COMMAND "${testfilename}" WORKING_DIRECTORY ${TEST_DIR})
+ENDFOREACH()
+message("-- Finished building ${ARCHIVE-EXTENSIONS_TEST_COUNT} Lib Archive related test file(s)...")

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c12d3b6a/libminifi/test/curl-tests/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/libminifi/test/curl-tests/CMakeLists.txt b/libminifi/test/curl-tests/CMakeLists.txt
new file mode 100644
index 0000000..37e8b25
--- /dev/null
+++ b/libminifi/test/curl-tests/CMakeLists.txt
@@ -0,0 +1,53 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+#
+
+file(GLOB CURL_INTEGRATION_TESTS  "*.cpp")
+
+SET(CURL_INT_TEST_COUNT 0)
+
+FOREACH(testfile ${CURL_INTEGRATION_TESTS})
+  	get_filename_component(testfilename "${testfile}" NAME_WE)
+  	add_executable("${testfilename}" "${testfile}" ${SPD_SOURCES} "${TEST_DIR}/TestBase.cpp")
+  	target_include_directories(${testfilename} PRIVATE BEFORE ${CURL_INCLUDE_DIRS})
+	target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/http-curl/")
+	target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/http-curl/client/")
+	target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/http-curl/processors/")
+	target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/http-curl/protocols/")
+    target_link_libraries(${testfilename} ${CURL_LIBRARIES} )
+    createTests("${testfilename}")
+    if (APPLE)    
+    	target_link_libraries ("${testfilename}" -Wl,-all_load minifi-http-curl )
+	else ()
+  		target_link_libraries ("${testfilename}" -Wl,--whole-archive minifi-http-curl -Wl,--no-whole-archive)
+  	endif()
+  MATH(EXPR CURL_INT_TEST_COUNT "${CURL_INT_TEST_COUNT}+1")
+ENDFOREACH()
+
+message("-- Finished building ${CURL_INT_TEST_COUNT} libcURL integration test file(s)...")
+
+add_test(NAME HttpGetIntegrationTest COMMAND HttpGetIntegrationTest "${TEST_RESOURCES}/TestHTTPGet.yml"  "${TEST_RESOURCES}/")
+add_test(NAME C2UpdateTest COMMAND C2UpdateTest "${TEST_RESOURCES}/TestHTTPGet.yml"  "${TEST_RESOURCES}/")
+add_test(NAME HttpGetIntegrationTestSecure COMMAND HttpGetIntegrationTest "${TEST_RESOURCES}/TestHTTPGetSecure.yml"  "${TEST_RESOURCES}/")
+add_test(NAME HttpPostIntegrationTest COMMAND HttpPostIntegrationTest "${TEST_RESOURCES}/TestHTTPPost.yml" "${TEST_RESOURCES}/")
+add_test(NAME HttpPostIntegrationTestChunked COMMAND HttpPostIntegrationTest "${TEST_RESOURCES}/TestHTTPPostChunkedEncoding.yml" "${TEST_RESOURCES}/")
+add_test(NAME C2VerifyServeResults COMMAND C2VerifyServeResults "${TEST_RESOURCES}/TestHTTPGet.yml" "${TEST_RESOURCES}/")
+add_test(NAME C2VerifyHeartbeatAndStop COMMAND C2VerifyHeartbeatAndStop "${TEST_RESOURCES}/TestHTTPGet.yml" "${TEST_RESOURCES}/")
+add_test(NAME SiteToSiteRestTest COMMAND SiteToSiteRestTest "${TEST_RESOURCES}/TestSite2SiteRest.yml" "${TEST_RESOURCES}/" "http://localhost:8082/nifi-api/controller")
+add_test(NAME ControllerServiceIntegrationTests COMMAND ControllerServiceIntegrationTests "${TEST_RESOURCES}/TestControllerServices.yml" "${TEST_RESOURCES}/")
+add_test(NAME ThreadPoolAdjust COMMAND ThreadPoolAdjust "${TEST_RESOURCES}/TestHTTPPostChunkedEncoding.yml" "${TEST_RESOURCES}/")

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c12d3b6a/libminifi/test/curl-tests/ControllerServiceIntegrationTests.cpp
----------------------------------------------------------------------
diff --git a/libminifi/test/curl-tests/ControllerServiceIntegrationTests.cpp b/libminifi/test/curl-tests/ControllerServiceIntegrationTests.cpp
new file mode 100644
index 0000000..7a4ee35
--- /dev/null
+++ b/libminifi/test/curl-tests/ControllerServiceIntegrationTests.cpp
@@ -0,0 +1,165 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+
+#undef NDEBUG
+#include <cassert>
+#include <chrono>
+#include <fstream>
+#include <memory>
+#include <string>
+#include <utility>
+#include <thread>
+#include <type_traits>
+#include <vector>
+
+#include "../include/core/controller/ControllerServiceMap.h"
+#include "../include/core/controller/StandardControllerServiceNode.h"
+#include "../include/core/controller/StandardControllerServiceProvider.h"
+#include "controllers/SSLContextService.h"
+#include "../include/core/Core.h"
+#include "../include/core/logging/LoggerConfiguration.h"
+#include "../include/core/ProcessGroup.h"
+#include "../include/core/Resource.h"
+#include "../include/core/yaml/YamlConfiguration.h"
+#include "../include/FlowController.h"
+#include "../include/properties/Configure.h"
+#include "../unit/MockClasses.h"
+#include "../unit/ProvenanceTestHelper.h"
+
+REGISTER_RESOURCE(MockControllerService);
+REGISTER_RESOURCE(MockProcessor);
+
+std::shared_ptr<core::controller::StandardControllerServiceNode> newCsNode(std::shared_ptr<core::controller::ControllerServiceProvider> provider, const std::string id) {
+  std::shared_ptr<core::controller::ControllerService> service = std::make_shared<MockControllerService>();
+  std::shared_ptr<core::controller::StandardControllerServiceNode> testNode = std::make_shared<core::controller::StandardControllerServiceNode>(service, provider, id,
+                                                                                                                                                std::make_shared<minifi::Configure>());
+  return testNode;
+}
+
+void waitToVerifyProcessor() {
+  std::this_thread::sleep_for(std::chrono::seconds(2));
+}
+
+int main(int argc, char **argv) {
+  std::string test_file_location;
+  std::string key_dir;
+
+  if (argc > 2) {
+    test_file_location = argv[1];
+    key_dir = argv[1];
+  }
+
+  std::shared_ptr<minifi::Configure> configuration = std::make_shared<minifi::Configure>();
+
+  std::shared_ptr<core::Repository> test_repo = std::make_shared<TestRepository>();
+  std::shared_ptr<core::Repository> test_flow_repo = std::make_shared<TestFlowRepository>();
+
+  configuration->set(minifi::Configure::nifi_flow_configuration_file, test_file_location);
+  std::string client_cert = "cn.crt.pem";
+  std::string priv_key_file = "cn.ckey.pem";
+  std::string passphrase = "cn.pass";
+  std::string ca_cert = "nifi-cert.pem";
+  configuration->set(minifi::Configure::nifi_security_client_certificate, test_file_location);
+  configuration->set(minifi::Configure::nifi_security_client_private_key, priv_key_file);
+  configuration->set(minifi::Configure::nifi_security_client_pass_phrase, passphrase);
+  configuration->set(minifi::Configure::nifi_default_directory, key_dir);
+
+  std::shared_ptr<minifi::io::StreamFactory> stream_factory = std::make_shared<minifi::io::StreamFactory>(configuration);
+  std::shared_ptr<core::ContentRepository> content_repo = std::make_shared<core::repository::VolatileContentRepository>();
+  content_repo->initialize(configuration);
+  std::unique_ptr<core::FlowConfiguration> yaml_ptr = std::unique_ptr<core::YamlConfiguration>(
+      new core::YamlConfiguration(test_repo, test_repo, content_repo, stream_factory, configuration, test_file_location));
+  std::shared_ptr<TestRepository> repo = std::static_pointer_cast<TestRepository>(test_repo);
+
+  std::shared_ptr<minifi::FlowController> controller = std::make_shared<minifi::FlowController>(test_repo, test_flow_repo, configuration, std::move(yaml_ptr),
+                                                                                                content_repo,
+                                                                                                DEFAULT_ROOT_GROUP_NAME,
+                                                                                                true);
+
+  disabled = false;
+  std::shared_ptr<core::controller::ControllerServiceMap> map = std::make_shared<core::controller::ControllerServiceMap>();
+
+  core::YamlConfiguration yaml_config(test_repo, test_repo, content_repo, stream_factory, configuration, test_file_location);
+
+  std::unique_ptr<core::ProcessGroup> ptr = yaml_config.getRoot(test_file_location);
+  std::shared_ptr<core::ProcessGroup> pg = std::shared_ptr<core::ProcessGroup>(ptr.get());
+  ptr.release();
+
+  std::shared_ptr<core::controller::StandardControllerServiceProvider> provider = std::make_shared<core::controller::StandardControllerServiceProvider>(map, pg, std::make_shared<minifi::Configure>());
+  std::shared_ptr<core::controller::ControllerServiceNode> mockNode = pg->findControllerService("MockItLikeIts1995");
+  assert(mockNode != nullptr);
+  mockNode->enable();
+  std::vector<std::shared_ptr<core::controller::ControllerServiceNode> > linkedNodes = mockNode->getLinkedControllerServices();
+  assert(linkedNodes.size() == 1);
+
+  std::shared_ptr<core::controller::ControllerServiceNode> notexistNode = pg->findControllerService("MockItLikeItsWrong");
+  assert(notexistNode == nullptr);
+
+  std::shared_ptr<core::controller::ControllerServiceNode> ssl_client_cont = nullptr;
+  std::shared_ptr<minifi::controllers::SSLContextService> ssl_client = nullptr;
+  {
+    std::lock_guard<std::mutex> lock(control_mutex);
+    controller->load();
+    controller->start();
+    ssl_client_cont = controller->getControllerServiceNode("SSLClientServiceTest");
+    ssl_client_cont->enable();
+    assert(ssl_client_cont != nullptr);
+    assert(ssl_client_cont->getControllerServiceImplementation() != nullptr);
+    ssl_client = std::static_pointer_cast<minifi::controllers::SSLContextService>(ssl_client_cont->getControllerServiceImplementation());
+  }
+  assert(ssl_client->getCACertificate().length() > 0);
+  std::cout << "Disabling ID" << std::endl;
+  // now let's disable one of the controller services.
+  std::shared_ptr<core::controller::ControllerServiceNode> cs_id = controller->getControllerServiceNode("ID");
+  assert(cs_id != nullptr);
+  {
+    std::lock_guard<std::mutex> lock(control_mutex);
+    controller->disableControllerService(cs_id);
+    disabled = true;
+    waitToVerifyProcessor();
+  }
+  std::cout << "Disabled ID" << std::endl;
+  {
+    std::lock_guard<std::mutex> lock(control_mutex);
+    controller->enableControllerService(cs_id);
+    disabled = false;
+    waitToVerifyProcessor();
+  }
+  std::shared_ptr<core::controller::ControllerServiceNode> mock_cont = controller->getControllerServiceNode("MockItLikeIts1995");
+  std::cout << "Disabling MockItLikeIts1995" << std::endl;
+  assert(cs_id->enabled());
+{
+    std::lock_guard<std::mutex> lock(control_mutex);
+    controller->disableReferencingServices(mock_cont);
+    disabled = true;
+    waitToVerifyProcessor();
+  }
+std::cout << "Disabled MockItLikeIts1995" << std::endl;
+    assert(cs_id->enabled() == false);
+{
+    std::lock_guard<std::mutex> lock(control_mutex);
+    controller->enableReferencingServices(mock_cont);
+    disabled = false;
+    waitToVerifyProcessor();
+  }
+std::cout << "Enabled ref for MockItLikeIts1995" << std::endl;
+  assert(cs_id->enabled() == true);
+
+  controller->waitUnload(60000);
+  return 0;
+}

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c12d3b6a/libminifi/test/integration/ControllerServiceIntegrationTests.cpp
----------------------------------------------------------------------
diff --git a/libminifi/test/integration/ControllerServiceIntegrationTests.cpp b/libminifi/test/integration/ControllerServiceIntegrationTests.cpp
deleted file mode 100644
index 7a4ee35..0000000
--- a/libminifi/test/integration/ControllerServiceIntegrationTests.cpp
+++ /dev/null
@@ -1,165 +0,0 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-#undef NDEBUG
-#include <cassert>
-#include <chrono>
-#include <fstream>
-#include <memory>
-#include <string>
-#include <utility>
-#include <thread>
-#include <type_traits>
-#include <vector>
-
-#include "../include/core/controller/ControllerServiceMap.h"
-#include "../include/core/controller/StandardControllerServiceNode.h"
-#include "../include/core/controller/StandardControllerServiceProvider.h"
-#include "controllers/SSLContextService.h"
-#include "../include/core/Core.h"
-#include "../include/core/logging/LoggerConfiguration.h"
-#include "../include/core/ProcessGroup.h"
-#include "../include/core/Resource.h"
-#include "../include/core/yaml/YamlConfiguration.h"
-#include "../include/FlowController.h"
-#include "../include/properties/Configure.h"
-#include "../unit/MockClasses.h"
-#include "../unit/ProvenanceTestHelper.h"
-
-REGISTER_RESOURCE(MockControllerService);
-REGISTER_RESOURCE(MockProcessor);
-
-std::shared_ptr<core::controller::StandardControllerServiceNode> newCsNode(std::shared_ptr<core::controller::ControllerServiceProvider> provider, const std::string id) {
-  std::shared_ptr<core::controller::ControllerService> service = std::make_shared<MockControllerService>();
-  std::shared_ptr<core::controller::StandardControllerServiceNode> testNode = std::make_shared<core::controller::StandardControllerServiceNode>(service, provider, id,
-                                                                                                                                                std::make_shared<minifi::Configure>());
-  return testNode;
-}
-
-void waitToVerifyProcessor() {
-  std::this_thread::sleep_for(std::chrono::seconds(2));
-}
-
-int main(int argc, char **argv) {
-  std::string test_file_location;
-  std::string key_dir;
-
-  if (argc > 2) {
-    test_file_location = argv[1];
-    key_dir = argv[1];
-  }
-
-  std::shared_ptr<minifi::Configure> configuration = std::make_shared<minifi::Configure>();
-
-  std::shared_ptr<core::Repository> test_repo = std::make_shared<TestRepository>();
-  std::shared_ptr<core::Repository> test_flow_repo = std::make_shared<TestFlowRepository>();
-
-  configuration->set(minifi::Configure::nifi_flow_configuration_file, test_file_location);
-  std::string client_cert = "cn.crt.pem";
-  std::string priv_key_file = "cn.ckey.pem";
-  std::string passphrase = "cn.pass";
-  std::string ca_cert = "nifi-cert.pem";
-  configuration->set(minifi::Configure::nifi_security_client_certificate, test_file_location);
-  configuration->set(minifi::Configure::nifi_security_client_private_key, priv_key_file);
-  configuration->set(minifi::Configure::nifi_security_client_pass_phrase, passphrase);
-  configuration->set(minifi::Configure::nifi_default_directory, key_dir);
-
-  std::shared_ptr<minifi::io::StreamFactory> stream_factory = std::make_shared<minifi::io::StreamFactory>(configuration);
-  std::shared_ptr<core::ContentRepository> content_repo = std::make_shared<core::repository::VolatileContentRepository>();
-  content_repo->initialize(configuration);
-  std::unique_ptr<core::FlowConfiguration> yaml_ptr = std::unique_ptr<core::YamlConfiguration>(
-      new core::YamlConfiguration(test_repo, test_repo, content_repo, stream_factory, configuration, test_file_location));
-  std::shared_ptr<TestRepository> repo = std::static_pointer_cast<TestRepository>(test_repo);
-
-  std::shared_ptr<minifi::FlowController> controller = std::make_shared<minifi::FlowController>(test_repo, test_flow_repo, configuration, std::move(yaml_ptr),
-                                                                                                content_repo,
-                                                                                                DEFAULT_ROOT_GROUP_NAME,
-                                                                                                true);
-
-  disabled = false;
-  std::shared_ptr<core::controller::ControllerServiceMap> map = std::make_shared<core::controller::ControllerServiceMap>();
-
-  core::YamlConfiguration yaml_config(test_repo, test_repo, content_repo, stream_factory, configuration, test_file_location);
-
-  std::unique_ptr<core::ProcessGroup> ptr = yaml_config.getRoot(test_file_location);
-  std::shared_ptr<core::ProcessGroup> pg = std::shared_ptr<core::ProcessGroup>(ptr.get());
-  ptr.release();
-
-  std::shared_ptr<core::controller::StandardControllerServiceProvider> provider = std::make_shared<core::controller::StandardControllerServiceProvider>(map, pg, std::make_shared<minifi::Configure>());
-  std::shared_ptr<core::controller::ControllerServiceNode> mockNode = pg->findControllerService("MockItLikeIts1995");
-  assert(mockNode != nullptr);
-  mockNode->enable();
-  std::vector<std::shared_ptr<core::controller::ControllerServiceNode> > linkedNodes = mockNode->getLinkedControllerServices();
-  assert(linkedNodes.size() == 1);
-
-  std::shared_ptr<core::controller::ControllerServiceNode> notexistNode = pg->findControllerService("MockItLikeItsWrong");
-  assert(notexistNode == nullptr);
-
-  std::shared_ptr<core::controller::ControllerServiceNode> ssl_client_cont = nullptr;
-  std::shared_ptr<minifi::controllers::SSLContextService> ssl_client = nullptr;
-  {
-    std::lock_guard<std::mutex> lock(control_mutex);
-    controller->load();
-    controller->start();
-    ssl_client_cont = controller->getControllerServiceNode("SSLClientServiceTest");
-    ssl_client_cont->enable();
-    assert(ssl_client_cont != nullptr);
-    assert(ssl_client_cont->getControllerServiceImplementation() != nullptr);
-    ssl_client = std::static_pointer_cast<minifi::controllers::SSLContextService>(ssl_client_cont->getControllerServiceImplementation());
-  }
-  assert(ssl_client->getCACertificate().length() > 0);
-  std::cout << "Disabling ID" << std::endl;
-  // now let's disable one of the controller services.
-  std::shared_ptr<core::controller::ControllerServiceNode> cs_id = controller->getControllerServiceNode("ID");
-  assert(cs_id != nullptr);
-  {
-    std::lock_guard<std::mutex> lock(control_mutex);
-    controller->disableControllerService(cs_id);
-    disabled = true;
-    waitToVerifyProcessor();
-  }
-  std::cout << "Disabled ID" << std::endl;
-  {
-    std::lock_guard<std::mutex> lock(control_mutex);
-    controller->enableControllerService(cs_id);
-    disabled = false;
-    waitToVerifyProcessor();
-  }
-  std::shared_ptr<core::controller::ControllerServiceNode> mock_cont = controller->getControllerServiceNode("MockItLikeIts1995");
-  std::cout << "Disabling MockItLikeIts1995" << std::endl;
-  assert(cs_id->enabled());
-{
-    std::lock_guard<std::mutex> lock(control_mutex);
-    controller->disableReferencingServices(mock_cont);
-    disabled = true;
-    waitToVerifyProcessor();
-  }
-std::cout << "Disabled MockItLikeIts1995" << std::endl;
-    assert(cs_id->enabled() == false);
-{
-    std::lock_guard<std::mutex> lock(control_mutex);
-    controller->enableReferencingServices(mock_cont);
-    disabled = false;
-    waitToVerifyProcessor();
-  }
-std::cout << "Enabled ref for MockItLikeIts1995" << std::endl;
-  assert(cs_id->enabled() == true);
-
-  controller->waitUnload(60000);
-  return 0;
-}

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c12d3b6a/libminifi/test/rocksdb-tests/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/libminifi/test/rocksdb-tests/CMakeLists.txt b/libminifi/test/rocksdb-tests/CMakeLists.txt
new file mode 100644
index 0000000..713921b
--- /dev/null
+++ b/libminifi/test/rocksdb-tests/CMakeLists.txt
@@ -0,0 +1,36 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+#
+
+file(GLOB ROCKSDB_INTEGRATION_TESTS  "*.cpp")
+SET(ROCKSDB_TEST_COUNT 0)
+FOREACH(testfile ${ROCKSDB_INTEGRATION_TESTS})
+  	get_filename_component(testfilename "${testfile}" NAME_WE)
+  	add_executable("${testfilename}" "${testfile}" ${SPD_SOURCES} "${TEST_DIR}/TestBase.cpp")
+  	target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/rocksdb-repos/")
+  	target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/thirdparty/rocksdb/include")
+	createTests("${testfilename}")	
+  	if (APPLE)
+		target_link_libraries (${testfilename} -Wl,-all_load minifi-rocksdb-repos)
+	else ()
+	  	target_link_libraries (${testfilename} -Wl,--whole-archive minifi-rocksdb-repos -Wl,--no-whole-archive)
+	endif ()
+	MATH(EXPR ROCKSDB_TEST_COUNT "${ROCKSDB_TEST_COUNT}+1")
+	add_test(NAME "${testfilename}" COMMAND "${testfilename}" WORKING_DIRECTORY ${TEST_DIR})
+ENDFOREACH()
+message("-- Finished building ${ROCKSDB_TEST_COUNT} RocksDB related test file(s)...")

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c12d3b6a/main/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt
index e984dee..7f875cc 100644
--- a/main/CMakeLists.txt
+++ b/main/CMakeLists.txt
@@ -55,26 +55,16 @@ include_directories(${OPENSSL_INCLUDE_DIR})
 target_link_libraries(minifiexe core-minifi minifi yaml-cpp c-library civetweb-cpp ${JSON_CPP_LIB} ${UUID_LIBRARIES} ${OPENSSL_LIBRARIES})
 
 if (APPLE)
-	if (HTTP-CURL)    
-    	target_link_libraries (minifiexe -Wl,-all_load ${HTTP-CURL})
-    endif()
-    if (ROCKSDB-REPOS)    
-    	target_link_libraries (minifiexe -Wl,-all_load ${ROCKSDB-REPOS})
-    endif()
-    if (ARCHIVE-EXTENSIONS)    
-    	target_link_libraries (minifiexe -Wl,-all_load ${ARCHIVE-EXTENSIONS})
-    endif()
-    
+	get_property(extensions GLOBAL PROPERTY EXTENSION-OPTIONS)
+	foreach(EXTENSION ${extensions})
+		message("Linking against ${EXTENSION}")
+		target_link_libraries (minifiexe -Wl,-all_load ${EXTENSION})
+	endforeach()    
 else ()
-	if (HTTP-CURL)
-	  target_link_libraries (minifiexe -Wl,--whole-archive ${HTTP-CURL} -Wl,--no-whole-archive)
-	endif()
-	if (ROCKSDB-REPOS)
-	  target_link_libraries (minifiexe -Wl,--whole-archive ${ROCKSDB-REPOS} -Wl,--no-whole-archive)
-	endif()
-	if (ARCHIVE-EXTENSIONS)
-	  target_link_libraries (minifiexe -Wl,--whole-archive ${ARCHIVE-EXTENSIONS} -Wl,--no-whole-archive)
-	endif()        
+	get_property(extensions GLOBAL PROPERTY EXTENSION-OPTIONS)
+	foreach(EXTENSION ${extensions})
+	  target_link_libraries (minifiexe -Wl,--whole-archive ${EXTENSION} -Wl,--no-whole-archive)
+	endforeach()
 endif ()
 
 set_property(TARGET minifiexe PROPERTY INTERPROCEDURAL_OPTIMIZATION True)
@@ -82,8 +72,6 @@ set_property(TARGET minifiexe PROPERTY INTERPROCEDURAL_OPTIMIZATION True)
 set_target_properties(minifiexe
         PROPERTIES OUTPUT_NAME minifi)
 
-
-
 install(TARGETS minifiexe
         RUNTIME
         DESTINATION bin


Mime
View raw message