Fix the integration test

This commit is contained in:
Guillaume Nodet
2021-01-14 14:08:16 +01:00
parent 3b2efbfead
commit a846ccb96d
3 changed files with 17 additions and 11 deletions

View File

@@ -71,6 +71,7 @@ import org.apache.maven.extension.internal.CoreExtensionEntry;
import org.apache.maven.lifecycle.LifecycleExecutionException;
import org.apache.maven.model.building.ModelProcessor;
import org.apache.maven.plugin.ExtensionRealmCache;
import org.apache.maven.plugin.MavenPluginManager;
import org.apache.maven.plugin.PluginArtifactsCache;
import org.apache.maven.plugin.PluginRealmCache;
import org.apache.maven.project.MavenProject;
@@ -102,6 +103,7 @@ import org.mvndaemon.mvnd.logging.internal.Slf4jLoggerManager;
import org.mvndaemon.mvnd.logging.smart.BuildEventListener;
import org.mvndaemon.mvnd.logging.smart.LoggingExecutionListener;
import org.mvndaemon.mvnd.logging.smart.LoggingOutputStream;
import org.mvndaemon.mvnd.plugin.CliMavenPluginManager;
import org.mvndaemon.mvnd.transfer.DaemonMavenTransferListener;
import org.slf4j.ILoggerFactory;
import org.slf4j.Logger;
@@ -505,6 +507,7 @@ public class DaemonMavenCli {
bind(PluginArtifactsCache.class).to(CliPluginArtifactsCache.class);
bind(PluginRealmCache.class).to(CliPluginRealmCache.class);
bind(ProjectArtifactsCache.class).to(CliProjectArtifactsCache.class);
bind(MavenPluginManager.class).to(CliMavenPluginManager.class);
}
});

View File

@@ -48,17 +48,19 @@ public class ConcurrentDownloadsTest {
int maxCur = 0;
int cur = 0;
for (Message m : o.getMessages()) {
if (m instanceof Message.TransferEvent) {
Message.TransferEvent event = (Message.TransferEvent) m;
String resource = event.getResourceName();
if (resource.contains("apache-camel") || resource.contains("apache-activemq")) {
if (m.getType() == Message.TRANSFER_STARTED) {
if (((Message.TransferEvent) m).getResourceName().contains("apache-camel")) {
cur++;
maxCur = Math.max(cur, maxCur);
}
} else if (m.getType() == Message.TRANSFER_SUCCEEDED) {
if (((Message.TransferEvent) m).getResourceName().contains("apache-camel")) {
cur--;
}
}
}
}
assertEquals(2, maxCur);
}

View File

@@ -34,9 +34,10 @@
<artifactId>maven-compiler-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>apache-camel</artifactId>
<version>3.7.0</version>
<groupId>org.apache.activemq</groupId>
<artifactId>apache-activemq</artifactId>
<version>5.16.0</version>
<classifier>bin</classifier>
<type>tar.gz</type>
<exclusions>
<exclusion>