I checked out T5-hibernate-core source code,there's possible to make a
test module for hibernate-core module.
in HibernateCoreModule:

public class HibernateCoreModule
{
    public static void bind(ServiceBinder binder)
    {
        binder.bind(HibernateTransactionDecorator.class,
HibernateTransactionDecoratorImpl.class);
        binder.bind(HibernateTransactionAdvisor.class,
HibernateTransactionAdvisorImpl.class);
        binder.bind(HibernateConfigurer.class,
DefaultHibernateConfigurer.class).withId("DefaultHibernateConfigurer");
    }
    ...
    public static void
contributeHibernateSessionSource(OrderedConfiguration<HibernateConfigurer>
config,

                                                        @Local

HibernateConfigurer defaultHibernateConfigurer)
    {
        config.add("Default", defaultHibernateConfigurer);
        config.addInstance("PackageName", PackageNameHibernateConfigurer.class);
    }
}

It's my idea:
1.create a test-usage configurer like defaultConfigurer,but use hsqldb
or sqlite.
2.contribute this configurer to HibernateSessionSource service in test
module that will orverride the function above.
3.load this test module to build services,and then run unit test and
integration test.

It's a straw,let me try~

On Fri, Aug 6, 2010 at 1:54 AM, based2 <ba...@free.fr> wrote:
>
> http://maven.apache.org/guides/mini/guide-building-for-different-environments.html
> http://maven.apache.org/guides/introduction/introduction-to-profiles.html
>
> ==
> http://tapestry.apache.org/tapestry5/tapestry-test/
> http://tapestry.formos.com/projects/tapestry-testify/
>
> ref: http://wiki.apache.org/tapestry/Tapestry5ModuleRegistry
>
>
> cleverpig-2 wrote:
>>
>> JMockit allows developers to write unit and integration tests without
>> the testability issues typically found with other mocking tools.
>> It support hibernate mock too.
>>
>> Sounds like very well fit with tapestry.
>> T5 has test ability with inject dependency itself: it can load
>> RegistryBuilder from test appModule to get DAO and service injections.
>> such as :
>> protected void setUp(){
>>     builder=new RegistryBuilder();
>>     builder.add(TapestryIOCModule.class);
>>     builder.add(HibernateCoreModule.class);
>>     builder.add(MiniAppModule.class); //MiniAppModule is my test app
>> module
>>     reg= builder.build();
>>     reg.performRegistryStartup();
>>     ...
>> }
>>
>> Do you know how to make db related test on jmockit or dbunit?
>>
>> One simplest way: change hibernate to use hsqlDB in memory for test
>> environment,but how can do that to change another hibernate
>> configure,instead of product or development environment?
>> --
>> cleverpig(Dan)
>> Location: Beijing
>> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
>> Zipcode: 100031
>> MSN: great_liu...@hotmail.com
>> QQ: 149291732
>> Skype: cleverpigatmatrix
>> Facebook ID:cleverpig
>> Blog: cleverpig.name/dan/
>> Tags: del.icio.us/cleverpig
>> Twitter: twitter.com/cleverpig
>> 新浪微博: t.sina.com.cn/cleverpig
>> Organization: www.beijing-open-party.org
>> or...@facebook: http://www.facebook.com/group.php?gid=8159558294
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>>
>
> --
> View this message in context: 
> http://old.nabble.com/How-to-using-jmockit-or-dbunit-to-test-DAO-%28hibernate%29-in-tapestry--tp29343465p29356377.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>



-- 
cleverpig(Dan)
Location: Beijing
Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
Zipcode: 100031
MSN: great_liu...@hotmail.com
QQ: 149291732
Skype: cleverpigatmatrix
Facebook ID:cleverpig
Blog: cleverpig.name/dan/
Tags: del.icio.us/cleverpig
Twitter: twitter.com/cleverpig
新浪微博: t.sina.com.cn/cleverpig
Organization: www.beijing-open-party.org
or...@facebook: http://www.facebook.com/group.php?gid=8159558294

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

Reply via email to