From a7f011315eeacbffca0981ce06cc5a0bcb199cde Mon Sep 17 00:00:00 2001 From: Fabrizio Cannizzo Date: Tue, 28 May 2024 15:51:06 +0100 Subject: [PATCH] running integr tests only manually for now --- .../iotics/nifi/services/Configuration.java | 12 +++- .../iotics/nifi/services/Iotics.java | 4 ++ nifi-iotics-processors/pom.xml | 60 ------------------- .../nifi/processors/IoticsDescriberIT.java | 0 .../nifi/processors/IoticsFinderIT.java | 0 .../nifi/processors/IoticsFollowerIT.java | 0 .../nifi/processors/IoticsJSONLDToTwinIT.java | 0 .../nifi/processors/IoticsJSONToTwinIT.java | 0 .../nifi/processors/IoticsPublisherIT.java | 0 .../nifi/processors/IoticsSPARQLQueryIT.java | 0 .../nifi/processors/tools/IoticsIT.java | 4 +- pom.xml | 5 -- 12 files changed, 17 insertions(+), 68 deletions(-) rename nifi-iotics-processors/src/{test => integration}/java/smartrics/iotics/nifi/processors/IoticsDescriberIT.java (100%) rename nifi-iotics-processors/src/{test => integration}/java/smartrics/iotics/nifi/processors/IoticsFinderIT.java (100%) rename nifi-iotics-processors/src/{test => integration}/java/smartrics/iotics/nifi/processors/IoticsFollowerIT.java (100%) rename nifi-iotics-processors/src/{test => integration}/java/smartrics/iotics/nifi/processors/IoticsJSONLDToTwinIT.java (100%) rename nifi-iotics-processors/src/{test => integration}/java/smartrics/iotics/nifi/processors/IoticsJSONToTwinIT.java (100%) rename nifi-iotics-processors/src/{test => integration}/java/smartrics/iotics/nifi/processors/IoticsPublisherIT.java (100%) rename nifi-iotics-processors/src/{test => integration}/java/smartrics/iotics/nifi/processors/IoticsSPARQLQueryIT.java (100%) rename nifi-iotics-processors/src/{test => integration}/java/smartrics/iotics/nifi/processors/tools/IoticsIT.java (94%) diff --git a/nifi-iotics-hostservice/src/main/java/smartrics/iotics/nifi/services/Configuration.java b/nifi-iotics-hostservice/src/main/java/smartrics/iotics/nifi/services/Configuration.java index cd9e6b6..c8a699c 100644 --- a/nifi-iotics-hostservice/src/main/java/smartrics/iotics/nifi/services/Configuration.java +++ b/nifi-iotics-hostservice/src/main/java/smartrics/iotics/nifi/services/Configuration.java @@ -12,6 +12,14 @@ public record Configuration(String seed, String userKey, String agentKey, Integer apiExecutorThreads, String idLibPath) { + private static final String DEFAULT_ID_LIB_PATH = "./lib"; + + public Configuration(String seed, String userKey, String agentKey, + String hostDNS, Integer tokenDuration, + Integer apiExecutorThreads) { + this(seed, userKey, agentKey, hostDNS, tokenDuration, apiExecutorThreads, Configuration.DEFAULT_ID_LIB_PATH); + } + public Configuration(Map conf) { this( conf.get(SEED.getName()), @@ -20,7 +28,7 @@ public Configuration(Map conf) { conf.get(HOST_DNS.getName()), Integer.parseInt(conf.get(TOKEN_DURATION.getName())), Integer.parseInt(Optional.ofNullable(conf.get(API_EXECUTOR_THREADS.getName())).orElse("16")), - conf.get(ID_LIB_PATH.getName()) + Optional.ofNullable(conf.get(ID_LIB_PATH.getName())).orElse(Configuration.DEFAULT_ID_LIB_PATH) ); } @@ -32,7 +40,7 @@ public Configuration(PropertyContext context) { context.getProperty(HOST_DNS).getValue(), context.getProperty(TOKEN_DURATION).asInteger(), context.getProperty(API_EXECUTOR_THREADS).asInteger(), - context.getProperty(ID_LIB_PATH).getValue() + Optional.ofNullable(context.getProperty(ID_LIB_PATH).getValue()).orElse(Configuration.DEFAULT_ID_LIB_PATH) ); } diff --git a/nifi-iotics-hostservice/src/main/java/smartrics/iotics/nifi/services/Iotics.java b/nifi-iotics-hostservice/src/main/java/smartrics/iotics/nifi/services/Iotics.java index dee5638..80fa04c 100644 --- a/nifi-iotics-hostservice/src/main/java/smartrics/iotics/nifi/services/Iotics.java +++ b/nifi-iotics-hostservice/src/main/java/smartrics/iotics/nifi/services/Iotics.java @@ -82,6 +82,10 @@ public Iotics build() { throw new IllegalArgumentException("invalid configuration: can't access host endpoints via hostDNS:" + configuration.hostDNS(), ioe); } } + if(ioticsFactory == null) { + ioticsFactory = new IoticsFactory() { + }; + } if (sim == null) { try { diff --git a/nifi-iotics-processors/pom.xml b/nifi-iotics-processors/pom.xml index 89bc79c..45fbc04 100644 --- a/nifi-iotics-processors/pom.xml +++ b/nifi-iotics-processors/pom.xml @@ -79,64 +79,4 @@ ${iotics4j.version} - - - - - - org.apache.maven.plugins - maven-surefire-plugin - ${maven-test-plugins.version} - - - **/*Test.java - - - - - - - org.apache.maven.plugins - maven-failsafe-plugin - ${maven-test-plugins.version} - - - integration-test - integration-test - - integration-test - - - - verify - verify - - verify - - - - - - - - - - integration - - - - org.apache.maven.plugins - maven-failsafe-plugin - ${maven-test-plugins.version} - - - **/*IT.java - - - - - - - - diff --git a/nifi-iotics-processors/src/test/java/smartrics/iotics/nifi/processors/IoticsDescriberIT.java b/nifi-iotics-processors/src/integration/java/smartrics/iotics/nifi/processors/IoticsDescriberIT.java similarity index 100% rename from nifi-iotics-processors/src/test/java/smartrics/iotics/nifi/processors/IoticsDescriberIT.java rename to nifi-iotics-processors/src/integration/java/smartrics/iotics/nifi/processors/IoticsDescriberIT.java diff --git a/nifi-iotics-processors/src/test/java/smartrics/iotics/nifi/processors/IoticsFinderIT.java b/nifi-iotics-processors/src/integration/java/smartrics/iotics/nifi/processors/IoticsFinderIT.java similarity index 100% rename from nifi-iotics-processors/src/test/java/smartrics/iotics/nifi/processors/IoticsFinderIT.java rename to nifi-iotics-processors/src/integration/java/smartrics/iotics/nifi/processors/IoticsFinderIT.java diff --git a/nifi-iotics-processors/src/test/java/smartrics/iotics/nifi/processors/IoticsFollowerIT.java b/nifi-iotics-processors/src/integration/java/smartrics/iotics/nifi/processors/IoticsFollowerIT.java similarity index 100% rename from nifi-iotics-processors/src/test/java/smartrics/iotics/nifi/processors/IoticsFollowerIT.java rename to nifi-iotics-processors/src/integration/java/smartrics/iotics/nifi/processors/IoticsFollowerIT.java diff --git a/nifi-iotics-processors/src/test/java/smartrics/iotics/nifi/processors/IoticsJSONLDToTwinIT.java b/nifi-iotics-processors/src/integration/java/smartrics/iotics/nifi/processors/IoticsJSONLDToTwinIT.java similarity index 100% rename from nifi-iotics-processors/src/test/java/smartrics/iotics/nifi/processors/IoticsJSONLDToTwinIT.java rename to nifi-iotics-processors/src/integration/java/smartrics/iotics/nifi/processors/IoticsJSONLDToTwinIT.java diff --git a/nifi-iotics-processors/src/test/java/smartrics/iotics/nifi/processors/IoticsJSONToTwinIT.java b/nifi-iotics-processors/src/integration/java/smartrics/iotics/nifi/processors/IoticsJSONToTwinIT.java similarity index 100% rename from nifi-iotics-processors/src/test/java/smartrics/iotics/nifi/processors/IoticsJSONToTwinIT.java rename to nifi-iotics-processors/src/integration/java/smartrics/iotics/nifi/processors/IoticsJSONToTwinIT.java diff --git a/nifi-iotics-processors/src/test/java/smartrics/iotics/nifi/processors/IoticsPublisherIT.java b/nifi-iotics-processors/src/integration/java/smartrics/iotics/nifi/processors/IoticsPublisherIT.java similarity index 100% rename from nifi-iotics-processors/src/test/java/smartrics/iotics/nifi/processors/IoticsPublisherIT.java rename to nifi-iotics-processors/src/integration/java/smartrics/iotics/nifi/processors/IoticsPublisherIT.java diff --git a/nifi-iotics-processors/src/test/java/smartrics/iotics/nifi/processors/IoticsSPARQLQueryIT.java b/nifi-iotics-processors/src/integration/java/smartrics/iotics/nifi/processors/IoticsSPARQLQueryIT.java similarity index 100% rename from nifi-iotics-processors/src/test/java/smartrics/iotics/nifi/processors/IoticsSPARQLQueryIT.java rename to nifi-iotics-processors/src/integration/java/smartrics/iotics/nifi/processors/IoticsSPARQLQueryIT.java diff --git a/nifi-iotics-processors/src/test/java/smartrics/iotics/nifi/processors/tools/IoticsIT.java b/nifi-iotics-processors/src/integration/java/smartrics/iotics/nifi/processors/tools/IoticsIT.java similarity index 94% rename from nifi-iotics-processors/src/test/java/smartrics/iotics/nifi/processors/tools/IoticsIT.java rename to nifi-iotics-processors/src/integration/java/smartrics/iotics/nifi/processors/tools/IoticsIT.java index e132e39..95ee309 100644 --- a/nifi-iotics-processors/src/test/java/smartrics/iotics/nifi/processors/tools/IoticsIT.java +++ b/nifi-iotics-processors/src/integration/java/smartrics/iotics/nifi/processors/tools/IoticsIT.java @@ -40,7 +40,9 @@ private static Configuration newConfiguration(int tokenDuration) throws IOExcept @Test void validToken() throws Exception { - Iotics iotics = Iotics.Builder.newBuilder().withConfiguration(newConfiguration(3)).build(); + Iotics iotics = Iotics.Builder.newBuilder() + .withConfiguration(newConfiguration(3)) + .build(); for(int i = 0; i < 10; i++) { Thread.sleep(1000); System.out.println("Iteration " + i); diff --git a/pom.xml b/pom.xml index 51e9e15..b66c2ad 100644 --- a/pom.xml +++ b/pom.xml @@ -99,11 +99,6 @@ true - - org.apache.maven.plugins - maven-failsafe-plugin - 3.2.5 -