Re: Tapestry + Hibernate + Testing

2013-10-20 Thread Boris Horvat
It seems that the problem is that I needed to have both annotations import org.testng.annotations.BeforeMethod; import org.testng.annotations.BeforeTest; not sure why. but I will try to read the documentation cheers On Sun, Oct 20, 2013 at 11:10 AM, Boris Horvat wrote: > Hi everyone, > > Lanc

Re: Tapestry + Hibernate + Testing

2013-10-20 Thread Boris Horvat
Hi everyone, Lance I have a question for you (though anyone can answer it). You suggested to use something like http://stackoverflow.com/questions/15664815/how-to-test-dao-layer-in-tapestry-dependent-projects/15671034#15671034 I was expecting that my db will be rebuild before every test? Is this

Re: Tapestry + Hibernate + Testing

2013-09-27 Thread Martin Kersten
I always start simple first and most simply is without tapestry. When you deal with 3 or 4 services at once you feel the need to go for IOC. Then you want to test a single page and thats when you use tapestry-test and then you go for full scale testing and you find yourself using htmlunit or seleni

Re: Tapestry + Hibernate + Testing

2013-09-26 Thread Boris Horvat
I guess for now I will proceed with using code that is not tapestry related inside my test classes though that is likely to change in the future. Thanks for you suggestions I will keep them in my head when the time for them arises :) Cheers On Thu, Sep 26, 2013 at 9:40 AM, Lance Java wrote: >

Re: Tapestry + Hibernate + Testing

2013-09-26 Thread Lance Java
HibernateEntityPackageManager only has one method which gets the list of hibernate entity package names. You might find it more lightweight to create mock this rather than including HibernateModule. On 26 Sep 2013 01:30, "Thiago H de Paula Figueiredo" wrote: > On Wed, 25 Sep 2013 20:01:14 -0300,

Re: Tapestry + Hibernate + Testing

2013-09-25 Thread Thiago H de Paula Figueiredo
On Wed, 25 Sep 2013 20:01:14 -0300, Boris Horvat wrote: Is there a list like the default services that should be added. For example if I add my configuration of the hibernate it complains HibernateEntityPackageManager doesn't exist In this case, you need the HibernateModule added to the r

Re: Tapestry + Hibernate + Testing

2013-09-25 Thread Boris Horvat
Ah sorry for spam this is the last one for the day. Is there a list like the default services that should be added. For example if I add my configuration of the hibernate it complains HibernateEntityPackageManager doesn't exist On Thu, Sep 26, 2013 at 12:56 AM, Boris Horvat wrote: > ah I think

Re: Tapestry + Hibernate + Testing

2013-09-25 Thread Boris Horvat
ah I think I see RegistryBuilder b = new RegistryBuilder(); b.add(HibernateModule.class); Registry r = b.build(); r.getService(MyService.class); that makes sense Cheers On Thu, Sep 26, 2013 at 12:55 AM, Boris Horvat wrote: > Thanks for the detail replay it helps

Re: Tapestry + Hibernate + Testing

2013-09-25 Thread Boris Horvat
Thanks for the detail replay it helps me to figure out the best way to organise everything. btw once you have everything registered how do you get a service? cheers On Thu, Sep 26, 2013 at 12:38 AM, Martin Kersten < martin.kersten...@gmail.com> wrote: > Hi Boris, > >I just use a registery

Re: Tapestry + Hibernate + Testing

2013-09-25 Thread Martin Kersten
Hi Boris, I just use a registery builder and add the sub modules I need to test (as already mentioned). Often I use public TestModule static classes that reside into the TestCase class. Then I just use those TestModule classes to build the registry. They contain often only the services needed u

Re: Tapestry + Hibernate + Testing

2013-09-25 Thread Boris Horvat
btw PackageNameHibernateConfigurer uses AnnotationConfiguration that has been deprecated any plans to change this class? On Wed, Sep 25, 2013 at 11:36 PM, Boris Horvat wrote: > I use Submodule but I guess for the tests I need RegistryBuilder. Will try > that > > Thanks > > > On Wed, Sep 25, 2013

Re: Tapestry + Hibernate + Testing

