Avoid use of fragile Swing classes in tests (for compatibility with JDK 8u40)
Issue: SPR-12235
This commit is contained in:
parent
1936dee991
commit
a80495b47d
|
@ -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}
|
||||
*
|
||||
|
@ -39,13 +38,13 @@ public class DirectFieldAccessorTests extends AbstractConfigurablePropertyAccess
|
|||
@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"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue