01: /**
02: *
03: * Licensed to the Apache Software Foundation (ASF) under one or more
04: * contributor license agreements. See the NOTICE file distributed with
05: * this work for additional information regarding copyright ownership.
06: * The ASF licenses this file to You under the Apache License, Version 2.0
07: * (the "License"); you may not use this file except in compliance with
08: * the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: */package org.apache.openejb;
18:
19: import junit.framework.Test;
20: import junit.framework.TestSuite;
21: import org.apache.openejb.test.TestManager;
22: import org.apache.openejb.test.entity.bmp.BmpLocalTestSuite;
23: import org.apache.openejb.test.entity.cmp.CmpLocalTestSuite;
24: import org.apache.openejb.test.entity.cmp2.Cmp2TestSuite;
25: import org.apache.openejb.test.entity.cmr.CmrTestSuite;
26: import org.apache.openejb.test.mdb.MdbTestSuite;
27: import org.apache.openejb.test.stateful.StatefulLocalTestSuite;
28: import org.apache.openejb.test.stateless.StatelessLocalTestSuite;
29:
30: /**
31: * @version $Revision: 633268 $ $Date: 2008-03-03 12:39:06 -0800 $
32: */
33: public class iTest extends org.apache.openejb.test.TestSuite {
34:
35: /**
36: * To run this from your ide, set -Dopenejb.home=target/test-classes/
37: * @throws Exception
38: */
39: protected void setUp() throws Exception {
40: try {
41: OpenEJB.destroy();
42: TestManager.stop();
43: } catch (Exception e) {
44: // do nothing - exception ignored
45: }
46: // org.apache.log4j.BasicConfigurator.configure();
47: System.setProperty("openejb.test.server",
48: org.apache.openejb.test.IvmTestServer.class.getName());
49: // System.setProperty("openejb.test.database", org.apache.openejb.test.DerbyTestDatabase.class.getName());
50: System.setProperty("openejb.test.database",
51: org.apache.openejb.test.HsqldbTestDatabase.class
52: .getName());
53: System.setProperty("openejb.deployments.classpath", "true");
54:
55: // m2 executes tests in a module home directory (e.g. container/openejb-persistence)
56: // Derby creates derby.log file in derby.system.home
57: // @see http://publib.boulder.ibm.com/infocenter/cscv/v10r1/index.jsp?topic=/com.ibm.cloudscape.doc/cdevdvlp25889.html
58: System.setProperty("derby.system.home", "target");
59:
60: // Copied from org.apache.openejb.SomeoneBrokeSurefireAndThisIsADirtyHackForItTest that's now gone
61: System.setProperty("openejb.assembler",
62: org.apache.openejb.assembler.classic.Assembler.class
63: .getName());
64: System.setProperty("openejb.deployments.classpath.include",
65: ".*openejb-itests-*.*");
66: System.setProperty(
67: "openejb.deployments.classpath.filter.descriptors",
68: "true");
69: System.setProperty(
70: "openejb.deployments.classpath.filter.systemapps",
71: "false");
72:
73: TestManager.init(null);
74: TestManager.start();
75: }
76:
77: protected void tearDown() throws Exception {
78: TestManager.stop();
79: OpenEJB.destroy();
80: }
81:
82: public static Test suite() {
83: TestSuite suite = new iTest();
84: suite.addTest(StatelessLocalTestSuite.suite());
85: suite.addTest(StatefulLocalTestSuite.suite());
86: suite.addTest(BmpLocalTestSuite.suite());
87: suite.addTest(CmpLocalTestSuite.suite());
88: suite.addTest(Cmp2TestSuite.suite());
89: suite.addTest(new CmrTestSuite());
90: suite.addTest(MdbTestSuite.suite());
91: return suite;
92: }
93: }
|