浏览代码

cope with new messages in test

tags/V1_7_0RC1
aclement 12 年前
父节点
当前提交
8bbddd9948

+ 7
- 2
org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/JavadocTest.java 查看文件

import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;


import org.aspectj.bridge.IMessage;
import org.aspectj.tools.ajc.AjcTestCase; import org.aspectj.tools.ajc.AjcTestCase;
import org.aspectj.tools.ajc.CompilationResult; import org.aspectj.tools.ajc.CompilationResult;


public void testMissingJavadoc() { public void testMissingJavadoc() {
String[] args = new String[] { "World.java", "-warn:allJavadoc" }; String[] args = new String[] { "World.java", "-warn:allJavadoc" };


List warningMessages = new ArrayList();
List<Message> warningMessages = new ArrayList<Message>();
// These warnings are against public textX() methods declared in the World.java // These warnings are against public textX() methods declared in the World.java
// type. These test methods are spread between AJ constructuts, meaning
// type. These test methods are spread between AJ constructs, meaning
// if someone messes up and the javadoc is not associated with the aspectj // if someone messes up and the javadoc is not associated with the aspectj
// construct then it will associated by accident with one of the testX() methods. // construct then it will associated by accident with one of the testX() methods.
// By checking we get a warning against every testX() method, we are verifying // By checking we get a warning against every testX() method, we are verifying
warningMessages.add(new Message(53, "Missing comment for public declaration")); warningMessages.add(new Message(53, "Missing comment for public declaration"));
warningMessages.add(new Message(61, "Missing comment for public declaration")); warningMessages.add(new Message(61, "Missing comment for public declaration"));
warningMessages.add(new Message(69, "Missing comment for public declaration")); warningMessages.add(new Message(69, "Missing comment for public declaration"));
// TODO why don't see these for the other ones that have the same problem?
// Basically that the javadoc on a public member refers to something that is not public
warningMessages.add(new Message(6,"'public' visibility for malformed doc comments hides this 'default' reference"));
warningMessages.add(new Message(32,"'public' visibility for malformed doc comments hides this 'default' reference"));
MessageSpec spec = new MessageSpec(warningMessages, null); MessageSpec spec = new MessageSpec(warningMessages, null);


CompilationResult result = ajc(baseDir, args); CompilationResult result = ajc(baseDir, args);

正在加载...
取消
保存