@@ -1200,4 +1200,36 @@ else if (overload == 2) {
12001200 assertNotNull (copy .properties .getCopyState ().getCopyDestinationSnapshotID ());
12011201 assertNotNull (copy .getCopyState ().getCompletionTime ());
12021202 }
1203+
1204+ @ Test
1205+ public void testEightTBBlob () throws StorageException , URISyntaxException , IOException {
1206+ CloudPageBlob blob = this .container .getPageBlobReference ("blob1" );
1207+ CloudPageBlob blob2 = this .container .getPageBlobReference ("blob1" );
1208+
1209+ long eightTb = 8L * 1024L * 1024L * 1024L * 1024L ;
1210+ blob .create (eightTb );
1211+ assertEquals (eightTb , blob .getProperties ().getLength ());
1212+
1213+ blob2 .downloadAttributes ();
1214+ assertEquals (eightTb , blob2 .getProperties ().getLength ());
1215+
1216+ for (ListBlobItem listBlob : this .container .listBlobs ()) {
1217+ CloudPageBlob listPageBlob = (CloudPageBlob )listBlob ;
1218+ assertEquals (eightTb , listPageBlob .getProperties ().getLength ());
1219+ }
1220+
1221+ CloudPageBlob blob3 = this .container .getPageBlobReference ("blob3" );
1222+ blob3 .create (1024 );
1223+ blob3 .resize (eightTb );
1224+
1225+ final Random randGenerator = new Random ();
1226+ final byte [] buffer = new byte [1024 ];
1227+ randGenerator .nextBytes (buffer );
1228+ blob .uploadPages (new ByteArrayInputStream (buffer ), eightTb - 512L , 512L );
1229+
1230+ ArrayList <PageRange > ranges = blob .downloadPageRanges ();
1231+ assertEquals (1 , ranges .size ());
1232+ assertEquals (eightTb - 512L , ranges .get (0 ).getStartOffset ());
1233+ assertEquals (eightTb - 1L , ranges .get (0 ).getEndOffset ());
1234+ }
12031235}
0 commit comments