maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From micha...@apache.org
Subject maven-wagon git commit: Intermedite commit; will disappear soon
Date Fri, 30 Dec 2016 21:04:43 GMT
Repository: maven-wagon
Updated Branches:
  refs/heads/jetty-8 307f8a6db -> df0af51bc


Intermedite commit; will disappear soon

* Use fsutil on Windows to create a 4 GiB file very fast


Project: http://git-wip-us.apache.org/repos/asf/maven-wagon/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-wagon/commit/df0af51b
Tree: http://git-wip-us.apache.org/repos/asf/maven-wagon/tree/df0af51b
Diff: http://git-wip-us.apache.org/repos/asf/maven-wagon/diff/df0af51b

Branch: refs/heads/jetty-8
Commit: df0af51bca96570e3cff1f1a84746329b146cf36
Parents: 307f8a6
Author: Michael Osipov <michaelo@apache.org>
Authored: Fri Dec 30 22:03:55 2016 +0100
Committer: Michael Osipov <michaelo@apache.org>
Committed: Fri Dec 30 22:03:55 2016 +0100

----------------------------------------------------------------------
 .../providers/http/HugeFileDownloadTest.java    | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-wagon/blob/df0af51b/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 f460e0b..fba63c4 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
@@ -24,6 +24,7 @@ import org.apache.maven.wagon.Wagon;
 import org.apache.maven.wagon.observers.Debug;
 import org.apache.maven.wagon.repository.Repository;
 import org.codehaus.plexus.PlexusTestCase;
+import org.codehaus.plexus.util.Os;
 import org.eclipse.jetty.server.Server;
 import org.eclipse.jetty.servlet.DefaultServlet;
 import org.eclipse.jetty.servlet.ServletContextHandler;
@@ -168,11 +169,20 @@ public class HugeFileDownloadTest
     private void makeHugeFile( File hugeFile )
         throws Exception
     {
-        RandomAccessFile ra = new RandomAccessFile( hugeFile.getPath(), "rw" );
-        ra.setLength( HUGE_FILE_SIZE + 1 );
-        ra.seek( HUGE_FILE_SIZE );
-        ra.write( 1 );
-        ra.close();
+        if ( Os.isFamily( Os.FAMILY_WINDOWS ) )
+        {
+            Process p = new ProcessBuilder( "fsutil", "file", "createnew", hugeFile.getAbsolutePath(),
+                                            String.valueOf( HUGE_FILE_SIZE ) ).start();
+            p.waitFor();
+        }
+        else
+        {
+            RandomAccessFile ra = new RandomAccessFile( hugeFile.getPath(), "rw" );
+            ra.setLength( HUGE_FILE_SIZE + 1L );
+            ra.seek( HUGE_FILE_SIZE );
+            ra.write( 1 );
+            ra.close();
+        }
     }
 
 }


Mime
View raw message