Skip to content

Commit c1d3962

Browse files
committed
Merge pull request #131 from simon-liubin/update/remove-print
remove System.out.print
2 parents 27ff2f1 + cabfc6c commit c1d3962

File tree

11 files changed

+7
-42
lines changed

11 files changed

+7
-42
lines changed

src/test/java/com/examples/client/PutFileDemo.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package com.examples.client;
22

3-
import java.io.File;
4-
53
import com.qiniu.api.io.IoApi;
64
import com.qiniu.api.io.PutExtra;
75
import com.qiniu.api.io.PutRet;

src/test/java/com/qiniu/testing/BatchCopyTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.qiniu.testing;
22

3-
import java.io.File;
43
import java.util.ArrayList;
54
import java.util.List;
65

src/test/java/com/qiniu/testing/BatchMoveTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.qiniu.testing;
22

3-
import java.io.File;
43
import java.util.ArrayList;
54
import java.util.List;
65

src/test/java/com/qiniu/testing/BatchStatTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.qiniu.testing;
22

3-
import java.io.File;
43
import java.util.ArrayList;
54
import java.util.List;
65

src/test/java/com/qiniu/testing/CopyTest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package com.qiniu.testing;
22

3-
import java.io.File;
4-
53
import junit.framework.TestCase;
64

