|
|
@@ -60,13 +60,15 @@ public class Enums extends TestUtils { |
|
|
|
// Deals with the cases where an explicit type is specified and it is an enum type |
|
|
|
public void test003_decpOnEnumNotAllowed_errors() { |
|
|
|
CompilationResult cR = binaryWeave("testcode.jar","EnumAspect03.aj",3,0,true); |
|
|
|
IMessage msg = (IMessage)cR.getErrorMessages().get(0); |
|
|
|
// THE ORDERING CAN BE SENSITIVE HERE... OUGHT TO FIX IT PROPERLY AND ALLOW FOR THEM |
|
|
|
// IN ANY POSITION |
|
|
|
IMessage msg = (IMessage)cR.getErrorMessages().get(1); |
|
|
|
assertTrue("Expected a message about can't use decp to alter supertype of an enum: "+msg, |
|
|
|
msg.toString().indexOf("to alter supertype of enum type")!=-1); |
|
|
|
msg = (IMessage)cR.getErrorMessages().get(1); |
|
|
|
msg = (IMessage)cR.getErrorMessages().get(2); |
|
|
|
assertTrue("Expected a message about can't use decp to make enum implement interface: "+msg, |
|
|
|
msg.toString().indexOf("implement an interface")!=-1); |
|
|
|
msg = (IMessage)cR.getErrorMessages().get(2); |
|
|
|
msg = (IMessage)cR.getErrorMessages().get(0); |
|
|
|
assertTrue("Expected a message about can't use decp to make Enum parent of another type: "+msg, |
|
|
|
msg.toString().indexOf("the parent of type")!=-1); |
|
|
|
verifyWeavingMessagesOutput(cR,new String[]{}); |