@@ -13,13 +13,15 @@ public class RecursiveAddTest {
13
13
14
14
private final IPFS ipfs = new IPFS (new MultiAddress ("/ip4/127.0.0.1/tcp/5001" ));
15
15
16
+ static Path TMPDATA = Paths .get ("target/tmpdata" );
17
+
16
18
@ Test
17
19
public void testAdd () throws Exception {
18
20
System .out .println ("ipfs version: " + ipfs .version ());
19
21
20
22
String EXPECTED = "QmX5fZ6aUxNTAS7ZfYc8f4wPoMx6LctuNbMjuJZ9EmUSr6" ;
21
23
22
- Path base = Paths . get ( "tmpdata" ) ;
24
+ Path base = TMPDATA ;
23
25
base .toFile ().mkdirs ();
24
26
Files .write (base .resolve ("index.html" ), "<html></html>" .getBytes ());
25
27
Path js = base .resolve ("js" );
@@ -35,7 +37,7 @@ public void testAdd() throws Exception {
35
37
public void binaryRecursiveAdd () throws Exception {
36
38
String EXPECTED = "Qmd1dTx4Z1PHxSHDR9jYoyLJTrYsAau7zLPE3kqo14s84d" ;
37
39
38
- Path base = Paths . get ( "tmpbindata " );
40
+ Path base = TMPDATA . resolve ( "bindata " );
39
41
base .toFile ().mkdirs ();
40
42
byte [] bindata = new byte [1024 *1024 ];
41
43
new Random (28 ).nextBytes (bindata );
@@ -53,7 +55,7 @@ public void binaryRecursiveAdd() throws Exception {
53
55
public void largeBinaryRecursiveAdd () throws Exception {
54
56
String EXPECTED = "QmZdfdj7nfxE68fBPUWAGrffGL3sYGx1MDEozMg73uD2wj" ;
55
57
56
- Path base = Paths . get ( "tmplargebindata " );
58
+ Path base = TMPDATA . resolve ( "largebindata " );
57
59
base .toFile ().mkdirs ();
58
60
byte [] bindata = new byte [100 * 1024 *1024 ];
59
61
new Random (28 ).nextBytes (bindata );
@@ -73,7 +75,7 @@ public void largeBinaryRecursiveAdd() throws Exception {
73
75
public void largeBinaryInSubdirRecursiveAdd () throws Exception {
74
76
String EXPECTED = "QmUYuMwCpgaxJhNxRA5Pmje8EfpEgU3eQSB9t3VngbxYJk" ;
75
77
76
- Path base = Paths . get ( "tmplargebininsubdirdata " );
78
+ Path base = TMPDATA . resolve ( "largebininsubdirdata " );
77
79
base .toFile ().mkdirs ();
78
80
Path bindir = base .resolve ("moredata" );
79
81
bindir .toFile ().mkdirs ();
0 commit comments