Browse Source

Testcases for Bug 149322 "Change Xlint cantFindType default to warning"

tags/PRE_PIPELINE
mwebster 18 years ago
parent
commit
c38a878e00

+ 0
- 7
tests/bugs153/pr149322/Aspect.aj View File


public aspect Aspect {

before () : call(public * method(..)) && target(Interface) {
System.out.println("Aspect.before()");
}
}

+ 6
- 0
tests/bugs153/pr149322/Aspect1.aj View File

public aspect Aspect1 {

before () : call(public * interfaceMethod(..)) && target(Interface) {
System.out.println("Aspect1.before() " + thisJoinPoint.getSignature().getName());
}
}

+ 6
- 0
tests/bugs153/pr149322/Aspect2.aj View File

public aspect Aspect2 {

before () : call(public * Interface.interfaceMethod(..)) {
System.out.println("Aspect2.before() " + thisJoinPoint.getSignature().getName());
}
}

+ 6
- 0
tests/bugs153/pr149322/Aspect3.aj View File

public aspect Aspect3 {

before () : call(public * Interface.*(..)) {
System.out.println("Aspect3.before() " + thisJoinPoint.getSignature().getName());
}
}

+ 1
- 1
tests/bugs153/pr149322/Interface.java View File



public interface Interface { public interface Interface {


public void method ();
public void interfaceMethod ();
} }

+ 6
- 2
tests/bugs153/pr149322/Missing.java View File



public class Missing implements Interface { public class Missing implements Interface {
public void interfaceMethod () {
System.out.println("Missing.interfaceMethod()");
}


public void method () {
System.out.println("Missing.method()");
public void missingMethod () {
System.out.println("Missing.missingMethod()");
} }
} }

+ 0
- 14
tests/bugs153/pr149322/TestFail.java View File

public class TestFail {

public void invoke () {
Interface i = new Missing();
i.method();
Missing cf = new Missing();
cf.method();
}
public static void main(String[] args) {
new TestFail().invoke();
}

}

+ 0
- 13
tests/bugs153/pr149322/TestPass.java View File


public class TestPass {

public void invoke () {
Interface i = new CantFind();
i.method();
}
public static void main(String[] args) {
new TestFail();
}

}

+ 15
- 0
tests/bugs153/pr149322/TestWithMissing.java View File

public class TestWithMissing {

public void invoke () {
Interface i = new Missing();
i.interfaceMethod();
Missing m = new Missing();
m.interfaceMethod();
m.missingMethod();
}
public static void main(String[] args) {
new TestWithMissing().invoke();
}

}

+ 0
- 6
tests/bugs153/pr149322/aop.xml View File

<aspectj>
<aspects>
<aspect name="Aspect"/>
</aspects>
<weaver options="-verbose -showWeaveInfo"/>
</aspectj>

+ 3
- 1
tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java View File

// public void testAdviceNotWovenAspectPath_pr147841() { runTest("advice not woven on aspectpath");} // public void testAdviceNotWovenAspectPath_pr147841() { runTest("advice not woven on aspectpath");}
public void testGenericSignatures_pr148409() { runTest("generic signature problem"); } public void testGenericSignatures_pr148409() { runTest("generic signature problem"); }
// public void testBrokenIfArgsCflowAtAj_pr145018() { runTest("ataj crashing with cflow, if and args");} // public void testBrokenIfArgsCflowAtAj_pr145018() { runTest("ataj crashing with cflow, if and args");}
public void testCantFindType_pr149322_1() {runTest("can't find type on interface call");}
public void testCantFindType_pr149322_01() {runTest("can't find type on interface call 1");}
public void testCantFindType_pr149322_02() {runTest("can't find type on interface call 2");}
public void testCantFindType_pr149322_03() {runTest("can't find type on interface call 3");}


