Skip to content
Snippets Groups Projects
Commit bf4b6a40 authored by Jonas Blatt's avatar Jonas Blatt :ant:
Browse files

Merge branch '#3' into feat/dmnapp

parents af64ff05 3030d6f9
No related branches found
No related tags found
No related merge requests found
...@@ -35,25 +35,6 @@ ...@@ -35,25 +35,6 @@
<artifactId>jwi</artifactId> <artifactId>jwi</artifactId>
<version>2.2.3</version> <version>2.2.3</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core -->
<dependency>
<artifactId>jackson-core</artifactId>
<groupId>com.fasterxml.jackson.core</groupId>
<version>2.10.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
<dependency>
<artifactId>jackson-databind</artifactId>
<groupId>com.fasterxml.jackson.core</groupId>
<version>2.10.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations -->
<dependency>
<artifactId>jackson-annotations</artifactId>
<groupId>com.fasterxml.jackson.core</groupId>
<version>2.10.0</version>
</dependency>
<!-- Utils --> <!-- Utils -->
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
......
package de.unikoblenz.fgbks.core.dmn.verification.metrics; package de.unikoblenz.fgbks.core.dmn.verification.metrics;
import com.fasterxml.jackson.annotation.JsonProperty;
import de.unikoblenz.fgbks.core.dmn.verification.verifier.types.VerificationType; import de.unikoblenz.fgbks.core.dmn.verification.verifier.types.VerificationType;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import javax.json.bind.annotation.JsonbProperty;
/** /**
* A metric instance give statistics about the execution of one verifier {@link VerificationType}). * A metric instance give statistics about the execution of one verifier {@link VerificationType}).
...@@ -29,7 +29,7 @@ public class Metric implements Serializable { ...@@ -29,7 +29,7 @@ public class Metric implements Serializable {
* *
* @return the number of executions * @return the number of executions
*/ */
@JsonProperty("amountOfExecutions") @JsonbProperty("amountOfExecutions")
public int getAmountOfExecutions() { public int getAmountOfExecutions() {
return executionTimes.size(); return executionTimes.size();
} }
...@@ -39,7 +39,7 @@ public class Metric implements Serializable { ...@@ -39,7 +39,7 @@ public class Metric implements Serializable {
* *
* @return the average execution time * @return the average execution time
*/ */
@JsonProperty("averageExecutionTime") @JsonbProperty("averageExecutionTime")
public double getAverageExecutionTime() { public double getAverageExecutionTime() {
return executionTimes.stream().mapToLong(Long::longValue).average().orElseGet(() -> 0); return executionTimes.stream().mapToLong(Long::longValue).average().orElseGet(() -> 0);
} }
...@@ -49,14 +49,14 @@ public class Metric implements Serializable { ...@@ -49,14 +49,14 @@ public class Metric implements Serializable {
* *
* @return the average execution time * @return the average execution time
*/ */
@JsonProperty("averageExecutionTimeInMs") @JsonbProperty("averageExecutionTimeInMs")
public double getAverageExecutionTimeInMs() { public double getAverageExecutionTimeInMs() {
return executionTimes.stream().mapToLong(Long::longValue).average().orElseGet(() -> 0) return executionTimes.stream().mapToLong(Long::longValue).average().orElseGet(() -> 0)
/ NANO_SECONDS_PER_SECOND; / NANO_SECONDS_PER_SECOND;
} }
/** Get the total execution time in ns. */ /** Get the total execution time in ns. */
@JsonProperty("totalExecutionTime") @JsonbProperty("totalExecutionTime")
public long getTotalExecutionTime() { public long getTotalExecutionTime() {
return executionTimes.stream().mapToLong(Long::longValue).sum(); return executionTimes.stream().mapToLong(Long::longValue).sum();
} }
...@@ -66,7 +66,7 @@ public class Metric implements Serializable { ...@@ -66,7 +66,7 @@ public class Metric implements Serializable {
* *
* @return the {@link VerificationType} * @return the {@link VerificationType}
*/ */
@JsonProperty("type") @JsonbProperty("type")
public VerificationType getType() { public VerificationType getType() {
return type; return type;
} }
...@@ -74,9 +74,9 @@ public class Metric implements Serializable { ...@@ -74,9 +74,9 @@ public class Metric implements Serializable {
/** /**
* Get the total execution time in ms. * Get the total execution time in ms.
* *
* @return * @return the execution time in ms
*/ */
@JsonProperty("totalExecutionTimeInMs") @JsonbProperty("totalExecutionTimeInMs")
public long getTotalExecutionTimeInMs() { public long getTotalExecutionTimeInMs() {
return executionTimes.stream().mapToLong(Long::longValue).sum() / NANO_SECONDS_PER_SECOND; return executionTimes.stream().mapToLong(Long::longValue).sum() / NANO_SECONDS_PER_SECOND;
} }
......
package de.unikoblenz.fgbks.core.dmn.verification.metrics; package de.unikoblenz.fgbks.core.dmn.verification.metrics;
import com.fasterxml.jackson.annotation.JsonProperty;
import de.unikoblenz.fgbks.core.dmn.verification.verifier.types.VerificationType; import de.unikoblenz.fgbks.core.dmn.verification.verifier.types.VerificationType;
import java.io.Serializable; import java.io.Serializable;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import javax.json.bind.annotation.JsonbProperty;
import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.Validate;
/** /**
...@@ -19,7 +19,7 @@ public class MetricSet implements Serializable { ...@@ -19,7 +19,7 @@ public class MetricSet implements Serializable {
* *
* @return the set of {@link Metric}s * @return the set of {@link Metric}s
*/ */
@JsonProperty("verificationMetrics") @JsonbProperty("verificationMetrics")
public Set<Metric> getMetrics() { public Set<Metric> getMetrics() {
return new HashSet<>(metrics); return new HashSet<>(metrics);
} }
......
...@@ -8,11 +8,11 @@ import static de.unikoblenz.fgbks.core.dmn.verification.result.actions.Action.AC ...@@ -8,11 +8,11 @@ import static de.unikoblenz.fgbks.core.dmn.verification.result.actions.Action.AC
import static de.unikoblenz.fgbks.core.dmn.verification.result.actions.Action.ACTION_SHOW_OUTPUT_ENTRIES; import static de.unikoblenz.fgbks.core.dmn.verification.result.actions.Action.ACTION_SHOW_OUTPUT_ENTRIES;
import static de.unikoblenz.fgbks.core.dmn.verification.result.actions.Action.ACTION_SHOW_RULES; import static de.unikoblenz.fgbks.core.dmn.verification.result.actions.Action.ACTION_SHOW_RULES;
import com.fasterxml.jackson.annotation.JsonProperty;
import de.unikoblenz.fgbks.base.builder.DefaultBuilder; import de.unikoblenz.fgbks.base.builder.DefaultBuilder;
import de.unikoblenz.fgbks.base.domain.Name; import de.unikoblenz.fgbks.base.domain.Name;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import javax.json.bind.annotation.JsonbProperty;
import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.Validate;
public class VerificationFix { public class VerificationFix {
...@@ -69,12 +69,12 @@ public class VerificationFix { ...@@ -69,12 +69,12 @@ public class VerificationFix {
private Name fixName; private Name fixName;
private List<Action> actions; private List<Action> actions;
@JsonProperty("fixName") @JsonbProperty("fixName")
public Name getFixName() { public Name getFixName() {
return fixName; return fixName;
} }
@JsonProperty("actions") @JsonbProperty("actions")
public List<Action> getActions() { public List<Action> getActions() {
return actions; return actions;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment