Re: matched by 2 services: FullTextSession, Session

2014-09-10 Thread Lance Java
Hmm, very strange. Are you calling registry.shutdown() ever? Is this perhaps an issue with registry.cleanupThread()? How many @Test annotations in the class? Does the first @Test work and the second fail? Just grasping at straws here! On 10 Sep 2014 02:05, George Christman

Re: matched by 2 services: FullTextSession, Session

2014-09-10 Thread Chris Poulsen
Hi, Isn't this a matter of indicating which session you want injected? ( I guess both sessions match Session ), there are some mechanisms for that described here: http://tapestry.apache.org/injection-faq.html -- Chris On Wed, Sep 10, 2014 at 8:35 AM, Lance Java lance.j...@googlemail.com wrote:

Re: matched by 2 services: FullTextSession, Session

2014-09-10 Thread Lance Java
That's not my understanding of how the tapestry registry works. Spring ioc works like this but tapestry should bind the service to the interface supplied by your module. On 10 Sep 2014 07:48, Chris Poulsen mailingl...@nesluop.dk wrote: Hi, Isn't this a matter of indicating which session you

Re: Tapestry onActivate messes up after submitting a form

2014-09-10 Thread Lance Java
Exception in method null, parameter #1: Could not find a coercion from type java.lang.String to type Scene. context - 3 It looks like the context is -3? Is this primary key in the database? Also annotation wont, really work for me as I have more then one field You might be interested in this

Re: Tapestry onActivate messes up after submitting a form

2014-09-10 Thread Boris Horvat
Yea -3 is not propet db id, but what could have changed it into negative number...strange Is this partbof the 5.3.7 or 5.4 as I am still on the old offucial version. I can try it out tonight and see what happen Thanks On 10 Sep 2014 09:16, Lance Java lance.j...@googlemail.com wrote:

Re: Tapestry onActivate messes up after submitting a form

2014-09-10 Thread Lance Java
No, this is a new feature. Your onActivate methods are very complex. Have you considered a single onActivate(EventContext)? Perhaps the '-' in '-3' is just a presentation issue. I think the main culprit is likely to be your onPassivate(). Does it return all 3 objects (when populated).

Re: Tapestry onActivate messes up after submitting a form

2014-09-10 Thread Chris Poulsen
I think I've seen messages on the mailing lists about problems related to multiple onActivate's a long time ago. https://issues.apache.org/jira/browse/TAPESTRY-1730 seems to suggest that the method with the most parameters is called first, but whether the execution stops here or continues to the

tapestry kaptcha image does not refesh after an ajax form submit?

2014-09-10 Thread John
Hi, How do I get a kaptcha image to refresh when a zone is rerendered on an ajax request? At present this only happens for a form that submits for the page. Without a new code the next validation always fails. John --- This email is free from viruses and malware because avast! Antivirus

Re: matched by 2 services: FullTextSession, Session

2014-09-10 Thread George Christman
Hi Lance, I hear ya, same here. Okay I'm going to provide all the code and the full exception. * AppModuleTest * public class AppModuleTest { public static void bind(ServiceBinder binder) { try { ClassLoader contextClassLoader =

Re: Tynamo-Conversations + Tapestry-Atmosphere

2014-09-10 Thread Semen Vishniakov
Thank you, Lance! Now it works perfectly. And one more question: I would like to push custom javascript using atmosphere. I've seen this https://github.com/uklance/tapestry-atmosphere/issues/5 and my question is, how can I override your tapesty-atmosphere.js? Thanks, Sem

Re: matched by 2 services: FullTextSession, Session

2014-09-10 Thread George Christman
Sorry email prematurely sent. Exception with some output showing where the code is breaking. The first query using sessionManager in the test class runs, the second query in the service using the genericDAO fails. [TestNG] Running: Command line suite [WARN ] (ConfigContext.java:257) -

Re: Tynamo-Conversations + Tapestry-Atmosphere

2014-09-10 Thread Lance Java
Now it works perfectly. Great! I'll add an issue to copy the isSecure() flag from the async request. how can I override your tapesty-atmosphere.js? stick it in the right path under WEB-IBF/classes and your container's classloader will give it precedence.

Re: matched by 2 services: FullTextSession, Session

2014-09-10 Thread Lance Java
It looks like I'm wrong. Ultimately Registry.getService(Class) passes through to Module.findServiceIdsForInterface() which ultimately finds all services where: serviceInterface.isAssignableFrom(def.getServiceInterface()) So it works the same as spring IOC which really surprised me. So, as

Re: component events bubbling down?

2014-09-10 Thread John
Yes, that was my initial solution but I ran into problems, but strangely it seems to work fine now?! I just call the onX event I already use for catching the bubbled up events, so it seems I can remove my doRefresh and onRefresh code afterall. Confused but happy :) - Original Message

Re: matched by 2 services: FullTextSession, Session

2014-09-10 Thread George Christman
Some more oddities, I looks as if I'm able to get past this issue if I use @InjectService as Chris described, however I noticed if I try to do any saves in the GenericDAO, it fails. I'm also running into problems where my services are looking for Tapestry services but can't find them. Example

Re: matched by 2 services: FullTextSession, Session

2014-09-10 Thread Lance Java
Hi George, PageRenderLinkSource is a part of the web framework. I mentioned before that you could split your app into 2 modules: api - depends on tapestry-ioc web - depends on tapestry-core The test case I setup for you only tests the api stuff (tapestry-ioc). If you split into 2 modules this

