Avoid use of fragile Swing classes in tests (for compatibility with JDK 8u40)
Issue: SPR-12235
This commit is contained in:
@@ -16,13 +16,12 @@
|
|||||||
|
|
||||||
package org.springframework.beans;
|
package org.springframework.beans;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
|
|
||||||
import javax.swing.JPanel;
|
|
||||||
import javax.swing.JTextField;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import org.springframework.tests.sample.beans.TestBean;
|
||||||
|
|
||||||
|
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"));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user