75
import com.qiniu.api.auth.AuthException;
@@ -64,7 +62,6 @@ public void testCopy() throws Exception {
6462
{
6563
RSClient rs = new RSClient(mac);
6664
CallRet ret = rs.copy(srcBucket, key, destBucket, key);
67-
System.out.println(ret);
6865
assertTrue(ret.ok());
6966
}
7067

src/test/java/com/qiniu/testing/HttpClientTimeOutTest.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ public void tearDown() {
3232

3333
public void testCONNECTION_TIMEOUT() {
3434
Throwable tx = null;
35-
long s = 0;
3635
try {
3736
Config.CONNECTION_TIMEOUT = 5;
3837
Config.SO_TIMEOUT = 20 * 1000;
@@ -42,13 +41,10 @@ public void testCONNECTION_TIMEOUT() {
4241

4342
HttpGet httpget = new HttpGet("http://www.qiniu.com");
4443

45-
s = System.currentTimeMillis();
4644
HttpResponse ret = client.execute(httpget);
4745

4846
fail("应该按预期抛出异常 ConnectTimeoutException,测试失败");
4947
} catch (Exception e) {
50-
long end = System.currentTimeMillis();
51-
System.out.println("CONNECTION_TIMEOUT test : " + (end - s));
5248
tx = e;
5349
}
5450

@@ -58,7 +54,6 @@ public void testCONNECTION_TIMEOUT() {
5854

5955
public void testSO_TIMEOUT() {
6056
Throwable tx = null;
61-
long s = 0;
6257
try {
6358
Config.CONNECTION_TIMEOUT = 20 * 1000;
6459
Config.SO_TIMEOUT = 5;
@@ -68,12 +63,9 @@ public void testSO_TIMEOUT() {
6863

6964
HttpGet httpget = new HttpGet("http://www.qiniu.com");
7065

71-
s = System.currentTimeMillis();
7266
HttpResponse ret = client.execute(httpget);
7367
fail("应该按预期抛出异常 SocketTimeoutException,测试失败");
7468
} catch (Exception e) {
75-
long end = System.currentTimeMillis();
76-
System.out.println("SO_TIMEOUT test : " + (end - s));
7769
tx = e;
7870
}
7971
assertNotNull(tx.getMessage());

src/test/java/com/qiniu/testing/IOTest.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
package com.qiniu.testing;
22

3-
import java.io.*;
3+
import java.io.ByteArrayInputStream;
4+
import java.io.IOException;
5+
import java.io.InputStream;
46
import java.util.HashMap;
57
import java.util.Map;
68
import java.util.UUID;
79

10+
import junit.framework.TestCase;
11+
812
import org.apache.http.HttpEntity;
913
import org.apache.http.HttpResponse;
1014
import org.apache.http.client.ClientProtocolException;
1115
import org.apache.http.client.HttpClient;
1216
import org.apache.http.client.methods.HttpGet;
1317
import org.json.JSONObject;
1418

15-
import junit.framework.TestCase;
16-
1719
import com.qiniu.api.auth.digest.Mac;
1820
import com.qiniu.api.config.Config;
1921
import com.qiniu.api.io.IoApi;
2022
import com.qiniu.api.io.PutExtra;
2123
import com.qiniu.api.io.PutRet;
2224
import com.qiniu.api.net.Http;
23-
import com.qiniu.api.resumableio.ResumeableIoApi;
2425
import com.qiniu.api.rs.PutPolicy;
2526
import com.qiniu.api.rs.RSClient;
2627

@@ -139,9 +140,7 @@ public void close() throws IOException {
139140

140141
PutRet ret = IoApi.Put(upToken, key, new MyInputStream(en.getContent()), null);
141142

142-
System.out.println(ret);
143143
assertTrue(ret.ok());
144-
System.out.println("is.available() = " + en.getContent().available());
145144
}
146145

147146
public void testSetLengthStream() throws Exception {
@@ -154,9 +153,7 @@ public void testSetLengthStream() throws Exception {
154153
extra.mimeType = en.getContentType().getValue();
155154
PutRet ret = IoApi.Put(upToken, key, en.getContent(), extra, en.getContentLength());
156155

157-
System.out.println(ret);
158156
assertTrue(ret.ok());
159-
System.out.println("is.available() = " + en.getContent().available());
160157
}
161158

162159
private HttpEntity getHttpEntity(String url) throws ClientProtocolException, IOException{

src/test/java/com/qiniu/testing/MoveTest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package com.qiniu.testing;
22

3-
import java.io.File;
4-
53
import junit.framework.TestCase;
64

75
import com.qiniu.api.auth.AuthException;
@@ -66,7 +64,6 @@ public void testMove() throws Exception {
6664
{
6765
RSClient rs = new RSClient(mac);
6866
CallRet ret = rs.move(srcBucket, key, destBucket, key);
69-
System.out.println(ret);
7067
assertTrue(ret.ok());
7168
}
7269

src/test/java/com/qiniu/testing/RSFTest.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.qiniu.testing;
22

3-
import java.io.File;
43
import java.util.ArrayList;
54
import java.util.List;
65

@@ -78,12 +77,8 @@ public void testRSF() throws Exception {
7877
}
7978
if (ret.exception.getClass() != RSFEofException.class) {
8079
// error handler
81-
System.out.println(ret.exception);
8280
}
8381

84-
// 防止该bucket有别人在用
85-
System.out.println(ret.exception);
86-
System.out.println(all.size());
8782
assertTrue(all.size() >= 3);
8883
}
8984
}

src/test/java/com/qiniu/testing/RSStatTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package com.qiniu.testing;
22

3-
import java.io.File;
4-
53
import junit.framework.TestCase;
64

75
import com.qiniu.api.auth.AuthException;

src/test/java/com/qiniu/testing/ResumeableioTest.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import java.io.IOException;
88
import java.util.UUID;
99

10+
import junit.framework.TestCase;
11+
1012
import org.apache.http.HttpEntity;
1113
import org.apache.http.HttpResponse;
1214
import org.apache.http.client.ClientProtocolException;
@@ -15,8 +17,6 @@
1517
import org.json.JSONException;
1618
import org.json.JSONObject;
1719

18-
import junit.framework.TestCase;
19-
2020
import com.qiniu.api.auth.AuthException;
2121
import com.qiniu.api.auth.digest.Mac;
2222
import com.qiniu.api.config.Config;
@@ -90,7 +90,6 @@ private void uploadFile() throws AuthException, JSONException{
9090
p.returnBody = "{\"key\": $(key), \"hash\": $(etag),\"mimeType\": $(mimeType)}";
9191
String upToken = p.token(mac);
9292
PutRet ret = ResumeableIoApi.put(file, upToken, currentKey, mimeType);
93-
System.out.println(ret);
9493
assertTrue(ret.ok());
9594
if(mimeType != null){
9695
JSONObject jsonObject = new JSONObject(ret.response);
@@ -106,7 +105,6 @@ private void uploadStream() throws AuthException, JSONException, FileNotFoundExc
106105
String upToken = p.token(mac);
107106
FileInputStream fis = new FileInputStream(file);
108107
PutRet ret = ResumeableIoApi.put(fis, upToken, currentKey, mimeType);
109-
System.out.println(ret);
110108
assertTrue(ret.ok());
111109
if(mimeType != null){
112110
JSONObject jsonObject = new JSONObject(ret.response);
@@ -123,9 +121,7 @@ public void testStream() throws Exception {
123121
HttpEntity en = getHttpEntity("http://qiniuphotos.qiniudn.com/gogopher.jpg");
124122
PutRet ret = ResumeableIoApi.put(en.getContent(), upToken, currentKey, en.getContentType().getValue(), en.getContentLength());
125123

126-
System.out.println(ret);
127124
assertTrue(ret.ok());
128-
System.out.println("is.available() = " + en.getContent().available());
129125
}
130126

131127
private HttpEntity getHttpEntity(String url) throws ClientProtocolException, IOException{
@@ -146,9 +142,7 @@ public void tearDown() {
146142
}
147143

148144
RSClient rs = new RSClient(mac);
149-
System.out.println("try to delete: " + currentKey);
150145
CallRet cr = rs.delete(bucketName, currentKey);
151-
System.out.println("delete " + currentKey + " successed!");
152146
}
153147

154148
/**

0 commit comments

Comments
 (0)