i want to know that if "MethodOrderer" class is available in JUnit5 Library FOR ECLIPSE or not, because i am unable to find it. If not, how can i shift jupiter.api_5.3.1 to jupiter.api_5.4.2 in eclipse JUnit5 library?
Will be thankful to see your reply.
I downloaded JUnit5 jar file from "https://search.maven.org/artifact/name.remal.tools.test/junit5/1.26.97/jar" and this jar does have "MethodOrderer" class but when i add this to project dependency and run the testclass, eclipse shows up this error "No tests found with test runner 'JUnit5'."
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
class JunitCalculatorV4 {
@BeforeAll
static void setUpBeforeClass() throws Exception {
System.out.println("Before All");
}
@AfterAll
static void tearDownAfterClass() throws Exception {
System.out.println("After All");
}
@Test
@Order(1)
void addTest() {
System.out.println("Add test");
}
@Test
@Order(2)
void divideTest() {
System.out.println("Divide Test");
}
}
Actually this annotation @TestMethodOrder(MethodOrderer.OrderAnnotation.class) is from jupiter.api_5.4.2 which i added as an external jar, and that might be causing conflict with the existing JUnit5 library.
My problem would be solved if the JUnit5 library is updated as a whole, or atleast the jarfile inside the library is updated.
Aucun commentaire:
Enregistrer un commentaire