1
1
/*
2
- * Copyright 2002-2011 the original author or authors.
2
+ * Copyright 2002-2014 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
16
16
17
17
package org .springframework .beans ;
18
18
19
- import static org .junit .Assert . assertEquals ;
19
+ import org .junit .Test ;
20
20
21
- import javax .swing .JPanel ;
22
- import javax .swing .JTextField ;
21
+ import org .springframework .tests .sample .beans .TestBean ;
23
22
24
- import org .junit .Test ;
23
+ import static org .junit .Assert .* ;
25
24
26
25
/**
27
26
* Unit tests for {@link DirectFieldAccessor}
@@ -34,12 +33,13 @@ public class DirectFieldAccessorTests {
34
33
@ Test
35
34
public void withShadowedField () throws Exception {
36
35
@ SuppressWarnings ("serial" )
37
- JPanel p = new JPanel () {
36
+ TestBean tb = new TestBean () {
38
37
@ SuppressWarnings ("unused" )
39
- JTextField name = new JTextField ();
38
+ StringBuilder name = new StringBuilder ();
40
39
};
41
40
42
- DirectFieldAccessor dfa = new DirectFieldAccessor (p );
43
- assertEquals (JTextField .class , dfa .getPropertyType ("name" ));
41
+ DirectFieldAccessor dfa = new DirectFieldAccessor (tb );
42
+ assertEquals (StringBuilder .class , dfa .getPropertyType ("name" ));
44
43
}
44
+
45
45
}
0 commit comments