Jenkins doesn't see my @Test

I got this wrote in my code.
@Test

  • public void main()*

but jenkins doesn’t see my @Test.But tell my that the build success.
*[INFO] *— maven-surefire-plugin:3.0.0-M4:test (default-test) @ tasl1
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.792 s
[INFO] Finished at: 2021-11-16T20:41:03+03:00
[INFO] ------------------------------------------------------------------------
What have i done wrong.
I would like to something like this.


Can someone please help me solve this?

  1. Jenkins itself doesn’t run your tests, in this case it looks like jenkins is running maven, and maven is running your tests
  2. Everything else depends on … well things
  • What testing framework are you using? I assume junit with @Test but want to confirm
  • What version of testing framework
  • Whats the path to your file, I’m pretty sure tests need to be in src/test but depends on your project setup
  1. Why Your JUnit 5 Tests Are Not Running Under Maven - DZone Java seems to have info?
  1. i am using junit
  2. 4.13
  3. JUNUT plugin work correctly.and result is located **/target/report/result.xml

I try do some things from link below,but id doesn’t help.

junit plugin is for after the tests run. If your saying the tests don’t run its a junit/maven thing.

do you have the full source of the test file public at all?

I can’t run it because its pretty hard coded to windows, but I think you have the wrong annotation

Looking at JUnit Annotations Tutorial with Example: What is @Test and @After vs test2/BringItOn.java at 38ab0f2505b2c22ebec73bf0131d5010dc3785d5 · KirillPochta/test2 · GitHub I think you want import org.junit.Test instead of the jupiter version (and you have jupiter in pom which I don’t think is needed).

Also I’m not a java expert, but isn’t package mandatory?

Yeah.jupiter package is useless here,i just tried to do something with those package.
I dont think is problem with annotations,because i do the same thing in other project. and there all work correctly

so test2 doesn’t exist anymore. I downloaded test1 and replaced it with the following because I don’t have webdriver

cat src/test/java/ManualTest.java
import org.junit.Test;
import static org.junit.Assert.assertEquals;

public class ManualTest {
    @Test
    public void main() throws InterruptedException {
        assertEquals(1,1);
    }
}

mvn test runs fine.

if you restore test2, I can take a deeper look now that I’m not working

nevermind,i fix this something,thx gor helping.