After Ran mvn clean install, I got the FileRenameRouteTest failed on windows box

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

After Ran mvn clean install, I got the FileRenameRouteTest failed on windows box

Willem.Jiang
Administrator
Hi,

   I just found an interesting thing. When I run mvn clean install with
the trunk code on windows box, I got the FileRenameRouteTest failed. But
when I ran it on Linux or ran the test separately in eclipse , the
FileRenameRouteTest was passed .

   So I digged out the codes. I found the new added asyncProcessor in
FileConsumer will not call the processStrategy.commit method in the
whole unit test.  That is AsyncCallback never be called in the
FileRouteTest.

When I changed the AsyncProcessorTypeConverter's process method like the
below codes,
the FileConsumer's AsyncCallback was called.

public boolean process(Exchange exchange, AsyncCallback callback) {
            try {
                processor.process(exchange);
            } catch (Throwable e) {
                exchange.setException(e);
            }
            // false means processing of the exchange asynchronously,
the original code used true parameter
            callback.done(false);
            return true;
        }

And for the FileRenameRouteTest , my suggestion is set the surefire
plugin's forkMode to be pertest. I just tested it on windows.
<plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <forkMode>pertest</forkMode>
          .....

Willem.


Reply | Threaded
Open this post in threaded view
|

Re: After Ran mvn clean install, I got the FileRenameRouteTest failed on windows box

jstrachan
Great stuff, patch applied!

On 8/29/07, Willem Jiang <[hidden email]> wrote:

> Hi,
>
>    I just found an interesting thing. When I run mvn clean install with
> the trunk code on windows box, I got the FileRenameRouteTest failed. But
> when I ran it on Linux or ran the test separately in eclipse , the
> FileRenameRouteTest was passed .
>
>    So I digged out the codes. I found the new added asyncProcessor in
> FileConsumer will not call the processStrategy.commit method in the
> whole unit test.  That is AsyncCallback never be called in the
> FileRouteTest.
>
> When I changed the AsyncProcessorTypeConverter's process method like the
> below codes,
> the FileConsumer's AsyncCallback was called.
>
> public boolean process(Exchange exchange, AsyncCallback callback) {
>             try {
>                 processor.process(exchange);
>             } catch (Throwable e) {
>                 exchange.setException(e);
>             }
>             // false means processing of the exchange asynchronously,
> the original code used true parameter
>             callback.done(false);
>             return true;
>         }
>
> And for the FileRenameRouteTest , my suggestion is set the surefire
> plugin's forkMode to be pertest. I just tested it on windows.
> <plugin>
>         <artifactId>maven-surefire-plugin</artifactId>
>         <configuration>
>           <forkMode>pertest</forkMode>
>           .....
>
> Willem.
>
>
>


--
James
-------
http://macstrac.blogspot.com/