From 4b8c82dc80825f8b1c93ad14b6df940b3ccb239d Mon Sep 17 00:00:00 2001 From: Marc Parisi Date: Tue, 9 Jan 2018 19:48:22 -0500 Subject: [PATCH] MINIFICPP-364: resolve issues with test extension. This will cause issues with bootstrapping. Also resolve linkage between civet and curl extensions --- CMakeLists.txt | 9 +-- cmake/BuildTests.cmake | 1 + .../civet_curl_tests/unit/CMakeLists.txt | 76 ------------------- extensions/civetweb/CMakeLists.txt | 2 +- extensions/civetweb/CivetLoader.cpp | 29 ------- extensions/civetweb/include/CivetLoader.h | 70 ----------------- .../civetweb/{ => processors}/ListenHTTP.cpp | 2 +- .../{include => }/processors/ListenHTTP.h | 9 ++- extensions/http-curl/CMakeLists.txt | 3 +- extensions/http-curl/HTTPCurlLoader.h | 2 +- extensions/http-curl/client/HTTPClient.h | 4 - .../protocols}/RESTReceiver.cpp | 2 +- .../c2 => http-curl}/protocols/RESTReceiver.h | 0 .../http-curl/{ => protocols}/RESTSender.cpp | 2 +- .../http-curl/{c2 => }/protocols/RESTSender.h | 0 .../tests}/C2NullConfiguration.cpp | 7 +- .../tests}/C2UpdateTest.cpp | 2 +- .../tests}/C2VerifyHeartbeatAndStop.cpp | 6 +- .../tests}/C2VerifyServeResults.cpp | 4 +- .../tests}/CMakeLists.txt | 28 +++---- .../io => http-curl/tests}/CivetStream.h | 0 .../ControllerServiceIntegrationTests.cpp | 0 .../tests}/GetFileNoData.cpp | 2 +- .../tests}/HTTPHandlers.h | 2 +- .../tests}/HTTPIntegrationBase.h | 2 +- .../tests}/HTTPSiteToSiteTests.cpp | 4 +- .../tests}/HttpGetIntegrationTest.cpp | 0 .../tests}/HttpPostIntegrationTest.cpp | 4 +- .../tests}/SiteToSiteRestTest.cpp | 4 +- .../include => http-curl/tests}/TestServer.h | 0 .../tests}/ThreadPoolAdjust.cpp | 2 +- .../tests}/unit/InvokeHTTPTests.cpp | 0 32 files changed, 49 insertions(+), 229 deletions(-) delete mode 100644 extensions/civet_curl_tests/unit/CMakeLists.txt delete mode 100644 extensions/civetweb/CivetLoader.cpp delete mode 100644 extensions/civetweb/include/CivetLoader.h rename extensions/civetweb/{ => processors}/ListenHTTP.cpp (99%) rename extensions/civetweb/{include => }/processors/ListenHTTP.h (97%) rename extensions/{civetweb => http-curl/protocols}/RESTReceiver.cpp (99%) rename extensions/{civetweb/include/c2 => http-curl}/protocols/RESTReceiver.h (100%) rename extensions/http-curl/{ => protocols}/RESTSender.cpp (99%) rename extensions/http-curl/{c2 => }/protocols/RESTSender.h (100%) rename extensions/{civet_curl_tests => http-curl/tests}/C2NullConfiguration.cpp (96%) rename extensions/{civet_curl_tests => http-curl/tests}/C2UpdateTest.cpp (99%) rename extensions/{civet_curl_tests => http-curl/tests}/C2VerifyHeartbeatAndStop.cpp (97%) rename extensions/{civet_curl_tests => http-curl/tests}/C2VerifyServeResults.cpp (97%) rename extensions/{civet_curl_tests => http-curl/tests}/CMakeLists.txt (81%) rename extensions/{civetweb/include/io => http-curl/tests}/CivetStream.h (100%) rename extensions/{civet_curl_tests => http-curl/tests}/ControllerServiceIntegrationTests.cpp (100%) rename extensions/{civet_curl_tests => http-curl/tests}/GetFileNoData.cpp (99%) rename extensions/{civet_curl_tests/include/sitetositehttp => http-curl/tests}/HTTPHandlers.h (99%) rename extensions/{civet_curl_tests/include/integration => http-curl/tests}/HTTPIntegrationBase.h (98%) rename extensions/{civet_curl_tests => http-curl/tests}/HTTPSiteToSiteTests.cpp (99%) rename extensions/{civet_curl_tests => http-curl/tests}/HttpGetIntegrationTest.cpp (100%) rename extensions/{civet_curl_tests => http-curl/tests}/HttpPostIntegrationTest.cpp (98%) rename extensions/{civet_curl_tests => http-curl/tests}/SiteToSiteRestTest.cpp (98%) rename extensions/{civet_curl_tests/include => http-curl/tests}/TestServer.h (100%) rename extensions/{civet_curl_tests => http-curl/tests}/ThreadPoolAdjust.cpp (98%) rename extensions/{civet_curl_tests => http-curl/tests}/unit/InvokeHTTPTests.cpp (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 05d3425373..57afc95b76 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -139,13 +139,13 @@ add_subdirectory(libminifi) #### EXTENSION option(DISABLE_CURL "Disables libCurl Properties." OFF) -if (NOT DISABLE_CURL) - createExtension(HTTP-CURL "HTTP CURL" "This enables RESTProtocol, InvokeHTTP, and the HTTPClient for Site to Site" "extensions/http-curl") +if (NOT DISABLE_CURL AND NOT DISABLE_CIVET) + createExtension(HTTP-CURL "HTTP CURL" "This enables RESTProtocol, InvokeHTTP, and the HTTPClient for Site to Site" "extensions/http-curl" "extensions/http-curl/tests/") endif() option(DISABLE_CIVET "Disables CivetWeb components." OFF) if (NOT DISABLE_CIVET) -createExtension(CIVETWEB CIVETWEB "This enables ListenHTTP and several cURL tests" "extensions/civetweb") +createExtension(CIVETWEB CIVETWEB "This enables ListenHTTP" "extensions/civetweb") endif() ## Add the rocks DB extension @@ -262,9 +262,6 @@ include(CPack) if (NOT SKIP_TESTS) include(BuildTests) - if (NOT (DISABLE_CURL OR DISABLE_CIVET)) - add_subdirectory(extensions/civet_curl_tests) - endif() endif() include(BuildDocs) diff --git a/cmake/BuildTests.cmake b/cmake/BuildTests.cmake index 1f6fc8ad61..42698981df 100644 --- a/cmake/BuildTests.cmake +++ b/cmake/BuildTests.cmake @@ -118,3 +118,4 @@ foreach(EXTENSION ${extensions}) endforeach() add_test(NAME TestExecuteProcess COMMAND TestExecuteProcess ) + diff --git a/extensions/civet_curl_tests/unit/CMakeLists.txt b/extensions/civet_curl_tests/unit/CMakeLists.txt deleted file mode 100644 index b645da1a9e..0000000000 --- a/extensions/civet_curl_tests/unit/CMakeLists.txt +++ /dev/null @@ -1,76 +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. -# - -file(GLOB CURL_UNIT_TESTS "unit/*.cpp") -file(GLOB CURL_INTEGRATION_TESTS "*.cpp") - -SET(CURL_INT_TEST_COUNT 0) - -FOREACH(testfile ${CURL_UNIT_TESTS}) - get_filename_component(testfilename "${testfile}" NAME_WE) - add_executable("${testfilename}" "${testfile}") - target_include_directories(${testfilename} BEFORE PRIVATE ${CURL_INCLUDE_DIRS}) - target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/extensions/http-curl/") - target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/extensions/http-curl/client/") - target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/extensions/http-curl/processors/") - target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/extensions/http-curl/protocols/") - target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/extensions/http-curl/sitetosite/") - target_link_libraries(${testfilename} ${CURL_LIBRARIES} ) - createTests("${testfilename}") - target_link_libraries(${testfilename} ${CATCH_MAIN_LIB}) - 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() - -FOREACH(testfile ${CURL_INTEGRATION_TESTS}) - get_filename_component(testfilename "${testfile}" NAME_WE) - add_executable("${testfilename}" "${testfile}") - target_include_directories(${testfilename} BEFORE PRIVATE ${CURL_INCLUDE_DIRS}) - target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/extensions/http-curl/") - target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/extensions/http-curl/client/") - target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/extensions/http-curl/processors/") - target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/extensions/http-curl/protocols/") - target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/extensions/http-curl/sitetosite/") - 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 C2NullConfiguration COMMAND C2NullConfiguration "${TEST_RESOURCES}/TestNull.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}/C2VerifyServeResults.yml" "${TEST_RESOURCES}/") -add_test(NAME C2VerifyHeartbeatAndStop COMMAND C2VerifyHeartbeatAndStop "${TEST_RESOURCES}/C2VerifyHeartbeatAndStop.yml" "${TEST_RESOURCES}/") -add_test(NAME SiteToSiteRestTest COMMAND SiteToSiteRestTest "${TEST_RESOURCES}/TestSite2SiteRest.yml" "${TEST_RESOURCES}/" "http://localhost:8077/nifi-api/site-to-site") -add_test(NAME ControllerServiceIntegrationTests COMMAND ControllerServiceIntegrationTests "${TEST_RESOURCES}/TestControllerServices.yml" "${TEST_RESOURCES}/") -add_test(NAME ThreadPoolAdjust COMMAND ThreadPoolAdjust "${TEST_RESOURCES}/ThreadPoolAdjust.yml" "${TEST_RESOURCES}/") diff --git a/extensions/civetweb/CMakeLists.txt b/extensions/civetweb/CMakeLists.txt index d31baad430..470a23124f 100644 --- a/extensions/civetweb/CMakeLists.txt +++ b/extensions/civetweb/CMakeLists.txt @@ -35,7 +35,7 @@ add_subdirectory(${CIVET_THIRDPARTY_ROOT} ${CIVET_BINARY_ROOT} EXCLUDE_FROM_ALL) -file(GLOB SOURCES "*.cpp") +file(GLOB SOURCES "processors/*.cpp") add_library(minifi-civet-extensions STATIC ${SOURCES}) set_property(TARGET minifi-civet-extensions PROPERTY POSITION_INDEPENDENT_CODE ON) diff --git a/extensions/civetweb/CivetLoader.cpp b/extensions/civetweb/CivetLoader.cpp deleted file mode 100644 index c593bb797e..0000000000 --- a/extensions/civetweb/CivetLoader.cpp +++ /dev/null @@ -1,29 +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. - */ -#include "CivetLoader.h" -#include "core/FlowConfiguration.h" - -bool CivetFactory::added = core::FlowConfiguration::add_static_func("createCivetFactory"); - -extern "C" { - -void *createCivetFactory(void) { - return new CivetFactory(); -} - -} diff --git a/extensions/civetweb/include/CivetLoader.h b/extensions/civetweb/include/CivetLoader.h deleted file mode 100644 index f571b5d102..0000000000 --- a/extensions/civetweb/include/CivetLoader.h +++ /dev/null @@ -1,70 +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. - */ -#ifndef EXTENSION_CIVETLOADER_H -#define EXTENSION_CIVETLOADER_H - -#include "core/ClassLoader.h" -#include "c2/protocols/RESTReceiver.h" -#include "processors/ListenHTTP.h" - -class __attribute__((visibility("default"))) CivetFactory : public core::ObjectFactory { - public: - CivetFactory() { - - } - - /** - * Gets the name of the object. - * @return class name of processor - */ - virtual std::string getName() { - return "CivetFactory"; - } - - virtual std::string getClassName() { - return "CivetFactory"; - } - /** - * Gets the class name for the object - * @return class name for the processor. - */ - virtual std::vector getClassNames() { - std::vector class_names; - class_names.push_back("RESTReceiver"); - class_names.push_back("ListenHTTP"); - return class_names; - } - - virtual std::unique_ptr assign(const std::string &class_name) { - if (utils::StringUtils::equalsIgnoreCase(class_name, "RESTReceiver")) { - return std::unique_ptr(new core::DefautObjectFactory()); - } else if (utils::StringUtils::equalsIgnoreCase(class_name, "ListenHTTP")) { - return std::unique_ptr(new core::DefautObjectFactory()); - } else { - return nullptr; - } - } - - static bool added; - -}; - -extern "C" { -void *createCivetFactory(void); -} -#endif /* EXTENSION_CIVETLOADER_H */ diff --git a/extensions/civetweb/ListenHTTP.cpp b/extensions/civetweb/processors/ListenHTTP.cpp similarity index 99% rename from extensions/civetweb/ListenHTTP.cpp rename to extensions/civetweb/processors/ListenHTTP.cpp index 62f819494a..73ade40f5f 100644 --- a/extensions/civetweb/ListenHTTP.cpp +++ b/extensions/civetweb/processors/ListenHTTP.cpp @@ -18,7 +18,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "processors/ListenHTTP.h" +#include "ListenHTTP.h" #include #include #include diff --git a/extensions/civetweb/include/processors/ListenHTTP.h b/extensions/civetweb/processors/ListenHTTP.h similarity index 97% rename from extensions/civetweb/include/processors/ListenHTTP.h rename to extensions/civetweb/processors/ListenHTTP.h index 1b58dcd83f..5199d1921f 100644 --- a/extensions/civetweb/include/processors/ListenHTTP.h +++ b/extensions/civetweb/processors/ListenHTTP.h @@ -73,19 +73,20 @@ class ListenHTTP : public core::Processor { // HTTP request handler class Handler : public CivetHandler { public: - Handler(core::ProcessContext *context, core::ProcessSessionFactory *sessionFactory, std::string &&authDNPattern, std::string &&headersAsAttributesPattern);bool handlePost( - CivetServer *server, struct mg_connection *conn); + Handler(core::ProcessContext *context, core::ProcessSessionFactory *sessionFactory, std::string &&authDNPattern, std::string &&headersAsAttributesPattern); + bool handlePost(CivetServer *server, struct mg_connection *conn); private: // Send HTTP 500 error response to client void sendErrorResponse(struct mg_connection *conn); - // Logger - std::shared_ptr logger_; std::regex _authDNRegex; std::regex _headersAsAttributesRegex; core::ProcessContext *_processContext; core::ProcessSessionFactory *_processSessionFactory; + + // Logger + std::shared_ptr logger_; }; // Write callback for transferring data from HTTP request to content repo diff --git a/extensions/http-curl/CMakeLists.txt b/extensions/http-curl/CMakeLists.txt index b855e8edaf..dfa4259ad1 100644 --- a/extensions/http-curl/CMakeLists.txt +++ b/extensions/http-curl/CMakeLists.txt @@ -22,7 +22,7 @@ find_package(CURL REQUIRED) set(CMAKE_EXE_LINKER_FLAGS "-Wl,--export-all-symbols") set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--export-symbols") -include_directories(../../libminifi/include ../../libminifi/include/core/yaml ../../libminifi/include/core ../../thirdparty/spdlog-20170710/include ../../thirdparty/concurrentqueue ../../thirdparty/yaml-cpp-yaml-cpp-0.5.3/include ${CIVET_THIRDPARTY_ROOT}/include ../../thirdparty/jsoncpp/include ../../thirdparty/) +include_directories(../../libminifi/include ../../libminifi/include/core/yaml ../../libminifi/include/core ../../thirdparty/spdlog-20170710/include ../../thirdparty/concurrentqueue ../../thirdparty/yaml-cpp-yaml-cpp-0.5.3/include ${CIVET_THIRDPARTY_ROOT} ../../thirdparty/jsoncpp/include ../../thirdparty/) include_directories(protocols client processors sitetosite) file(GLOB SOURCES "*.cpp" "protocols/*.cpp" "client/*.cpp" "processors/*.cpp" "sitetosite/*.cpp") @@ -49,6 +49,7 @@ find_package(UUID REQUIRED) find_package(OpenSSL REQUIRED) include_directories(${OPENSSL_INCLUDE_DIR}) target_link_libraries(minifi-http-curl ${CMAKE_DL_LIBS} ${OPENSSL_LIBRARIES}) +target_link_libraries(minifi-http-curl minifi-civet-extensions) find_package(ZLIB REQUIRED) include_directories(${ZLIB_INCLUDE_DIRS}) diff --git a/extensions/http-curl/HTTPCurlLoader.h b/extensions/http-curl/HTTPCurlLoader.h index 9a6e821667..ec90e99e2c 100644 --- a/extensions/http-curl/HTTPCurlLoader.h +++ b/extensions/http-curl/HTTPCurlLoader.h @@ -19,7 +19,7 @@ #define EXTENSIONS_HTTPCURLLOADER_H_ #include "c2/protocols/RESTProtocol.h" -#include "c2/protocols/RESTSender.h" +#include "protocols/RESTSender.h" #include "processors/InvokeHTTP.h" #include "client/HTTPClient.h" #include "core/ClassLoader.h" diff --git a/extensions/http-curl/client/HTTPClient.h b/extensions/http-curl/client/HTTPClient.h index 85000d9d94..ace479c060 100644 --- a/extensions/http-curl/client/HTTPClient.h +++ b/extensions/http-curl/client/HTTPClient.h @@ -198,10 +198,6 @@ class HTTPClient : public BaseHTTPClient, public core::Connectable { CURLcode res; - - - - CURL *http_session_; std::string method_; diff --git a/extensions/civetweb/RESTReceiver.cpp b/extensions/http-curl/protocols/RESTReceiver.cpp similarity index 99% rename from extensions/civetweb/RESTReceiver.cpp rename to extensions/http-curl/protocols/RESTReceiver.cpp index 1f015ad425..4c46516882 100644 --- a/extensions/civetweb/RESTReceiver.cpp +++ b/extensions/http-curl/protocols/RESTReceiver.cpp @@ -16,7 +16,7 @@ * limitations under the License. */ -#include "c2/protocols/RESTReceiver.h" +#include "RESTReceiver.h" #include #include #include diff --git a/extensions/civetweb/include/c2/protocols/RESTReceiver.h b/extensions/http-curl/protocols/RESTReceiver.h similarity index 100% rename from extensions/civetweb/include/c2/protocols/RESTReceiver.h rename to extensions/http-curl/protocols/RESTReceiver.h diff --git a/extensions/http-curl/RESTSender.cpp b/extensions/http-curl/protocols/RESTSender.cpp similarity index 99% rename from extensions/http-curl/RESTSender.cpp rename to extensions/http-curl/protocols/RESTSender.cpp index 839c70b13f..ebf532a13f 100644 --- a/extensions/http-curl/RESTSender.cpp +++ b/extensions/http-curl/protocols/RESTSender.cpp @@ -16,7 +16,7 @@ * limitations under the License. */ -#include "c2/protocols/RESTSender.h" +#include "RESTSender.h" #include #include diff --git a/extensions/http-curl/c2/protocols/RESTSender.h b/extensions/http-curl/protocols/RESTSender.h similarity index 100% rename from extensions/http-curl/c2/protocols/RESTSender.h rename to extensions/http-curl/protocols/RESTSender.h diff --git a/extensions/civet_curl_tests/C2NullConfiguration.cpp b/extensions/http-curl/tests/C2NullConfiguration.cpp similarity index 96% rename from extensions/civet_curl_tests/C2NullConfiguration.cpp rename to extensions/http-curl/tests/C2NullConfiguration.cpp index c68e04734b..934cf024c8 100644 --- a/extensions/civet_curl_tests/C2NullConfiguration.cpp +++ b/extensions/http-curl/tests/C2NullConfiguration.cpp @@ -46,12 +46,11 @@ #include "core/ConfigurableComponent.h" #include "controllers/SSLContextService.h" #include "TestServer.h" -#include "c2/protocols/RESTReceiver.h" -#include "c2/protocols/RESTSender.h" +#include "protocols/RESTReceiver.h" +#include "protocols/RESTSender.h" #include "c2/C2Agent.h" -#include "c2/protocols/RESTReceiver.h" #include "processors/LogAttribute.h" -#include "integration/HTTPIntegrationBase.h" +#include "HTTPIntegrationBase.h" class VerifyC2Server : public HTTPIntegrationBase { public: diff --git a/extensions/civet_curl_tests/C2UpdateTest.cpp b/extensions/http-curl/tests/C2UpdateTest.cpp similarity index 99% rename from extensions/civet_curl_tests/C2UpdateTest.cpp rename to extensions/http-curl/tests/C2UpdateTest.cpp index edc92f0504..f21084be29 100644 --- a/extensions/civet_curl_tests/C2UpdateTest.cpp +++ b/extensions/http-curl/tests/C2UpdateTest.cpp @@ -44,7 +44,7 @@ #include "c2/C2Agent.h" #include "CivetServer.h" #include -#include "c2/protocols/RESTSender.h" +#include "protocols/RESTSender.h" void waitToVerifyProcessor() { std::this_thread::sleep_for(std::chrono::seconds(10)); diff --git a/extensions/civet_curl_tests/C2VerifyHeartbeatAndStop.cpp b/extensions/http-curl/tests/C2VerifyHeartbeatAndStop.cpp similarity index 97% rename from extensions/civet_curl_tests/C2VerifyHeartbeatAndStop.cpp rename to extensions/http-curl/tests/C2VerifyHeartbeatAndStop.cpp index f447d69e50..adb2db1b99 100644 --- a/extensions/civet_curl_tests/C2VerifyHeartbeatAndStop.cpp +++ b/extensions/http-curl/tests/C2VerifyHeartbeatAndStop.cpp @@ -47,9 +47,9 @@ #include "controllers/SSLContextService.h" #include "TestServer.h" #include "c2/C2Agent.h" -#include "c2/protocols/RESTReceiver.h" -#include "c2/protocols/RESTSender.h" -#include "integration/HTTPIntegrationBase.h" +#include "protocols/RESTReceiver.h" +#include "protocols/RESTSender.h" +#include "HTTPIntegrationBase.h" #include "processors/LogAttribute.h" class Responder : public CivetHandler { diff --git a/extensions/civet_curl_tests/C2VerifyServeResults.cpp b/extensions/http-curl/tests/C2VerifyServeResults.cpp similarity index 97% rename from extensions/civet_curl_tests/C2VerifyServeResults.cpp rename to extensions/http-curl/tests/C2VerifyServeResults.cpp index d99a2d883f..fbbc8c88e9 100644 --- a/extensions/civet_curl_tests/C2VerifyServeResults.cpp +++ b/extensions/http-curl/tests/C2VerifyServeResults.cpp @@ -47,8 +47,8 @@ #include "controllers/SSLContextService.h" #include "TestServer.h" #include "c2/C2Agent.h" -#include "c2/protocols/RESTReceiver.h" -#include "integration/HTTPIntegrationBase.h" +#include "protocols/RESTReceiver.h" +#include "HTTPIntegrationBase.h" #include "processors/LogAttribute.h" class VerifyC2Server : public HTTPIntegrationBase { diff --git a/extensions/civet_curl_tests/CMakeLists.txt b/extensions/http-curl/tests/CMakeLists.txt similarity index 81% rename from extensions/civet_curl_tests/CMakeLists.txt rename to extensions/http-curl/tests/CMakeLists.txt index 727c0ab2c9..8fd89e9426 100644 --- a/extensions/civet_curl_tests/CMakeLists.txt +++ b/extensions/http-curl/tests/CMakeLists.txt @@ -26,14 +26,14 @@ FOREACH(testfile ${CURL_UNIT_TESTS}) get_filename_component(testfilename "${testfile}" NAME_WE) add_executable("${testfilename}" "${testfile}") target_include_directories(${testfilename} BEFORE PRIVATE ${CURL_INCLUDE_DIRS}) - target_include_directories(${testfilename} BEFORE PRIVATE "${CIVET_THIRDPARTY_ROOT}/include") + target_include_directories(${testfilename} BEFORE PRIVATE "${CIVET_THIRDPARTY_ROOT}") target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/libminifi/test/") - target_include_directories(${testfilename} BEFORE PRIVATE "../http-curl/") - target_include_directories(${testfilename} BEFORE PRIVATE "../http-curl/client/") - target_include_directories(${testfilename} BEFORE PRIVATE "../http-curl/processors/") - target_include_directories(${testfilename} BEFORE PRIVATE "../http-curl/protocols/") - target_include_directories(${testfilename} BEFORE PRIVATE "../http-curl/sitetosite/") - target_include_directories(${testfilename} BEFORE PRIVATE "../civetweb/include/") + target_include_directories(${testfilename} BEFORE PRIVATE "../") + target_include_directories(${testfilename} BEFORE PRIVATE "../client/") + target_include_directories(${testfilename} BEFORE PRIVATE "../processors/") + target_include_directories(${testfilename} BEFORE PRIVATE "../protocols/") + target_include_directories(${testfilename} BEFORE PRIVATE "../sitetosite/") + target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/extensions/civetweb/") target_include_directories(${testfilename} BEFORE PRIVATE ./include) createTests("${testfilename}") target_link_libraries(${testfilename} ${CATCH_MAIN_LIB}) @@ -51,12 +51,12 @@ FOREACH(testfile ${CURL_INTEGRATION_TESTS}) target_include_directories(${testfilename} BEFORE PRIVATE ${CURL_INCLUDE_DIRS}) target_include_directories(${testfilename} BEFORE PRIVATE "${CIVET_THIRDPARTY_ROOT}/include") target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/libminifi/test/") - target_include_directories(${testfilename} BEFORE PRIVATE "../http-curl/") - target_include_directories(${testfilename} BEFORE PRIVATE "../http-curl/client/") - target_include_directories(${testfilename} BEFORE PRIVATE "../http-curl/processors/") - target_include_directories(${testfilename} BEFORE PRIVATE "../http-curl/protocols/") - target_include_directories(${testfilename} BEFORE PRIVATE "../http-curl/sitetosite/") - target_include_directories(${testfilename} BEFORE PRIVATE "../civetweb/include/") + target_include_directories(${testfilename} BEFORE PRIVATE "../") + target_include_directories(${testfilename} BEFORE PRIVATE "../client/") + target_include_directories(${testfilename} BEFORE PRIVATE "../processors/") + target_include_directories(${testfilename} BEFORE PRIVATE "../protocols/") + target_include_directories(${testfilename} BEFORE PRIVATE "../sitetosite/") + target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/extensions/civetweb/") target_include_directories(${testfilename} BEFORE PRIVATE ./include) createTests("${testfilename}") if (APPLE) @@ -79,4 +79,4 @@ add_test(NAME C2VerifyServeResults COMMAND C2VerifyServeResults "${TEST_RESOURCE add_test(NAME C2VerifyHeartbeatAndStop COMMAND C2VerifyHeartbeatAndStop "${TEST_RESOURCES}/C2VerifyHeartbeatAndStop.yml" "${TEST_RESOURCES}/") add_test(NAME SiteToSiteRestTest COMMAND SiteToSiteRestTest "${TEST_RESOURCES}/TestSite2SiteRest.yml" "${TEST_RESOURCES}/" "http://localhost:8077/nifi-api/site-to-site") add_test(NAME ControllerServiceIntegrationTests COMMAND ControllerServiceIntegrationTests "${TEST_RESOURCES}/TestControllerServices.yml" "${TEST_RESOURCES}/") -add_test(NAME ThreadPoolAdjust COMMAND ThreadPoolAdjust "${TEST_RESOURCES}/TestHTTPPostChunkedEncoding.yml" "${TEST_RESOURCES}/") +add_test(NAME ThreadPoolAdjust COMMAND ThreadPoolAdjust "${TEST_RESOURCES}/ThreadPoolAdjust.yml" "${TEST_RESOURCES}/") diff --git a/extensions/civetweb/include/io/CivetStream.h b/extensions/http-curl/tests/CivetStream.h similarity index 100% rename from extensions/civetweb/include/io/CivetStream.h rename to extensions/http-curl/tests/CivetStream.h diff --git a/extensions/civet_curl_tests/ControllerServiceIntegrationTests.cpp b/extensions/http-curl/tests/ControllerServiceIntegrationTests.cpp similarity index 100% rename from extensions/civet_curl_tests/ControllerServiceIntegrationTests.cpp rename to extensions/http-curl/tests/ControllerServiceIntegrationTests.cpp diff --git a/extensions/civet_curl_tests/GetFileNoData.cpp b/extensions/http-curl/tests/GetFileNoData.cpp similarity index 99% rename from extensions/civet_curl_tests/GetFileNoData.cpp rename to extensions/http-curl/tests/GetFileNoData.cpp index f475f48b04..299d994345 100644 --- a/extensions/civet_curl_tests/GetFileNoData.cpp +++ b/extensions/http-curl/tests/GetFileNoData.cpp @@ -42,7 +42,7 @@ #include "c2/C2Agent.h" #include "CivetServer.h" #include -#include "c2/protocols/RESTSender.h" +#include "protocols/RESTSender.h" void waitToVerifyProcessor() { std::this_thread::sleep_for(std::chrono::seconds(10)); diff --git a/extensions/civet_curl_tests/include/sitetositehttp/HTTPHandlers.h b/extensions/http-curl/tests/HTTPHandlers.h similarity index 99% rename from extensions/civet_curl_tests/include/sitetositehttp/HTTPHandlers.h rename to extensions/http-curl/tests/HTTPHandlers.h index d188df32f0..714090ad16 100644 --- a/extensions/civet_curl_tests/include/sitetositehttp/HTTPHandlers.h +++ b/extensions/http-curl/tests/HTTPHandlers.h @@ -18,7 +18,7 @@ #include "civetweb.h" #include "CivetServer.h" #include "concurrentqueue.h" -#include "io/CivetStream.h" +#include "CivetStream.h" #include "io/CRCStream.h" #ifndef LIBMINIFI_TEST_CURL_TESTS_SITETOSITEHTTP_HTTPHANDLERS_H_ #define LIBMINIFI_TEST_CURL_TESTS_SITETOSITEHTTP_HTTPHANDLERS_H_ diff --git a/extensions/civet_curl_tests/include/integration/HTTPIntegrationBase.h b/extensions/http-curl/tests/HTTPIntegrationBase.h similarity index 98% rename from extensions/civet_curl_tests/include/integration/HTTPIntegrationBase.h rename to extensions/http-curl/tests/HTTPIntegrationBase.h index be80dcea99..611c11f46b 100644 --- a/extensions/civet_curl_tests/include/integration/HTTPIntegrationBase.h +++ b/extensions/http-curl/tests/HTTPIntegrationBase.h @@ -18,7 +18,7 @@ #ifndef LIBMINIFI_TEST_INTEGRATION_HTTPINTEGRATIONBASE_H_ #define LIBMINIFI_TEST_INTEGRATION_HTTPINTEGRATIONBASE_H_ -#include "TestServer.h" +#include "../tests/TestServer.h" #include "CivetServer.h" #include "integration/IntegrationBase.h" diff --git a/extensions/civet_curl_tests/HTTPSiteToSiteTests.cpp b/extensions/http-curl/tests/HTTPSiteToSiteTests.cpp similarity index 99% rename from extensions/civet_curl_tests/HTTPSiteToSiteTests.cpp rename to extensions/http-curl/tests/HTTPSiteToSiteTests.cpp index 01d7231423..309492e485 100644 --- a/extensions/civet_curl_tests/HTTPSiteToSiteTests.cpp +++ b/extensions/http-curl/tests/HTTPSiteToSiteTests.cpp @@ -46,8 +46,8 @@ #include "RemoteProcessorGroupPort.h" #include "core/ConfigurableComponent.h" #include "TestServer.h" -#include "integration/HTTPIntegrationBase.h" -#include "sitetositehttp/HTTPHandlers.h" +#include "HTTPIntegrationBase.h" +#include "HTTPHandlers.h" #include "client/HTTPStream.h" class SiteToSiteTestHarness : public HTTPIntegrationBase { diff --git a/extensions/civet_curl_tests/HttpGetIntegrationTest.cpp b/extensions/http-curl/tests/HttpGetIntegrationTest.cpp similarity index 100% rename from extensions/civet_curl_tests/HttpGetIntegrationTest.cpp rename to extensions/http-curl/tests/HttpGetIntegrationTest.cpp diff --git a/extensions/civet_curl_tests/HttpPostIntegrationTest.cpp b/extensions/http-curl/tests/HttpPostIntegrationTest.cpp similarity index 98% rename from extensions/civet_curl_tests/HttpPostIntegrationTest.cpp rename to extensions/http-curl/tests/HttpPostIntegrationTest.cpp index 853fdc62d3..7b5ca97048 100644 --- a/extensions/civet_curl_tests/HttpPostIntegrationTest.cpp +++ b/extensions/http-curl/tests/HttpPostIntegrationTest.cpp @@ -47,8 +47,8 @@ #include "RemoteProcessorGroupPort.h" #include "core/ConfigurableComponent.h" #include "controllers/SSLContextService.h" -#include "TestServer.h" -#include "integration/HTTPIntegrationBase.h" +#include "../tests/TestServer.h" +#include "HTTPIntegrationBase.h" class HttpTestHarness : public HTTPIntegrationBase { public: diff --git a/extensions/civet_curl_tests/SiteToSiteRestTest.cpp b/extensions/http-curl/tests/SiteToSiteRestTest.cpp similarity index 98% rename from extensions/civet_curl_tests/SiteToSiteRestTest.cpp rename to extensions/http-curl/tests/SiteToSiteRestTest.cpp index f235be1a44..2cf0955704 100644 --- a/extensions/civet_curl_tests/SiteToSiteRestTest.cpp +++ b/extensions/http-curl/tests/SiteToSiteRestTest.cpp @@ -46,8 +46,8 @@ #include "RemoteProcessorGroupPort.h" #include "core/ConfigurableComponent.h" #include "controllers/SSLContextService.h" -#include "TestServer.h" -#include "integration/HTTPIntegrationBase.h" +#include "../tests/TestServer.h" +#include "HTTPIntegrationBase.h" class Responder : public CivetHandler { public: diff --git a/extensions/civet_curl_tests/include/TestServer.h b/extensions/http-curl/tests/TestServer.h similarity index 100% rename from extensions/civet_curl_tests/include/TestServer.h rename to extensions/http-curl/tests/TestServer.h diff --git a/extensions/civet_curl_tests/ThreadPoolAdjust.cpp b/extensions/http-curl/tests/ThreadPoolAdjust.cpp similarity index 98% rename from extensions/civet_curl_tests/ThreadPoolAdjust.cpp rename to extensions/http-curl/tests/ThreadPoolAdjust.cpp index 27851178d4..13524d6269 100644 --- a/extensions/civet_curl_tests/ThreadPoolAdjust.cpp +++ b/extensions/http-curl/tests/ThreadPoolAdjust.cpp @@ -47,7 +47,7 @@ #include "core/ConfigurableComponent.h" #include "controllers/SSLContextService.h" #include "TestServer.h" -#include "integration/HTTPIntegrationBase.h" +#include "HTTPIntegrationBase.h" #include "processors/InvokeHTTP.h" #include "processors/ListenHTTP.h" #include "processors/LogAttribute.h" diff --git a/extensions/civet_curl_tests/unit/InvokeHTTPTests.cpp b/extensions/http-curl/tests/unit/InvokeHTTPTests.cpp similarity index 100% rename from extensions/civet_curl_tests/unit/InvokeHTTPTests.cpp rename to extensions/http-curl/tests/unit/InvokeHTTPTests.cpp