1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.yaml.snakeyaml.introspector;
17
18 import java.beans.IntrospectionException;
19 import java.beans.Introspector;
20 import java.beans.PropertyDescriptor;
21
22 import junit.framework.TestCase;
23
24 import org.yaml.snakeyaml.constructor.TestBean1;
25
26 public class MethodPropertyTest extends TestCase {
27
28 public void testToString() throws IntrospectionException {
29 for (PropertyDescriptor property : Introspector.getBeanInfo(TestBean1.class)
30 .getPropertyDescriptors()) {
31 if (property.getName().equals("text")) {
32 MethodProperty prop = new MethodProperty(property);
33 assertEquals("text of class java.lang.String", prop.toString());
34 }
35 }
36 }
37 }