1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.bcel.generic;
18
19 import static org.junit.jupiter.api.Assertions.assertEquals;
20
21 import org.junit.jupiter.api.Test;
22
23 public class PUTFIELDTestCase {
24 @Test
25 public void testAccept() {
26 final CountingVisitor countVisitor = new CountingVisitor();
27 final PUTFIELD putfield = new PUTFIELD(0);
28 putfield.accept(countVisitor);
29 final CountingVisitor expected = new CountingVisitor();
30 expected.setExceptionThrower(1);
31 expected.setStackConsumer(1);
32 expected.setPopInstruction(1);
33 expected.setTypedInstruction(1);
34 expected.setLoadClass(1);
35 expected.setCpInstruction(1);
36 expected.setFieldOrMethod(1);
37 expected.setFieldInstruction(1);
38 expected.setPutfield(1);
39 assertEquals(expected, countVisitor);
40 }
41 }