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 <micha...@apache.org>
Authored: Fri Dec 30 22:03:55 2016 +0100
Committer: Michael Osipov <micha...@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();
+        }
     }
 
 }

Reply via email to