1 package org.apache.commons.beanutils2.issues;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import static org.apache.commons.beanutils2.Argument.argument;
23 import static org.apache.commons.beanutils2.BeanUtils.on;
24
25 import org.apache.commons.beanutils2.testbeans.TestBean;
26 import org.junit.After;
27 import org.junit.Before;
28 import org.junit.Test;
29
30
31
32
33 public class JiraSandbox433TestCase
34 {
35
36 private final static int COUNT = 50000;
37
38 private TestBean testBean;
39
40 @Before
41 public void setUp()
42 {
43 testBean = new TestBean();
44 }
45
46 @After
47 public void tearDown()
48 {
49 testBean = null;
50 }
51
52 @Test
53 public void setPropertyVeryOften()
54 {
55 for ( int i = 0; i < COUNT; i++ )
56 {
57 on( testBean ).set( "intProperty" ).with( i );
58 }
59 }
60
61 @Test
62 public void getPropertyVeryOften()
63 {
64 for ( int i = 0; i < COUNT; i++ )
65 {
66 on( testBean ).get( "intProperty" );
67 }
68 }
69
70 @Test
71 public void callMethodVeryOften()
72 {
73 for ( int i = 0; i < COUNT; i++ )
74 {
75 on( testBean ).invoke( "setIntProperty" ).with( argument( i ) );
76 }
77 }
78
79 @Test
80 public void callConstructorVeryOften()
81 {
82 for ( int i = 0; i < COUNT; i++ )
83 {
84 on( TestBean.class ).newInstance();
85 }
86 }
87 }