2424
2525@ Ignore
2626public class OneDriveTests {
27- private TestBase testBase ;
27+ private TestBase testBase ;
2828
29- @ Before
30- public void setUp () {
31- testBase = new TestBase ();
32- }
29+ @ Before
30+ public void setUp () {
31+ testBase = new TestBase ();
32+ }
3333
3434 IProgressCallback <DriveItem > callback = new IProgressCallback <DriveItem > () {
3535 @ Override
@@ -49,37 +49,37 @@ public void failure(final ClientException ex) {
4949 Assert .fail ("Upload session failed" );
5050 }
5151 };
52- /**
53- * Test large file upload.
54- * https://github.com/OneDrive/onedrive-sdk-csharp/blob/master/docs/chunked-uploads.md
55- *
56- * @throws IOException if the input file is not found
57- * @throws InterruptedException if the chunked upload fails
58- */
59- @ Test
52+ /**
53+ * Test large file upload.
54+ * https://github.com/OneDrive/onedrive-sdk-csharp/blob/master/docs/chunked-uploads.md
55+ *
56+ * @throws IOException if the input file is not found
57+ * @throws InterruptedException if the chunked upload fails
58+ */
59+ @ Test
6060 public void testLargeFileUpload () throws IOException , InterruptedException {
61- //Get resource file from file system
62- InputStream uploadFile = OneDriveTests .class .getClassLoader ().getResourceAsStream ("largefile10M.blob" );
63- long fileSize = (long ) uploadFile .available ();
64-
65- UploadSession uploadSession = testBase
66- .graphClient
67- .me ()
61+ //Get resource file from file system
62+ InputStream uploadFile = OneDriveTests .class .getClassLoader ().getResourceAsStream ("largefile10M.blob" );
63+ long fileSize = (long ) uploadFile .available ();
64+
65+ UploadSession uploadSession = testBase
66+ .graphClient
67+ .me ()
6868 .drive ()
6969 .root ()
70- .itemWithPath ("largefile10M.blob" )
71- .createUploadSession (new DriveItemUploadableProperties ())
72- .buildRequest ()
73- .post ();
74- ChunkedUploadProvider <DriveItem > chunkedUploadProvider = new ChunkedUploadProvider <DriveItem >(
75- uploadSession ,
76- testBase .graphClient ,
77- uploadFile ,
78- fileSize ,
79- DriveItem .class );
70+ .itemWithPath ("largefile10M.blob" )
71+ .createUploadSession (new DriveItemUploadableProperties ())
72+ .buildRequest ()
73+ .post ();
74+ ChunkedUploadProvider <DriveItem > chunkedUploadProvider = new ChunkedUploadProvider <DriveItem >(
75+ uploadSession ,
76+ testBase .graphClient ,
77+ uploadFile ,
78+ fileSize ,
79+ DriveItem .class );
8080
81- chunkedUploadProvider .upload (callback );
82- }
81+ chunkedUploadProvider .upload (callback );
82+ }
8383 @ Test
8484 public void testDownloadWithCustomRequest () throws IOException {
8585 final String testDownloadFileId = "01RWFXFJG3UYRHE75RZVFYWKNUEBB53H7A" ;
@@ -95,7 +95,7 @@ public void downloadJsonFileFromOneDrive() throws Exception {
9595
9696 final InputStream uploadFile = new ByteArrayInputStream ("{\" hehe\" :\" haha\" }" .getBytes (StandardCharsets .UTF_8 ));
9797
98- final long fileSize = (long ) uploadFile .available ();
98+ final long fileSize = (long ) uploadFile .available ();
9999
100100 final UploadSession session = testBase .graphClient .me ()
101101 .drive ()
@@ -106,11 +106,11 @@ public void downloadJsonFileFromOneDrive() throws Exception {
106106 .post ();
107107
108108 ChunkedUploadProvider <DriveItem > chunkedUploadProvider = new ChunkedUploadProvider <DriveItem >(
109- session ,
110- testBase .graphClient ,
111- uploadFile ,
112- fileSize ,
113- DriveItem .class );
109+ session ,
110+ testBase .graphClient ,
111+ uploadFile ,
112+ fileSize ,
113+ DriveItem .class );
114114
115115 chunkedUploadProvider .upload (callback );
116116
0 commit comments