diff --git a/org.springframework.test/src/test/java/org/springframework/test/context/testng/TimedTransactionalTestNGSpringContextTests-context.xml b/org.springframework.test/src/test/java/org/springframework/test/context/testng/TimedTransactionalTestNGSpringContextTests-context.xml new file mode 100644 index 0000000000..ed86e35a47 --- /dev/null +++ b/org.springframework.test/src/test/java/org/springframework/test/context/testng/TimedTransactionalTestNGSpringContextTests-context.xml @@ -0,0 +1,13 @@ + + + + + + + + \ No newline at end of file diff --git a/org.springframework.test/src/test/java/org/springframework/test/context/testng/TimedTransactionalTestNGSpringContextTests.java b/org.springframework.test/src/test/java/org/springframework/test/context/testng/TimedTransactionalTestNGSpringContextTests.java new file mode 100644 index 0000000000..f7bc81107e --- /dev/null +++ b/org.springframework.test/src/test/java/org/springframework/test/context/testng/TimedTransactionalTestNGSpringContextTests.java @@ -0,0 +1,47 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.test.context.testng; + +import static org.springframework.test.transaction.TransactionTestUtils.assertInTransaction; + +import org.springframework.test.context.ContextConfiguration; +import org.testng.annotations.Test; + +/** + * Timed integration tests for + * {@link AbstractTransactionalTestNGSpringContextTests}; used to verify claim + * raised in SPR-6124. + * + * @author Sam Brannen + * @since 3.0 + */ +@ContextConfiguration +public class TimedTransactionalTestNGSpringContextTests extends AbstractTransactionalTestNGSpringContextTests { + + @Test + public void testWithoutTimeout() { + assertInTransaction(true); + } + + // TODO Enable TestNG test with timeout once we have a solution. + @Test(timeOut = 10000, enabled = false) + public void testWithTimeout() { + assertInTransaction(true); + } + +}