01: /*
02: * $Id: TestConfiguration.java 667 2006-04-25 08:01:58Z hengels $
03: * (c) Copyright 2004 con:cern development team.
04: *
05: * This file is part of con:cern (http://concern.org).
06: *
07: * con:cern is free software; you can redistribute it and/or modify
08: * it under the terms of the GNU Lesser General Public License
09: * as published by the Free Software Foundation; either version 2.1
10: * of the License, or (at your option) any later version.
11: *
12: * Please see COPYING for the complete licence.
13: */
14: package org.concern.controller.test;
15:
16: import org.hibernate.SessionFactory;
17: import org.concern.ControllerException;
18: import org.concern.controller.Configuration;
19:
20: import javax.transaction.TransactionManager;
21:
22: /**
23: * @author hengels
24: * @version $Revision: 667 $
25: */
26: public class TestConfiguration extends Configuration {
27: public TestController buildTestController() {
28: try {
29: TestController controller = new TestController();
30: initializeController(controller);
31:
32: SessionFactory sessionFactory = getSessionFactory();
33: controller.setSessionFactory(sessionFactory);
34: TransactionManager transactionManager = getTransactionManager();
35: if (transactionManager != null)
36: controller.setTransactionManager(transactionManager);
37:
38: controller.setResourceLocator(getResourceLocator());
39: return controller;
40: } catch (Exception e) {
41: e.printStackTrace();
42: throw new ControllerException(e);
43: }
44: }
45: }
|