Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Wicket enabled tests #21

Closed
tejl opened this issue May 27, 2013 · 9 comments
Closed

Support Wicket enabled tests #21

tejl opened this issue May 27, 2013 · 9 comments

Comments

@tejl
Copy link

tejl commented May 27, 2013

I have tried to use CDI-Unit for testing my Wicket enabled application. It seems work during Eclipse development, but fails during the Maven test phase. I suspect Wicket needs to inject classes. How to broaden search for CDI enabled classes?

More info here: http://stackoverflow.com/questions/16770518/unit-test-with-wickettester-and-cdi-unit-works-in-eclipse-but-fails-during-maven

@BrynCooke
Copy link
Collaborator

Hi.

Would you mind sending me a zip of the project? (bryn@jglue.org) From SO it look like there isn't anything sensitive in it yet. It would enable me to take a quick look and see what's going on.

Maven support for web apps testing was actually not straight forward so it's possible you've found a bug.

The other thing to do is to try the 2.0.9-SNAPSHOT. Details can be found here: https://groups.google.com/forum/?fromgroups#!topic/cdi-unit/52qn0gAfe8E

@BrynCooke
Copy link
Collaborator

Tried to recreate your project from SO. Didn't manage it fully, but it did make seem to be making it past the wicket configure step without problems.

Going to have to wait for an example project that I can test with.

@tejl
Copy link
Author

tejl commented May 28, 2013

Hi Bryn

Thank you very much for spending the time. I hope you can wait a bit. I've
put the Wicket test setup aside for a bit and is now focusing on other
parts. As I am working hard on 2 projekts of which the other is to be
finished on monday, I'll have to continue work on the Wicket/JGlue test
setup some time end of next week.

Best regards,
Jesper

On Mon, May 27, 2013 at 11:07 PM, Bryn Cooke notifications@github.comwrote:

Tried to recreate your project from SO. Didn't manage it fully, but it did
make seem to be making it past the wicket configure step without problems.

Going to have to wait for an example project that I can test with.


Reply to this email directly or view it on GitHubhttps://github.com//issues/21#issuecomment-18514781
.

@tejl
Copy link
Author

tejl commented May 31, 2013

Hej Bryn

I had some time to use. I've created a simple Eclipse/Maven setup to demonstrate the problem. The POM might be a bit bloated because its a slightly modified copy of our prototyping project.

I think this is not just a Maven problem. I've expanded the testing a bit.

I did simplify my question a bit to much. The correct scenario is this:

  1. MyPanelTest corresponds to my earlier provided example and works. The
    class under test (MyPanel) is situated in src/main/java, while MyPanelTest
    is in src/test/java.
  2. The problem is when testing an abstract class.
    First I did this by creating a subclass and extending it.

The subclass EmbryonicPanelTested is situated in the src/test/java/panel/EmbryonicPanelTest file. This works will in Eclipse but fails in Maven.

Secondly I did the same but put the sub class as a separate file i.e. src/test/java/panel/EmbryonicPanelTested2.java. This does not work in Eclipse nor in Maven.

Best regards,
Jesper

@BrynCooke
Copy link
Collaborator

OK. Please try the 2.0.9-SNAPSHOT. Details can be found here: https://groups.google.com/forum/?fromgroups#!topic/cdi-unit/52qn0gAfe8E

This was because there was caching of some type information in wicket keyed on bean manager. However because all the bean managers had the same id they were treated as equal leading to bad things happening.

@BrynCooke
Copy link
Collaborator

OK, I'm goona close this one. Please reopen if you still have issues.

@tejl
Copy link
Author

tejl commented Jun 6, 2013

Hi Bryn.

Sorry for late response. I've been struck with fever. It works with version
2.0.9-SNAPSHOT!

Thanks
Jesper

On Tue, Jun 4, 2013 at 10:12 PM, Bryn Cooke notifications@github.comwrote:

OK, I'm goona close this one. Please reopen if you still have issues.


Reply to this email directly or view it on GitHubhttps://github.com//issues/21#issuecomment-18935721
.

@BrynCooke
Copy link
Collaborator

Great to hear it.

I've released a new version of CDI-Unit so you should be able to start using 2.1.0 from maven central.

Bryn

On 6 Jun 2013, at 14:13, Jesper Tejlgaard notifications@github.com wrote:

Hi Bryn.

Sorry for late response. I've been struck with fever. It works with version
2.0.9-SNAPSHOT!

Thanks
Jesper

On Tue, Jun 4, 2013 at 10:12 PM, Bryn Cooke notifications@github.comwrote:

OK, I'm goona close this one. Please reopen if you still have issues.


Reply to this email directly or view it on GitHubhttps://github.com//issues/21#issuecomment-18935721
.


Reply to this email directly or view it on GitHub.

@tejl
Copy link
Author

tejl commented Jun 6, 2013

I've already configured the dependency in my pom ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants