import junit.framework.TestCase;
import org.aspectj.ajdt.internal.core.builder.*;
+import org.aspectj.bridge.CountingMessageHandler;
+import org.aspectj.bridge.IMessage;
import org.aspectj.bridge.MessageWriter;
import org.aspectj.testing.util.TestUtil;
import org.eclipse.jdt.core.compiler.InvalidInputException;
assertTrue("size: " + config.getInJars().size(), config.getInJars().size() == 1);
}
+ public void testBadPathToSourceFiles() {
+ CountingMessageHandler countingHandler = new CountingMessageHandler(messageWriter);
+ AjBuildConfig config = parser.genBuildConfig(new String[]{ "inventedDir/doesntexist/*.java"},countingHandler);
+ assertTrue("Expected an error for the invalid path.",countingHandler.numMessages(IMessage.ERROR,false)==1);
+ }
+
public void testMultipleSourceRoots() throws InvalidInputException, IOException {
final String SRCROOT_1 = AjdtAjcTests.TESTDATA_PATH + "/src1/p1";
final String SRCROOT_2 = AjdtAjcTests.TESTDATA_PATH + "/ajc";
if (!dir.isDirectory()) {
showError("can't find " + dir.getPath());
- }
+ } else {
- File[] files = dir.listFiles(filter);
- if (files.length == 0) {
+ File[] files = dir.listFiles(filter);
+ if (files.length == 0) {
showWarning("no matching files found in: " + dir);
- }
+ }
- for (int i = 0; i < files.length; i++) {
+ for (int i = 0; i < files.length; i++) {
addFile(files[i]);
+ }
}
}