blob: b8ce0afa74f91374758f19f3d02c1a3bc052f661 (
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
|
/*******************************************************************************
* Copyright (c) 2008 Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
*
* Contributors:
* Andy Clement - initial API and implementation
*******************************************************************************/
package org.aspectj.systemtest.ajc165;
import java.util.List;
import org.aspectj.bridge.IMessage;
import org.aspectj.testing.XMLBasedAjcTestCase;
import org.aspectj.weaver.LintMessage;
import junit.framework.Test;
public class Ajc165Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
// fix is too disruptive for 1.6.5
// public void testGenericsBridge_pr279983() {
// runTest("generics bridge");
// }
public void testVerifyError_pr277959() {
runTest("verifyerror");
}
// on the build machine (linux) - these tests don't expect the right output - i suspect due to CR/LF issues
// since that will affect the generated name of the if methods
// public void testIfNames_pr277508() {
// runTest("if method names");
// }
//
// public void testIfNames_pr277508_2() {
// runTest("if method names - 2");
// }
public void testDecAnnoMethod_pr275625() {
runTest("dec anno method");
}
public void testDecAnnoField_pr275625() {
runTest("dec anno field");
}
// check ITD can replace a generated default constructor
public void testItdDefaultCtor_pr275032() {
runTest("itd default ctor");
}
// check ITD can't overwrite an existing constructor
public void testItdDefaultCtor_pr275032_2() {
runTest("itd default ctor - 2");
}
// binary weaving version of case 2 - check ITD can't overwrite an existing constructor
public void testItdDefaultCtor_pr275032_3() {
runTest("itd default ctor - 3");
}
// binary weaving version of case 4 - check ITD can replace a generated default constructor
public void testItdDefaultCtor_pr275032_4() {
runTest("itd default ctor - 4");
}
public void testVerifyOnAnnoBind_pr273628() {
runTest("verifyerror on anno bind");
}
public void testFunkyPointcut_pr272233() {
runTest("funky pointcut");
}
public void testFunkyPointcut_pr272233_2() {
runTest("funky pointcut 2");
}
public void testAnnotationStyle_pr265356() {
runTest("annotation style message positions");
List<IMessage> ms = ajc.getLastCompilationResult().getWarningMessages();
boolean checked = true;
// Look for the message relating to 'List' and check the offsets
for (IMessage iMessage : ms) {
LintMessage m = (LintMessage) iMessage;
if (m.toString().contains("List")) {
// 225/228 on windows - 237/240 on linux
if (!(m.getSourceStart() == 225 || m.getSourceStart() == 237)) {
fail("Did not get expected start position, was:" + m.getSourceStart());
}
if (!(m.getSourceEnd() == 228 || m.getSourceEnd() == 240)) {
fail("Did not get expected end position, was:" + m.getSourceEnd());
}
checked = true;
}
}
assertTrue("Failed to check the message", checked);
}
public void testAroundCall_pr271169() {
runTest("around call npe");
}
public void testGenericITD_pr272825() {
runTest("generic ITD");
}
// ---
public static Test suite() {
return XMLBasedAjcTestCase.loadSuite(Ajc165Tests.class);
}
@Override
protected java.net.URL getSpecFile() {
return getClassResource("ajc165.xml");
}
}
|