mirror of
https://github.com/apache/activemq-artemis.git
synced 2025-02-23 02:44:10 +00:00
NO-JIRA IMprovements on CompareUpgradeTest
This commit is contained in:
parent
549612242a
commit
7685890574
@ -85,24 +85,19 @@ public class FileUtil {
|
||||
public static final void copyDirectory(final File directorySource, final File directoryTarget) throws Exception {
|
||||
Path sourcePath = directorySource.toPath();
|
||||
Path targetPath = directoryTarget.toPath();
|
||||
Files.walkFileTree(sourcePath, new SimpleFileVisitor<>() {
|
||||
@Override
|
||||
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
|
||||
Path targetDir = targetPath.resolve(sourcePath.relativize(dir));
|
||||
Files.createDirectories(targetDir);
|
||||
return FileVisitResult.CONTINUE;
|
||||
}
|
||||
|
||||
try {
|
||||
Files.walkFileTree(sourcePath, new SimpleFileVisitor<>() {
|
||||
@Override
|
||||
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
|
||||
Path targetDir = targetPath.resolve(sourcePath.relativize(dir));
|
||||
Files.createDirectories(targetDir);
|
||||
return FileVisitResult.CONTINUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
|
||||
Files.copy(file, targetPath.resolve(sourcePath.relativize(file)), StandardCopyOption.REPLACE_EXISTING);
|
||||
return FileVisitResult.CONTINUE;
|
||||
}
|
||||
});
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@Override
|
||||
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
|
||||
Files.copy(file, targetPath.resolve(sourcePath.relativize(file)), StandardCopyOption.REPLACE_EXISTING);
|
||||
return FileVisitResult.CONTINUE;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -164,7 +164,7 @@ public class CompareUpgradeTest {
|
||||
while (expectedIterator.hasNext()) {
|
||||
Assert.assertTrue(upgradeIterator.hasNext());
|
||||
|
||||
String expectedString = expectedIterator.next().replace("Expected", "").trim();
|
||||
String expectedString = expectedIterator.next().trim();
|
||||
String upgradeString = upgradeIterator.next().trim();
|
||||
|
||||
// there's a test in this class that will use a different name ID. on that case we replace Expected by ""
|
||||
|
Loading…
x
Reference in New Issue
Block a user