Skip to content

Commit

Permalink
running integr tests only manually for now
Browse files Browse the repository at this point in the history
  • Loading branch information
smartrics committed May 28, 2024
1 parent 63ac84f commit a7f0113
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, String> conf) {
this(
conf.get(SEED.getName()),
Expand All @@ -20,7 +28,7 @@ public Configuration(Map<String, String> 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)
);
}

Expand All @@ -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)
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
60 changes: 0 additions & 60 deletions nifi-iotics-processors/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,64 +79,4 @@
<version>${iotics4j.version}</version>
</dependency>
</dependencies>

<build>
<plugins>
<!-- Surefire Plugin for Unit Tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-test-plugins.version}</version>
<configuration>
<includes>
<include>**/*Test.java</include>
</includes>
</configuration>
</plugin>

<!-- Failsafe Plugin for Integration Tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-test-plugins.version}</version>
<executions>
<execution>
<id>integration-test</id>
<phase>integration-test</phase>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
<execution>
<id>verify</id>
<phase>verify</phase>
<goals>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>integration</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-test-plugins.version}</version>
<configuration>
<includes>
<include>**/*IT.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 0 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,6 @@
<reuseForks>true</reuseForks>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.2.5</version>
</plugin>
</plugins>
</pluginManagement>
</build>
Expand Down

0 comments on commit a7f0113

Please sign in to comment.