Repository: maven-wagon Updated Branches: refs/heads/jetty-8 df0af51bc -> 05d04b298
Adding timestamps to wagon-http Surefire logs * Be able to measure how long it takes to download the 4Go test file (and write the downloaded data to disk) in HugeFileDownloadTest. * Adding log lines before/after the creation of the test file and download, to measure how much time this actually takes. Project: http://git-wip-us.apache.org/repos/asf/maven-wagon/repo Commit: http://git-wip-us.apache.org/repos/asf/maven-wagon/commit/05d04b29 Tree: http://git-wip-us.apache.org/repos/asf/maven-wagon/tree/05d04b29 Diff: http://git-wip-us.apache.org/repos/asf/maven-wagon/diff/05d04b29 Branch: refs/heads/jetty-8 Commit: 05d04b298137b9d072fd284f34ade504ec163c9f Parents: df0af51 Author: Guillaume Boué <gb...@apache.org> Authored: Sat Dec 31 18:33:32 2016 +0100 Committer: Guillaume Boué <gb...@apache.org> Committed: Sat Dec 31 18:33:32 2016 +0100 ---------------------------------------------------------------------- wagon-providers/wagon-http/pom.xml | 2 ++ .../wagon/providers/http/HugeFileDownloadTest.java | 13 ++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/maven-wagon/blob/05d04b29/wagon-providers/wagon-http/pom.xml ---------------------------------------------------------------------- diff --git a/wagon-providers/wagon-http/pom.xml b/wagon-providers/wagon-http/pom.xml index e32cfcc..27554b9 100644 --- a/wagon-providers/wagon-http/pom.xml +++ b/wagon-providers/wagon-http/pom.xml @@ -163,6 +163,8 @@ under the License. <systemPropertyVariables> <maven.wagon.http.ssl.insecure>true</maven.wagon.http.ssl.insecure> <maven.wagon.http.ssl.ignore.validity.dates>true</maven.wagon.http.ssl.ignore.validity.dates> + <org.slf4j.simpleLogger.showDateTime>true</org.slf4j.simpleLogger.showDateTime> + <org.slf4j.simpleLogger.dateTimeFormat>yyyy-MM-dd'T'HH:mm:ss.SSS</org.slf4j.simpleLogger.dateTimeFormat> </systemPropertyVariables> </configuration> </plugin> http://git-wip-us.apache.org/repos/asf/maven-wagon/blob/05d04b29/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HugeFileDownloadTest.java ---------------------------------------------------------------------- diff --git a/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HugeFileDownloadTest.java b/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HugeFileDownloadTest.java index fba63c4..4489b6b 100644 --- a/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HugeFileDownloadTest.java +++ b/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HugeFileDownloadTest.java @@ -29,6 +29,8 @@ import org.eclipse.jetty.server.Server; import org.eclipse.jetty.servlet.DefaultServlet; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; @@ -46,6 +48,8 @@ public class HugeFileDownloadTest extends PlexusTestCase { + private static final Logger LOGGER = LoggerFactory.getLogger( HugeFileDownloadTest.class ); + private static long HUGE_FILE_SIZE = Integer.valueOf( Integer.MAX_VALUE ).longValue() + Integer.valueOf( Integer.MAX_VALUE ).longValue(); @@ -78,9 +82,11 @@ public class HugeFileDownloadTest dest = File.createTempFile( "huge", "txt" ); + LOGGER.info( "Fetching 'hugefile.txt' with content length" ); wagon.get( "hugefile.txt", dest ); Assert.assertTrue( dest.length() >= HUGE_FILE_SIZE ); + LOGGER.info( "The file was successfully fetched" ); wagon.disconnect(); } @@ -91,7 +97,6 @@ public class HugeFileDownloadTest hugeFile.delete(); } - } public void testDownloadHugeFileWithChunked() @@ -137,9 +142,11 @@ public class HugeFileDownloadTest dest = File.createTempFile( "huge", "txt" ); + LOGGER.info( "Fetching 'hugefile.txt' in chunks" ); wagon.get( "hugefile.txt", dest ); Assert.assertTrue( dest.length() >= HUGE_FILE_SIZE ); + LOGGER.info( "The file was successfully fetched" ); wagon.disconnect(); } @@ -150,10 +157,8 @@ public class HugeFileDownloadTest hugeFile.delete(); } - } - protected Wagon getWagon() throws Exception { @@ -169,6 +174,7 @@ public class HugeFileDownloadTest private void makeHugeFile( File hugeFile ) throws Exception { + LOGGER.info( "Creating test file" ); if ( Os.isFamily( Os.FAMILY_WINDOWS ) ) { Process p = new ProcessBuilder( "fsutil", "file", "createnew", hugeFile.getAbsolutePath(), @@ -183,6 +189,7 @@ public class HugeFileDownloadTest ra.write( 1 ); ra.close(); } + LOGGER.info( "Test file created" ); } }