aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/test/java/org/aspectj/systemtest/ajc1611/Ajc1611Tests.java
blob: de0c20a89f7de1f0f473fc222771d38c40f92e2d (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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/*******************************************************************************
 * Copyright (c) 2008 Contributors
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Andy Clement - initial API and implementation
 *******************************************************************************/
package org.aspectj.systemtest.ajc1611;

import java.io.File;

import org.aspectj.apache.bcel.classfile.JavaClass;
import org.aspectj.apache.bcel.classfile.Method;
import org.aspectj.systemtest.ajc150.GenericsTests;
import org.aspectj.testing.XMLBasedAjcTestCase;

import junit.framework.Test;

/**
 * @author Andy Clement
 */
public class Ajc1611Tests extends org.aspectj.testing.XMLBasedAjcTestCase {

	// error without the fix:
	// Second.java:8:0::0 Bound mismatch: The generic method foo(R, Class<T>) of type II is not applicable for the arguments (E1,
	// Class<capture#1-of ? extends E2>). The inferred type capture#1-of ? extends E2 is not a valid substitute for the bounded
	// parameter <R extends I1>
	public void testBoundsChecking_pr336880() {
		runTest("bounds check confusion");
	}

	public void testClashingItds_pr336774() {
		runTest("clashing itds");
	}

	public void testBadGenericSigAttribute_pr336745() {
		runTest("incorrect signature");
		JavaClass jc = GenericsTests.getClass(ajc, "C");
		assertNotNull(jc);
		Method m = getMethod(jc, "m");
		Method mitd = getMethod(jc, "mitd");
		assertEquals("<T::LI;>(TT;)V", m.getGenericSignature());
		assertEquals("<T::LI;>(TT;)V", mitd.getGenericSignature());
	}

	private Method getMethod(JavaClass jc, String name) {
		for (Method m : jc.getMethods()) {
			if (m.getName().equals(name)) {
				return m;
			}
		}
		return null;
	}

	public void testESJP_336471() {
		runTest("esjp");
	}

	public void testITIT_336136() {
		runTest("itit");
	}

	public void testITIT_336136_2() {
		runTest("itit - 2");
	}

	public void testDeserialization_335682() {
		runTest("pr335682");
	}

	public void testDeserialization_335682_2() {
		runTest("pr335682 - 2");
	}

	public void testDeserialization_335682_3() {
		runTest("pr335682 - 3");
	}

	public void testDeserialization_335682_5() {
		runTest("pr335682 - 5");
	}

	public void testNPEAddSerialVersionUID_bug335783() {
		runTest("pr335783");
	}

	public void testGenericsAndItds_333469() {
		runTest("pr333469");
	}

	public void testMissingType_332388() {
		runTest("pr332388");
	}

	public void testMissingType_332388_2() {
		runTest("pr332388 - 2");
	}

	public void testDeclareField_328840() {
		runTest("pr328840");
	}

	// public void testAnnoStyleAdviceChain_333274() {
	// runTest("anno style advice chain");
	// }
	//
	// public void testAnnoStyleAdviceChain_333274_2() {
	// runTest("code style advice chain");
	// }
	//
	// public void testAnnoStyleAdviceChain_333274_3() {
	// runTest("code style advice chain - no inline");
	// }

	// ---

	public static Test suite() {
		return XMLBasedAjcTestCase.loadSuite(Ajc1611Tests.class);
	}

	@Override
	protected File getSpecFile() {
		return getClassResource("ajc1611.xml");
	}

}