aboutsummaryrefslogtreecommitdiffstats
path: root/testing-util
diff options
context:
space:
mode:
authorwisberg <wisberg>2003-02-13 05:47:01 +0000
committerwisberg <wisberg>2003-02-13 05:47:01 +0000
commitee8c84d2dcedcb0e7b432fc4a6ca3aba66bfdac5 (patch)
tree040d91b6ac6ee30268e6465f96308a84b1646314 /testing-util
parent5ed9faaf0e5c7ab2f2178adb6743ce33e2ddd187 (diff)
downloadaspectj-ee8c84d2dcedcb0e7b432fc4a6ca3aba66bfdac5.tar.gz
aspectj-ee8c84d2dcedcb0e7b432fc4a6ca3aba66bfdac5.zip
resolving unused-imports warnings
Diffstat (limited to 'testing-util')
-rw-r--r--testing-util/src/org/aspectj/testing/util/TestUtil.java32
-rw-r--r--testing-util/testsrc/org/aspectj/testing/util/TestUtilTest.java1
2 files changed, 23 insertions, 10 deletions
diff --git a/testing-util/src/org/aspectj/testing/util/TestUtil.java b/testing-util/src/org/aspectj/testing/util/TestUtil.java
index b33e1fac9..553684eb3 100644
--- a/testing-util/src/org/aspectj/testing/util/TestUtil.java
+++ b/testing-util/src/org/aspectj/testing/util/TestUtil.java
@@ -28,7 +28,6 @@ import java.io.InputStream;
import java.io.PrintStream;
import java.io.StringReader;
import java.io.StringWriter;
-import java.io.Writer;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
@@ -209,7 +208,18 @@ public final class TestUtil {
/**
* If there is an expected dir, expect each file in its subtree
* to match a corresponding actual file in the base directory.
- * @return boolean
+ * This does NOT check that all actual files have corresponding
+ * expected files.
+ * This ignores directory paths containing "CVS".
+ * @param handler the IMessageHandler sink for error messages
+ * @param expectedBaseDir the File path to the directory
+ * containing expected files, all of which are compared
+ * with any corresponding actual files
+ * @param actualBaseDir the File path to the base directory
+ * from which to find any actual files corresponding
+ * to expected files.
+ * @return true if all files in the expectedBaseDir directory tree
+ * have matching files in the actualBaseDir directory tree.
*/
public static boolean sameDirectoryContents(
final IMessageHandler handler,
@@ -217,7 +227,6 @@ public final class TestUtil {
final File actualBaseDir,
final boolean fastFail) {
LangUtil.throwIaxIfNull(handler, "handler");
- FileUtil.throwIaxUnlessCanReadDir(actualBaseDir, "actualBaseDir");
if (!FileUtil.canReadDir(expectedBaseDir)) {
MessageUtil.fail(handler, " expected dir not found: " + expectedBaseDir);
return false;
@@ -229,7 +238,10 @@ public final class TestUtil {
String[] paths = FileUtil.listFiles(expectedBaseDir);
boolean result = true;
for (int i = 0; i < paths.length; i++) {
- if (!sameFiles(handler, expectedBaseDir, actualBaseDir, paths[i]) && !result) {
+ if (-1 != paths[i].indexOf("CVS")) {
+ continue;
+ }
+ if (!sameFiles(handler, expectedBaseDir, actualBaseDir, paths[i]) && result) {
result = false;
if (fastFail) {
break;
@@ -241,14 +253,15 @@ public final class TestUtil {
//------------ File-comparison utilities (XXX need their own class...)
/**
- * Compare two files, line by line, and report differences as one FAIL message
+ * Test interface to
+ * compare two files, line by line, and report differences as one FAIL message
* if a handler is supplied. This preprocesses .class files by disassembling.
* @param handler the IMessageHandler for any FAIL messages (null to ignore)
* @param expectedFile the File path to the canonical file
* @param actualFile the File path to the actual file, if any
* @return true if the input files are the same, based on per-line comparisons
*/
- public static boolean sameFiles (
+ static boolean sameFiles (
IMessageHandler handler,
File expectedFile,
File actualFile) {
@@ -256,7 +269,8 @@ public final class TestUtil {
}
/**
- * Compare two files, line by line, and report differences as one FAIL message
+ * Test interface to
+ * compare two files, line by line, and report differences as one FAIL message
* if a handler is supplied. This preprocesses .class files by disassembling.
* This method assumes that the files are at the same offset from two
* respective base directories.
@@ -266,7 +280,7 @@ public final class TestUtil {
* @param path the String path offset from the base directories
* @return true if the input files are the same, based on per-line comparisons
*/
- public static boolean sameFiles (
+ static boolean sameFiles (
IMessageHandler handler,
File expectedBaseDir,
File actualBaseDir,
@@ -279,7 +293,7 @@ public final class TestUtil {
/**
* This does the work, selecting a lineator subclass and converting public
* API's to JDiff APIs for comparison.
- * Currently, all jdiff interfaces are method-local, so this class with load
+ * Currently, all jdiff interfaces are method-local, so this class will load
* without it; if we do use it, we can avoid the duplication.
*/
private static boolean doSameFile(
diff --git a/testing-util/testsrc/org/aspectj/testing/util/TestUtilTest.java b/testing-util/testsrc/org/aspectj/testing/util/TestUtilTest.java
index 73da9cf83..e884fb143 100644
--- a/testing-util/testsrc/org/aspectj/testing/util/TestUtilTest.java
+++ b/testing-util/testsrc/org/aspectj/testing/util/TestUtilTest.java
@@ -13,7 +13,6 @@
package org.aspectj.testing.util;
-import org.aspectj.bridge.IMessageHolder;
import org.aspectj.bridge.MessageHandler;
import org.aspectj.bridge.MessageUtil;
import org.aspectj.util.FileUtil;