mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 06:55:47 +01:00
added unit test for plugin updates
This commit is contained in:
@@ -77,6 +77,9 @@ import javax.xml.bind.JAXBException;
|
||||
public final class PluginProcessor
|
||||
{
|
||||
|
||||
/** Field description */
|
||||
private static final String INSTALLEDNAME_FORMAT = "%s.%03d";
|
||||
|
||||
/** Field description */
|
||||
private static final String DIRECTORY_CLASSES = "classes";
|
||||
|
||||
@@ -640,7 +643,23 @@ public final class PluginProcessor
|
||||
Files.createDirectories(installedDirectory);
|
||||
}
|
||||
|
||||
Files.move(archive, installedDirectory.resolve(archive.getFileName()));
|
||||
Path installed = null;
|
||||
|
||||
for (int i = 0; i < 1000; i++)
|
||||
{
|
||||
String name = String.format(INSTALLEDNAME_FORMAT, archive.getFileName(), i);
|
||||
|
||||
installed = installedDirectory.resolve(name);
|
||||
|
||||
if (!Files.exists(installed))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
logger.debug("move installed archive to {}", installed);
|
||||
|
||||
Files.move(archive, installed);
|
||||
}
|
||||
|
||||
//~--- inner classes --------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user