You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ph...@apache.org on 2017/11/03 17:50:29 UTC
nifi-minifi-cpp git commit: MINIFICPP-282 Improve test build speed,
add Travis build cache
Repository: nifi-minifi-cpp
Updated Branches:
refs/heads/master 98882882f -> 583b2f621
MINIFICPP-282 Improve test build speed, add Travis build cache
Add two minutes to the default cache store timeout
This closes #169.
Signed-off-by: Marc Parisi <ph...@apache.org>
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/583b2f62
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/583b2f62
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/583b2f62
Branch: refs/heads/master
Commit: 583b2f621ee720eed398c557ef359bdcfa4fab16
Parents: 9888288
Author: Caleb Johnson <me...@calebj.io>
Authored: Thu Nov 2 13:03:28 2017 +0000
Committer: Marc Parisi <ph...@apache.org>
Committed: Fri Nov 3 13:43:27 2017 -0400
----------------------------------------------------------------------
.travis.yml | 8 +-
cmake/BuildTests.cmake | 62 ++--
libminifi/include/utils/StringUtils.h | 1 +
libminifi/test/CatchMain.cpp | 20 ++
libminifi/test/archive-tests/CMakeLists.txt | 7 +-
.../test/archive-tests/CompressContentTests.cpp | 1 -
.../test/archive-tests/FocusArchiveTests.cpp | 1 -
libminifi/test/archive-tests/MergeFileTests.cpp | 1 -
libminifi/test/curl-tests/CMakeLists.txt | 37 ++-
libminifi/test/curl-tests/InvokeHTTPTests.cpp | 312 -------------------
.../test/curl-tests/unit/InvokeHTTPTests.cpp | 311 ++++++++++++++++++
libminifi/test/rocksdb-tests/CMakeLists.txt | 11 +-
.../rocksdb-tests/DBContentRepositoryTests.cpp | 1 -
.../test/rocksdb-tests/ProvenanceTests.cpp | 1 -
libminifi/test/rocksdb-tests/RepoTests.cpp | 1 -
libminifi/test/script-tests/CMakeLists.txt | 4 +-
libminifi/test/unit/C2MetricsTests.cpp | 1 -
libminifi/test/unit/CRCTests.cpp | 2 -
libminifi/test/unit/ClassLoaderTests.cpp | 1 -
libminifi/test/unit/ControllerServiceTests.cpp | 1 -
libminifi/test/unit/ExtractTextTests.cpp | 1 -
libminifi/test/unit/FileStreamTests.cpp | 1 -
libminifi/test/unit/GetTCPTests.cpp | 1 -
libminifi/test/unit/IdTests.cpp | 1 -
.../test/unit/LoggerConfigurationTests.cpp | 1 -
libminifi/test/unit/LoggerTests.cpp | 1 -
libminifi/test/unit/ProcessorTests.cpp | 1 -
libminifi/test/unit/PropertyTests.cpp | 1 -
libminifi/test/unit/PutFileTests.cpp | 1 -
libminifi/test/unit/SchedulingAgentTests.cpp | 1 -
libminifi/test/unit/SerializationTests.cpp | 1 -
libminifi/test/unit/Site2SiteTests.cpp | 1 -
libminifi/test/unit/SocketTests.cpp | 1 -
libminifi/test/unit/StringUtilsTests.cpp | 1 -
libminifi/test/unit/TailFileTests.cpp | 1 -
libminifi/test/unit/Tests.cpp | 1 -
libminifi/test/unit/ThreadPoolTests.cpp | 1 -
libminifi/test/unit/YamlConfigurationTests.cpp | 1 -
38 files changed, 418 insertions(+), 384 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 51173c5..892c329 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -14,6 +14,11 @@
# limitations under the License.
language: cpp
+cache:
+ directories:
+ - $HOME/.ccache
+ - $HOME/Library/Caches/Homebrew
+ timeout: 300
matrix:
include:
@@ -73,5 +78,4 @@ matrix:
- package='lua'; [[ $(brew ls --versions ${package}) ]] && { brew outdated ${package} || brew upgrade ${package}; } || brew install ${package}
script:
- # Travis instances typically have ~2 vcpus. Parallel testing is currently BROKEN due to socket tests; do not use.
- - mkdir ./build && cd ./build && cmake .. ${CMAKE_BUILD_OPTIONS} && make -j2 VERBOSE=1 && make test ARGS="--output-on-failure" && make linter && make apache-rat && make docs
+ - mkdir ./build && cd ./build && cmake .. ${CMAKE_BUILD_OPTIONS} && make -j2 VERBOSE=1 && make test ARGS="-j2 --output-on-failure" && make linter && make apache-rat && make docs
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/cmake/BuildTests.cmake
----------------------------------------------------------------------
diff --git a/cmake/BuildTests.cmake b/cmake/BuildTests.cmake
index 99e980b..90e910f 100644
--- a/cmake/BuildTests.cmake
+++ b/cmake/BuildTests.cmake
@@ -33,27 +33,28 @@ find_package(Boost COMPONENTS system filesystem REQUIRED)
function(createTests testName)
message ("-- Adding test: ${testName}")
- 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_include_directories(${testName} PRIVATE BEFORE "${Boost_INCLUDE_DIRS}")
+ target_include_directories(${testName} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/catch")
+ target_include_directories(${testName} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/spdlog-20170710/include")
+ target_include_directories(${testName} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/yaml-cpp-yaml-cpp-0.5.3/include")
+ target_include_directories(${testName} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/jsoncpp/include")
+ target_include_directories(${testName} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/civetweb-1.9.1/include")
+ target_include_directories(${testName} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/libarchive-3.3.2/libarchive")
+ target_include_directories(${testName} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/include")
+ target_include_directories(${testName} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/libminifi/include/")
+ target_include_directories(${testName} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/libminifi/include/c2/protocols")
+ target_include_directories(${testName} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/libminifi/include/c2")
+ target_include_directories(${testName} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/libminifi/include/core")
+ target_include_directories(${testName} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/libminifi/include/core/controller")
+ target_include_directories(${testName} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/libminifi/include/core/repository")
+ target_include_directories(${testName} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/libminifi/include/core/yaml")
+ target_include_directories(${testName} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/libminifi/include/core/statemanagement")
+ target_include_directories(${testName} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/libminifi/include/core/statemanagement/metrics")
+ target_include_directories(${testName} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/libminifi/include/io")
+ target_include_directories(${testName} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/libminifi/include/utils")
+ target_include_directories(${testName} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/libminifi/include/processors")
+ target_include_directories(${testName} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/libminifi/include/provenance")
+ target_include_directories(${testName} BEFORE PRIVATE "${Boost_INCLUDE_DIRS}")
+ target_link_libraries(${testName} ${SPD_LIB} ${TEST_BASE_LIB})
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})
@@ -62,6 +63,20 @@ endfunction()
enable_testing(test)
+SET(SPD_LIB spd_lib)
+add_library(${SPD_LIB} STATIC ${SPD_SOURCES})
+
+SET(TEST_BASE_LIB test_base)
+add_library(${TEST_BASE_LIB} STATIC "${TEST_DIR}/TestBase.cpp")
+target_include_directories(${TEST_BASE_LIB} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/catch")
+target_include_directories(${TEST_BASE_LIB} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/libminifi/include/")
+target_include_directories(${TEST_BASE_LIB} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/spdlog-20170710/include")
+target_include_directories(${TEST_BASE_LIB} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/civetweb-1.9.1/include")
+
+SET(CATCH_MAIN_LIB catch_main)
+add_library(${CATCH_MAIN_LIB} STATIC "${TEST_DIR}/CatchMain.cpp")
+target_include_directories(${CATCH_MAIN_LIB} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/catch")
+
SET(TEST_RESOURCES ${TEST_DIR}/resources)
GETSOURCEFILES(UNIT_TESTS "${TEST_DIR}/unit/")
@@ -70,8 +85,9 @@ GETSOURCEFILES(INTEGRATION_TESTS "${TEST_DIR}/integration/")
SET(UNIT_TEST_COUNT 0)
FOREACH(testfile ${UNIT_TESTS})
get_filename_component(testfilename "${testfile}" NAME_WE)
- add_executable("${testfilename}" "${TEST_DIR}/unit/${testfile}" ${SPD_SOURCES} "${TEST_DIR}/TestBase.cpp")
+ add_executable("${testfilename}" "${TEST_DIR}/unit/${testfile}")
createTests("${testfilename}")
+ target_link_libraries(${testfilename} ${CATCH_MAIN_LIB})
MATH(EXPR UNIT_TEST_COUNT "${UNIT_TEST_COUNT}+1")
add_test(NAME "${testfilename}" COMMAND "${testfilename}" WORKING_DIRECTORY ${TEST_DIR})
ENDFOREACH()
@@ -80,7 +96,7 @@ message("-- Finished building ${UNIT_TEST_COUNT} unit test file(s)...")
SET(INT_TEST_COUNT 0)
FOREACH(testfile ${INTEGRATION_TESTS})
get_filename_component(testfilename "${testfile}" NAME_WE)
- add_executable("${testfilename}" "${TEST_DIR}/integration/${testfile}" ${SPD_SOURCES} "${TEST_DIR}/TestBase.cpp")
+ add_executable("${testfilename}" "${TEST_DIR}/integration/${testfile}")
createTests("${testfilename}")
MATH(EXPR INT_TEST_COUNT "${INT_TEST_COUNT}+1")
ENDFOREACH()
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/libminifi/include/utils/StringUtils.h
----------------------------------------------------------------------
diff --git a/libminifi/include/utils/StringUtils.h b/libminifi/include/utils/StringUtils.h
index f50ec91..b404928 100644
--- a/libminifi/include/utils/StringUtils.h
+++ b/libminifi/include/utils/StringUtils.h
@@ -19,6 +19,7 @@
#include <algorithm>
#include <sstream>
+#include <vector>
#include "utils/FailurePolicy.h"
namespace org {
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/libminifi/test/CatchMain.cpp
----------------------------------------------------------------------
diff --git a/libminifi/test/CatchMain.cpp b/libminifi/test/CatchMain.cpp
new file mode 100644
index 0000000..a029a9d
--- /dev/null
+++ b/libminifi/test/CatchMain.cpp
@@ -0,0 +1,20 @@
+/**
+ *
+ * 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 CATCH_CONFIG_MAIN
+#include "catch.hpp"
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/libminifi/test/archive-tests/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/libminifi/test/archive-tests/CMakeLists.txt b/libminifi/test/archive-tests/CMakeLists.txt
index dc23b1c..340291d 100644
--- a/libminifi/test/archive-tests/CMakeLists.txt
+++ b/libminifi/test/archive-tests/CMakeLists.txt
@@ -22,10 +22,11 @@ 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")
+ add_executable("${testfilename}" "${testfile}")
+ target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/extensions/libarchive")
+ target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/libarchive-3.3.2/libarchive")
createTests("${testfilename}")
+ target_link_libraries(${testfilename} ${CATCH_MAIN_LIB})
if (APPLE)
target_link_libraries (${testfilename} -Wl,-all_load minifi-archive-extensions)
else ()
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/libminifi/test/archive-tests/CompressContentTests.cpp
----------------------------------------------------------------------
diff --git a/libminifi/test/archive-tests/CompressContentTests.cpp b/libminifi/test/archive-tests/CompressContentTests.cpp
index a01d632..a543ef4 100644
--- a/libminifi/test/archive-tests/CompressContentTests.cpp
+++ b/libminifi/test/archive-tests/CompressContentTests.cpp
@@ -16,7 +16,6 @@
* limitations under the License.
*/
-#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include <uuid/uuid.h>
#include <fstream>
#include <map>
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/libminifi/test/archive-tests/FocusArchiveTests.cpp
----------------------------------------------------------------------
diff --git a/libminifi/test/archive-tests/FocusArchiveTests.cpp b/libminifi/test/archive-tests/FocusArchiveTests.cpp
index 2a9affe..1a68d20 100644
--- a/libminifi/test/archive-tests/FocusArchiveTests.cpp
+++ b/libminifi/test/archive-tests/FocusArchiveTests.cpp
@@ -16,7 +16,6 @@
* limitations under the License.
*/
-#define CATCH_CONFIG_MAIN
#include <uuid/uuid.h>
#include <iostream>
#include <map>
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/libminifi/test/archive-tests/MergeFileTests.cpp
----------------------------------------------------------------------
diff --git a/libminifi/test/archive-tests/MergeFileTests.cpp b/libminifi/test/archive-tests/MergeFileTests.cpp
index ca6682b..361048b 100644
--- a/libminifi/test/archive-tests/MergeFileTests.cpp
+++ b/libminifi/test/archive-tests/MergeFileTests.cpp
@@ -16,7 +16,6 @@
* limitations under the License.
*/
-#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include <uuid/uuid.h>
#include <fstream>
#include <map>
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/libminifi/test/curl-tests/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/libminifi/test/curl-tests/CMakeLists.txt b/libminifi/test/curl-tests/CMakeLists.txt
index e162c7c..7d928cf 100644
--- a/libminifi/test/curl-tests/CMakeLists.txt
+++ b/libminifi/test/curl-tests/CMakeLists.txt
@@ -17,19 +17,40 @@
# under the License.
#
-file(GLOB CURL_INTEGRATION_TESTS "*.cpp")
+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}" ${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_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/http-curl/sitetosite/")
+ 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)
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/libminifi/test/curl-tests/InvokeHTTPTests.cpp
----------------------------------------------------------------------
diff --git a/libminifi/test/curl-tests/InvokeHTTPTests.cpp b/libminifi/test/curl-tests/InvokeHTTPTests.cpp
deleted file mode 100644
index 3f6db82..0000000
--- a/libminifi/test/curl-tests/InvokeHTTPTests.cpp
+++ /dev/null
@@ -1,312 +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.
- */
-
-#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
-#include <uuid/uuid.h>
-#include <fstream>
-#include <map>
-#include <memory>
-#include <utility>
-#include <string>
-#include <set>
-#include "FlowController.h"
-#include "io/BaseStream.h"
-#include "../TestBase.h"
-#include "processors/GetFile.h"
-#include "core/Core.h"
-#include "HTTPClient.h"
-#include "InvokeHTTP.h"
-#include "../../include/core/FlowFile.h"
-#include "../unit/ProvenanceTestHelper.h"
-#include "core/Processor.h"
-#include "core/ProcessContext.h"
-#include "core/ProcessSession.h"
-#include "core/ProcessorNode.h"
-
-TEST_CASE("HTTPTestsWithNoResourceClaimPOST", "[httptest1]") {
- TestController testController;
- std::shared_ptr<core::ContentRepository> content_repo = std::make_shared<core::repository::VolatileContentRepository>();
- LogTestController::getInstance().setInfo<org::apache::nifi::minifi::processors::InvokeHTTP>();
-
- std::shared_ptr<TestRepository> repo = std::make_shared<TestRepository>();
-
- std::shared_ptr<core::Processor> getfileprocessor = std::make_shared<org::apache::nifi::minifi::processors::GetFile>("getfileCreate2");
-
- std::shared_ptr<core::Processor> logAttribute = std::make_shared<org::apache::nifi::minifi::processors::LogAttribute>("logattribute");
-
- char format[] = "/tmp/gt.XXXXXX";
- char *dir = testController.createTempDirectory(format);
-
- std::shared_ptr<core::Processor> listenhttp = std::make_shared<org::apache::nifi::minifi::processors::ListenHTTP>("listenhttp");
-
- std::shared_ptr<core::Processor> invokehttp = std::make_shared<org::apache::nifi::minifi::processors::InvokeHTTP>("invokehttp");
- uuid_t processoruuid;
- REQUIRE(true == listenhttp->getUUID(processoruuid));
-
- uuid_t invokehttp_uuid;
- REQUIRE(true == invokehttp->getUUID(invokehttp_uuid));
-
- std::shared_ptr<minifi::Connection> gcConnection = std::make_shared<minifi::Connection>(repo, content_repo, "getfileCreate2Connection");
- gcConnection->setRelationship(core::Relationship("success", "description"));
-
- std::shared_ptr<minifi::Connection> laConnection = std::make_shared<minifi::Connection>(repo, content_repo, "logattribute");
- laConnection->setRelationship(core::Relationship("success", "description"));
-
- std::shared_ptr<minifi::Connection> connection = std::make_shared<minifi::Connection>(repo, content_repo, "getfileCreate2Connection");
- connection->setRelationship(core::Relationship("success", "description"));
-
- std::shared_ptr<minifi::Connection> connection2 = std::make_shared<minifi::Connection>(repo, content_repo, "listenhttp");
-
- connection2->setRelationship(core::Relationship("No Retry", "description"));
-
- // link the connections so that we can test results at the end for this
- connection->setSource(listenhttp);
-
- connection2->setSourceUUID(invokehttp_uuid);
- connection->setSourceUUID(processoruuid);
- connection->setDestinationUUID(invokehttp_uuid);
-
- listenhttp->addConnection(connection);
- invokehttp->addConnection(connection);
- invokehttp->addConnection(connection2);
-
- std::shared_ptr<core::ProcessorNode> node = std::make_shared<core::ProcessorNode>(listenhttp);
- std::shared_ptr<core::ProcessorNode> node2 = std::make_shared<core::ProcessorNode>(invokehttp);
- std::shared_ptr<core::controller::ControllerServiceProvider> controller_services_provider = nullptr;
- std::shared_ptr<core::ProcessContext> context = std::make_shared<core::ProcessContext>(node, controller_services_provider, repo, repo, content_repo);
- std::shared_ptr<core::ProcessContext> context2 = std::make_shared<core::ProcessContext>(node2, controller_services_provider, repo, repo, content_repo);
- context->setProperty(org::apache::nifi::minifi::processors::ListenHTTP::Port, "8686");
- context->setProperty(org::apache::nifi::minifi::processors::ListenHTTP::BasePath, "/testytesttest");
-
- context2->setProperty(org::apache::nifi::minifi::processors::InvokeHTTP::Method, "POST");
- context2->setProperty(org::apache::nifi::minifi::processors::InvokeHTTP::URL, "http://localhost:8686/testytesttest");
- auto session = std::make_shared<core::ProcessSession>(context);
- auto session2 = std::make_shared<core::ProcessSession>(context2);
-
- REQUIRE(listenhttp->getName() == "listenhttp");
-
- std::shared_ptr<core::ProcessSessionFactory> factory = std::make_shared<core::ProcessSessionFactory>(context);
-
- std::shared_ptr<core::FlowFile> record;
- listenhttp->setScheduledState(core::ScheduledState::RUNNING);
- listenhttp->onSchedule(context, factory);
- listenhttp->onTrigger(context, session);
-
- invokehttp->incrementActiveTasks();
- invokehttp->setScheduledState(core::ScheduledState::RUNNING);
- std::shared_ptr<core::ProcessSessionFactory> factory2 = std::make_shared<core::ProcessSessionFactory>(context2);
- invokehttp->onSchedule(context2, factory2);
- invokehttp->onTrigger(context2, session2);
-
- provenance::ProvenanceReporter *reporter = session->getProvenanceReporter();
- std::set<provenance::ProvenanceEventRecord*> records = reporter->getEvents();
- record = session->get();
- REQUIRE(record == nullptr);
- REQUIRE(records.size() == 0);
-
- listenhttp->incrementActiveTasks();
- listenhttp->setScheduledState(core::ScheduledState::RUNNING);
- listenhttp->onTrigger(context, session);
-
- reporter = session->getProvenanceReporter();
-
- records = reporter->getEvents();
- session->commit();
-
- invokehttp->incrementActiveTasks();
- invokehttp->setScheduledState(core::ScheduledState::RUNNING);
- invokehttp->onTrigger(context2, session2);
-
- session2->commit();
- records = reporter->getEvents();
-
- for (provenance::ProvenanceEventRecord *provEventRecord : records) {
- REQUIRE(provEventRecord->getComponentType() == listenhttp->getName());
- }
- std::shared_ptr<core::FlowFile> ffr = session2->get();
- REQUIRE(true == LogTestController::getInstance().contains("exiting because method is POST"));
- LogTestController::getInstance().reset();
-}
-
-class CallBack : public minifi::OutputStreamCallback {
- public:
- CallBack() {
- }
- virtual ~CallBack() {
- }
- virtual int64_t process(std::shared_ptr<minifi::io::BaseStream> stream) {
- // leaving the typo for posterity sake
- std::string st = "we're gnna write some test stuff";
- return stream->write(reinterpret_cast<uint8_t*>(const_cast<char*>(st.c_str())), st.length());
- }
-};
-
-TEST_CASE("HTTPTestsWithResourceClaimPOST", "[httptest1]") {
- TestController testController;
- LogTestController::getInstance().setInfo<org::apache::nifi::minifi::processors::InvokeHTTP>();
-
- std::shared_ptr<TestRepository> repo = std::make_shared<TestRepository>();
-
- std::shared_ptr<core::Processor> getfileprocessor = std::make_shared<org::apache::nifi::minifi::processors::GetFile>("getfileCreate2");
-
- std::shared_ptr<core::Processor> logAttribute = std::make_shared<org::apache::nifi::minifi::processors::LogAttribute>("logattribute");
-
- char format[] = "/tmp/gt.XXXXXX";
- char *dir = testController.createTempDirectory(format);
-
- std::shared_ptr<core::Processor> listenhttp = std::make_shared<org::apache::nifi::minifi::processors::ListenHTTP>("listenhttp");
-
- std::shared_ptr<core::Processor> invokehttp = std::make_shared<org::apache::nifi::minifi::processors::InvokeHTTP>("invokehttp");
- uuid_t processoruuid;
- REQUIRE(true == listenhttp->getUUID(processoruuid));
-
- uuid_t invokehttp_uuid;
- REQUIRE(true == invokehttp->getUUID(invokehttp_uuid));
-
- std::shared_ptr<core::ContentRepository> content_repo = std::make_shared<core::repository::VolatileContentRepository>();
-
- std::shared_ptr<minifi::Connection> gcConnection = std::make_shared<minifi::Connection>(repo, content_repo, "getfileCreate2Connection");
- gcConnection->setRelationship(core::Relationship("success", "description"));
-
- std::shared_ptr<minifi::Connection> laConnection = std::make_shared<minifi::Connection>(repo, content_repo, "logattribute");
- laConnection->setRelationship(core::Relationship("success", "description"));
-
- std::shared_ptr<minifi::Connection> connection = std::make_shared<minifi::Connection>(repo, content_repo, "getfileCreate2Connection");
- connection->setRelationship(core::Relationship("success", "description"));
-
- std::shared_ptr<minifi::Connection> connection2 = std::make_shared<minifi::Connection>(repo, content_repo, "listenhttp");
-
- connection2->setRelationship(core::Relationship("No Retry", "description"));
-
- // link the connections so that we can test results at the end for this
- connection->setSource(listenhttp);
-
- connection->setSourceUUID(invokehttp_uuid);
- connection->setDestinationUUID(processoruuid);
-
- connection2->setSourceUUID(processoruuid);
- connection2->setSourceUUID(processoruuid);
-
- listenhttp->addConnection(connection);
- invokehttp->addConnection(connection);
- invokehttp->addConnection(connection2);
-
-
- std::shared_ptr<core::ProcessorNode> node = std::make_shared<core::ProcessorNode>(listenhttp);
- std::shared_ptr<core::ProcessorNode> node2 = std::make_shared<core::ProcessorNode>(invokehttp);
- std::shared_ptr<core::controller::ControllerServiceProvider> controller_services_provider = nullptr;
- std::shared_ptr<core::ProcessContext> context = std::make_shared<core::ProcessContext>(node, controller_services_provider, repo, repo, content_repo);
- std::shared_ptr<core::ProcessContext> context2 = std::make_shared<core::ProcessContext>(node2, controller_services_provider, repo, repo, content_repo);
- context->setProperty(org::apache::nifi::minifi::processors::ListenHTTP::Port, "8680");
- context->setProperty(org::apache::nifi::minifi::processors::ListenHTTP::BasePath, "/testytesttest");
-
- context2->setProperty(org::apache::nifi::minifi::processors::InvokeHTTP::Method, "POST");
- context2->setProperty(org::apache::nifi::minifi::processors::InvokeHTTP::URL, "http://localhost:8680/testytesttest");
- auto session = std::make_shared<core::ProcessSession>(context);
- auto session2 = std::make_shared<core::ProcessSession>(context2);
-
- REQUIRE(listenhttp->getName() == "listenhttp");
-
- std::shared_ptr<core::ProcessSessionFactory> factory = std::make_shared<core::ProcessSessionFactory>(context);
-
- std::shared_ptr<core::FlowFile> record;
-
- CallBack callback;
-
- std::map<std::string, std::string> attributes;
- attributes["testy"] = "test";
- std::shared_ptr<minifi::FlowFileRecord> flow = std::make_shared<minifi::FlowFileRecord>(repo, content_repo, attributes);
- session2->write(flow, &callback);
-
- invokehttp->incrementActiveTasks();
- invokehttp->setScheduledState(core::ScheduledState::RUNNING);
- std::shared_ptr<core::ProcessSessionFactory> factory2 = std::make_shared<core::ProcessSessionFactory>(context2);
- invokehttp->onSchedule(context2, factory2);
- invokehttp->onTrigger(context2, session2);
-
- listenhttp->incrementActiveTasks();
- listenhttp->setScheduledState(core::ScheduledState::RUNNING);
- listenhttp->onSchedule(context, factory);
- listenhttp->onTrigger(context, session);
-
- provenance::ProvenanceReporter *reporter = session->getProvenanceReporter();
- std::set<provenance::ProvenanceEventRecord*> records = reporter->getEvents();
- record = session->get();
- REQUIRE(record == nullptr);
- REQUIRE(records.size() == 0);
-
- listenhttp->incrementActiveTasks();
- listenhttp->setScheduledState(core::ScheduledState::RUNNING);
- listenhttp->onTrigger(context, session);
-
- reporter = session->getProvenanceReporter();
-
- records = reporter->getEvents();
- session->commit();
-
- invokehttp->incrementActiveTasks();
- invokehttp->setScheduledState(core::ScheduledState::RUNNING);
- invokehttp->onTrigger(context2, session2);
-
- session2->commit();
- records = reporter->getEvents();
-
- for (provenance::ProvenanceEventRecord *provEventRecord : records) {
- REQUIRE(provEventRecord->getComponentType() == listenhttp->getName());
- }
- std::shared_ptr<core::FlowFile> ffr = session2->get();
- REQUIRE(true == LogTestController::getInstance().contains("exiting because method is POST"));
- LogTestController::getInstance().reset();
-}
-
-TEST_CASE("HTTPTestsPostNoResourceClaim", "[httptest1]") {
- TestController testController;
- LogTestController::getInstance().setInfo<org::apache::nifi::minifi::processors::InvokeHTTP>();
- LogTestController::getInstance().setInfo<org::apache::nifi::minifi::processors::ListenHTTP>();
- LogTestController::getInstance().setInfo<core::Processor>();
-
- std::shared_ptr<TestPlan> plan = testController.createPlan();
- std::shared_ptr<core::Processor> processor = plan->addProcessor("ListenHTTP", "listenhttp", core::Relationship("No Retry", "description"), false);
- std::shared_ptr<core::Processor> invokehttp = plan->addProcessor("InvokeHTTP", "invokehttp", core::Relationship("success", "description"), true);
-
- REQUIRE(true == plan->setProperty(processor, org::apache::nifi::minifi::processors::ListenHTTP::Port.getName(), "8685"));
- REQUIRE(true == plan->setProperty(processor, org::apache::nifi::minifi::processors::ListenHTTP::BasePath.getName(), "/testytesttest"));
-
- REQUIRE(true == plan->setProperty(invokehttp, org::apache::nifi::minifi::processors::InvokeHTTP::Method.getName(), "POST"));
- REQUIRE(true == plan->setProperty(invokehttp, org::apache::nifi::minifi::processors::InvokeHTTP::URL.getName(), "http://localhost:8685/testytesttest"));
- plan->reset();
- testController.runSession(plan, true);
-
- std::set<provenance::ProvenanceEventRecord*> records = plan->getProvenanceRecords();
- std::shared_ptr<core::FlowFile> record = plan->getCurrentFlowFile();
- REQUIRE(record == nullptr);
- REQUIRE(records.size() == 0);
-
- plan->reset();
- testController.runSession(plan, true);
-
- records = plan->getProvenanceRecords();
- record = plan->getCurrentFlowFile();
-
- for (provenance::ProvenanceEventRecord *provEventRecord : records) {
- REQUIRE(provEventRecord->getComponentType() == processor->getName());
- }
- std::shared_ptr<core::FlowFile> ffr = plan->getCurrentFlowFile();
- REQUIRE(true == LogTestController::getInstance().contains("exiting because method is POST"));
- LogTestController::getInstance().reset();
-}
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/libminifi/test/curl-tests/unit/InvokeHTTPTests.cpp
----------------------------------------------------------------------
diff --git a/libminifi/test/curl-tests/unit/InvokeHTTPTests.cpp b/libminifi/test/curl-tests/unit/InvokeHTTPTests.cpp
new file mode 100644
index 0000000..c51a142
--- /dev/null
+++ b/libminifi/test/curl-tests/unit/InvokeHTTPTests.cpp
@@ -0,0 +1,311 @@
+/**
+ *
+ * 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 <uuid/uuid.h>
+#include <fstream>
+#include <map>
+#include <memory>
+#include <utility>
+#include <string>
+#include <set>
+#include "FlowController.h"
+#include "io/BaseStream.h"
+#include "../../TestBase.h"
+#include "processors/GetFile.h"
+#include "core/Core.h"
+#include "HTTPClient.h"
+#include "InvokeHTTP.h"
+#include "core/FlowFile.h"
+#include "../../unit/ProvenanceTestHelper.h"
+#include "core/Processor.h"
+#include "core/ProcessContext.h"
+#include "core/ProcessSession.h"
+#include "core/ProcessorNode.h"
+
+TEST_CASE("HTTPTestsWithNoResourceClaimPOST", "[httptest1]") {
+ TestController testController;
+ std::shared_ptr<core::ContentRepository> content_repo = std::make_shared<core::repository::VolatileContentRepository>();
+ LogTestController::getInstance().setInfo<org::apache::nifi::minifi::processors::InvokeHTTP>();
+
+ std::shared_ptr<TestRepository> repo = std::make_shared<TestRepository>();
+
+ std::shared_ptr<core::Processor> getfileprocessor = std::make_shared<org::apache::nifi::minifi::processors::GetFile>("getfileCreate2");
+
+ std::shared_ptr<core::Processor> logAttribute = std::make_shared<org::apache::nifi::minifi::processors::LogAttribute>("logattribute");
+
+ char format[] = "/tmp/gt.XXXXXX";
+ char *dir = testController.createTempDirectory(format);
+
+ std::shared_ptr<core::Processor> listenhttp = std::make_shared<org::apache::nifi::minifi::processors::ListenHTTP>("listenhttp");
+
+ std::shared_ptr<core::Processor> invokehttp = std::make_shared<org::apache::nifi::minifi::processors::InvokeHTTP>("invokehttp");
+ uuid_t processoruuid;
+ REQUIRE(true == listenhttp->getUUID(processoruuid));
+
+ uuid_t invokehttp_uuid;
+ REQUIRE(true == invokehttp->getUUID(invokehttp_uuid));
+
+ std::shared_ptr<minifi::Connection> gcConnection = std::make_shared<minifi::Connection>(repo, content_repo, "getfileCreate2Connection");
+ gcConnection->setRelationship(core::Relationship("success", "description"));
+
+ std::shared_ptr<minifi::Connection> laConnection = std::make_shared<minifi::Connection>(repo, content_repo, "logattribute");
+ laConnection->setRelationship(core::Relationship("success", "description"));
+
+ std::shared_ptr<minifi::Connection> connection = std::make_shared<minifi::Connection>(repo, content_repo, "getfileCreate2Connection");
+ connection->setRelationship(core::Relationship("success", "description"));
+
+ std::shared_ptr<minifi::Connection> connection2 = std::make_shared<minifi::Connection>(repo, content_repo, "listenhttp");
+
+ connection2->setRelationship(core::Relationship("No Retry", "description"));
+
+ // link the connections so that we can test results at the end for this
+ connection->setSource(listenhttp);
+
+ connection2->setSourceUUID(invokehttp_uuid);
+ connection->setSourceUUID(processoruuid);
+ connection->setDestinationUUID(invokehttp_uuid);
+
+ listenhttp->addConnection(connection);
+ invokehttp->addConnection(connection);
+ invokehttp->addConnection(connection2);
+
+ std::shared_ptr<core::ProcessorNode> node = std::make_shared<core::ProcessorNode>(listenhttp);
+ std::shared_ptr<core::ProcessorNode> node2 = std::make_shared<core::ProcessorNode>(invokehttp);
+ std::shared_ptr<core::controller::ControllerServiceProvider> controller_services_provider = nullptr;
+ std::shared_ptr<core::ProcessContext> context = std::make_shared<core::ProcessContext>(node, controller_services_provider, repo, repo, content_repo);
+ std::shared_ptr<core::ProcessContext> context2 = std::make_shared<core::ProcessContext>(node2, controller_services_provider, repo, repo, content_repo);
+ context->setProperty(org::apache::nifi::minifi::processors::ListenHTTP::Port, "8686");
+ context->setProperty(org::apache::nifi::minifi::processors::ListenHTTP::BasePath, "/testytesttest");
+
+ context2->setProperty(org::apache::nifi::minifi::processors::InvokeHTTP::Method, "POST");
+ context2->setProperty(org::apache::nifi::minifi::processors::InvokeHTTP::URL, "http://localhost:8686/testytesttest");
+ auto session = std::make_shared<core::ProcessSession>(context);
+ auto session2 = std::make_shared<core::ProcessSession>(context2);
+
+ REQUIRE(listenhttp->getName() == "listenhttp");
+
+ std::shared_ptr<core::ProcessSessionFactory> factory = std::make_shared<core::ProcessSessionFactory>(context);
+
+ std::shared_ptr<core::FlowFile> record;
+ listenhttp->setScheduledState(core::ScheduledState::RUNNING);
+ listenhttp->onSchedule(context, factory);
+ listenhttp->onTrigger(context, session);
+
+ invokehttp->incrementActiveTasks();
+ invokehttp->setScheduledState(core::ScheduledState::RUNNING);
+ std::shared_ptr<core::ProcessSessionFactory> factory2 = std::make_shared<core::ProcessSessionFactory>(context2);
+ invokehttp->onSchedule(context2, factory2);
+ invokehttp->onTrigger(context2, session2);
+
+ provenance::ProvenanceReporter *reporter = session->getProvenanceReporter();
+ std::set<provenance::ProvenanceEventRecord*> records = reporter->getEvents();
+ record = session->get();
+ REQUIRE(record == nullptr);
+ REQUIRE(records.size() == 0);
+
+ listenhttp->incrementActiveTasks();
+ listenhttp->setScheduledState(core::ScheduledState::RUNNING);
+ listenhttp->onTrigger(context, session);
+
+ reporter = session->getProvenanceReporter();
+
+ records = reporter->getEvents();
+ session->commit();
+
+ invokehttp->incrementActiveTasks();
+ invokehttp->setScheduledState(core::ScheduledState::RUNNING);
+ invokehttp->onTrigger(context2, session2);
+
+ session2->commit();
+ records = reporter->getEvents();
+
+ for (provenance::ProvenanceEventRecord *provEventRecord : records) {
+ REQUIRE(provEventRecord->getComponentType() == listenhttp->getName());
+ }
+ std::shared_ptr<core::FlowFile> ffr = session2->get();
+ REQUIRE(true == LogTestController::getInstance().contains("exiting because method is POST"));
+ LogTestController::getInstance().reset();
+}
+
+class CallBack : public minifi::OutputStreamCallback {
+ public:
+ CallBack() {
+ }
+ virtual ~CallBack() {
+ }
+ virtual int64_t process(std::shared_ptr<minifi::io::BaseStream> stream) {
+ // leaving the typo for posterity sake
+ std::string st = "we're gnna write some test stuff";
+ return stream->write(reinterpret_cast<uint8_t*>(const_cast<char*>(st.c_str())), st.length());
+ }
+};
+
+TEST_CASE("HTTPTestsWithResourceClaimPOST", "[httptest1]") {
+ TestController testController;
+ LogTestController::getInstance().setInfo<org::apache::nifi::minifi::processors::InvokeHTTP>();
+
+ std::shared_ptr<TestRepository> repo = std::make_shared<TestRepository>();
+
+ std::shared_ptr<core::Processor> getfileprocessor = std::make_shared<org::apache::nifi::minifi::processors::GetFile>("getfileCreate2");
+
+ std::shared_ptr<core::Processor> logAttribute = std::make_shared<org::apache::nifi::minifi::processors::LogAttribute>("logattribute");
+
+ char format[] = "/tmp/gt.XXXXXX";
+ char *dir = testController.createTempDirectory(format);
+
+ std::shared_ptr<core::Processor> listenhttp = std::make_shared<org::apache::nifi::minifi::processors::ListenHTTP>("listenhttp");
+
+ std::shared_ptr<core::Processor> invokehttp = std::make_shared<org::apache::nifi::minifi::processors::InvokeHTTP>("invokehttp");
+ uuid_t processoruuid;
+ REQUIRE(true == listenhttp->getUUID(processoruuid));
+
+ uuid_t invokehttp_uuid;
+ REQUIRE(true == invokehttp->getUUID(invokehttp_uuid));
+
+ std::shared_ptr<core::ContentRepository> content_repo = std::make_shared<core::repository::VolatileContentRepository>();
+
+ std::shared_ptr<minifi::Connection> gcConnection = std::make_shared<minifi::Connection>(repo, content_repo, "getfileCreate2Connection");
+ gcConnection->setRelationship(core::Relationship("success", "description"));
+
+ std::shared_ptr<minifi::Connection> laConnection = std::make_shared<minifi::Connection>(repo, content_repo, "logattribute");
+ laConnection->setRelationship(core::Relationship("success", "description"));
+
+ std::shared_ptr<minifi::Connection> connection = std::make_shared<minifi::Connection>(repo, content_repo, "getfileCreate2Connection");
+ connection->setRelationship(core::Relationship("success", "description"));
+
+ std::shared_ptr<minifi::Connection> connection2 = std::make_shared<minifi::Connection>(repo, content_repo, "listenhttp");
+
+ connection2->setRelationship(core::Relationship("No Retry", "description"));
+
+ // link the connections so that we can test results at the end for this
+ connection->setSource(listenhttp);
+
+ connection->setSourceUUID(invokehttp_uuid);
+ connection->setDestinationUUID(processoruuid);
+
+ connection2->setSourceUUID(processoruuid);
+ connection2->setSourceUUID(processoruuid);
+
+ listenhttp->addConnection(connection);
+ invokehttp->addConnection(connection);
+ invokehttp->addConnection(connection2);
+
+
+ std::shared_ptr<core::ProcessorNode> node = std::make_shared<core::ProcessorNode>(listenhttp);
+ std::shared_ptr<core::ProcessorNode> node2 = std::make_shared<core::ProcessorNode>(invokehttp);
+ std::shared_ptr<core::controller::ControllerServiceProvider> controller_services_provider = nullptr;
+ std::shared_ptr<core::ProcessContext> context = std::make_shared<core::ProcessContext>(node, controller_services_provider, repo, repo, content_repo);
+ std::shared_ptr<core::ProcessContext> context2 = std::make_shared<core::ProcessContext>(node2, controller_services_provider, repo, repo, content_repo);
+ context->setProperty(org::apache::nifi::minifi::processors::ListenHTTP::Port, "8680");
+ context->setProperty(org::apache::nifi::minifi::processors::ListenHTTP::BasePath, "/testytesttest");
+
+ context2->setProperty(org::apache::nifi::minifi::processors::InvokeHTTP::Method, "POST");
+ context2->setProperty(org::apache::nifi::minifi::processors::InvokeHTTP::URL, "http://localhost:8680/testytesttest");
+ auto session = std::make_shared<core::ProcessSession>(context);
+ auto session2 = std::make_shared<core::ProcessSession>(context2);
+
+ REQUIRE(listenhttp->getName() == "listenhttp");
+
+ std::shared_ptr<core::ProcessSessionFactory> factory = std::make_shared<core::ProcessSessionFactory>(context);
+
+ std::shared_ptr<core::FlowFile> record;
+
+ CallBack callback;
+
+ std::map<std::string, std::string> attributes;
+ attributes["testy"] = "test";
+ std::shared_ptr<minifi::FlowFileRecord> flow = std::make_shared<minifi::FlowFileRecord>(repo, content_repo, attributes);
+ session2->write(flow, &callback);
+
+ invokehttp->incrementActiveTasks();
+ invokehttp->setScheduledState(core::ScheduledState::RUNNING);
+ std::shared_ptr<core::ProcessSessionFactory> factory2 = std::make_shared<core::ProcessSessionFactory>(context2);
+ invokehttp->onSchedule(context2, factory2);
+ invokehttp->onTrigger(context2, session2);
+
+ listenhttp->incrementActiveTasks();
+ listenhttp->setScheduledState(core::ScheduledState::RUNNING);
+ listenhttp->onSchedule(context, factory);
+ listenhttp->onTrigger(context, session);
+
+ provenance::ProvenanceReporter *reporter = session->getProvenanceReporter();
+ std::set<provenance::ProvenanceEventRecord*> records = reporter->getEvents();
+ record = session->get();
+ REQUIRE(record == nullptr);
+ REQUIRE(records.size() == 0);
+
+ listenhttp->incrementActiveTasks();
+ listenhttp->setScheduledState(core::ScheduledState::RUNNING);
+ listenhttp->onTrigger(context, session);
+
+ reporter = session->getProvenanceReporter();
+
+ records = reporter->getEvents();
+ session->commit();
+
+ invokehttp->incrementActiveTasks();
+ invokehttp->setScheduledState(core::ScheduledState::RUNNING);
+ invokehttp->onTrigger(context2, session2);
+
+ session2->commit();
+ records = reporter->getEvents();
+
+ for (provenance::ProvenanceEventRecord *provEventRecord : records) {
+ REQUIRE(provEventRecord->getComponentType() == listenhttp->getName());
+ }
+ std::shared_ptr<core::FlowFile> ffr = session2->get();
+ REQUIRE(true == LogTestController::getInstance().contains("exiting because method is POST"));
+ LogTestController::getInstance().reset();
+}
+
+TEST_CASE("HTTPTestsPostNoResourceClaim", "[httptest1]") {
+ TestController testController;
+ LogTestController::getInstance().setInfo<org::apache::nifi::minifi::processors::InvokeHTTP>();
+ LogTestController::getInstance().setInfo<org::apache::nifi::minifi::processors::ListenHTTP>();
+ LogTestController::getInstance().setInfo<core::Processor>();
+
+ std::shared_ptr<TestPlan> plan = testController.createPlan();
+ std::shared_ptr<core::Processor> processor = plan->addProcessor("ListenHTTP", "listenhttp", core::Relationship("No Retry", "description"), false);
+ std::shared_ptr<core::Processor> invokehttp = plan->addProcessor("InvokeHTTP", "invokehttp", core::Relationship("success", "description"), true);
+
+ REQUIRE(true == plan->setProperty(processor, org::apache::nifi::minifi::processors::ListenHTTP::Port.getName(), "8685"));
+ REQUIRE(true == plan->setProperty(processor, org::apache::nifi::minifi::processors::ListenHTTP::BasePath.getName(), "/testytesttest"));
+
+ REQUIRE(true == plan->setProperty(invokehttp, org::apache::nifi::minifi::processors::InvokeHTTP::Method.getName(), "POST"));
+ REQUIRE(true == plan->setProperty(invokehttp, org::apache::nifi::minifi::processors::InvokeHTTP::URL.getName(), "http://localhost:8685/testytesttest"));
+ plan->reset();
+ testController.runSession(plan, true);
+
+ std::set<provenance::ProvenanceEventRecord*> records = plan->getProvenanceRecords();
+ std::shared_ptr<core::FlowFile> record = plan->getCurrentFlowFile();
+ REQUIRE(record == nullptr);
+ REQUIRE(records.size() == 0);
+
+ plan->reset();
+ testController.runSession(plan, true);
+
+ records = plan->getProvenanceRecords();
+ record = plan->getCurrentFlowFile();
+
+ for (provenance::ProvenanceEventRecord *provEventRecord : records) {
+ REQUIRE(provEventRecord->getComponentType() == processor->getName());
+ }
+ std::shared_ptr<core::FlowFile> ffr = plan->getCurrentFlowFile();
+ REQUIRE(true == LogTestController::getInstance().contains("exiting because method is POST"));
+ LogTestController::getInstance().reset();
+}
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/libminifi/test/rocksdb-tests/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/libminifi/test/rocksdb-tests/CMakeLists.txt b/libminifi/test/rocksdb-tests/CMakeLists.txt
index 713921b..d34ce6c 100644
--- a/libminifi/test/rocksdb-tests/CMakeLists.txt
+++ b/libminifi/test/rocksdb-tests/CMakeLists.txt
@@ -17,14 +17,15 @@
# under the License.
#
-file(GLOB ROCKSDB_INTEGRATION_TESTS "*.cpp")
+file(GLOB ROCKSDB_UNIT_TESTS "*.cpp")
SET(ROCKSDB_TEST_COUNT 0)
-FOREACH(testfile ${ROCKSDB_INTEGRATION_TESTS})
+FOREACH(testfile ${ROCKSDB_UNIT_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")
+ add_executable("${testfilename}" "${testfile}")
+ target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/extensions/rocksdb-repos/")
+ target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/rocksdb/include")
createTests("${testfilename}")
+ target_link_libraries(${testfilename} ${CATCH_MAIN_LIB})
if (APPLE)
target_link_libraries (${testfilename} -Wl,-all_load minifi-rocksdb-repos)
else ()
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/libminifi/test/rocksdb-tests/DBContentRepositoryTests.cpp
----------------------------------------------------------------------
diff --git a/libminifi/test/rocksdb-tests/DBContentRepositoryTests.cpp b/libminifi/test/rocksdb-tests/DBContentRepositoryTests.cpp
index d92c038..c45a037 100644
--- a/libminifi/test/rocksdb-tests/DBContentRepositoryTests.cpp
+++ b/libminifi/test/rocksdb-tests/DBContentRepositoryTests.cpp
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include "../TestBase.h"
#include <memory>
#include <string>
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/libminifi/test/rocksdb-tests/ProvenanceTests.cpp
----------------------------------------------------------------------
diff --git a/libminifi/test/rocksdb-tests/ProvenanceTests.cpp b/libminifi/test/rocksdb-tests/ProvenanceTests.cpp
index ffc5d98..a40c6ca 100644
--- a/libminifi/test/rocksdb-tests/ProvenanceTests.cpp
+++ b/libminifi/test/rocksdb-tests/ProvenanceTests.cpp
@@ -16,7 +16,6 @@
* limitations under the License.
*/
-#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include "../TestBase.h"
#include <utility>
#include <memory>
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/libminifi/test/rocksdb-tests/RepoTests.cpp
----------------------------------------------------------------------
diff --git a/libminifi/test/rocksdb-tests/RepoTests.cpp b/libminifi/test/rocksdb-tests/RepoTests.cpp
index e966aba..2da5713 100644
--- a/libminifi/test/rocksdb-tests/RepoTests.cpp
+++ b/libminifi/test/rocksdb-tests/RepoTests.cpp
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include "../TestBase.h"
#include <memory>
#include <string>
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/libminifi/test/script-tests/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/libminifi/test/script-tests/CMakeLists.txt b/libminifi/test/script-tests/CMakeLists.txt
index f0a57d0..a485e32 100644
--- a/libminifi/test/script-tests/CMakeLists.txt
+++ b/libminifi/test/script-tests/CMakeLists.txt
@@ -29,7 +29,7 @@ SET(EXTENSIONS_TEST_COUNT 0)
FOREACH(testfile ${EXECUTESCRIPT_PYTHON_INTEGRATION_TESTS})
get_filename_component(testfilename "${testfile}" NAME_WE)
- add_executable("${testfilename}" "${testfile}" ${SPD_SOURCES} "${TEST_DIR}/TestBase.cpp")
+ add_executable("${testfilename}" "${testfile}")
createTests("${testfilename}")
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/script")
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/script/python")
@@ -46,7 +46,7 @@ ENDFOREACH()
FOREACH(testfile ${EXECUTESCRIPT_LUA_INTEGRATION_TESTS})
get_filename_component(testfilename "${testfile}" NAME_WE)
- add_executable("${testfilename}" "${testfile}" ${SPD_SOURCES} "${TEST_DIR}/TestBase.cpp")
+ add_executable("${testfilename}" "${testfile}")
createTests("${testfilename}")
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/script")
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/script/lua")
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/libminifi/test/unit/C2MetricsTests.cpp
----------------------------------------------------------------------
diff --git a/libminifi/test/unit/C2MetricsTests.cpp b/libminifi/test/unit/C2MetricsTests.cpp
index 75e6cc2..34843c9 100644
--- a/libminifi/test/unit/C2MetricsTests.cpp
+++ b/libminifi/test/unit/C2MetricsTests.cpp
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include <uuid/uuid.h>
#include <memory>
#include "../TestBase.h"
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/libminifi/test/unit/CRCTests.cpp
----------------------------------------------------------------------
diff --git a/libminifi/test/unit/CRCTests.cpp b/libminifi/test/unit/CRCTests.cpp
index 97af4c3..f7fbce6 100644
--- a/libminifi/test/unit/CRCTests.cpp
+++ b/libminifi/test/unit/CRCTests.cpp
@@ -16,8 +16,6 @@
* limitations under the License.
*/
-#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
-
#include <string>
#include <vector>
#include "io/CRCStream.h"
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/libminifi/test/unit/ClassLoaderTests.cpp
----------------------------------------------------------------------
diff --git a/libminifi/test/unit/ClassLoaderTests.cpp b/libminifi/test/unit/ClassLoaderTests.cpp
index fa8e5ef..82825e9 100644
--- a/libminifi/test/unit/ClassLoaderTests.cpp
+++ b/libminifi/test/unit/ClassLoaderTests.cpp
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include <uuid/uuid.h>
#include "../TestBase.h"
#include "io/ClientSocket.h"
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/libminifi/test/unit/ControllerServiceTests.cpp
----------------------------------------------------------------------
diff --git a/libminifi/test/unit/ControllerServiceTests.cpp b/libminifi/test/unit/ControllerServiceTests.cpp
index a24ee03..2d609d6 100644
--- a/libminifi/test/unit/ControllerServiceTests.cpp
+++ b/libminifi/test/unit/ControllerServiceTests.cpp
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include <uuid/uuid.h>
#include <memory>
#include <string>
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/libminifi/test/unit/ExtractTextTests.cpp
----------------------------------------------------------------------
diff --git a/libminifi/test/unit/ExtractTextTests.cpp b/libminifi/test/unit/ExtractTextTests.cpp
index de5c591..fc49c7f 100644
--- a/libminifi/test/unit/ExtractTextTests.cpp
+++ b/libminifi/test/unit/ExtractTextTests.cpp
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include <uuid/uuid.h>
#include <fstream>
#include <map>
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/libminifi/test/unit/FileStreamTests.cpp
----------------------------------------------------------------------
diff --git a/libminifi/test/unit/FileStreamTests.cpp b/libminifi/test/unit/FileStreamTests.cpp
index 92ff092..68e9d3e 100644
--- a/libminifi/test/unit/FileStreamTests.cpp
+++ b/libminifi/test/unit/FileStreamTests.cpp
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include "io/FileStream.h"
#include <string>
#include <vector>
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/libminifi/test/unit/GetTCPTests.cpp
----------------------------------------------------------------------
diff --git a/libminifi/test/unit/GetTCPTests.cpp b/libminifi/test/unit/GetTCPTests.cpp
index c09da68..5e47dff 100644
--- a/libminifi/test/unit/GetTCPTests.cpp
+++ b/libminifi/test/unit/GetTCPTests.cpp
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include <uuid/uuid.h>
#include <utility>
#include <memory>
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/libminifi/test/unit/IdTests.cpp
----------------------------------------------------------------------
diff --git a/libminifi/test/unit/IdTests.cpp b/libminifi/test/unit/IdTests.cpp
index 946fc0c..fb30835 100644
--- a/libminifi/test/unit/IdTests.cpp
+++ b/libminifi/test/unit/IdTests.cpp
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include <utility>
#include <string>
#include <memory>
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/libminifi/test/unit/LoggerConfigurationTests.cpp
----------------------------------------------------------------------
diff --git a/libminifi/test/unit/LoggerConfigurationTests.cpp b/libminifi/test/unit/LoggerConfigurationTests.cpp
index 8a8b0bc..7850de0 100644
--- a/libminifi/test/unit/LoggerConfigurationTests.cpp
+++ b/libminifi/test/unit/LoggerConfigurationTests.cpp
@@ -16,7 +16,6 @@
* limitations under the License.
*/
-#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include <algorithm>
#include <memory>
#include <string>
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/libminifi/test/unit/LoggerTests.cpp
----------------------------------------------------------------------
diff --git a/libminifi/test/unit/LoggerTests.cpp b/libminifi/test/unit/LoggerTests.cpp
index b39b233..744071c 100644
--- a/libminifi/test/unit/LoggerTests.cpp
+++ b/libminifi/test/unit/LoggerTests.cpp
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include <utility>
#include <string>
#include <memory>
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/libminifi/test/unit/ProcessorTests.cpp
----------------------------------------------------------------------
diff --git a/libminifi/test/unit/ProcessorTests.cpp b/libminifi/test/unit/ProcessorTests.cpp
index 99b9a07..2ae7553 100644
--- a/libminifi/test/unit/ProcessorTests.cpp
+++ b/libminifi/test/unit/ProcessorTests.cpp
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include <uuid/uuid.h>
#include <utility>
#include <memory>
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/libminifi/test/unit/PropertyTests.cpp
----------------------------------------------------------------------
diff --git a/libminifi/test/unit/PropertyTests.cpp b/libminifi/test/unit/PropertyTests.cpp
index eeb74ef..f994879 100644
--- a/libminifi/test/unit/PropertyTests.cpp
+++ b/libminifi/test/unit/PropertyTests.cpp
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include "../../include/core/Property.h"
#include <string>
#include "utils/StringUtils.h"
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/libminifi/test/unit/PutFileTests.cpp
----------------------------------------------------------------------
diff --git a/libminifi/test/unit/PutFileTests.cpp b/libminifi/test/unit/PutFileTests.cpp
index 024b6fa..724f252 100644
--- a/libminifi/test/unit/PutFileTests.cpp
+++ b/libminifi/test/unit/PutFileTests.cpp
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include <uuid/uuid.h>
#include <sys/stat.h>
#include <utility>
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/libminifi/test/unit/SchedulingAgentTests.cpp
----------------------------------------------------------------------
diff --git a/libminifi/test/unit/SchedulingAgentTests.cpp b/libminifi/test/unit/SchedulingAgentTests.cpp
index 898636a..8604069 100644
--- a/libminifi/test/unit/SchedulingAgentTests.cpp
+++ b/libminifi/test/unit/SchedulingAgentTests.cpp
@@ -16,7 +16,6 @@
* limitations under the License.
*/
-#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include <memory>
#include <string>
#include <vector>
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/libminifi/test/unit/SerializationTests.cpp
----------------------------------------------------------------------
diff --git a/libminifi/test/unit/SerializationTests.cpp b/libminifi/test/unit/SerializationTests.cpp
index c0852a2..fe703f2 100644
--- a/libminifi/test/unit/SerializationTests.cpp
+++ b/libminifi/test/unit/SerializationTests.cpp
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include "io/BaseStream.h"
#include <uuid/uuid.h>
#include "SiteToSiteHelper.h"
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/libminifi/test/unit/Site2SiteTests.cpp
----------------------------------------------------------------------
diff --git a/libminifi/test/unit/Site2SiteTests.cpp b/libminifi/test/unit/Site2SiteTests.cpp
index d79a950..d1844ee 100644
--- a/libminifi/test/unit/Site2SiteTests.cpp
+++ b/libminifi/test/unit/Site2SiteTests.cpp
@@ -16,7 +16,6 @@
* limitations under the License.
*/
-#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include <uuid/uuid.h>
#include <string>
#include <memory>
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/libminifi/test/unit/SocketTests.cpp
----------------------------------------------------------------------
diff --git a/libminifi/test/unit/SocketTests.cpp b/libminifi/test/unit/SocketTests.cpp
index 0576d5f..3e2760e 100644
--- a/libminifi/test/unit/SocketTests.cpp
+++ b/libminifi/test/unit/SocketTests.cpp
@@ -16,7 +16,6 @@
* limitations under the License.
*/
-#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include <thread>
#include <random>
#include <chrono>
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/libminifi/test/unit/StringUtilsTests.cpp
----------------------------------------------------------------------
diff --git a/libminifi/test/unit/StringUtilsTests.cpp b/libminifi/test/unit/StringUtilsTests.cpp
index c071ef7..c4e839b 100644
--- a/libminifi/test/unit/StringUtilsTests.cpp
+++ b/libminifi/test/unit/StringUtilsTests.cpp
@@ -16,7 +16,6 @@
* limitations under the License.
*/
-#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include <string>
#include <vector>
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/libminifi/test/unit/TailFileTests.cpp
----------------------------------------------------------------------
diff --git a/libminifi/test/unit/TailFileTests.cpp b/libminifi/test/unit/TailFileTests.cpp
index a7baec9..53bfc9c 100644
--- a/libminifi/test/unit/TailFileTests.cpp
+++ b/libminifi/test/unit/TailFileTests.cpp
@@ -16,7 +16,6 @@
* limitations under the License.
*/
-#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include <uuid/uuid.h>
#include <fstream>
#include <map>
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/libminifi/test/unit/Tests.cpp
----------------------------------------------------------------------
diff --git a/libminifi/test/unit/Tests.cpp b/libminifi/test/unit/Tests.cpp
index 291fc2f..705665d 100644
--- a/libminifi/test/unit/Tests.cpp
+++ b/libminifi/test/unit/Tests.cpp
@@ -16,7 +16,6 @@
* limitations under the License.
*/
-#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include "utils/TimeUtil.h"
#include "../TestBase.h"
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/libminifi/test/unit/ThreadPoolTests.cpp
----------------------------------------------------------------------
diff --git a/libminifi/test/unit/ThreadPoolTests.cpp b/libminifi/test/unit/ThreadPoolTests.cpp
index 587fb9b..0436f05 100644
--- a/libminifi/test/unit/ThreadPoolTests.cpp
+++ b/libminifi/test/unit/ThreadPoolTests.cpp
@@ -16,7 +16,6 @@
* limitations under the License.
*/
-#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include <utility>
#include <future>
#include <memory>
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/583b2f62/libminifi/test/unit/YamlConfigurationTests.cpp
----------------------------------------------------------------------
diff --git a/libminifi/test/unit/YamlConfigurationTests.cpp b/libminifi/test/unit/YamlConfigurationTests.cpp
index 5c50de1..2c78c7b 100644
--- a/libminifi/test/unit/YamlConfigurationTests.cpp
+++ b/libminifi/test/unit/YamlConfigurationTests.cpp
@@ -16,7 +16,6 @@
* limitations under the License.
*/
-#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include <map>
#include <memory>
#include <string>