Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
3 replies Latest Post - ‏2011-07-04T05:19:27Z by SystemAdmin
SystemAdmin
SystemAdmin
9224 Posts
ACCEPTED ANSWER

Pinned topic junit tests are run twice. why?

‏2011-06-07T14:09:47Z |
NOTE: this thread was migrated from projectzero.org. Some content and formatting may have been lost in the move.


Originally posted by projectzero userid: dcosenti - f=4&t=2320#p9409
I have developed a test class for some smash code of mine.

Seems like my tests are run twice when I run the "zero test" command, any idea why?


I am using junit 4.3.1 and my test class is structured like this:



@BeforeClass
public static void setup() throws IOException
@AfterClass
public static void tearDown() throws MalformedURLException


@Test
void test1()
@Test
void test2()
...
@Test
void testN()


Thanks for any hint.
Updated on 2011-07-04T05:19:27Z at 2011-07-04T05:19:27Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    9224 Posts
    ACCEPTED ANSWER

    Re: junit tests are run twice. why?

    ‏2011-06-09T09:12:55Z  in response to SystemAdmin

    Originally posted by projectzero userid: KentaTakahashi - f=4&t=2320#p9410
    Are you using eclipse and Groovy-Eclipse plugin, and writing test code by groovy?
    "zero test" finds 2 test classes in "/app/scripts" and "/classes", so tests are run twice.

    Groovy-Eclipse plugins are compiling groovy files to "/classes" folder.
    But it is not recommended in unit test because Groovy-Eclipse plugin's groovy is often different from zero.core's groovy.
    I always turn off Groovy-Eclipse's build in test phase.
  • SystemAdmin
    SystemAdmin
    9224 Posts
    ACCEPTED ANSWER

    Re: junit tests are run twice. why?

    ‏2011-06-09T09:19:01Z  in response to SystemAdmin

    Originally posted by projectzero userid: dcosenti - f=4&t=2320#p9411
    hi Kenta,
    thanks A LOT for your reply. Very clear now.

    Davide Cosentino.
  • SystemAdmin
    SystemAdmin
    9224 Posts
    ACCEPTED ANSWER

    Re: junit tests are run twice. why?

    ‏2011-07-04T05:19:27Z  in response to SystemAdmin

    Originally posted by projectzero userid: KentaTakahashi - f=4&t=2320#p9421
    I find I can configure settings to each build paths of class folders in a eclipse.
    I don't have to turn off Groovy-Eclipse, just only I configure settings below.
    - check "Allow output folders for source folder" in Java Build Path
    - configure a build path of "/app/scripts" to a other folder like "/groovy_classes".)