Menu

#56 testOneJar test doesn't work (0.97)

open-accepted
Ant (4)
5
2010-10-20
2010-10-19
Anonymous
No

If I modify the test code to actually reference the class under test, it will no longer build.

e.g., add one line to Test.java

public void testTestOneJar1() {
new TestOneJarMain().run(); // let's just call the thing from the test!
System.out.println("testTestOneJar1: OK");
}

Now, ant building gives you:

[javac] C:\svn\sb\testOneJar\test\com\oco\utility\testOneJar\test\Test.java:11: package com.oco.utility.testOneJar.main does not exist
[javac] import com.oco.utility.testOneJar.main.TestOneJarMain;
[javac] ^
[javac] C:\svn\sb\testOneJar\test\com\oco\utility\testOneJar\test\Test.java:24: cannot find symbol
[javac] symbol : class TestOneJarMain
[javac] location: class com.oco.utility.testOneJar.test.Test
[javac] new TestOneJarMain().run();
[javac] ^
[javac] 2 errors

So it seems the class path for the tests doesn't include the main application classes under src.

I put the classes/src on the compile time class path, and that silences these warnings, but moves the error to runtime when you try to run the test jar.

Discussion

  • mike.beckerle

    mike.beckerle - 2010-10-19

    Sorry that was anonymous. mbeckerle posted the bug. Note this bug still exists in 0.98-RC2.

     
  • P. Simon Tuffs

    P. Simon Tuffs - 2010-10-20

    Thanks for reporting this. I'll take a look, I don't think this should be happening -- there are plenty of tests in the build tree, but the appgen mechanism is new and might be missing something.

     
  • P. Simon Tuffs

    P. Simon Tuffs - 2010-10-20
    • labels: 641824 --> Ant
    • assigned_to: nobody --> simontuffs
    • status: open --> open-accepted
     

Log in to post a comment.