Browse Source

tests for pr83377

tags/V1_5_0M3
acolyer 19 years ago
parent
commit
3cedc6ef49

+ 18
- 0
tests/bugs150/pr83377.aj View File


interface I extends Cloneable {
public Object clone ();
}

class C implements I {
// public Object clone() {return this;}
}

privileged aspect A {
declare parents : C implements java.lang.Cloneable;
public Object C.clone () {
return null;
}
}


+ 4
- 0
tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java View File

runTest("good error message for unmatched member syntax"); runTest("good error message for unmatched member syntax");
} }
public void testITDWithNoExceptionAndIntermediary() {
runTest("itd override with no exception clause");
}
// helper methods..... // helper methods.....
public SyntheticRepository createRepos(File cpentry) { public SyntheticRepository createRepos(File cpentry) {

+ 58
- 10
tests/src/org/aspectj/systemtest/ajc150/ajc150.xml View File

<message kind="error" line="41" text="ConnectionRequestContext cannot be resolved to a type"/> <message kind="error" line="41" text="ConnectionRequestContext cannot be resolved to a type"/>
</compile> </compile>
</ajc-test> </ajc-test>
<ajc-test title="itd override with no exception clause" dir="bugs150">
<compile files="pr83377.aj"></compile>
</ajc-test>
<ajc-test dir="bugs150/pr84260" vm="1.5" title="static import failures"> <ajc-test dir="bugs150/pr84260" vm="1.5" title="static import failures">
<compile files="A.java,I1.java,I2.java" options="-1.5"/> <compile files="A.java,I1.java,I2.java" options="-1.5"/>
<message kind="error" line="3" text="Syntax error on token &quot;new&quot;, &quot;method name (not constructor)&quot; expected"/> <message kind="error" line="3" text="Syntax error on token &quot;new&quot;, &quot;method name (not constructor)&quot; expected"/>
</compile> </compile>
</ajc-test> </ajc-test>

<!-- hasmethod / hasfield tests -->

<ajc-test title="declare parents : hasmethod(..) - 1" dir="hasmember">
<compile files="HasMethod.aj">
</compile>
<run class="HasMethod"></run>
</ajc-test>

<ajc-test title="declare parents : hasmethod(..) - 2" dir="hasmember">
<compile files="HasMethodInherited.aj">
</compile>
<run class="HasMethodInherited"></run>
</ajc-test>

<ajc-test title="declare parents : hasmethod(..) - 3" dir="hasmember">
<compile files="HasPrivateMethodInherited.aj">
</compile>
<run class="HasPrivateMethodInherited"></run>
</ajc-test>

<ajc-test title="declare parents : hasmethod(..) - 4" dir="hasmember">
<compile files="HasMethodViaITD.aj">
<message kind="warning" line="15" text="hasmethod matched on ITD ok"/>
</compile>
</ajc-test>
<ajc-test title="declare parents : hasfield(..) - 1" dir="hasmember">
<compile files="HasField.aj">
</compile>
<run class="HasField"></run>
</ajc-test>

<ajc-test title="declare parents : hasfield(..) - 2" dir="hasmember">
<compile files="HasFieldInherited.aj">
</compile>
<run class="HasFieldInherited"></run>
</ajc-test>

<ajc-test title="declare parents : hasfield(..) - 3" dir="hasmember">
<compile files="HasPrivateFieldInherited.aj">
</compile>
<run class="HasPrivateFieldInherited"></run>
</ajc-test>
<!-- Annotation binding tests --> <!-- Annotation binding tests -->
<ajc-test dir="java5/annotations/binding" vm="1.5" title="call annotation binding 1"> <ajc-test dir="java5/annotations/binding" vm="1.5" title="call annotation binding 1">
<ajc-test dir="java5/generics/itds" title="parameterized method itd - 2"> <ajc-test dir="java5/generics/itds" title="parameterized method itd - 2">
<compile files="ParameterizedMethodITD2.aj" options="-1.5"> <compile files="ParameterizedMethodITD2.aj" options="-1.5">
<message kind="error" line="9" text="The method simple(List&lt;? extends Number&gt;) in the type X is not applicable for the arguments (List&lt;A&gt;)"/>
<message kind="error" line="9" text="The method simple(List&lt;? extends Number&gt;) in the type Base is not applicable for the arguments (List&lt;A&gt;)"/>
</compile> </compile>
</ajc-test> </ajc-test>




<ajc-test dir="java5/generics/itds" title="parameterized method itd - 3"> <ajc-test dir="java5/generics/itds" title="parameterized method itd - 3">
<compile files="ParameterizedMethodITD3.aj" options="-1.5"> <compile files="ParameterizedMethodITD3.aj" options="-1.5">
<message kind="error" line="9" text="The method simple(List&lt;? super A&gt;) in the type X is not applicable for the arguments (List&lt;B&gt;)"/>
<message kind="error" line="9" text="The method simple(List&lt;? super A&gt;) in the type Base is not applicable for the arguments (List&lt;B&gt;)"/>
</compile> </compile>
</ajc-test> </ajc-test>


<ajc-test dir="java5/generics/itds" title="generic method itd - 2"> <ajc-test dir="java5/generics/itds" title="generic method itd - 2">
<compile files="GenericMethodITD2.aj" options="-1.5"> <compile files="GenericMethodITD2.aj" options="-1.5">
<message kind="error" line="9" text="Bound mismatch: The generic method simple(List&lt;? extends E&gt;) of type X is not applicable for the arguments (List&lt;A&gt;). The inferred type A is not a valid substitute for the bounded parameter &lt;E extends Number&gt;"/>
<message kind="error" line="9" text="Bound mismatch: The generic method simple(List&lt;? extends E&gt;) of type Base is not applicable for the arguments (List&lt;A&gt;). The inferred type A is not a valid substitute for the bounded parameter &lt;E extends Number&gt;"/>
</compile> </compile>
</ajc-test> </ajc-test>


<ajc-test dir="java5/generics/itds" title="generic method itd - 5"> <ajc-test dir="java5/generics/itds" title="generic method itd - 5">
<compile files="GenericMethodITD5.aj" options="-1.5"> <compile files="GenericMethodITD5.aj" options="-1.5">
<message kind="error" line="10" text="The method simple(List&lt;E&gt;, List&lt;E&gt;) in the type X is not applicable for the arguments (List&lt;A&gt;, List&lt;B&gt;)"/>
<message kind="error" line="10" text="The method simple(List&lt;E&gt;, List&lt;E&gt;) in the type Base is not applicable for the arguments (List&lt;A&gt;, List&lt;B&gt;)"/>
</compile> </compile>
</ajc-test> </ajc-test>
<ajc-test dir="java5/generics/itds" title="generic method itd - 8"> <ajc-test dir="java5/generics/itds" title="generic method itd - 8">
<compile files="GenericMethodITD8.aj" options="-1.5"> <compile files="GenericMethodITD8.aj" options="-1.5">
<message kind="error" line="10" text="The method simple(List&lt;E&gt;, List&lt;? extends E&gt;) in the type X is not applicable for the arguments (List&lt;Number&gt;, List&lt;String&gt;)"/>
<message kind="error" line="10" text="The method simple(List&lt;E&gt;, List&lt;? extends E&gt;) in the type Base is not applicable for the arguments (List&lt;Number&gt;, List&lt;String&gt;)"/>
</compile> </compile>
</ajc-test> </ajc-test>
<ajc-test dir="java5/generics/itds" title="generic method itd - 10"> <ajc-test dir="java5/generics/itds" title="generic method itd - 10">
<compile files="GenericMethodITD10.aj" options="-1.5"> <compile files="GenericMethodITD10.aj" options="-1.5">
<message kind="error" line="10" text="Bound mismatch: The generic method crazy(List&lt;R&gt;) of type X is not applicable for the arguments (List&lt;A&gt;). The inferred type A is not a valid substitute for the bounded parameter &lt;R extends Object &amp; Comparable&lt;? super R&gt;&gt;"/>
<message kind="error" line="10" text="Bound mismatch: The generic method crazy(List&lt;R&gt;) of type Base is not applicable for the arguments (List&lt;A&gt;). The inferred type A is not a valid substitute for the bounded parameter &lt;R extends Object &amp; Comparable&lt;? super R&gt;&gt;"/>
</compile> </compile>
</ajc-test> </ajc-test>
<ajc-test dir="java5/generics/itds" title="generic method itd - 12"> <ajc-test dir="java5/generics/itds" title="generic method itd - 12">
<compile files="GenericMethodITD12.aj" options="-1.5"> <compile files="GenericMethodITD12.aj" options="-1.5">
<message kind="error" line="10" text="Bound mismatch: The generic method crazy(List&lt;R&gt;) of type X is not applicable for the arguments (List&lt;A&gt;). The inferred type A is not a valid substitute for the bounded parameter &lt;R extends Object &amp; Foo&lt;? extends R&gt;&gt;"/>
<message kind="error" line="10" text="Bound mismatch: The generic method crazy(List&lt;R&gt;) of type Base is not applicable for the arguments (List&lt;A&gt;). The inferred type A is not a valid substitute for the bounded parameter &lt;R extends Object &amp; Foo&lt;? extends R&gt;&gt;"/>
</compile> </compile>
</ajc-test> </ajc-test>


<ajc-test dir="java5/generics/itds" title="generic method itd - 14"> <ajc-test dir="java5/generics/itds" title="generic method itd - 14">
<compile files="GenericMethodITD14.aj" options="-1.5"> <compile files="GenericMethodITD14.aj" options="-1.5">
<message kind="error" line="10" text="Bound mismatch: The generic method crazy(List&lt;R&gt;) of type X is not applicable for the arguments (List&lt;A&gt;). The inferred type A is not a valid substitute for the bounded parameter &lt;R extends Object &amp; Foo&lt;? super R&gt;&gt;"/>
<message kind="error" line="10" text="Bound mismatch: The generic method crazy(List&lt;R&gt;) of type Base is not applicable for the arguments (List&lt;A&gt;). The inferred type A is not a valid substitute for the bounded parameter &lt;R extends Object &amp; Foo&lt;? super R&gt;&gt;"/>
</compile> </compile>
</ajc-test> </ajc-test>
<ajc-test dir="java5/generics/itds/visibility" title="public itds with errors"> <ajc-test dir="java5/generics/itds/visibility" title="public itds with errors">
<compile files="PublicITDsErrors.aj" options="-1.5"> <compile files="PublicITDsErrors.aj" options="-1.5">
<message kind="error" line="13" text="The method publicMethod2(List&lt;R&gt;, List&lt;R&gt;) in the type X is not applicable for the arguments (List&lt;Double&gt;, List&lt;Float&gt;)"/>
<message kind="error" line="13" text="The method publicMethod2(List&lt;R&gt;, List&lt;R&gt;) in the type Base is not applicable for the arguments (List&lt;Double&gt;, List&lt;Float&gt;)"/>
<message kind="error" line="15" text="The constructor Base(List&lt;Double&gt;, Map&lt;Integer,String&gt;) is undefined"/> <message kind="error" line="15" text="The constructor Base(List&lt;Double&gt;, Map&lt;Integer,String&gt;) is undefined"/>
</compile> </compile>
</ajc-test> </ajc-test>

Loading…
Cancel
Save