01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */package org.apache.openejb.test.entity.cmp;
17:
18: import org.apache.openejb.test.TestManager;
19: import org.apache.openejb.test.entity.cmp2.EjbqlLocalTest;
20:
21: import javax.naming.InitialContext;
22: import java.util.Properties;
23:
24: /**
25: * @author <a href="mailto:david.blevins@visi.com">David Blevins</a>
26: * @author <a href="mailto:Richard@Monson-Haefel.com">Richard Monson-Haefel</a>
27: */
28: public class CmpLocalTestSuite extends
29: org.apache.openejb.test.FilteredTestSuite {
30:
31: public CmpLocalTestSuite() {
32: super ();
33: this .addTest(new CmpJndiTests());
34: this .addTest(new CmpHomeIntfcTests());
35: this .addTest(new CmpEjbHomeTests());
36: this .addTest(new CmpEjbObjectTests());
37: this .addTest(new CmpRemoteIntfcTests());
38: this .addTest(new CmpHomeHandleTests());
39: this .addTest(new CmpHandleTests());
40: this .addTest(new CmpEjbMetaDataTests());
41: this .addTest(new CmpAllowedOperationsTests());
42: this .addTest(new CmpJndiEncTests());
43: this .addTest(new CmpContextLookupTests());
44: this .addTest(new CmpRmiIiopTests());
45:
46: this .addTest(new ComplexHomeIntfcTests());
47: this .addTest(new ComplexEjbHomeTests());
48: this .addTest(new ComplexEjbObjectTests());
49: this .addTest(new ComplexRemoteIntfcTests());
50: this .addTest(new ComplexHomeHandleTests());
51: this .addTest(new ComplexHandleTests());
52: this .addTest(new ComplexEjbMetaDataTests());
53:
54: this .addTest(new UnknownHomeIntfcTests());
55: this .addTest(new UnknownEjbHomeTests());
56: this .addTest(new UnknownEjbObjectTests());
57: this .addTest(new UnknownRemoteIntfcTests());
58: this .addTest(new UnknownHomeHandleTests());
59: this .addTest(new UnknownHandleTests());
60: this .addTest(new UnknownEjbMetaDataTests());
61:
62: this .addTest(new EjbqlLocalTest());
63: }
64:
65: public static junit.framework.Test suite() {
66: return new CmpLocalTestSuite();
67: }
68:
69: /**
70: * Sets up the fixture, for example, open a network connection.
71: * This method is called before a test is executed.
72: */
73: protected void setUp() throws Exception {
74: Properties props = TestManager.getServer()
75: .getContextEnvironment();
76: //props.put(Context.SECURITY_PRINCIPAL, "ENTITY_TEST_CLIENT");
77: //props.put(Context.SECURITY_CREDENTIALS, "ENTITY_TEST_CLIENT");
78: InitialContext initialContext = new InitialContext(props);
79:
80: /*[2] Create database table */
81: TestManager.getDatabase().createEntityTable();
82: }
83:
84: /**
85: * Tears down the fixture, for example, close a network connection.
86: * This method is called after a test is executed.
87: */
88: protected void tearDown() throws Exception {
89: /*[1] Drop database table */
90: TestManager.getDatabase().dropEntityTable();
91: }
92: }
|