aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/testproxy/Target189.java
blob: ebe7805e3b5c76b13145d2068092dc54f72448e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package testproxy;

import javassist.util.proxy.MethodHandler;
import java.lang.reflect.Method;

public class Target189 {
	public interface TestProxy {
	}

	public static class TestMethodHandler implements MethodHandler {

		int invoked = 0;

		public Object invoke(Object self, Method thisMethod, Method proceed,
				Object[] args) throws Throwable {
			invoked++;
			return proceed.invoke(self, args);
		}

		public boolean wasInvokedOnce() {
			return invoked == 1;
		}

		public void reset() {
			invoked = 0;
		}
	}

	public static class Issue {

		private Integer id;

		public Integer getId() {
			return id;
		}

		public void setId(Integer id) {
			this.id = id;
		}
	}

	public static class PublishedIssue extends Issue {
	}

	public static abstract class Article {
		private Integer id;

		public Integer getId() {
			return id;
		}

		public void setId(Integer id) {
			this.id = id;
		}

		public abstract Issue getIssue();
	}

	public static class PublishedArticle extends Article {

		private PublishedIssue issue;

		@Override
		public PublishedIssue getIssue() {
			return issue;
		}

		public void setIssue(PublishedIssue issue) {
			this.issue = issue;
		}

	}

}