Skip to content

Commit a1d00fe

Browse files
committed
use static files for tests and sample from github instead of dropbox
1 parent f5a7792 commit a1d00fe

4 files changed

Lines changed: 17 additions & 13 deletions

File tree

sample/src/main/java/com/danikula/videocache/sample/Video.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77
public enum Video {
88

9-
ORANGE_1("https://dl.dropboxusercontent.com/u/15506779/persistent/proxycache/orange1.mp4"),
10-
ORANGE_2("https://dl.dropboxusercontent.com/u/15506779/persistent/proxycache/orange2.mp4"),
11-
ORANGE_3("https://dl.dropboxusercontent.com/u/15506779/persistent/proxycache/orange3.mp4"),
12-
ORANGE_4("https://dl.dropboxusercontent.com/u/15506779/persistent/proxycache/orange4.mp4"),
13-
ORANGE_5("https://dl.dropboxusercontent.com/u/15506779/persistent/proxycache/orange5.mp4");
9+
ORANGE_1(Config.ROOT + "orange1.mp4"),
10+
ORANGE_2(Config.ROOT + "orange2.mp4"),
11+
ORANGE_3(Config.ROOT + "orange3.mp4"),
12+
ORANGE_4(Config.ROOT + "orange4.mp4"),
13+
ORANGE_5(Config.ROOT + "orange5.mp4");
1414

1515
public final String url;
1616

@@ -21,4 +21,8 @@ public enum Video {
2121
public File getCacheFile(Context context) {
2222
return new File(context.getExternalCacheDir(), name());
2323
}
24+
25+
private class Config {
26+
private static final String ROOT = "https://raw.githubusercontent.com/danikula/AndroidVideoCache/master/files/";
27+
}
2428
}

test/src/test/java/com/danikula/videocache/HttpProxyCacheServerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public void testProxyContentWithPartialCache() throws Exception {
8282

8383
@Test
8484
public void testMimeFromResponse() throws Exception {
85-
Pair<File, Response> response = readProxyData("https://dl.dropboxusercontent.com/u/15506779/persistent/proxycache/android");
85+
Pair<File, Response> response = readProxyData("https://raw.githubusercontent.com/danikula/AndroidVideoCache/master/files/android");
8686
assertThat(response.second.contentType).isEqualTo("application/octet-stream");
8787
}
8888

test/src/test/java/com/danikula/videocache/HttpProxyCacheTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public void testProcessPartialRequestWithoutCache() throws Exception {
7878

7979
@Test
8080
public void testLoadEmptyFile() throws Exception {
81-
String zeroSizeUrl = "https://dl.dropboxusercontent.com/u/15506779/persistent/proxycache/empty.txt";
81+
String zeroSizeUrl = "https://raw.githubusercontent.com/danikula/AndroidVideoCache/master/files/empty.txt";
8282
HttpUrlSource source = new HttpUrlSource(zeroSizeUrl);
8383
HttpProxyCache proxyCache = new HttpProxyCache(source, new FileCache(ProxyCacheTestUtils.newCacheFile()));
8484
GetRequest request = new GetRequest("GET /" + HTTP_DATA_URL + " HTTP/1.1");

test/src/test/java/com/danikula/videocache/support/ProxyCacheTestUtils.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
*/
2121
public class ProxyCacheTestUtils {
2222

23-
public static final String HTTP_DATA_URL = "https://dl.dropboxusercontent.com/u/15506779/persistent/proxycache/android.jpg";
24-
public static final String HTTP_DATA_URL_ONE_REDIRECT = "http://bit.ly/1V5PeY5";
25-
public static final String HTTP_DATA_URL_3_REDIRECTS = "http://bit.ly/1KvVmgZ";
26-
public static final String HTTP_DATA_URL_6_REDIRECTS = "http://ow.ly/SugRH";
27-
public static final String HTTP_DATA_BIG_URL = "https://dl.dropboxusercontent.com/u/15506779/persistent/proxycache/phones.jpg";
28-
public static final String HTTP_DATA_BIG_URL_ONE_REDIRECT = "http://bit.ly/1iJ69yA";
23+
public static final String HTTP_DATA_URL = "https://raw.githubusercontent.com/danikula/AndroidVideoCache/master/files/android.jpg";
24+
public static final String HTTP_DATA_URL_ONE_REDIRECT = "http://bit.ly/1LAJKAy";
25+
public static final String HTTP_DATA_URL_3_REDIRECTS = "http://bit.ly/1QtKJiB";
26+
public static final String HTTP_DATA_URL_6_REDIRECTS = "http://ow.ly/Z17wz";
27+
public static final String HTTP_DATA_BIG_URL = "https://raw.githubusercontent.com/danikula/AndroidVideoCache/master/files/phones.jpg";
28+
public static final String HTTP_DATA_BIG_URL_ONE_REDIRECT = "http://bit.ly/24DdZ06";
2929
public static final String ASSETS_DATA_NAME = "android.jpg";
3030
public static final String ASSETS_DATA_BIG_NAME = "phones.jpg";
3131
public static final int HTTP_DATA_SIZE = 4768;

0 commit comments

Comments
 (0)