|
|
|
@ -16,12 +16,11 @@ |
|
|
|
|
|
|
|
|
|
|
|
package org.springframework.beans; |
|
|
|
package org.springframework.beans; |
|
|
|
|
|
|
|
|
|
|
|
import static org.junit.Assert.assertEquals; |
|
|
|
import org.junit.Test; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.JPanel; |
|
|
|
import org.springframework.tests.sample.beans.TestBean; |
|
|
|
import javax.swing.JTextField; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.junit.Test; |
|
|
|
import static org.junit.Assert.*; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Unit tests for {@link DirectFieldAccessor} |
|
|
|
* Unit tests for {@link DirectFieldAccessor} |
|
|
|
@ -39,13 +38,13 @@ public class DirectFieldAccessorTests extends AbstractConfigurablePropertyAccess |
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void withShadowedField() throws Exception { |
|
|
|
public void withShadowedField() throws Exception { |
|
|
|
@SuppressWarnings("serial") |
|
|
|
@SuppressWarnings("serial") |
|
|
|
JPanel p = new JPanel() { |
|
|
|
TestBean tb = new TestBean() { |
|
|
|
@SuppressWarnings("unused") |
|
|
|
@SuppressWarnings("unused") |
|
|
|
JTextField name = new JTextField(); |
|
|
|
StringBuilder name = new StringBuilder(); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
DirectFieldAccessor dfa = new DirectFieldAccessor(p); |
|
|
|
DirectFieldAccessor dfa = new DirectFieldAccessor(tb); |
|
|
|
assertEquals(JTextField.class, dfa.getPropertyType("name")); |
|
|
|
assertEquals(StringBuilder.class, dfa.getPropertyType("name")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|