You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ad...@apache.org on 2025/06/30 07:11:30 UTC
(nifi-minifi-cpp) 24/25: Windows proc update
This is an automated email from the ASF dual-hosted git repository.
adebreceni pushed a commit to branch minifi-api-reduced
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git
commit 17d31feea97c445a32d4ebb08e9cba37bf36a453
Author: Adam Debreceni <ad...@apache.org>
AuthorDate: Tue Jun 24 15:14:38 2025 +0200
Windows proc update
---
extensions/smb/tests/FetchSmbTests.cpp | 5 +++--
extensions/smb/tests/ListAndFetchSmbTests.cpp | 8 ++++----
extensions/smb/tests/ListSmbTests.cpp | 3 ++-
extensions/smb/tests/PutSmbTests.cpp | 7 ++++---
4 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/extensions/smb/tests/FetchSmbTests.cpp b/extensions/smb/tests/FetchSmbTests.cpp
index 0fe708167..921b92341 100644
--- a/extensions/smb/tests/FetchSmbTests.cpp
+++ b/extensions/smb/tests/FetchSmbTests.cpp
@@ -24,13 +24,14 @@
#include "unit/SingleProcessorTestController.h"
#include "utils/OsUtils.h"
#include "core/Resource.h"
+#include "unit/ProcessorUtils.h"
namespace org::apache::nifi::minifi::extensions::smb::test {
REGISTER_RESOURCE(MockSmbConnectionControllerService, ControllerService);
TEST_CASE("FetchSmb invalid network path") {
- minifi::test::SingleProcessorTestController controller{std::make_unique<FetchSmb>("FetchSmb")};
+ minifi::test::SingleProcessorTestController controller{minifi::test::utils::make_processor<FetchSmb>("FetchSmb")};
const auto fetch_smb = controller.getProcessor();
auto smb_connection_node = controller.plan->addController("MockSmbConnectionControllerService", "smb_connection_controller_service");
REQUIRE(controller.plan->setProperty(smb_connection_node, SmbConnectionControllerService::Hostname, utils::OsUtils::getHostName().value_or("localhost")));
@@ -43,7 +44,7 @@ TEST_CASE("FetchSmb invalid network path") {
}
TEST_CASE("FetchSmb tests") {
- minifi::test::SingleProcessorTestController controller{std::make_unique<FetchSmb>("FetchSmb")};
+ minifi::test::SingleProcessorTestController controller{minifi::test::utils::make_processor<FetchSmb>("FetchSmb")};
const auto fetch_smb = controller.getProcessor();
auto smb_connection_node = controller.plan->addController("MockSmbConnectionControllerService", "smb_connection_controller_service");
diff --git a/extensions/smb/tests/ListAndFetchSmbTests.cpp b/extensions/smb/tests/ListAndFetchSmbTests.cpp
index ee820c9e7..d413ece1b 100644
--- a/extensions/smb/tests/ListAndFetchSmbTests.cpp
+++ b/extensions/smb/tests/ListAndFetchSmbTests.cpp
@@ -33,10 +33,10 @@ using minifi::processors::ReadFromFlowFileTestProcessor;
TEST_CASE("ListSmb and FetchSmb work together") {
TestController controller;
auto plan = controller.createPlan();
- auto list_smb = dynamic_cast<ListSmb*>(plan->addProcessor("ListSmb", "list_smb"));
- auto fetch_smb = dynamic_cast<FetchSmb*>(plan->addProcessor("FetchSmb", "fetch_smb"));
- auto read_from_success_relationship = dynamic_cast<ReadFromFlowFileTestProcessor*>(plan->addProcessor("ReadFromFlowFileTestProcessor", "read_from_success_relationship"));
- auto read_from_failure_relationship = dynamic_cast<ReadFromFlowFileTestProcessor*>(plan->addProcessor("ReadFromFlowFileTestProcessor", "read_from_failure_relationship"));
+ auto list_smb = plan->addProcessor<ListSmb>("list_smb");
+ auto fetch_smb = plan->addProcessor<ListSmb>("fetch_smb");
+ auto read_from_success_relationship = plan->addProcessor<ReadFromFlowFileTestProcessor>("read_from_success_relationship");
+ auto read_from_failure_relationship = plan->addProcessor<ReadFromFlowFileTestProcessor>("read_from_failure_relationship");
plan->addConnection(list_smb, ListSmb::Success, fetch_smb);
diff --git a/extensions/smb/tests/ListSmbTests.cpp b/extensions/smb/tests/ListSmbTests.cpp
index 15120d029..d7b197831 100644
--- a/extensions/smb/tests/ListSmbTests.cpp
+++ b/extensions/smb/tests/ListSmbTests.cpp
@@ -25,13 +25,14 @@
#include "range/v3/algorithm/count_if.hpp"
#include "range/v3/algorithm/find_if.hpp"
#include "core/Resource.h"
+#include "unit/ProcessorUtils.h"
namespace org::apache::nifi::minifi::extensions::smb::test {
REGISTER_RESOURCE(MockSmbConnectionControllerService, ControllerService);
TEST_CASE("ListSmb invalid network path") {
- minifi::test::SingleProcessorTestController controller{std::make_unique<ListSmb>("ListSmb")};
+ minifi::test::SingleProcessorTestController controller{minifi::test::utils::make_processor<ListSmb>("ListSmb")};
const auto list_smb = controller.getProcessor();
auto smb_connection_node = controller.plan->addController("MockSmbConnectionControllerService", "smb_connection_controller_service");
REQUIRE(controller.plan->setProperty(smb_connection_node, SmbConnectionControllerService::Hostname, utils::OsUtils::getHostName().value_or("localhost")));
diff --git a/extensions/smb/tests/PutSmbTests.cpp b/extensions/smb/tests/PutSmbTests.cpp
index a60f99e43..1f86d83e2 100644
--- a/extensions/smb/tests/PutSmbTests.cpp
+++ b/extensions/smb/tests/PutSmbTests.cpp
@@ -23,6 +23,7 @@
#include "unit/SingleProcessorTestController.h"
#include "range/v3/algorithm/count_if.hpp"
#include "core/Resource.h"
+#include "unit/ProcessorUtils.h"
namespace org::apache::nifi::minifi::extensions::smb::test {
@@ -35,7 +36,7 @@ std::string checkFileContent(const std::filesystem::path& path) {
}
TEST_CASE("PutSmb invalid network path") {
- minifi::test::SingleProcessorTestController controller{std::make_unique<PutSmb>("PutSmb")};
+ minifi::test::SingleProcessorTestController controller{minifi::test::utils::make_processor<PutSmb>("PutSmb")};
const auto put_smb = controller.getProcessor();
auto smb_connection_node = controller.plan->addController("MockSmbConnectionControllerService", "smb_connection_controller_service");
REQUIRE(controller.plan->setProperty(smb_connection_node, SmbConnectionControllerService::Hostname, utils::OsUtils::getHostName().value_or("localhost")));
@@ -48,7 +49,7 @@ TEST_CASE("PutSmb invalid network path") {
}
TEST_CASE("PutSmb conflict resolution test") {
- minifi::test::SingleProcessorTestController controller{std::make_unique<PutSmb>("PutSmb")};
+ minifi::test::SingleProcessorTestController controller{minifi::test::utils::make_processor<PutSmb>("PutSmb")};
const auto put_smb = controller.getProcessor();
auto temp_directory = controller.createTempDirectory();
@@ -133,7 +134,7 @@ TEST_CASE("PutSmb conflict resolution test") {
}
TEST_CASE("PutSmb create missing dirs test") {
- minifi::test::SingleProcessorTestController controller{std::make_unique<PutSmb>("PutSmb")};
+ minifi::test::SingleProcessorTestController controller{minifi::test::utils::make_processor<PutSmb>("PutSmb")};
const auto put_smb = controller.getProcessor();
auto temp_directory = controller.createTempDirectory();