diff --git a/spring-beans/src/test/java/org/springframework/beans/DirectFieldAccessorTests.java b/spring-beans/src/test/java/org/springframework/beans/DirectFieldAccessorTests.java index 01a117d2b6..43ce76b417 100644 --- a/spring-beans/src/test/java/org/springframework/beans/DirectFieldAccessorTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/DirectFieldAccessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2014 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. @@ -16,13 +16,12 @@ package org.springframework.beans; -import static org.junit.Assert.assertEquals; - -import javax.swing.JPanel; -import javax.swing.JTextField; - import org.junit.Test; +import org.springframework.tests.sample.beans.TestBean; + +import static org.junit.Assert.*; + /** * Unit tests for {@link DirectFieldAccessor} * @@ -34,12 +33,13 @@ public class DirectFieldAccessorTests { @Test public void withShadowedField() throws Exception { @SuppressWarnings("serial") - JPanel p = new JPanel() { + TestBean tb = new TestBean() { @SuppressWarnings("unused") - JTextField name = new JTextField(); + StringBuilder name = new StringBuilder(); }; - DirectFieldAccessor dfa = new DirectFieldAccessor(p); - assertEquals(JTextField.class, dfa.getPropertyType("name")); + DirectFieldAccessor dfa = new DirectFieldAccessor(tb); + assertEquals(StringBuilder.class, dfa.getPropertyType("name")); } + }