2013-09-25 Thread Boris Horvat
I use Submodule but I guess for the tests I need RegistryBuilder. Will try that Thanks On Wed, Sep 25, 2013 at 10:55 PM, Thiago H de Paula Figueiredo < thiag...@gmail.com> wrote: > On Wed, 25 Sep 2013 17:17:22 -0300, Boris Horvat > wrote: > > My config is already split in that way. But I cant

Re: Tapestry + Hibernate + Testing

2013-09-25 Thread Thiago H de Paula Figueiredo
On Wed, 25 Sep 2013 17:17:22 -0300, Boris Horvat wrote: My config is already split in that way. But I cant find a code that I can check to see how to load DAOModule :( @Submodule({DAOModule.class}) in another modules that is already loaded or RegistryBuilder.add(DDAOModule.class) or addin

Re: Tapestry + Hibernate + Testing

2013-09-25 Thread Boris Horvat
My config is already split in that way. But I cant find a code that I can check to see how to load DAOModule :( Any hints? :) On Wed, Sep 25, 2013 at 11:08 AM, Lance Java wrote: > > Is it possible somehow to automate this? > > Have you read Howard's answer on the Stack Overflow question? He sug

Re: Tapestry + Hibernate + Testing

2013-09-25 Thread Lance Java
> Is it possible somehow to automate this? Have you read Howard's answer on the Stack Overflow question? He suggests splitting your AppModules in such a way that you can load a DAOModule together with HibernateCoreModule for testing.

Re: Tapestry + Hibernate + Testing

2013-09-25 Thread Lance Java
It's in tapestry-hibernate-core https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;a=blob;f=tapestry-hibernate-core/src/main/java/org/apache/tapestry5/internal/hibernate/PackageNameHibernateConfigurer.java

Re: Tapestry + Hibernate + Testing

2013-09-24 Thread Boris Horvat
Hi Lance, Can you please share PackageNameHibernateConfigurer assuming that it is open source code (and that it is your code)? Thanks On Sun, Sep 22, 2013 at 10:43 PM, Boris Horvat wrote: > Well ideally I would like to avoid setting up the abstract class but at > lest I have a starting point t

Re: Tapestry + Hibernate + Testing

2013-09-22 Thread Boris Horvat
Well ideally I would like to avoid setting up the abstract class but at lest I have a starting point that I believe I can make it to work. I do have one more question though. Is it possible somehow to automate this? I have my business class that recieves hibernate classes vie a constructor and eac

Re: Tapestry + Hibernate + Testing

2013-09-22 Thread Lance Java
I do this http://stackoverflow.com/questions/15664815/how-to-test-dao-layer-in-tapestry-dependent-projects/15671034#15671034 On 22 September 2013 19:16, Boris Horvat wrote: > Hi all, > > How does one make a proper testing of the business layer in tapestry that I > inject into the page as a serv

Re: Tapestry-Hibernate Testing

2009-03-26 Thread Juan E. Maya
In tapestry 5.18 it was not possible (easily) to use tapestry-hibernate outside of the web application so i am not sure how feasible is to use them in the Test classes. That was one of the main reasons i did the early upgrade and i don't regret at all. On Thu, Mar 26, 2009 at 9:33 PM, Davor Miku

Re: Tapestry-Hibernate Testing

2009-03-26 Thread Davor Miku
Thank's for reply. I'm using T5.018. I tried: builder.add(TapestryIOCModule.class,HibernateModule.class ,AppModule.class); and got exception: [INFO] cfg.Configuration Configured SessionFactory: null [ERROR] ioc.Registry Symbol 'tapestry.app-package' is not defined. [ERROR] ioc.Registr

Re: Tapestry-Hibernate Testing

2009-03-26 Thread Juan E. Maya
Oh, i forgot to tell u that for this test to work tapestry 5.1.0.1 is required because it uses the CoreHibernateModule On Thu, Mar 26, 2009 at 9:08 PM, Juan E. Maya wrote: > Hi Davor, Injection only work on tapestry pages or components. U can't > inject tapestry services in JUnit classes (as far

Re: Tapestry-Hibernate Testing

2009-03-26 Thread Juan E. Maya
Hi Davor, Injection only work on tapestry pages or components. U can't inject tapestry services in JUnit classes (as far as i know) The way i run my test is as follow, i use testng but u could easily see how it would be in Junit It's important to notice that u have to manually load the Modules u n