diff --git a/src/functionalTest/java/co/com/bancolombia/PluginCleanFunctionalTest.java b/src/functionalTest/java/co/com/bancolombia/PluginCleanFunctionalTest.java index bda9d6a5..6dfcdd4f 100644 --- a/src/functionalTest/java/co/com/bancolombia/PluginCleanFunctionalTest.java +++ b/src/functionalTest/java/co/com/bancolombia/PluginCleanFunctionalTest.java @@ -1401,6 +1401,21 @@ public void shouldGenerateJarWithSpecificName() { .exists()); } + @Test + public void canRunTaskGeneratePerformanceTest() { + canRunTaskGenerateStructureWithOutParameters(); + String task = "generatePerformanceTest"; + String valuePerformanceType = "JMETER"; + + runner.withArguments(task, TYPE + valuePerformanceType); + runner.withProjectDir(projectDir); + BuildResult result = runner.build(); + + assertTrue(new File("build/functionalTest/performance-test/README.md").exists()); + + assertEquals(result.task(":" + task).getOutcome(), TaskOutcome.SUCCESS); + } + private void writeString(File file, String string) throws IOException { try (Writer writer = new FileWriter(file)) { writer.write(string); diff --git a/src/main/java/co/com/bancolombia/task/GeneratePerformanceTestTask.java b/src/main/java/co/com/bancolombia/task/GeneratePerformanceTestTask.java index 1a7878cb..60414fe8 100644 --- a/src/main/java/co/com/bancolombia/task/GeneratePerformanceTestTask.java +++ b/src/main/java/co/com/bancolombia/task/GeneratePerformanceTestTask.java @@ -28,6 +28,7 @@ public List getTypes() { @TaskAction public void generateAcceptanceTestTask() throws CleanException, IOException { + long start = System.currentTimeMillis(); if (type == null) { printHelp(); throw new IllegalArgumentException( @@ -40,5 +41,6 @@ public void generateAcceptanceTestTask() throws CleanException, IOException { moduleFactory.buildModule(builder); builder.persist(); + sendAnalytics(type.name(), System.currentTimeMillis() - start); } }