Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 35

Thread: Junit4

  1. #21
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,424

    Default

    Hmm strange. I could only assume it's either not working, or for some reason it's blocking your address (I wouldn't know why though). I'll try posting later as a test.

  2. #22
    Join Date
    Feb 2007
    Posts
    5

    Default

    Ok, thanks. I think the list is blocking my address for some reason.

  3. #23
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,424

    Default

    I've just sent an email no problems. I sent mine to springframework-user@lists.sourceforge.net.

  4. #24

    Default

    We are starting to use http://unitils.sourceforge.net/spring_article.html
    this supports JUnit4 and TestNG with Spring, plus provides support a whole host of other things including DBUnit

  5. #25
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,424

    Default

    Thanks for the link! It's always nice to hear about new and potentially useful projects.

  6. #26
    Join Date
    Apr 2007
    Posts
    2

    Default Workaround

    Workaround:

    @RunWith( TestClassRunner.class )
    public abstract class BaseTransactionalTest extends AbstractTransactionalSpringContextTests {

    @Before
    public void before() throws Exception{
    setUp();
    }

    @After
    public void after() throws Exception{
    tearDown();
    }

    @Override
    protected String[] getConfigLocations() {
    return new String[]
    {
    // .....................
    };
    }

    }

    All your integration test classes should extend this class.

  7. #27
    Join Date
    May 2007
    Location
    Monrovia, CA
    Posts
    5

    Default

    This is a great workaround.

    One thing I had to deal with -- mvn test complains that there are no tests to run in BaseTransactionalTest. The workaround I applied immediately was to add a do-nothing test to the base class. But I can't say I really like that.

    Do you just keep this class outside of the Test hierarchy to avoid that?

    Mojo

    --
    Morris Jones
    Monrovia, CA
    Shopzilla.com
    http://www.whiteoaks.com

  8. #28
    Join Date
    Apr 2007
    Posts
    2

    Default

    Actually I'm using ant and exclude this class explicitly from the list of tests.

  9. #29
    Join Date
    Sep 2004
    Location
    London
    Posts
    311

    Default

    Hello,
    not sure if this is in the context of your original topic, but at the moment i am testing my app using TestNG and Spring, using testNG annotations to tag my tests and so on..
    found an interesting article here if it might help you

    http://www.thearcmind.com/confluence...egration+tests

    i m loading context files using classpath:

    hth
    marco

  10. #30
    Join Date
    Jan 2006
    Location
    Zürich, Switzerland
    Posts
    423

    Default Introducing the "Spring TestContext Framework"

    Hi everybody,

    In Spring 2.1 M4 we are introducing the new "Spring TestContext Framework"
    which provides annotation-driven unit and integration testing support that
    is agnostic of the actual testing framework in use. The same techniques and
    annotation-based configuration used in, for example, a JUnit 3.8 environment
    can also be applied to tests written with JUnit 4.4, TestNG, etc.

    In addition to providing generic and extensible testing infrastructure, the
    Spring TestContext Framework provides out-of-the-box support for Spring-specific
    integration testing functionality such as context management and caching,
    dependency injection of test fixtures, and transactional test management with
    default rollback semantics.

    To discover how this new testing support can assist you with writing unit and
    integration tests, consult the "Spring TestContext Framework" section of the
    revised testing chapter in the Spring reference manual.

    I encourage everyone to take a look at the examples and give the new testing
    support a try with either JUnit 3.8 or JUnit 4.4. Let me know if you run
    into any issues or have any ideas for improvement.

    Thanks,

    Sam

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •