浏览代码

239649 and primitives no longer all resolved by default

tags/V1_6_12M2
aclement 12 年前
父节点
当前提交
26cd6dddc1

+ 83
- 0
tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java 查看文件

@@ -27,6 +27,89 @@ public class Ajc1612Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
// runTest("anno copying");
// }

// public void testDoubleITDF() throws Exception {
// runTest("double itdf");
// }

public void testThisAspectInstance_239649_1() throws Exception {
// simple case
runTest("thisAspectInstance - 1");
}

public void testThisAspectInstance_239649_2() throws Exception {
// before advice toggling on/off through if called method
runTest("thisAspectInstance - 2");
}

public void testThisAspectInstance_239649_3() throws Exception {
// after advice toggling on/off through if called method
runTest("thisAspectInstance - 3");
}

public void testThisAspectInstance_239649_4() throws Exception {
// before advice, also using thisJoinPointStaticPart
runTest("thisAspectInstance - 4");
}

public void testThisAspectInstance_239649_5() throws Exception {
// before advice, also using thisJoinPoint
runTest("thisAspectInstance - 5");
}

public void testThisAspectInstance_239649_6() throws Exception {
// before advice, also using thisEnclosingJoinPointStaticPart
runTest("thisAspectInstance - 6");
}

public void testThisAspectInstance_239649_7() throws Exception {
// before advice, also using thisJoinPoint and thisJoinPointStaticPart
runTest("thisAspectInstance - 7");
}

public void testThisAspectInstance_239649_8() throws Exception {
// before advice, also using abstract aspects
runTest("thisAspectInstance - 8");
}

public void testThisAspectInstance_239649_9() throws Exception {
// before advice, also using abstract aspects 2
runTest("thisAspectInstance - 9");
}

public void testThisAspectInstance_239649_10() throws Exception {
// aspects in a package
runTest("thisAspectInstance - 10");
}

public void testThisAspectInstance_239649_11() throws Exception {
// non-singleton aspect - should be an error for now
runTest("thisAspectInstance - 11");
}

public void testThisAspectInstance_239649_12() throws Exception {
// arg binding and tjpsp
runTest("thisAspectInstance - 12");
}

public void testThisAspectInstance_239649_13() throws Exception {
// pass instance
runTest("thisAspectInstance - 13");
}

public void testThisAspectInstance_239649_14() throws Exception {
// multiple ifs
runTest("thisAspectInstance - 14");
}

public void testThisAspectInstance_239649_15() throws Exception {
// abstract aspects
runTest("thisAspectInstance - 15");
}

public void testVerifyPerthis() throws Exception {
runTest("verify perthis");
}

