@@ -166,15 +166,17 @@ public void directoryTest() throws IOException {
166
166
throw new IllegalStateException ("Different contents!" );
167
167
}
168
168
169
- // @Test
169
+ @ Ignore
170
+ @ Test
170
171
public void largeFileTest () throws IOException {
171
172
byte [] largerData = new byte [100 *1024 *1024 ];
172
173
new Random (1 ).nextBytes (largerData );
173
174
NamedStreamable .ByteArrayWrapper largeFile = new NamedStreamable .ByteArrayWrapper ("nontrivial.txt" , largerData );
174
175
fileTest (largeFile );
175
176
}
176
177
177
- // @Test
178
+ @ Ignore
179
+ @ Test
178
180
public void hugeFileStreamTest () throws IOException {
179
181
byte [] hugeData = new byte [1000 *1024 *1024 ];
180
182
new Random (1 ).nextBytes (hugeData );
@@ -460,8 +462,8 @@ public void objectTest() throws IOException {
460
462
MerkleNode _new = ipfs .object ._new (Optional .empty ());
461
463
Multihash pointer = Multihash .fromBase58 ("QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB" );
462
464
MerkleNode object = ipfs .object .get (pointer );
463
- List <MerkleNode > newPointer = ipfs .object .put (Arrays . asList (object .toJSONString ().getBytes ()));
464
- List <MerkleNode > newPointer2 = ipfs .object .put ("json" , Arrays . asList (object .toJSONString ().getBytes ()));
465
+ List <MerkleNode > newPointer = ipfs .object .put (Collections . singletonList (object .toJSONString ().getBytes ()));
466
+ List <MerkleNode > newPointer2 = ipfs .object .put ("json" , Collections . singletonList (object .toJSONString ().getBytes ()));
465
467
MerkleNode links = ipfs .object .links (pointer );
466
468
byte [] data = ipfs .object .data (pointer );
467
469
Map stat = ipfs .object .stat (pointer );
@@ -472,7 +474,7 @@ public void blockTest() throws IOException {
472
474
MerkleNode pointer = new MerkleNode ("QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB" );
473
475
Map stat = ipfs .block .stat (pointer .hash );
474
476
byte [] object = ipfs .block .get (pointer .hash );
475
- List <MerkleNode > newPointer = ipfs .block .put (Arrays . asList ("Some random data..." .getBytes ()));
477
+ List <MerkleNode > newPointer = ipfs .block .put (Collections . singletonList ("Some random data..." .getBytes ()));
476
478
}
477
479
478
480
@ Test
@@ -556,15 +558,15 @@ public void merkleLinkInMap() throws IOException {
556
558
Random r = new Random ();
557
559
CborObject .CborByteArray target = new CborObject .CborByteArray (("g'day IPFS!" ).getBytes ());
558
560
byte [] rawTarget = target .toByteArray ();
559
- MerkleNode targetRes = ipfs .block .put (Arrays . asList (rawTarget ), Optional .of ("cbor" )).get (0 );
561
+ MerkleNode targetRes = ipfs .block .put (Collections . singletonList (rawTarget ), Optional .of ("cbor" )).get (0 );
560
562
561
563
CborObject .CborMerkleLink link = new CborObject .CborMerkleLink (targetRes .hash );
562
564
Map <String , CborObject > m = new TreeMap <>();
563
565
m .put ("alink" , link );
564
566
m .put ("arr" , new CborObject .CborList (Collections .emptyList ()));
565
567
CborObject .CborMap source = CborObject .CborMap .build (m );
566
568
byte [] rawSource = source .toByteArray ();
567
- MerkleNode sourceRes = ipfs .block .put (Arrays . asList (rawSource ), Optional .of ("cbor" )).get (0 );
569
+ MerkleNode sourceRes = ipfs .block .put (Collections . singletonList (rawSource ), Optional .of ("cbor" )).get (0 );
568
570
569
571
CborObject .fromByteArray (rawSource );
570
572
@@ -587,23 +589,23 @@ public void merkleLinkInMap() throws IOException {
587
589
public void recursiveRefs () throws IOException {
588
590
CborObject .CborByteArray leaf1 = new CborObject .CborByteArray (("G'day IPFS!" ).getBytes ());
589
591
byte [] rawLeaf1 = leaf1 .toByteArray ();
590
- MerkleNode leaf1Res = ipfs .block .put (Arrays . asList (rawLeaf1 ), Optional .of ("cbor" )).get (0 );
592
+ MerkleNode leaf1Res = ipfs .block .put (Collections . singletonList (rawLeaf1 ), Optional .of ("cbor" )).get (0 );
591
593
592
594
CborObject .CborMerkleLink link = new CborObject .CborMerkleLink (leaf1Res .hash );
593
595
Map <String , CborObject > m = new TreeMap <>();
594
596
m .put ("link1" , link );
595
597
CborObject .CborMap source = CborObject .CborMap .build (m );
596
- MerkleNode sourceRes = ipfs .block .put (Arrays . asList (source .toByteArray ()), Optional .of ("cbor" )).get (0 );
598
+ MerkleNode sourceRes = ipfs .block .put (Collections . singletonList (source .toByteArray ()), Optional .of ("cbor" )).get (0 );
597
599
598
600
CborObject .CborByteArray leaf2 = new CborObject .CborByteArray (("G'day again, IPFS!" ).getBytes ());
599
601
byte [] rawLeaf2 = leaf2 .toByteArray ();
600
- MerkleNode leaf2Res = ipfs .block .put (Arrays . asList (rawLeaf2 ), Optional .of ("cbor" )).get (0 );
602
+ MerkleNode leaf2Res = ipfs .block .put (Collections . singletonList (rawLeaf2 ), Optional .of ("cbor" )).get (0 );
601
603
602
604
Map <String , CborObject > m2 = new TreeMap <>();
603
605
m2 .put ("link1" , new CborObject .CborMerkleLink (sourceRes .hash ));
604
606
m2 .put ("link2" , new CborObject .CborMerkleLink (leaf2Res .hash ));
605
607
CborObject .CborMap source2 = CborObject .CborMap .build (m2 );
606
- MerkleNode rootRes = ipfs .block .put (Arrays . asList (source2 .toByteArray ()), Optional .of ("cbor" )).get (0 );
608
+ MerkleNode rootRes = ipfs .block .put (Collections . singletonList (source2 .toByteArray ()), Optional .of ("cbor" )).get (0 );
607
609
608
610
List <Multihash > refs = ipfs .refs (rootRes .hash , false );
609
611
boolean correct = refs .contains (sourceRes .hash ) && refs .contains (leaf2Res .hash ) && refs .size () == 2 ;
@@ -625,14 +627,14 @@ public void rootMerkleLink() throws IOException {
625
627
Random r = new Random ();
626
628
CborObject .CborByteArray target = new CborObject .CborByteArray (("g'day IPFS!" + r .nextInt ()).getBytes ());
627
629
byte [] rawTarget = target .toByteArray ();
628
- MerkleNode block1 = ipfs .block .put (Arrays . asList (rawTarget ), Optional .of ("cbor" )).get (0 );
630
+ MerkleNode block1 = ipfs .block .put (Collections . singletonList (rawTarget ), Optional .of ("cbor" )).get (0 );
629
631
Multihash block1Hash = block1 .hash ;
630
632
byte [] retrievedObj1 = ipfs .block .get (block1Hash );
631
633
Assert .assertTrue ("get inverse of put" , Arrays .equals (retrievedObj1 , rawTarget ));
632
634
633
635
CborObject .CborMerkleLink cbor2 = new CborObject .CborMerkleLink (block1 .hash );
634
636
byte [] obj2 = cbor2 .toByteArray ();
635
- MerkleNode block2 = ipfs .block .put (Arrays . asList (obj2 ), Optional .of ("cbor" )).get (0 );
637
+ MerkleNode block2 = ipfs .block .put (Collections . singletonList (obj2 ), Optional .of ("cbor" )).get (0 );
636
638
byte [] retrievedObj2 = ipfs .block .get (block2 .hash );
637
639
Assert .assertTrue ("get inverse of put" , Arrays .equals (retrievedObj2 , obj2 ));
638
640
@@ -655,7 +657,7 @@ public void rootMerkleLink() throws IOException {
655
657
public void rootNull () throws IOException {
656
658
CborObject .CborNull cbor = new CborObject .CborNull ();
657
659
byte [] obj = cbor .toByteArray ();
658
- MerkleNode block = ipfs .block .put (Arrays . asList (obj ), Optional .of ("cbor" )).get (0 );
660
+ MerkleNode block = ipfs .block .put (Collections . singletonList (obj ), Optional .of ("cbor" )).get (0 );
659
661
byte [] retrievedObj = ipfs .block .get (block .hash );
660
662
Assert .assertTrue ("get inverse of put" , Arrays .equals (retrievedObj , obj ));
661
663
@@ -676,12 +678,12 @@ public void merkleLinkInList() throws IOException {
676
678
Random r = new Random ();
677
679
CborObject .CborByteArray target = new CborObject .CborByteArray (("g'day IPFS!" + r .nextInt ()).getBytes ());
678
680
byte [] rawTarget = target .toByteArray ();
679
- MerkleNode targetRes = ipfs .block .put (Arrays . asList (rawTarget ), Optional .of ("cbor" )).get (0 );
681
+ MerkleNode targetRes = ipfs .block .put (Collections . singletonList (rawTarget ), Optional .of ("cbor" )).get (0 );
680
682
681
683
CborObject .CborMerkleLink link = new CborObject .CborMerkleLink (targetRes .hash );
682
- CborObject .CborList source = new CborObject .CborList (Arrays . asList (link ));
684
+ CborObject .CborList source = new CborObject .CborList (Collections . singletonList (link ));
683
685
byte [] rawSource = source .toByteArray ();
684
- MerkleNode sourceRes = ipfs .block .put (Arrays . asList (rawSource ), Optional .of ("cbor" )).get (0 );
686
+ MerkleNode sourceRes = ipfs .block .put (Collections . singletonList (rawSource ), Optional .of ("cbor" )).get (0 );
685
687
686
688
List <Multihash > add = ipfs .pin .add (sourceRes .hash );
687
689
ipfs .repo .gc ();
@@ -930,7 +932,8 @@ public void addArgsTest() {
930
932
Assert .assertTrue ("args toQueryString() format" , queryStr .equals ("inline=true&cid-version=1" ));
931
933
}
932
934
933
- // this api is disabled until deployment over IPFS is enabled
935
+ @ Ignore ("This api is disabled until deployment over IPFS is enabled" )
936
+ @ Test
934
937
public void updateTest () throws IOException {
935
938
Object check = ipfs .update .check ();
936
939
Object update = ipfs .update ();
0 commit comments