source: geisa/service/test/com/ether/ServiceTestHelper.java @ 390

Last change on this file since 390 was 390, checked in by npipsl, 12 years ago

Création du projet GEISA

File size: 1.6 KB
Line 
1package com.ether;
2
3import org.apache.commons.logging.Log;
4import org.apache.commons.logging.LogFactory;
5
6public abstract class ServiceTestHelper<SERVICE extends Service> 
7        extends HibernateTestHelper<SERVICE>
8{
9    protected ServiceTestHelper(final String serviceBeanName) {
10        super(null, serviceBeanName, getAllDependencies(), DEFAULT_SESSION_FACTORY_BEAN_NAME);
11    }
12
13    protected void deleteAllKnownData() throws Exception
14    {
15        //      deleteAllDatas( getAllKnownDomainClasses() );
16    }
17
18    public static String[] getAllDependencies()
19    {
20                return new String[] { 
21//                              "classpath:dao-context.xml",
22                                "classpath:service-context_test.xml",
23//                              "classpath:hibernate_test.cfg.xml",
24        };
25    }
26
27    @SuppressWarnings("rawtypes")
28    public static Class[] getAllKnownDomainClasses()
29    {
30        return new Class[] { 
31                        Plateform.class,};
32    }
33
34    /**
35     * Executes operations before running test.
36     */
37    protected abstract void beforeServiceTest() throws Exception;
38
39    /**
40     * Executes operations after running test.
41     */
42    protected final void afterServiceTest() throws Exception
43    {
44         //deleteAllKnownData();       
45    }
46
47    protected final void beforeHibernateTest() throws Exception
48    {
49        beforeServiceTest();
50    }
51
52    protected final void afterHibernateTest() throws Exception
53    {
54        afterServiceTest();
55    }
56
57    protected final SERVICE getService()
58    {
59        return getBean();
60    }
61
62    private static final Log LOGGER = LogFactory.getLog(ServiceTestHelper.class);
63    private static final String DEFAULT_SESSION_FACTORY_BEAN_NAME = "sessionFactory";
64}
Note: See TracBrowser for help on using the repository browser.