11/*
2- * Copyright 2002-2011 the original author or authors.
2+ * Copyright 2002-2014 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
1616
1717package org .springframework .beans ;
1818
19- import static org .junit .Assert . assertEquals ;
19+ import org .junit .Test ;
2020
21- import javax .swing .JPanel ;
22- import javax .swing .JTextField ;
21+ import org .springframework .tests .sample .beans .TestBean ;
2322
24- import org .junit .Test ;
23+ import static org .junit .Assert .* ;
2524
2625/**
2726 * Unit tests for {@link DirectFieldAccessor}
@@ -34,12 +33,13 @@ public class DirectFieldAccessorTests {
3433 @ Test
3534 public void withShadowedField () throws Exception {
3635 @ SuppressWarnings ("serial" )
37- JPanel p = new JPanel () {
36+ TestBean tb = new TestBean () {
3837 @ SuppressWarnings ("unused" )
39- JTextField name = new JTextField ();
38+ StringBuilder name = new StringBuilder ();
4039 };
4140
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" ));
4443 }
44+
4545}
0 commit comments