Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

I have two test files (lets say they're SomethingTestA and SomethingTestB).

Inside SomethingTestA, I have a bunch of mini smoke tests methods, like so

@Test
public void testCreate() {
    ...
}

@Test (dependsOnMethods = {"testCreate"})
public void doSomethingA() {
    ...
}

@Test (dependsOnMethods = {"testCreate"})
public void doSomethingB() {
    ...
}

@Test
public void doSomethingC() {
    ...
}

I have two problem:

1) I get the error: doSomethingA() is depending on method public void testCreate(), which is not annotated with @Test or not included. This happens for all three doSomething()

Now, the second problem is with SomethingTestB()

@Test
public void aTest() {
    System.out.println("Hello"); 
}

@Test
public void anotherTest() {
    ...
}

2) Whenever I try to run or debug a test method in SomethingTestB, if the test fails, eclipse automatically runs the entire SomethingTestA class after running SomethingTestB.

If I comment out the @Test for testCreate() in SomethingTestA, I get the "depending on method public... error" because it runs SomethingTestA automatically.

This only happens with SomethingTestA class, and I'm not sure why. Has this happened to anyone - if so, how did you fix it?

share|improve this question
    
You may need to include the entire class in your xml as described here: groups.google.com/forum/#!topic/testng-users/ciy1C9Bt9FY –  Sam Woods Jun 30 at 17:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.