You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Alessio Gambi <al...@gmail.com> on 2013/11/29 18:52:19 UTC

Strange behavior with JUnit and MVN test in Eclipse

Hi list !

I had a strange situation today that might deserve some more investigation (or at least a warning for those like me...).

Here it goes:

I created a plain service (List/Ordered contribs) via build* method
I created a contribution method to that service (List/Ordered contribs) via contribute* method

>> I forgot to add an ID to one of my contribution using addInstance method. Actually I used the empty string:
	userContribution.addInstance("", ...) <<

I wrote a test to start the registry, get an instance of the service, use the service, and check the results.
I run the test and "magically" it worked fine.

The I tried to deploy my artifact via mvn clean ... deploy
This triggered mvn test
And this time I got an exception in building the very same service (see output snippet below).


I am really curios to understand what's going on, and at the same time, I suggest the other "non-black-belts" like me to pay attention to this thing.

Thanks

-- Alessio



===========================================================================================
 Error invoking service contribution method at.ac.tuwien.dsg.cloud.modules.CloudAppModule.contributeBashUserDataService(OrderedConfiguration): java.lang.AssertionError
2013-11-29 18:42:13,876 [main] ERROR org.apache.tapestry5.ioc.Registry - Operations trace:
2013-11-29 18:42:13,876 [main] ERROR org.apache.tapestry5.ioc.Registry - [ 1] Instantiating service BashUserDataService implementation via at.ac.tuwien.dsg.cloud.modules.CloudAppModule.buildBashUserDataService(Logger, PipelineBuilder, File, List) (at CloudAppModule.java:164)
2013-11-29 18:42:13,876 [main] ERROR org.apache.tapestry5.ioc.Registry - [ 2] Creating plan to invoke public static at.ac.tuwien.dsg.cloud.services.UserDataService at.ac.tuwien.dsg.cloud.modules.CloudAppModule.buildBashUserDataService(org.slf4j.Logger,org.apache.tapestry5.ioc.services.PipelineBuilder,java.io.File,java.util.List)
2013-11-29 18:42:13,876 [main] ERROR org.apache.tapestry5.ioc.Registry - [ 3] Determining injection value for parameter #4 (java.util.List)
2013-11-29 18:42:13,877 [main] ERROR org.apache.tapestry5.ioc.Registry - [ 4] Collecting ordered configuration for service BashUserDataService
2013-11-29 18:42:13,877 [main] ERROR org.apache.tapestry5.ioc.Registry - [ 5] Invoking at.ac.tuwien.dsg.cloud.modules.CloudAppModule.contributeBashUserDataService(OrderedConfiguration) (at CloudAppModule.java:217)
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.993 sec <<< FAILURE!



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Strange behavior with JUnit and MVN test in Eclipse

Posted by Lance Java <la...@googlemail.com>.
Taking an educated stab in the dark here but maybe your using the m2e
plugin in eclipse and it's resolving one of your dependencies to another
project in eclipse

At the command line it's resolving the same dependency from your maven
repo.
 On 29 Nov 2013 17:52, "Alessio Gambi" <al...@gmail.com> wrote:

> Hi list !
>
> I had a strange situation today that might deserve some more investigation
> (or at least a warning for those like me...).
>
> Here it goes:
>
> I created a plain service (List/Ordered contribs) via build* method
> I created a contribution method to that service (List/Ordered contribs)
> via contribute* method
>
> >> I forgot to add an ID to one of my contribution using addInstance
> method. Actually I used the empty string:
>         userContribution.addInstance("", ...) <<
>
> I wrote a test to start the registry, get an instance of the service, use
> the service, and check the results.
> I run the test and "magically" it worked fine.
>
> The I tried to deploy my artifact via mvn clean ... deploy
> This triggered mvn test
> And this time I got an exception in building the very same service (see
> output snippet below).
>
>
> I am really curios to understand what's going on, and at the same time, I
> suggest the other "non-black-belts" like me to pay attention to this thing.
>
> Thanks
>
> -- Alessio
>
>
>
>
> ===========================================================================================
>  Error invoking service contribution method
> at.ac.tuwien.dsg.cloud.modules.CloudAppModule.contributeBashUserDataService(OrderedConfiguration):
> java.lang.AssertionError
> 2013-11-29 18:42:13,876 [main] ERROR org.apache.tapestry5.ioc.Registry -
> Operations trace:
> 2013-11-29 18:42:13,876 [main] ERROR org.apache.tapestry5.ioc.Registry - [
> 1] Instantiating service BashUserDataService implementation via
> at.ac.tuwien.dsg.cloud.modules.CloudAppModule.buildBashUserDataService(Logger,
> PipelineBuilder, File, List) (at CloudAppModule.java:164)
> 2013-11-29 18:42:13,876 [main] ERROR org.apache.tapestry5.ioc.Registry - [
> 2] Creating plan to invoke public static
> at.ac.tuwien.dsg.cloud.services.UserDataService
> at.ac.tuwien.dsg.cloud.modules.CloudAppModule.buildBashUserDataService(org.slf4j.Logger,org.apache.tapestry5.ioc.services.PipelineBuilder,java.io.File,java.util.List)
> 2013-11-29 18:42:13,876 [main] ERROR org.apache.tapestry5.ioc.Registry - [
> 3] Determining injection value for parameter #4 (java.util.List)
> 2013-11-29 18:42:13,877 [main] ERROR org.apache.tapestry5.ioc.Registry - [
> 4] Collecting ordered configuration for service BashUserDataService
> 2013-11-29 18:42:13,877 [main] ERROR org.apache.tapestry5.ioc.Registry - [
> 5] Invoking
> at.ac.tuwien.dsg.cloud.modules.CloudAppModule.contributeBashUserDataService(OrderedConfiguration)
> (at CloudAppModule.java:217)
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.993 sec
> <<< FAILURE!
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>