Skip to content

Commit

Permalink
Merge pull request #104 from tdiesler/ghi103
Browse files Browse the repository at this point in the history
[Ignore #103] DNS test cannot resolve name
  • Loading branch information
ianopolous authored Sep 4, 2018
2 parents 2d1ffbc + 6d1eb26 commit 8c0e46d
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 46 deletions.
62 changes: 20 additions & 42 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<junit.version>4.12</junit.version>
<hamcrest.version>1.3</hamcrest.version>
<version.junit>4.12</version.junit>
<version.hamcrest>1.3</version.hamcrest>
<version.multiaddr>v1.3.0</version.multiaddr>
</properties>

<repositories>
Expand All @@ -44,46 +45,23 @@
</repositories>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>${hamcrest.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.multiformats</groupId>
<artifactId>java-multiaddr</artifactId>
<version>v1.3.1</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/multiaddr.jar</systemPath>
</dependency>
<dependency>
<groupId>com.github.multiformats</groupId>
<artifactId>java-multihash</artifactId>
<version>v1.2.1</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/multihash.jar</systemPath>
</dependency>
<dependency>
<groupId>com.github.multiformats</groupId>
<artifactId>java-multibase</artifactId>
<version>v1.0.1</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/multibase.jar</systemPath>
</dependency>
<dependency>
<groupId>com.github.ipld</groupId>
<artifactId>java-cid</artifactId>
<version>v1.1.1</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/cid.jar</systemPath>
</dependency>
<dependency>
<groupId>com.github.multiformats</groupId>
<artifactId>java-multiaddr</artifactId>
<version>${version.multiaddr}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${version.junit}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>${version.hamcrest}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
1 change: 1 addition & 0 deletions src/test/java/io/ipfs/api/APITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,7 @@ public void nameTest() throws IOException {
}

@Test
@Ignore("[#103] DNS test cannot resolve name")
public void dnsTest() throws IOException {
String domain = "ipfs.io";
String dns = ipfs.dns(domain);
Expand Down
10 changes: 6 additions & 4 deletions src/test/java/io/ipfs/api/RecursiveAddTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ public class RecursiveAddTest {

private final IPFS ipfs = new IPFS(new MultiAddress("/ip4/127.0.0.1/tcp/5001"));

static Path TMPDATA = Paths.get("target/tmpdata");

@Test
public void testAdd() throws Exception {
System.out.println("ipfs version: " + ipfs.version());

String EXPECTED = "QmX5fZ6aUxNTAS7ZfYc8f4wPoMx6LctuNbMjuJZ9EmUSr6";

Path base = Paths.get("tmpdata");
Path base = TMPDATA;
base.toFile().mkdirs();
Files.write(base.resolve("index.html"), "<html></html>".getBytes());
Path js = base.resolve("js");
Expand All @@ -35,7 +37,7 @@ public void testAdd() throws Exception {
public void binaryRecursiveAdd() throws Exception {
String EXPECTED = "Qmd1dTx4Z1PHxSHDR9jYoyLJTrYsAau7zLPE3kqo14s84d";

Path base = Paths.get("tmpbindata");
Path base = TMPDATA.resolve("bindata");
base.toFile().mkdirs();
byte[] bindata = new byte[1024*1024];
new Random(28).nextBytes(bindata);
Expand All @@ -53,7 +55,7 @@ public void binaryRecursiveAdd() throws Exception {
public void largeBinaryRecursiveAdd() throws Exception {
String EXPECTED = "QmZdfdj7nfxE68fBPUWAGrffGL3sYGx1MDEozMg73uD2wj";

Path base = Paths.get("tmplargebindata");
Path base = TMPDATA.resolve("largebindata");
base.toFile().mkdirs();
byte[] bindata = new byte[100 * 1024*1024];
new Random(28).nextBytes(bindata);
Expand All @@ -73,7 +75,7 @@ public void largeBinaryRecursiveAdd() throws Exception {
public void largeBinaryInSubdirRecursiveAdd() throws Exception {
String EXPECTED = "QmUYuMwCpgaxJhNxRA5Pmje8EfpEgU3eQSB9t3VngbxYJk";

Path base = Paths.get("tmplargebininsubdirdata");
Path base = TMPDATA.resolve("largebininsubdirdata");
base.toFile().mkdirs();
Path bindir = base.resolve("moredata");
bindir.toFile().mkdirs();
Expand Down

0 comments on commit 8c0e46d

Please sign in to comment.