Re: matched by 2 services: FullTextSession, Session

2014-09-10 Thread Lance Java
Testing web stuff gets a bit messier, as I said before I usually have simple pass throughs from web to api and concentrate my unit testing on the api layer. Having two modules can really define this separation and forces you to do the right thing. Loading all the tapestry web module gets messy

Re: matched by 2 services: FullTextSession, Session

2014-09-10 Thread George Christman
Thanks Lance, I figured out the DAO issue :) Anyhow this happens to be my day job project and my co-worker is looking to test his generated emails. So if I understand you correctly, I need to include the tapestry-core? If so, is that just a mater of including TapestryModule or no? On Wed, Sep 10,

Re: matched by 2 services: FullTextSession, Session

2014-09-10 Thread George Christman
We'll have to talk about mocking over the weekend, probably going to need a lesson in it ;) Unit testing is still pretty new to me, so lots to learn yet. On Wed, Sep 10, 2014 at 12:40 PM, Lance Java lance.j...@googlemail.com wrote: Testing web stuff gets a bit messier, as I said before I

Re: matched by 2 services: FullTextSession, Session

2014-09-10 Thread Lance Java
Unit tests don't need a module at all. Your colleague could mock the PageRenderLinkSource using Mockito and pass it to the EmailService constructor. Then test the hell out of it! On 10 Sep 2014 17:41, George Christman gchrist...@cardaddy.com wrote: Thanks Lance, I figured out the DAO issue :)

Re: matched by 2 services: FullTextSession, Session

2014-09-10 Thread George Christman
I'm not very framilar with Mockito, So I'm assuming you would do something like this in AppModuleTest? public static PageRenderLinkSource buildPageRenderLinkSource() { return Mockito.mock(PageRenderLinkSource.class); } Next question is how do I go about passing it to the constructor?

Re: matched by 2 services: FullTextSession, Session

2014-09-10 Thread George Christman
Integration testing. On Wed, Sep 10, 2014 at 1:06 PM, Lance Java lance.j...@googlemail.com wrote: There's 2 types of tests that I feel are getting blurred here 1. Unit test - tests a single class. All dependencies are mocked 2. Integration test - tests 2 or more services in concert (might

Re: matched by 2 services: FullTextSession, Session

2014-09-10 Thread George Christman
There is an in mem database Two services The second service layer contains PageRenderLinkSource On Wed, Sep 10, 2014 at 1:08 PM, George Christman gchrist...@cardaddy.com wrote: Integration testing. On Wed, Sep 10, 2014 at 1:06 PM, Lance Java lance.j...@googlemail.com wrote: There's 2 types

Re: Tapestry onActivate messes up after submitting a form

2014-09-10 Thread Boris Horvat
I have tried with EventContext public void onActivate(EventContext eventContext) { if (eventContext.getCount() == 3) { activate(eventContext.get(Scene.class, 0), eventContext.get(Shot.class, 1), eventContext.get(ShotComponent.class, 2)); } else if

Re: Tapestry onActivate messes up after submitting a form

2014-09-10 Thread Thiago H de Paula Figueiredo
On Wed, 10 Sep 2014 14:14:01 -0300, Boris Horvat horvat.z.bo...@gmail.com wrote: public List onPassivate() { List a = new ArrayList(); a.add(selectedScene); a.add(selectedShot); a.add(selectedComponent); return a; } onPassivate() doesn't work

Re: matched by 2 services: FullTextSession, Session

2014-09-10 Thread George Christman
Lance, I think I'm really close lol. I think my struggles have to do with the concept of having to mock a service. Anyhow I have the following mock public static PageRenderLinkSource buildPageRenderLinkSource() { PageRenderLinkSource pageRenderLinkSource =

Re: Tapestry onActivate messes up after submitting a form

2014-09-10 Thread Thiago H de Paula Figueiredo
On Wed, 10 Sep 2014 15:40:25 -0300, Boris Horvat horvat.z.bo...@gmail.com wrote: public String[] onPassivate() { String[] a = new String[3]; a[0] = selectedScene != null ? selectedScene.getId().toString() : null; a[1] = selectedShot != null ?

Re: matched by 2 services: FullTextSession, Session

2014-09-10 Thread George Christman
It looks like .toAbsolute is null, but without it I can not return a String. hmm Any thoughts? On Wed, Sep 10, 2014 at 2:43 PM, George Christman gchrist...@cardaddy.com wrote: Lance, I think I'm really close lol. I think my struggles have to do with the concept of having to mock a service.

Re: matched by 2 services: FullTextSession, Session

2014-09-10 Thread Lance Java
This is getting a bit off topic for the tapestry user's list... I suggest you do some further reading on mockito It would probably look something like this: Link link = mock(Link.class); when(link.toAbsoluteURI()).thenReturn(http://test1;);

Re: Tapestry onActivate messes up after submitting a form

2014-09-10 Thread Boris Horvat
I know :) as I wrote in the previous mail I have tried both ways, but still not working On Wed, Sep 10, 2014 at 9:09 PM, Thiago H de Paula Figueiredo thiag...@gmail.com wrote: On Wed, 10 Sep 2014 15:40:25 -0300, Boris Horvat horvat.z.bo...@gmail.com wrote: public String[] onPassivate() {