Junit suite are running, also when running a test directly

test-tag

(shay fdna) #1

Hello all
i have lots of tests and lots of suits. and some times i just want to run a simple test.
but i can’t, since running a single test is running all my suites, and i have lots of them.

can you help me please

public class SomeTest {
    @Test
    public void test() {
        System.out.println("SomeTest.test --");
    }
}

@RunWith(Suite.class)
@Suite.SuiteClasses({SomeTest.class})
public class SomeSuit1 {} 

@RunWith(Suite.class)
@Suite.SuiteClasses({SomeTest.class})
public class SomeSuit2 {}

while running the single test will run is 3 times. as the number of the suites plus one

shay$ gradle test --tests com.mycompany.test.SomeTest
    Starting a Gradle Daemon, 2 busy Daemons could not be reused, use --status for details
    :compileAspect UP-TO-DATE
    :compileJava UP-TO-DATE
    :processResources UP-TO-DATE
    :classes UP-TO-DATE
    :compileTestAspect
    :compileTestJava
    :processTestResources UP-TO-DATE
    :testClasses
    :test
    Done cleaning report folder [reports]

    com.mycompany.test.SomeSuit1 > com.mycompany.test.SomeTest.test STANDARD_OUT
    SomeTest.test --

    com.mycompany.test.SomeSuit2 > com.mycompany.test.SomeTest.test STANDARD_OUT
    SomeTest.test --

    com.mycompany.test.SomeTest > test STANDARD_OUT
    SomeTest.test --

    BUILD SUCCESSFUL

    Total time: 20.219 secs

can you help me please.