-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
123 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
core/src/main/kotlin/org/evomaster/core/problem/enterprise/service/EnterpriseModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.evomaster.core.problem.enterprise.service | ||
|
||
import com.google.inject.AbstractModule | ||
|
||
abstract class EnterpriseModule : AbstractModule() { | ||
|
||
override fun configure() { | ||
super.configure() | ||
|
||
bind(WFCReportWriter::class.java) | ||
.asEagerSingleton() | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
core/src/main/kotlin/org/evomaster/core/problem/enterprise/service/WFCReportWriter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package org.evomaster.core.problem.enterprise.service | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper | ||
import com.google.inject.Inject | ||
import com.webfuzzing.commons.report.Faults | ||
import com.webfuzzing.commons.report.RESTReport | ||
import org.evomaster.core.EMConfig | ||
import org.evomaster.core.search.Solution | ||
import java.nio.file.Files | ||
import java.nio.file.Paths | ||
import java.util.* | ||
|
||
class WFCReportWriter { | ||
|
||
|
||
@Inject | ||
private lateinit var config: EMConfig | ||
|
||
|
||
fun writeReport(solution: Solution<*>) { | ||
|
||
val report = com.webfuzzing.commons.report.Report() | ||
|
||
report.schemaVersion = "0.0.1" //TODO | ||
report.toolName = "EvoMaster" | ||
//TODO tool version | ||
report.creationTime = Date() // FIXME use new JDK dates | ||
|
||
if(config.problemType == EMConfig.ProblemType.REST) { | ||
val rest = RESTReport() | ||
report.restReport = rest | ||
|
||
val faults = Faults() | ||
rest.faults = faults | ||
|
||
faults.totalNumber = solution.totalNumberOfDetectedFaults() | ||
|
||
//TODO all other entries | ||
} | ||
//TODO other problem types | ||
|
||
val jackson = ObjectMapper() | ||
val json = jackson.writeValueAsString(report) | ||
|
||
val path = Paths.get(config.outputFolder, "report.json").toAbsolutePath() | ||
|
||
Files.createDirectories(path.parent) | ||
Files.deleteIfExists(path) | ||
Files.createFile(path) | ||
|
||
path.toFile().appendText(json) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters