Loading ...
Sorry, an error occurred while loading the content.

Re: [junit] Re: How to set a global counter for several test cases

Expand Messages
  • Teemu KanstrĂ©n
    Maybe have the Ant task produce the JUnit report file and parse that to get the count of failed tests? ... [Non-text portions of this message have been
    Message 1 of 6 , Jul 18, 2012
    View Source
    • 0 Attachment
      Maybe have the Ant task produce the JUnit report file and parse that to get
      the count of failed tests?

      On 17 July 2012 16:44, David Saff <saff@...> wrote:

      > Yang,
      >
      > Sorry for the late response.
      >
      > I regularly run all my tests in the same JVM. Depending on your use case,
      > it might be a fine trade-off. It should be easy enough to give it a try
      > and see if it seems to cause any problems.
      >
      > David Saff
      >
      >
      > On Fri, Jul 13, 2012 at 3:29 AM, yang8628 <feeyungv@...> wrote:
      >
      > > **
      > >
      > >
      > > David,
      > >
      > > Good approach. But I am not sure if I turn this as "once", what kind
      > > influence would bring? I realize the cost of re-create JVM but each JVM
      > > process for one test case seem like a recommended way.
      > >
      > > Thanks!
      > >
      > >
      > > --- In junit@yahoogroups.com, David Saff <saff@...> wrote:
      > > >
      > > > Yang,
      > > >
      > > > Can you get all your tests running in a single JVM by adjusting the
      > > > "forkmode" parameter to your junit task? (
      > > > http://ant.apache.org/manual/Tasks/junit.html)
      > > >
      > > > David Saff
      > > >
      > > >
      > > > On Thu, Jul 12, 2012 at 6:39 AM, yang8628 <feeyungv@...> wrote:
      > > >
      > > > > **
      > >
      > > > >
      > > > >
      > > > > Hello experts,
      > > > >
      > > > > I am working on a project having several Junit 4.10 test cases driven
      > > by
      > > > > Ant, requirement of adding detection of failed tests is brought up.
      > > > > Specifically, it require us to implement a global counter for all
      > > tests,
      > > > > the counter record the number of failure, once it exceed this limit
      > > number,
      > > > > do something.
      > > > >
      > > > > For example, we have Test case A, B; each has three tests. The whole
      > > test
      > > > > begin with Test A. Assume 2 tests of A failed, the counter is 2;
      > then B
      > > > > begin, 1 test of B failed. Eventually the counter is 3.
      > > > >
      > > > > But I did some experiments, seem like each test case will be running
      > > in a
      > > > > separate JVM process. It is quite tricky to share a counter between
      > two
      > > > > process.
      > > > >
      > > > > I look through the API, maybe this requirement can be done with
      > custom
      > > > > runner, though we do want change too much and continue to use Ant -
      > > Junit
      > > > > runner.
      > > > >
      > > > > Please give me some hints on this issue. Thanks in advance.
      > > > >
      > > > > --
      > > > > Regards.
      > > > >
      > > > > Yang
      > > > >
      > > > >
      > > > >
      > > >
      > > >
      > > > [Non-text portions of this message have been removed]
      > > >
      > >
      > >
      > >
      >
      >
      > [Non-text portions of this message have been removed]
      >
      >
      >
      > ------------------------------------
      >
      > Yahoo! Groups Links
      >
      >
      >
      >


      [Non-text portions of this message have been removed]
    • Yang Fei
      David, Thanks for your reply. I tired several methods, seem like it is better to solve outside of Junit tests. ... -- Regards. Yang [Non-text portions of this
      Message 2 of 6 , Jul 22, 2012
      View Source
      • 0 Attachment
        David,

        Thanks for your reply. I tired several methods, seem like it is better to
        solve outside of Junit tests.

        On Wed, Jul 18, 2012 at 4:44 AM, David Saff <saff@...> wrote:

        > Yang,
        >
        > Sorry for the late response.
        >
        > I regularly run all my tests in the same JVM. Depending on your use case,
        > it might be a fine trade-off. It should be easy enough to give it a try
        > and see if it seems to cause any problems.
        >
        > David Saff
        >
        >
        > On Fri, Jul 13, 2012 at 3:29 AM, yang8628 <feeyungv@...> wrote:
        >
        > > **
        > >
        > >
        > > David,
        > >
        > > Good approach. But I am not sure if I turn this as "once", what kind
        > > influence would bring? I realize the cost of re-create JVM but each JVM
        > > process for one test case seem like a recommended way.
        > >
        > > Thanks!
        > >
        > >
        > > --- In junit@yahoogroups.com, David Saff <saff@...> wrote:
        > > >
        > > > Yang,
        > > >
        > > > Can you get all your tests running in a single JVM by adjusting the
        > > > "forkmode" parameter to your junit task? (
        > > > http://ant.apache.org/manual/Tasks/junit.html)
        > > >
        > > > David Saff
        > > >
        > > >
        > > > On Thu, Jul 12, 2012 at 6:39 AM, yang8628 <feeyungv@...> wrote:
        > > >
        > > > > **
        > >
        > > > >
        > > > >
        > > > > Hello experts,
        > > > >
        > > > > I am working on a project having several Junit 4.10 test cases driven
        > > by
        > > > > Ant, requirement of adding detection of failed tests is brought up.
        > > > > Specifically, it require us to implement a global counter for all
        > > tests,
        > > > > the counter record the number of failure, once it exceed this limit
        > > number,
        > > > > do something.
        > > > >
        > > > > For example, we have Test case A, B; each has three tests. The whole
        > > test
        > > > > begin with Test A. Assume 2 tests of A failed, the counter is 2;
        > then B
        > > > > begin, 1 test of B failed. Eventually the counter is 3.
        > > > >
        > > > > But I did some experiments, seem like each test case will be running
        > > in a
        > > > > separate JVM process. It is quite tricky to share a counter between
        > two
        > > > > process.
        > > > >
        > > > > I look through the API, maybe this requirement can be done with
        > custom
        > > > > runner, though we do want change too much and continue to use Ant -
        > > Junit
        > > > > runner.
        > > > >
        > > > > Please give me some hints on this issue. Thanks in advance.
        > > > >
        > > > > --
        > > > > Regards.
        > > > >
        > > > > Yang
        > > > >
        > > > >
        > > > >
        > > >
        > > >
        > > > [Non-text portions of this message have been removed]
        > > >
        > >
        > >
        > >
        >
        >
        > [Non-text portions of this message have been removed]
        >
        >
        >
        > ------------------------------------
        >
        > Yahoo! Groups Links
        >
        >
        >
        >


        --
        Regards.

        Yang


        [Non-text portions of this message have been removed]
      Your message has been successfully submitted and would be delivered to recipients shortly.