public void testRangeForLocalVariables_353936() throws ClassNotFoundException {
runTest("local variable tables");
JavaClass jc = getClassFrom(ajc.getSandboxDirectory(), "X");

+ 192
- 0
tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml 查看文件

@@ -2,6 +2,198 @@

<suite>

<ajc-test dir="bugs1612/pr239649" title="thisAspectInstance - 1">
<compile files="One.java" options="-1.5"/>
<run class="One">
<stdout>
<line text="In instance check method doit()"/>
<line text="In advice()"/>
<line text="Method m() running"/>
</stdout>
</run>
</ajc-test>

<ajc-test dir="bugs1612/pr239649" title="thisAspectInstance - 2">
<compile files="Two.java" options="-1.5"/>
<run class="Two">
<stdout>
<line text="In instance check method, count=1 so doit returns false"/>
<line text="Method m() running"/>
<line text="In instance check method, count=2 so doit returns true"/>
<line text="In advice()"/>
<line text="Method m() running"/>
<line text="In instance check method, count=3 so doit returns false"/>
<line text="Method m() running"/>
<line text="In instance check method, count=4 so doit returns true"/>
<line text="In advice()"/>
<line text="Method m() running"/>
</stdout>
</run>
</ajc-test>

<ajc-test dir="bugs1612/pr239649" title="thisAspectInstance - 3">
<compile files="Three.java" options="-1.5"/>
<run class="Three">
<stdout>
<line text="Method m() running"/>
<line text="In instance check method, count=1 so doit returns false"/>
<line text="Method m() running"/>
<line text="In instance check method, count=2 so doit returns true"/>
<line text="In advice()"/>
<line text="Method m() running"/>
<line text="In instance check method, count=3 so doit returns false"/>
<line text="Method m() running"/>
<line text="In instance check method, count=4 so doit returns true"/>
<line text="In advice()"/>
</stdout>
</run>
</ajc-test>

<ajc-test dir="bugs1612/pr239649" title="thisAspectInstance - 4">
<compile files="Four.java" options="-1.5"/>
<run class="Four">
<stdout>
<line text="In instance check method doit()"/>
<line text="In advice() execution(void Four.m())"/>
<line text="Method m() running"/>
</stdout>
</run>
</ajc-test>

<ajc-test dir="bugs1612/pr239649" title="thisAspectInstance - 5">
<compile files="Five.java" options="-1.5"/>
<run class="Five">
<stdout>
<line text="In instance check method doit()"/>
<line text="In advice() arg0=abc"/>
<line text="Method m() running"/>
</stdout>
</run>
</ajc-test>

<ajc-test dir="bugs1612/pr239649" title="thisAspectInstance - 6">
<compile files="Six.java" options="-1.5"/>
<run class="Six">
<stdout>
<line text="In instance check method doit()"/>
<line text="In advice() execution(void Six.main(String[]))"/>
<line text="Method m() running"/>
</stdout>
</run>
</ajc-test>

<ajc-test dir="bugs1612/pr239649" title="thisAspectInstance - 7">
<compile files="Seven.java" options="-1.5"/>
<run class="Seven">
<stdout>
<line text="In instance check method doit()"/>
<line text="In advice() call(void Seven.m()) execution(void Seven.main(String[]))"/>
<line text="Method m() running"/>
</stdout>
</run>
</ajc-test>

<ajc-test dir="bugs1612/pr239649" title="thisAspectInstance - 8">
<compile files="Eight.java" options="-1.5"/>
<run class="Eight">
<stdout>
<line text="in doit(): class=X"/>
<line text="In advice()"/>
<line text="Method m() running"/>
</stdout>
</run>
</ajc-test>

<ajc-test dir="bugs1612/pr239649" title="thisAspectInstance - 9">
<compile files="Nine.java" options="-1.5"/>
<run class="Nine">
<stdout>
<line text="in doit(): class=X"/>
<line text="In advice()"/>
<line text="Method m() running"/>
</stdout>
</run>
</ajc-test>

<ajc-test dir="bugs1612/pr239649" title="thisAspectInstance - 10">
<compile files="Ten.java" options="-1.5"/>
<run class="com.foo.bar.Ten">
<stdout>
<line text="In instance check method doit() class=com.foo.bar.X"/>
<line text="In advice()"/>
<line text="Method m() running"/>
</stdout>
</run>
</ajc-test>

<ajc-test dir="bugs1612/pr239649" title="thisAspectInstance - 11">
<compile files="Eleven.java" options="-1.5">
<message kind="error" text="thisAspectInstance can only be used inside an if() clause for singleton aspects (compiler limitation)"/>
</compile>
</ajc-test>

<ajc-test dir="bugs1612/pr239649" title="thisAspectInstance - 12">
<compile files="Twelve.java" options="-1.5"/>
<run class="Twelve">
<stdout>
<line text="In instance check method doit()"/>
<line text="In advice() arg=abc tjpsp=execution(void Twelve.m(String))"/>
<line text="Method m() running"/>
</stdout>
</run>
</ajc-test>

<ajc-test dir="bugs1612/pr239649" title="thisAspectInstance - 13">
<compile files="Thirteen.java" options="-1.5"/>
<run class="Thirteen">
<stdout>
<line text="instance is X"/>
<line text="In advice() arg=abc tjpsp=execution(void Thirteen.m(String))"/>
<line text="Method m() running"/>
</stdout>
</run>
</ajc-test>

<ajc-test dir="bugs1612/pr239649" title="thisAspectInstance - 14">
<compile files="Fourteen.java" options="-1.5"/>
<run class="Fourteen">
<stdout>
<line text="instance is X"/>
<line text="In advice()"/>
<line text="Method m() running"/>
</stdout>
</run>
</ajc-test>

<ajc-test dir="bugs1612/pr239649" title="thisAspectInstance - 15">
<compile files="Fifteen.java" options="-1.5"/>
<run class="Fifteen">
<stdout>
<line text="in doit(): class=X"/>
<line text="In advice()"/>
<line text="Method m() running"/>
</stdout>
</run>
</ajc-test>

<ajc-test dir="bugs1612/doubleITDF" title="double itdf">
<compile files="A.java" options="-1.7"/>
<run class="A">
<stdout>
<line text="AA"/>
</stdout>
</run>
</ajc-test>

<ajc-test dir="bugs1612/verify" title="verify perthis">
<compile files="Runner.aj" inpath="code.jar" classpath="groovy-1.8.0.jar;asm-3.2.jar" options="-1.6 -Xset:generateStackMaps=true"/>
<run class="Runner">
<stdout>
<line text="AA"/>
</stdout>
</run>
</ajc-test>

<ajc-test dir="bugs1612/pr353936" title="local variable tables">
<compile files="Code.java" options="-1.5"/>
</ajc-test>

+ 9
- 9
tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java 查看文件

@@ -252,8 +252,8 @@ public class AjdeInteractionTestbed extends TestCase {
private void addXmlConfigFilesToBuild(String pname, AjCompiler compiler) {
File projectBase = new File(sandboxDir, pname);
ICompilerConfiguration icc = compiler.getCompilerConfiguration();
List currentXmlFiles = icc.getProjectXmlConfigFiles();
List collector = new ArrayList();
List<String> currentXmlFiles = icc.getProjectXmlConfigFiles();
List<String> collector = new ArrayList<String>();
collectUpXmlFiles(projectBase, projectBase, collector);
boolean changed = false;
for (int i = 0; i < collector.size(); i++) {
@@ -271,7 +271,7 @@ public class AjdeInteractionTestbed extends TestCase {
}
}

private void collectUpFiles(File location, File base, List collectionPoint) {
private void collectUpFiles(File location, File base, List<String> collectionPoint) {
String contents[] = location.list();
if (contents == null) {
return;
@@ -296,7 +296,7 @@ public class AjdeInteractionTestbed extends TestCase {
}
}

private void collectUpXmlFiles(File location, File base, List collectionPoint) {
private void collectUpXmlFiles(File location, File base, List<String> collectionPoint) {
String contents[] = location.list();
if (contents == null) {
return;
@@ -400,14 +400,14 @@ public class AjdeInteractionTestbed extends TestCase {
public void printBuildReport(String projectName) {
System.out.println("\n====== BUILD REPORT (Project " + projectName + ") ===========");
System.out.println("Build took: " + getTimeTakenForBuild(projectName) + "ms");
List compiled = getCompiledFiles(projectName);
List<String> compiled = getCompiledFiles(projectName);
System.out.println("Compiled: " + compiled.size() + " files");
for (Iterator iter = compiled.iterator(); iter.hasNext();) {
for (Iterator<String> iter = compiled.iterator(); iter.hasNext();) {
System.out.println(" :" + iter.next());
}
List woven = getWovenClasses(projectName);
List<String> woven = getWovenClasses(projectName);
System.out.println("Wove: " + woven.size() + " files");
for (Iterator iter = woven.iterator(); iter.hasNext();) {
for (Iterator<String> iter = woven.iterator(); iter.hasNext();) {
System.out.println(" :" + iter.next());
}
if (wasFullBuild()) {
@@ -497,7 +497,7 @@ public class AjdeInteractionTestbed extends TestCase {

public static boolean informedAboutKindOfBuild;
public static boolean fullBuildOccurred;
public static List detectedDeletions = new ArrayList();
public static List<String> detectedDeletions = new ArrayList<String>();
public static StringBuffer decisions = new StringBuffer();

public static void reset() {

+ 5
- 5
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjTestCompilerConfiguration.java 查看文件

@@ -35,7 +35,7 @@ public class MultiProjTestCompilerConfiguration implements ICompilerConfiguratio
private IOutputLocationManager outputLocationManager = null;
private List dependants;
private Map javaOptionsMap;
private Set inpath;
private Set<File> inpath;
private String encoding = null;
private String outjar;
private String nonstandardoptions;
@@ -83,17 +83,17 @@ public class MultiProjTestCompilerConfiguration implements ICompilerConfiguratio
return cp;
}

public Set getInpath() {
public Set<File> getInpath() {
log("ICompilerConfiguration.getInPath()");
return inpath;
}

public Map getJavaOptionsMap() {
public Map<String, String> getJavaOptionsMap() {
log("ICompilerConfiguration.getJavaOptionsMap()");
if (javaOptionsMap != null && !javaOptionsMap.isEmpty())
return javaOptionsMap;

Hashtable ht = new Hashtable();
Hashtable<String, String> ht = new Hashtable<String, String>();
ht.put("org.eclipse.jdt.core.compiler.compliance", "1.5");
ht.put("org.eclipse.jdt.core.compiler.codegen.targetPlatform", "1.5");
ht.put("org.eclipse.jdt.core.compiler.source", "1.5");
@@ -155,7 +155,7 @@ public class MultiProjTestCompilerConfiguration implements ICompilerConfiguratio
this.changed |= ICompilerConfiguration.ASPECTPATH_CHANGED;
}

public void setInpath(Set inpath) {
public void setInpath(Set<File> inpath) {
this.inpath = inpath;
this.changed |= ICompilerConfiguration.INPATH_CHANGED;
}

+ 1
- 1
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjTestMessageHandler.java 查看文件

@@ -112,7 +112,7 @@ public class MultiProjTestMessageHandler implements IBuildMessageHandler {
return weavingMessages;
}

public List/* IMessage */getCompilerErrors() {
public List<IMessage> getCompilerErrors() {
return compilerErrors;
}


正在加载...
取消
保存