Announcement Announcement Module
Collapse
No announcement yet.
Sprint-Test integration with JUnit Test Suite Problem Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Sprint-Test integration with JUnit Test Suite Problem

    Hi all,

    I can execute individual test case with succeed, but when I try to execute a suite of them I get the next exception:

    java.lang.Exception: class 'www.iasoft.es.sigad.academica.modelo.impl.PersonB LImplTest' (possibly indirectly) contains itself as a SuiteClass


    My code for a single test is:

    PersonBLImplTest.java

    public class PersonBLImplTest extends BaseTest {

    @Autowired protected PersonBLImpl personBLImpl;

    @Test
    public void savePerson() {
    log.warn("Empieza");
    Person person = new Person();
    person.setFirstname("");
    long actualizado = personBLImpl.savePerson(person);
    assert (actualizado > 0);
    }

    }


    My code for the suite is:

    BaseTest .java

    @RunWith(Suite.class)
    @ContextConfiguration(locations = {"classpath*:applicationContextTest.xml"} )
    @TransactionConfiguration(defaultRollback = true)
    @Transactional
    @SuiteClasses({
    PersonBLImplTest.class,
    PersonBLImplTest2.class
    })

    public class BaseTest extends TestCase {
    @Autowired protected Log log;
    }


    Anyone can help me??

  • #2
    The class PersonBLImplTest extending BaseTest inherits the test suite annotation so you are both adding it to a suite and calling it a suite. You will need to change your inheritance hierarchy to remedy this.

    Comment


    • #3
      Test Suites

      Originally posted by jasonparallel View Post
      The class PersonBLImplTest extending BaseTest inherits the test suite annotation so you are both adding it to a suite and calling it a suite. You will need to change your inheritance hierarchy to remedy this.

      Indeed you were right, I have created another class for launching the tests and base test class without suites and It works

      Comment


      • #4
        Originally posted by diosinhumano View Post
        Test Suites
        Indeed you were right, I have created another class for launching the tests and base test class without suites and It works
        Can you please copy-paste your solution?

        Comment


        • #5
          Thanx for sharing this nice post.I am really impresed from this and information also.

          Comment

          Working...
          X