BAEL-3236 Determine the execution time of JUnit Tests (#7985)

* BAEL3236 Execution time Junit

* BAEL3236 Execution time Junit

* BAEL3236 Added more test cases

* BAEL3236 Added more test cases

* BAEL3236 Renaming to integration test

* BAEL3236 Temporary enabling

* BAEL3236 Reverting Integration tests

* BAEL3236 Refactoring TCs

* BAEL3236 Refactoring TCs

* BAEL3236 Removing now unused spring and http client deps

* BAEL3236 Fixing test cases and updating the missed version in pom.xml

* BAEL3236 throwing Exception in TCs
This commit is contained in:
dev-chirag 2019-11-14 03:06:39 +05:30 committed by ashleyfrieze
parent b46dc7a07b
commit 0451f008be
2 changed files with 44 additions and 1 deletions

View File

@ -124,9 +124,13 @@
<mainClass>com.baeldung.TestLauncher</mainClass> <mainClass>com.baeldung.TestLauncher</mainClass>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>${surefire.report.plugin}</version>
</plugin>
</plugins> </plugins>
</build> </build>
<properties> <properties>
<junit.jupiter.version>5.4.2</junit.jupiter.version> <junit.jupiter.version>5.4.2</junit.jupiter.version>
<mockito.junit.jupiter.version>2.23.0</mockito.junit.jupiter.version> <mockito.junit.jupiter.version>2.23.0</mockito.junit.jupiter.version>
@ -137,6 +141,7 @@
<maven-surefire-plugin.version>2.22.0</maven-surefire-plugin.version> <maven-surefire-plugin.version>2.22.0</maven-surefire-plugin.version>
<exec-maven-plugin.version>1.6.0</exec-maven-plugin.version> <exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
<spring.version>5.0.1.RELEASE</spring.version> <spring.version>5.0.1.RELEASE</spring.version>
<surefire.report.plugin>3.0.0-M3</surefire.report.plugin>
</properties> </properties>
</project> </project>

View File

@ -0,0 +1,38 @@
package com.baeldung.execution.time;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertTrue;
class SampleExecutionTimeUnitTest {
@Test
void someUnitTest() {
assertTrue(doSomething());
}
// @Test
// void someIntegrationTest() throws Exception {
//
// //simulate an operation that may take 5 seconds
// Thread.sleep(5000);
//
// assertTrue(doSomething());
// }
//
// @Test
// void someEndToEndTest() throws Exception {
//
// //simulate an operation that may take 10 seconds
// Thread.sleep(10000);
//
// assertTrue(doSomething());
//
// }
private boolean doSomething() {
return true;
}
}