Revert Java 6 specific change
This commit is contained in:
@@ -69,9 +69,10 @@ public class PollingTransactionTests {
|
||||
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
|
||||
"transactionTests.xml", this.getClass());
|
||||
PollingConsumer advicedPoller = context.getBean("advicedSa", PollingConsumer.class);
|
||||
List<Advice> adviceChain = TestUtils.getPropertyValue(advicedPoller, "adviceChain");
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Advice> adviceChain = TestUtils.getPropertyValue(advicedPoller, "adviceChain",List.class);
|
||||
assertEquals(2, adviceChain.size());
|
||||
Runnable poller = TestUtils.getPropertyValue(advicedPoller, "poller");
|
||||
Runnable poller = TestUtils.getPropertyValue(advicedPoller, "poller", Runnable.class);
|
||||
assertTrue("Poller is not Advised", poller instanceof Advised);
|
||||
Advisor[] advisors = ((Advised)poller).getAdvisors();
|
||||
assertEquals(3, advisors.length);
|
||||
|
||||
@@ -53,7 +53,7 @@ import org.springframework.util.ErrorHandler;
|
||||
*/
|
||||
public abstract class TestUtils {
|
||||
|
||||
public static <T> T getPropertyValue(Object root, String propertyPath) {
|
||||
public static Object getPropertyValue(Object root, String propertyPath) {
|
||||
Object value = null;
|
||||
DirectFieldAccessor accessor = new DirectFieldAccessor(root);
|
||||
String[] tokens = propertyPath.split("\\.");
|
||||
@@ -68,9 +68,7 @@ public abstract class TestUtils {
|
||||
"intermediate property '" + tokens[i] + "' is null");
|
||||
}
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
T result = (T) value;
|
||||
return result;
|
||||
return value;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
||||
Reference in New Issue
Block a user