You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@buildr.apache.org by Chris Adams <ch...@edatasource.com> on 2011/08/07 04:30:41 UTC

JUnit Warnings

Hi,

I'm trying to figure out what would be causing the following warning:
Running tests in eds:lib-shared
Trying to override old definition of datatype junit

The test code I'm using is below.

Thanks for any insights!

- Chris

--------
package com.emaildatasource.eds.java.file;

import java.io.File;

import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import com.emaildatasource.eds.java.helper.FileHelper;

public class TestDirectoryWatcher {
    private static final String TEST_DIRECTORY = "./data";

    @Before
    public void before() throws Exception {
        File directory = new File(TEST_DIRECTORY);
        if (!directory.exists()) {
            directory.mkdir();
        }
    }

    @After
    public void after() throws Exception {
        FileHelper.deleteAll(new File(TEST_DIRECTORY));
    }

    @Test
    public void testDirectoryWatcherThreadShutdown() throws Exception {
        DirectoryWatcher watcher = new DirectoryWatcher(TEST_DIRECTORY, 1);
        watcher.startMonitor(new DirectoryWatcherCallback() {
            @Override
            public void onFileArrived(File file) {
                //no-op
            }
        });

        Thread.sleep(500);
        assertTrue(watcher.isRunning());
        Thread.sleep(500);

        //Shutdown the watcher
        watcher.stopMonitor();
        assertTrue(watcher.isRunning());
    }
}

Re: JUnit Warnings

Posted by Alex Boisvert <al...@gmail.com>.
On Wed, Aug 10, 2011 at 8:08 AM, Ari Kast <ar...@gmail.com> wrote:

> I have the same problem too.
>
> Another strange/annoying behavior that I always wondered if this might be
> related to: no matter what I try, I can't get only ONE test to run by
> specifying a test class or method as described in the documentation --
> buildr always runs ALL the tests.  Is that also an artifact of the
> overridden junit datatype?
>

"buildr test:prefix" should only run test classes starting with "prefix".
Are you seeing otherwise?  If so, please file a bug and describe your
project/environment.

thanks
alex


>
> On Sun, Aug 7, 2011 at 8:43 AM, Peter Donald <pe...@realityforge.org>
> wrote:
>
> > On Sun, Aug 7, 2011 at 12:30 PM, Chris Adams <ch...@edatasource.com>
> > wrote:
> > > I'm trying to figure out what would be causing the following warning:
> > > Running tests in eds:lib-shared
> > > Trying to override old definition of datatype junit
> >
> > You can ignore that warning. It is ant trying to redefine a task.
> >
> >  I had thought we had tracked that warning down and eliminated it but
> > it seems not. Could you add an issue to jira to remind us to get
> > around to fixing it?
> >
> > Thanks!,
> >
> > Peter Donald
> >
>

Re: JUnit Warnings

Posted by Ari Kast <ar...@gmail.com>.
I have the same problem too.

Another strange/annoying behavior that I always wondered if this might be
related to: no matter what I try, I can't get only ONE test to run by
specifying a test class or method as described in the documentation --
buildr always runs ALL the tests.  Is that also an artifact of the
overridden junit datatype?


On Sun, Aug 7, 2011 at 8:43 AM, Peter Donald <pe...@realityforge.org> wrote:

> On Sun, Aug 7, 2011 at 12:30 PM, Chris Adams <ch...@edatasource.com>
> wrote:
> > I'm trying to figure out what would be causing the following warning:
> > Running tests in eds:lib-shared
> > Trying to override old definition of datatype junit
>
> You can ignore that warning. It is ant trying to redefine a task.
>
>  I had thought we had tracked that warning down and eliminated it but
> it seems not. Could you add an issue to jira to remind us to get
> around to fixing it?
>
> Thanks!,
>
> Peter Donald
>

Re: JUnit Warnings

Posted by Peter Donald <pe...@realityforge.org>.
On Sun, Aug 7, 2011 at 12:30 PM, Chris Adams <ch...@edatasource.com> wrote:
> I'm trying to figure out what would be causing the following warning:
> Running tests in eds:lib-shared
> Trying to override old definition of datatype junit

You can ignore that warning. It is ant trying to redefine a task.

 I had thought we had tracked that warning down and eliminated it but
it seems not. Could you add an issue to jira to remind us to get
around to fixing it?

Thanks!,

Peter Donald