@@ -19,7 +19,7 @@ public class APITest {
19
19
20
20
private final IPFS ipfs = new IPFS (new MultiAddress ("/ip4/127.0.0.1/tcp/5001" ));
21
21
22
- @ org . junit . Test
22
+ @ Test
23
23
public void dag () throws IOException {
24
24
byte [] object = "{\" data\" :1234}" .getBytes ();
25
25
MerkleNode put = ipfs .dag .put ("json" , object );
@@ -33,7 +33,7 @@ public void dag() throws IOException {
33
33
Assert .assertTrue ("Raw data equal" , Arrays .equals (object , get ));
34
34
}
35
35
36
- @ org . junit . Test
36
+ @ Test
37
37
public void dagCbor () throws IOException {
38
38
Map <String , CborObject > tmp = new TreeMap <>();
39
39
tmp .put ("data" , new CborObject .CborByteArray ("G'day mate!" .getBytes ()));
@@ -76,21 +76,21 @@ public void ipldNode() {
76
76
Assert .assertTrue ("Correct tree" , tree .equals (Arrays .asList ("/a/b" , "/c" )));
77
77
}
78
78
79
- @ org . junit . Test
79
+ @ Test
80
80
public void singleFileTest () {
81
81
NamedStreamable .ByteArrayWrapper file = new NamedStreamable .ByteArrayWrapper ("hello.txt" , "G'day world! IPFS rocks!" .getBytes ());
82
82
fileTest (file );
83
83
}
84
84
85
- @ org . junit . Test
85
+ @ Test
86
86
public void dirTest () throws IOException {
87
87
NamedStreamable .DirWrapper dir = new NamedStreamable .DirWrapper ("root" , Arrays .asList ());
88
88
MerkleNode addResult = ipfs .add (dir );
89
89
List <MerkleNode > ls = ipfs .ls (addResult .hash );
90
90
Assert .assertTrue (ls .size () > 0 );
91
91
}
92
92
93
- @ org . junit . Test
93
+ @ Test
94
94
public void directoryTest () throws IOException {
95
95
Random rnd = new Random ();
96
96
String dirName = "folder" + rnd .nextInt (100 );
@@ -130,15 +130,15 @@ public void directoryTest() throws IOException {
130
130
throw new IllegalStateException ("Different contents!" );
131
131
}
132
132
133
- // @org.junit. Test
133
+ // @Test
134
134
public void largeFileTest () {
135
135
byte [] largerData = new byte [100 *1024 *1024 ];
136
136
new Random (1 ).nextBytes (largerData );
137
137
NamedStreamable .ByteArrayWrapper largeFile = new NamedStreamable .ByteArrayWrapper ("nontrivial.txt" , largerData );
138
138
fileTest (largeFile );
139
139
}
140
140
141
- // @org.junit. Test
141
+ // @Test
142
142
public void hugeFileStreamTest () {
143
143
byte [] hugeData = new byte [1000 *1024 *1024 ];
144
144
new Random (1 ).nextBytes (hugeData );
@@ -166,7 +166,7 @@ public void hugeFileStreamTest() {
166
166
}
167
167
}
168
168
169
- @ org . junit . Test
169
+ @ Test
170
170
public void hostFileTest () throws IOException {
171
171
Path tempFile = Files .createTempFile ("IPFS" , "tmp" );
172
172
BufferedWriter w = new BufferedWriter (new FileWriter (tempFile .toFile ()));
@@ -193,7 +193,7 @@ public void fileTest(NamedStreamable file) {
193
193
}
194
194
}
195
195
196
- @ org . junit . Test
196
+ @ Test
197
197
public void pinTest () {
198
198
try {
199
199
MerkleNode file = ipfs .add (new NamedStreamable .ByteArrayWrapper ("some data" .getBytes ()));
@@ -217,7 +217,7 @@ public void pinTest() {
217
217
}
218
218
}
219
219
220
- @ org . junit . Test
220
+ @ Test
221
221
public void pinUpdate () {
222
222
try {
223
223
MerkleNode child1 = ipfs .add (new NamedStreamable .ByteArrayWrapper ("some data" .getBytes ()));
@@ -248,7 +248,7 @@ public void pinUpdate() {
248
248
}
249
249
}
250
250
251
- @ org . junit . Test
251
+ @ Test
252
252
public void rawLeafNodePinUpdate () {
253
253
try {
254
254
MerkleNode child1 = ipfs .block .put ("some data" .getBytes (), Optional .of ("raw" ));
@@ -275,7 +275,7 @@ public void rawLeafNodePinUpdate() {
275
275
}
276
276
}
277
277
278
- @ org . junit . Test
278
+ @ Test
279
279
public void indirectPinTest () {
280
280
try {
281
281
Multihash EMPTY = ipfs .object ._new (Optional .empty ()).hash ;
@@ -306,7 +306,7 @@ public void indirectPinTest() {
306
306
}
307
307
}
308
308
309
- @ org . junit . Test
309
+ @ Test
310
310
public void objectPatch () {
311
311
try {
312
312
MerkleNode obj = ipfs .object ._new (Optional .empty ());
@@ -343,7 +343,7 @@ public void objectPatch() {
343
343
}
344
344
}
345
345
346
- @ org . junit . Test
346
+ @ Test
347
347
public void refsTest () {
348
348
try {
349
349
List <Multihash > local = ipfs .refs .local ();
@@ -355,7 +355,7 @@ public void refsTest() {
355
355
}
356
356
}
357
357
358
- @ org . junit . Test
358
+ @ Test
359
359
public void objectTest () {
360
360
try {
361
361
MerkleNode _new = ipfs .object ._new (Optional .empty ());
@@ -371,7 +371,7 @@ public void objectTest() {
371
371
}
372
372
}
373
373
374
- @ org . junit . Test
374
+ @ Test
375
375
public void blockTest () {
376
376
try {
377
377
MerkleNode pointer = new MerkleNode ("QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB" );
@@ -383,7 +383,7 @@ public void blockTest() {
383
383
}
384
384
}
385
385
386
- @ org . junit . Test
386
+ @ Test
387
387
public void bulkBlockTest () {
388
388
try {
389
389
CborObject cbor = new CborObject .CborString ("G'day IPFS!" );
@@ -421,7 +421,7 @@ private static String toEscapedHex(byte[] in) throws IOException {
421
421
/**
422
422
* Test that merkle links in values of a cbor map are followed during recursive pins
423
423
*/
424
- @ org . junit . Test
424
+ @ Test
425
425
public void merkleLinkInMap () {
426
426
try {
427
427
Random r = new Random ();
@@ -457,7 +457,7 @@ public void merkleLinkInMap() {
457
457
}
458
458
}
459
459
460
- @ org . junit . Test
460
+ @ Test
461
461
public void recursiveRefs () {
462
462
try {
463
463
CborObject .CborByteArray leaf1 = new CborObject .CborByteArray (("G'day IPFS!" ).getBytes ());
@@ -498,7 +498,7 @@ public void recursiveRefs() {
498
498
/**
499
499
* Test that merkle links as a root object are followed during recursive pins
500
500
*/
501
- @ org . junit . Test
501
+ @ Test
502
502
public void rootMerkleLink () {
503
503
try {
504
504
Random r = new Random ();
@@ -531,9 +531,9 @@ public void rootMerkleLink() {
531
531
}
532
532
533
533
/**
534
- * Test that merkle links as a root object are followed during recursive pins
534
+ * Test that a cbor null is allowed as an object root
535
535
*/
536
- @ org . junit . Test
536
+ @ Test
537
537
public void rootNull () {
538
538
try {
539
539
CborObject .CborNull cbor = new CborObject .CborNull ();
@@ -557,7 +557,7 @@ public void rootNull() {
557
557
/**
558
558
* Test that merkle links in a cbor list are followed during recursive pins
559
559
*/
560
- @ org . junit . Test
560
+ @ Test
561
561
public void merkleLinkInList () {
562
562
try {
563
563
Random r = new Random ();
@@ -585,7 +585,7 @@ public void merkleLinkInList() {
585
585
}
586
586
}
587
587
588
- @ org . junit . Test
588
+ @ Test
589
589
public void fileContentsTest () {
590
590
try {
591
591
ipfs .repo .gc ();
@@ -601,7 +601,7 @@ public void fileContentsTest() {
601
601
}
602
602
}
603
603
604
- @ org . junit . Test
604
+ @ Test
605
605
public void nameTest () {
606
606
try {
607
607
MerkleNode pointer = new MerkleNode ("QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB" );
@@ -615,7 +615,7 @@ public void nameTest() {
615
615
}
616
616
}
617
617
618
- @ org . junit . Test
618
+ @ Test
619
619
public void dnsTest () {
620
620
try {
621
621
String domain = "ipfs.io" ;
@@ -633,7 +633,7 @@ public void mountTest() {
633
633
}
634
634
}
635
635
636
- @ org . junit . Test
636
+ @ Test
637
637
public void dhtTest () {
638
638
try {
639
639
Multihash pointer = Multihash .fromBase58 ("QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB" );
@@ -648,7 +648,7 @@ public void dhtTest() {
648
648
}
649
649
}
650
650
651
- @ org . junit . Test
651
+ @ Test
652
652
public void statsTest () {
653
653
try {
654
654
Map stats = ipfs .stats .bw ();
@@ -666,7 +666,7 @@ public void resolveTest() {
666
666
}
667
667
}
668
668
669
- @ org . junit . Test
669
+ @ Test
670
670
public void swarmTest () {
671
671
try {
672
672
String multiaddr = "/ip4/127.0.0.1/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ" ;
@@ -695,7 +695,7 @@ public void swarmTest() {
695
695
}
696
696
}
697
697
698
- @ org . junit . Test
698
+ @ Test
699
699
public void bootstrapTest () {
700
700
try {
701
701
List <MultiAddress > bootstrap = ipfs .bootstrap .list ();
@@ -708,7 +708,7 @@ public void bootstrapTest() {
708
708
}
709
709
}
710
710
711
- @ org . junit . Test
711
+ @ Test
712
712
public void diagTest () {
713
713
try {
714
714
Map config = ipfs .config .show ();
@@ -723,7 +723,7 @@ public void diagTest() {
723
723
}
724
724
}
725
725
726
- @ org . junit . Test
726
+ @ Test
727
727
public void toolsTest () {
728
728
try {
729
729
String version = ipfs .version ();
0 commit comments