01: /*
02: * Copyright 2007 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.springunit.framework.tests;
18:
19: import javax.sql.DataSource;
20:
21: import org.junit.Test;
22: import org.springunit.framework.SpringUnitContext;
23: import org.springunit.framework.junit4.SpringUnit4TransactionalTest;
24:
25: public class OneDeep4TransactionalTest extends
26: SpringUnit4TransactionalTest {
27:
28: public OneDeep4TransactionalTest() {
29: this .setDependencyCheck(false); // don't attempt to create real data source
30: }
31:
32: @Test
33: public void testOne() throws Exception {
34: assertEquals(1, getObject("a"));
35: assertEquals(4, getObject("d"));
36: assertNull(getObject("g"));
37: }
38:
39: @Test
40: public void testFour() throws Exception {
41: assertNull(getObject("z"));
42: }
43:
44: public SpringUnitContext getOneDeep4TransactionalTest() {
45: return this .oneDeep4TransactionalTest;
46: }
47:
48: public void setOneDeep4TransactionalTest(
49: SpringUnitContext oneDeep4TransactionalTest) {
50: this .oneDeep4TransactionalTest = oneDeep4TransactionalTest;
51: }
52:
53: public DataSource getDataSource() {
54: return this .dataSource;
55: }
56:
57: public void setDataSource(DataSource dataSource) {
58: this .dataSource = dataSource;
59: }
60:
61: private SpringUnitContext oneDeep4TransactionalTest;
62:
63: private DataSource dataSource;
64:
65: }
|