I converted my tests to JUnit4, but I'm still getting the "Trying to override
old definition of datatype junit":
1) Here's the console output
$ mini:webserver> buildr test
(in /Users/petrovic/foo/trunk, development)
Testing parent:testapps:webserver
Compiling parent:testapps:webserver:test into
/Users/petrovic/foo/trunk/testapps/webserver/target/test/classes
Running tests in parent:testapps:webserver
Trying to override old definition of datatype junit
[junit] Testsuite: org.foo.embed.AppTest
[junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.064 sec
[junit]
[junit] Testcase: testApp took 0.002 sec
Completed in 2.109s
2) Here's the test class:
package org.foo.embed;
import org.junit.Test;
import static org.junit.Assert.assertTrue;
public class AppTest {
@Test
public void testApp() {
assertTrue(true);
}
}
3) I'm using buildr 1.4.1:
$ buildr --version
Buildr 1.4.1
4) fwiw, when I grep junit in the output of the build I get
$ mini:trunk> buildr --trace test |grep junit
** Invoke /Users/petrovic/.m2/repository/junit/junit/4.7/junit-4.7.jar
(first_time, not_needed)
** Invoke
/Users/petrovic/.m2/repository/org/jmock/jmock-junit4/2.5.1/jmock-junit4-2.5.1.jar
(first_time, not_needed)
** Invoke /Users/petrovic/.m2/repository/junit/junit/4.7/junit-4.7.jar
(not_needed)
** Invoke
/Users/petrovic/.m2/repository/org/jmock/jmock-junit4/2.5.1/jmock-junit4-2.5.1.jar
(not_needed)
(Another tasteful Buildr choice: log to stdout).
On Aug 28, 2010, at 11:03 AM, Antoine Toulme wrote:
> I committed a test ; I had to fix the current behavior which assumes junit4
> is in the classpath, so this functionality will be released with 1.4.2.
>
> On Sat, Aug 28, 2010 at 10:10, Antoine Toulme <[email protected]>wrote:
>
>> Pointing out ? You can use junit3 for your project by changing your user
>> setting or in the Buildfile do:
>>
>> Buildr.settings.build['junit'] = '3.8.1'
>>
>> I guess I need to add a test for that :)
>>
>>
>> On Sat, Aug 28, 2010 at 10:00, Mark Petrovic <[email protected]> wrote:
>>
>>> Yes, in fact, they are junit3 tests. I should change them to junit4, but
>>> can buildr automate pointing out the condition?
>>>
>>>
>>> On Aug 28, 2010, at 9:46 AM, Antoine Toulme wrote:
>>>
>>>> I think it might be because of junit3 tests running in junit4. Are your
>>>> tests junit 3 tests ?
>>>>
>>>> The junit4 runner must be the one logging this.
>>>>
>>>> On Sat, Aug 28, 2010 at 07:17, Mark Petrovic <[email protected]>
>>> wrote:
>>>>
>>>>> I'm seeing
>>>>>
>>>>> "Trying to override old definition of datatype junit"
>>>>>
>>>>> when I run tests on a certain project. Appears to be the same issue as
>>>>> https://issues.apache.org/jira/browse/BUILDR-161.
>>>>>
>>>>> What causes this?
>>>>>
>>>>> --
>>>>> Mark Petrovic
>>>>>
>>>>>
>>>>>
>>>
>>>
>>> --
>>> Mark Petrovic
>>>
>>>
>>>
>>
--
Mark Petrovic