Results 1 to 3 of 3
  1. #1
    jolin is offline Member
    Join Date
    Sep 2010
    Posts
    1
    Rep Power
    0

    Default Unit test need to run on different enviorment

    I have some test method which need to run on different enviorment. Such as testmethod1 need to access web service. testmethod2 need to run on local software published interface and so on, I want to automatically check which is available to choose corresponding test run? anyone have good idea.

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,651
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by jolin View Post
    I have some test method which need to run on different enviorment. Such as testmethod1 need to access web service. testmethod2 need to run on local software published interface and so on, I want to automatically check which is available to choose corresponding test run? anyone have good idea.
    Start by looking whether or not those classes are present: Class.forName( ... ) can help you.

    kind regards,

    Jos

  3. #3
    wellgoing is offline Member
    Join Date
    Sep 2010
    Posts
    2
    Rep Power
    0

    Default

    I think Use Junit runner can help you..

    You need implement your own runner, when the runner invoke your testmethod, it should check your enviorment to see it's available to run current test case, if not just ignore this test, if it's ok just continue.

    in addition, if required you can check out Customer Junit Runner Implemention and Junit tutorial and example there maybe usefull for you Junit Runner learning or implemention

Similar Threads

  1. XML to JSP Unit Testing
    By Abder-Rahman in forum Advanced Java
    Replies: 2
    Last Post: 02-15-2009, 12:35 AM
  2. Replies: 0
    Last Post: 04-05-2008, 12:38 AM
  3. p-unit 0.12
    By Jamie in forum Java Software
    Replies: 0
    Last Post: 06-16-2007, 09:33 AM
  4. p-unit 0.11
    By levent in forum Java Software
    Replies: 0
    Last Post: 06-04-2007, 08:07 AM
  5. p-unit 0.10-release
    By levent in forum Java Software
    Replies: 0
    Last Post: 05-28-2007, 08:23 AM

Posting Permissions

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