Skip to content

Commit 1f9b05b

Browse files
committed
Added tests target to makefile
1 parent 506671c commit 1f9b05b

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

Makefile

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
11
JAVA_BUILD_OPTS = -g -source 1.8 -target 1.8 -cp .:$(CP)
2+
CP = `find lib -name "*.jar" -printf %p:`
3+
CP_SPACE = `ls lib/*.jar`
24

35
.PHONY: ipfs
46
ipfs:
7+
rm -rf build
58
mkdir -p build
69
echo "Name: IPFS Java HTTP Client library" > def.manifest
7-
echo "Build-Date: " `date` >> def.manifest
8-
echo "Class-Path: " $(CP_SPACE)>> def.manifest
910
javac $(JAVA_BUILD_OPTS) -d build `find src -name \*.java`
1011
jar -cfm IPFS.jar def.manifest \
1112
-C build org
1213
rm -f def.manifest
14+
15+
.PHONY: tests
16+
tests:
17+
rm -rf build
18+
mkdir -p build
19+
echo "Name: IPFS Java HTTP Client library Tests" > def.manifest
20+
echo "Class-Path: " $(CP_SPACE)>> def.manifest
21+
javac $(JAVA_BUILD_OPTS) -d build -cp $(CP) `find src test -name \*.java`
22+
jar -cfm Tests.jar def.manifest \
23+
-C build org
24+
rm -f def.manifest
25+
java -cp $(CP):Tests.jar org.junit.runner.JUnitCore org.ipfs.Test

test/org/ipfs/Test.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ public void refsTest() {
5959
List<String> local = ipfs.refs.local();
6060
for (String ref: local) {
6161
Object refs = ipfs.refs(ref, false);
62-
if (refs != null)
63-
System.out.println(refs);
6462
}
6563
} catch (IOException e) {
6664
throw new RuntimeException(e);
@@ -99,7 +97,6 @@ public void fileTest() {
9997
List<String> local = ipfs.refs.local();
10098
for (String hash: local) {
10199
Map ls = ipfs.file.ls(hash);
102-
System.out.println(ls);
103100
}
104101
} catch (IOException e) {
105102
throw new RuntimeException(e);
@@ -112,7 +109,6 @@ public void nameTest() {
112109
MerkleNode pointer = new MerkleNode("QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB");
113110
Map pub = ipfs.name.publish(pointer);
114111
String resolved = ipfs.name.resolve((String)pub.get("Name"));
115-
System.out.println(resolved);
116112
} catch (IOException e) {
117113
throw new RuntimeException(e);
118114
}
@@ -123,7 +119,6 @@ public void dnsTest() {
123119
try {
124120
String domain = "ipfs.io";
125121
String dns = ipfs.dns(domain);
126-
System.out.println(dns);
127122
} catch (IOException e) {
128123
throw new RuntimeException(e);
129124
}
@@ -132,7 +127,6 @@ public void dnsTest() {
132127
public void mountTest() {
133128
try {
134129
Map mount = ipfs.mount(null, null);
135-
System.out.println(mount);
136130
} catch (IOException e) {
137131
throw new RuntimeException(e);
138132
}
@@ -157,7 +151,6 @@ public void dhtTest() {
157151
public void statsTest() {
158152
try {
159153
Map stats = ipfs.stats.bw();
160-
System.out.println(stats);
161154
} catch (IOException e) {
162155
throw new RuntimeException(e);
163156
}
@@ -167,7 +160,6 @@ public void resolveTest() {
167160
try {
168161
String hash = "QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy";
169162
Map res = ipfs.resolve("ipns", hash, false);
170-
System.out.println(res);
171163
} catch (IOException e) {
172164
throw new RuntimeException(e);
173165
}
@@ -181,7 +173,6 @@ public void swarmTest() {
181173
if (addrs.size() > 0) {
182174
Map id = ipfs.id(addrs.keySet().stream().findAny().get());
183175
Map ping = ipfs.ping(addrs.keySet().stream().findAny().get());
184-
System.out.println(ping);
185176
}
186177
List<NodeAddress> peers = ipfs.swarm.peers();
187178
} catch (IOException e) {
@@ -207,9 +198,7 @@ public void diagTest() {
207198
public void toolsTest() {
208199
try {
209200
String version = ipfs.version();
210-
System.out.println(version);
211201
Map commands = ipfs.commands();
212-
System.out.println(commands);
213202
} catch (IOException e) {
214203
throw new RuntimeException(e);
215204
}
@@ -220,7 +209,6 @@ public void updateTest() {
220209
try {
221210
Object check = ipfs.update.check();
222211
Object update = ipfs.update();
223-
System.out.println(update);
224212
} catch (IOException e) {
225213
throw new RuntimeException(e);
226214
}

0 commit comments

Comments
 (0)