On Sun, Oct 11, 2015 at 5:48 PM, Daniel Dekany <[email protected]> wrote:
> Sunday, October 11, 2015, 4:56:34 AM, Woonsan Ko wrote:
>
>> Hi,
>>
>> When I added a new unit test, `ant test' seems failing in many test
>> classes. e.g, FileTemplateLoaderTest, etc.
>
> Maybe you ran into bugs in the test suite itself then. They are
> supposed to pass without doing anything special. I have only ever ran
> the test suite on Windows, and that's perhaps where the difference
> lies. They also must be all green if you ran them from Eclipse (or
> IntelliJ, etc.), and that's how I do it most of the time, since it's
> easier to navigate to errors, etc. You don't need the command line
> except for running JavaCC once (or after you have changed FTL.jj), and
> perhaps before a pull request to see if you have accidentally used a
> non-Java 5 API.
I sometimes run unit test in IDE, but I also like running all the unit
tests in the command line. :-) That also helps continuous integration.
I didn't add any non-Java 5 compatible API usages in my PR. Also the
current ant build.xml enforces Java 1.5 in compile tasks already.
>
> Anyway, can you look at the concrete errors to see if they are
> environment dependencies?
Looks like environment related issue. When I run `ant test', it stops
after testing FileTemplateLoaderTest, and error is:
junit.framework.AssertionFailedError
at
freemarker.cache.FileTemplateLoaderTest.testCaseSensitivity(FileTemplateLoaderTest.java:101)
I'm not sure if OSX behaves like Windows somehow when resolving a file
or if this is something else yet.
I also tried it after excluding FileTemplateLoaderTest, but there are
other tests failing..
Anyway, I stopped there for now because this is not related to my pull
request. ;-) I'll look into the unit test issues later.
>
>> So, I had to change build.xml (in batchtest task) to include only my
>> new test class locally.
>
> At least in Eclipse I can just right click on a package or class or
> method, and run it as JUnit test. (Then F11 to re-run it.)
>
>> My dev env is Ant 1.9.6 (Ivy 2.4.0) and JDK 1.8 on OSX.
>
> JDK 1.8 64 bit, 1.8.1, Windows 7 here... but if this matters, then
> that should be fixed.
>
>> How can I run all the unit tests successfully?
>> Also, is there any tip to run single unit test in command line (like
>> `mvn test -Dtest=...')?
>
> I think there was, but I don't remember the exact syntax anymore. But
> using you IDE is more efficient anyway.
I'm used to Maven and Maven plugins for Eclipse, where I was able to
run unit test in IDE easily. Ant/Ivy/Eclipse environment looks a bit
different to me. I need some more time to learn.
By the way, IIRC, you mentioned in old ML that it's planned to migrate
to Maven some day. Is it right? If so, when do you want to do that?
Kind regards,
Woonsan
>
>> Thanks in advance,
>>
>> Woonsan
>>
>
> --
> Thanks,
> Daniel Dekany
>