Skip to content

Commit d420e8f

Browse files
committed
fix ut issues.
1 parent 2a1feb6 commit d420e8f

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

QCloudCosXml/cosxml/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ static String safeEnvBoolean(b) {
141141
return "false"
142142
}
143143

144-
return "true"
144+
return b
145145
}
146146

147147

QCloudCosXml/cosxml/src/androidTest/java/com/tencent/cos/xml/core/TestUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,6 @@ public static void sleep(long time) {
197197
}
198198

199199
public static String localParentPath() {
200-
return getContext().getApplicationContext().getFilesDir().getAbsolutePath();
200+
return getContext().getExternalCacheDir().getAbsolutePath();
201201
}
202202
}

QCloudCosXml/cosxml/src/androidTest/java/com/tencent/cos/xml/image/ImageTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ private void downloadImageToLocalPath() {
8787

8888
final TestLocker testLocker = new TestLocker(1);
8989
GetObjectRequest getObjectRequest = new GetObjectRequest(TestConst.PERSIST_BUCKET, TestConst.PERSIST_BUCKET_PIC_PATH,
90-
Environment.getExternalStorageDirectory().getAbsolutePath(), "pic2.png");
90+
TestUtils.localParentPath(), "pic2.png");
9191

9292
Map<String, String> paras = new HashMap<>();
9393
paras.put("imageMogr2/thumbnail/!50p", null);

QCloudCosXml/cosxml/src/androidTest/java/com/tencent/cos/xml/quic/QuicTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public class QuicTest {
6767
@Test
6868
public void testUploadSmallFileByPath() {
6969

70-
if (testQuic) {
70+
if (!testQuic) {
7171
Assert.assertTrue(true);
7272
return;
7373
}
@@ -100,7 +100,7 @@ public void onFail(CosXmlRequest request, CosXmlClientException clientException,
100100
@Test
101101
public void testUploadSmallFileByUri() {
102102

103-
if (testQuic) {
103+
if (!testQuic) {
104104
Assert.assertTrue(true);
105105
return;
106106
}
@@ -131,7 +131,7 @@ public void onFail(CosXmlRequest request, CosXmlClientException clientException,
131131
@Test
132132
public void testUploadBigFileByUri() {
133133

134-
if (testQuic) {
134+
if (!testQuic) {
135135
Assert.assertTrue(true);
136136
return;
137137
}
@@ -159,7 +159,7 @@ public void onFail(CosXmlRequest request, CosXmlClientException clientException,
159159
@Test
160160
public void testUploadBigFileByPath() {
161161

162-
if (testQuic) {
162+
if (!testQuic) {
163163
Assert.assertTrue(true);
164164
return;
165165
}
@@ -190,7 +190,7 @@ public void onFail(CosXmlRequest request, CosXmlClientException clientException,
190190
@Test
191191
public void testUploadFileConcurrent() throws Exception{
192192

193-
if (testQuic) {
193+
if (!testQuic) {
194194
Assert.assertTrue(true);
195195
return;
196196
}
@@ -244,7 +244,7 @@ public void onStateChanged(TransferState state) {
244244
@Test
245245
public void testHeadQuicObject() {
246246

247-
if (testQuic) {
247+
if (!testQuic) {
248248
Assert.assertTrue(true);
249249
return;
250250
}
@@ -263,7 +263,7 @@ public void testHeadQuicObject() {
263263
@Test
264264
public void testBigDownload() {
265265

266-
if (testQuic) {
266+
if (!testQuic) {
267267
Assert.assertTrue(true);
268268
return;
269269
}

QCloudCosXml/cosxml/src/androidTest/java/com/tencent/cos/xml/weak_network/WeakNetworkTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ private void appendFile(File logFile, String line) {
223223
*/
224224
private File createTempFile(int fileSize, String fileName) {
225225

226-
File parentDir = new File(Environment.getExternalStorageDirectory(), "weakNetwork/");
226+
File parentDir = new File(TestUtils.localParentPath(), "weakNetwork/");
227227
if (!parentDir.exists()) {
228228
parentDir.mkdir();
229229
}

QCloudCosXml/settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ project(':quic').projectDir = new File(rootDir, '../QCloudFoundation/quic')
2828

2929
project(':xmlAnnoation').projectDir = new File(rootDir, '../QCloudXml/xmlAnnoation')
3030
// 合并到 foundation 中
31-
// project(':xmlCore').projectDir = new File(rootDir, '../QCloudXml/xmlCore')
31+
project(':xmlCore').projectDir = new File(rootDir, '../QCloudXml/xmlCore')
3232
project(':xmlCompiler').projectDir = new File(rootDir, '../QCloudXml/xmlCompiler')

0 commit comments

Comments
 (0)