提交 a80495b4 编写于 作者: J Juergen Hoeller

Avoid use of fragile Swing classes in tests (for compatibility with JDK 8u40)

Issue: SPR-12235
上级 1936dee9
......@@ -16,12 +16,11 @@
package org.springframework.beans;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import javax.swing.JPanel;
import javax.swing.JTextField;
import org.springframework.tests.sample.beans.TestBean;
import org.junit.Test;
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"));
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册