///////////////////////////////////////// /////////////////////////////////////////
public static Test suite() { public static Test suite() {

+ 74
- 16
tests/src/org/aspectj/systemtest/ajc153/ajc153.xml View File

<compile files="Foo.java" options="-1.5"/> <compile files="Foo.java" options="-1.5"/>
</ajc-test> </ajc-test>
<ajc-test dir="bugs153/pr149322" title="can't find type on interface call">
<ajc-test dir="bugs153/pr149322" title="can't find type on interface call 1">
<compile files="Interface.java"/> <compile files="Interface.java"/>
<compile <compile
files="Missing.java" files="Missing.java"
outjar="missing.jar" outjar="missing.jar"
/> />
<compile files="TestFail.java" classpath="missing.jar"/>
<!--
<compile files="Aspect.aj" options="-showWeaveInfo -inpath ." classpath="missing.jar">
<message kind="weave" text="void Interface.method()"/>
<message kind="weave" text="void Missing.method()"/>
<compile files="TestWithMissing.java" classpath="missing.jar"/>
<compile files="Aspect1.aj" options="-showWeaveInfo -inpath ." classpath="missing.jar">
<message kind="weave" text="void Interface.interfaceMethod()"/>
<message kind="weave" text="void Missing.interfaceMethod()"/>
</compile> </compile>
<compile files="Aspect.aj" options="-showWeaveInfo -inpath .">
<message kind="weave" text="void Interface.method()"/>
<message kind="weave" text="void Missing.method()"/>
<compile files="Aspect1.aj" options="-Xlint:warning -showWeaveInfo -inpath .">
<message kind="weave" text="void Interface.interfaceMethod()"/>
<message kind="warning" text="can't determine superclass of missing type Missing"/>
</compile> </compile>
-->
<compile files="Aspect.aj" options="-Xlint:warning -showWeaveInfo -inpath .">
<message kind="weave" text="void Interface.method()"/>
<message kind="warning" text="Missing"/>
<run class="TestWithMissing">
<stdout>
<line text="Aspect1.before() interfaceMethod"/>
<line text="Missing.interfaceMethod()"/>
<!--
<line text="Aspect1.before() interfaceMethod"/>
-->
<line text="Missing.interfaceMethod()"/>
<line text="Missing.missingMethod()"/>
</stdout>
</run>
</ajc-test>
<ajc-test dir="bugs153/pr149322" title="can't find type on interface call 2">
<compile files="Interface.java"/>
<compile
files="Missing.java"
outjar="missing.jar"
/>
<compile files="TestWithMissing.java" classpath="missing.jar"/>
<compile files="Aspect2.aj" options="-showWeaveInfo -inpath ." classpath="missing.jar">
<message kind="weave" text="void Interface.interfaceMethod()"/>
<message kind="weave" text="void Missing.interfaceMethod()"/>
</compile>
<compile files="Aspect2.aj" options="-Xlint:warning -showWeaveInfo -inpath .">
<message kind="weave" text="void Interface.interfaceMethod()"/>
<message kind="warning" text="can't determine whether missing type Missing is an instance of Interface"/>
<message kind="warning" text="can't determine superclass of missing type Missing"/>
</compile>
<run class="TestWithMissing">
<stdout>
<line text="Aspect2.before() interfaceMethod"/>
<line text="Missing.interfaceMethod()"/>
<!--
<line text="Aspect2.before() interfaceMethod"/>
-->
<line text="Missing.interfaceMethod()"/>
<line text="Missing.missingMethod()"/>
</stdout>
</run>
</ajc-test>
<ajc-test dir="bugs153/pr149322" title="can't find type on interface call 3">
<compile files="Interface.java"/>
<compile
files="Missing.java"
outjar="missing.jar"
/>
<compile files="TestWithMissing.java" classpath="missing.jar"/>
<compile files="Aspect3.aj" options="-showWeaveInfo -inpath ." classpath="missing.jar">
<message kind="weave" text="void Interface.interfaceMethod()"/>
<message kind="weave" text="void Missing.interfaceMethod()"/>
</compile>
<compile files="Aspect3.aj" options="-Xlint:warning -showWeaveInfo -inpath .">
<message kind="weave" text="void Interface.interfaceMethod()"/>
<message kind="warning" text="can't determine whether missing type Missing is an instance of Interface"/>
<message kind="warning" text="can't determine superclass of missing type Missing"/>
</compile> </compile>
<!--
<run class="TestFail" ltw="aop.xml"/>
-->
<run class="TestWithMissing">
<stdout>
<line text="Aspect3.before() interfaceMethod"/>
<line text="Missing.interfaceMethod()"/>
<!--
<line text="Aspect3.before() interfaceMethod"/>
-->
<line text="Missing.interfaceMethod()"/>
<line text="Missing.missingMethod()"/>
</stdout>
</run>
</ajc-test> </ajc-test>
</suite> </suite>

Loading…
Cancel
Save