diff options
author | Ralph Bergmann <ralph@the4thfloor.eu> | 2015-02-23 18:57:48 +0100 |
---|---|---|
committer | Ralph Bergmann <ralph@the4thfloor.eu> | 2015-02-25 12:39:36 +0100 |
commit | e1f0d61968d5194088c18f00b1bcfc46a91adbfd (patch) | |
tree | 252f9f00844062085f786b2f729f5e3606b8fa12 /src/test/java/com/android/volley/toolbox/DiskBasedCacheTest.java | |
parent | ee454371157d9a3fb74b70ee8ba93cf96559acf3 (diff) | |
download | volley-e1f0d61968d5194088c18f00b1bcfc46a91adbfd.tar.gz |
add test for public api
add test for public api. not for all classes but for the
most important ones
Change-Id: I494f60568c6caafc23754154fe930d9f90a3bde0
Diffstat (limited to 'src/test/java/com/android/volley/toolbox/DiskBasedCacheTest.java')
-rw-r--r-- | src/test/java/com/android/volley/toolbox/DiskBasedCacheTest.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/test/java/com/android/volley/toolbox/DiskBasedCacheTest.java b/src/test/java/com/android/volley/toolbox/DiskBasedCacheTest.java index d9d49e9..bf1d258 100644 --- a/src/test/java/com/android/volley/toolbox/DiskBasedCacheTest.java +++ b/src/test/java/com/android/volley/toolbox/DiskBasedCacheTest.java @@ -22,6 +22,7 @@ import org.junit.Test; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; +import java.io.File; import java.util.HashMap; import java.util.Map; @@ -124,8 +125,8 @@ public class DiskBasedCacheTest { assertEquals(DiskBasedCache.readStringStringMap(bais), emptyValue); } - // Test deserializing the old format into the new one. - public void testCacheHeaderSerializationOldToNewFormat() throws Exception { + /** deserializing the old format into the new one. */ + @Test public void testCacheHeaderSerializationOldToNewFormat() throws Exception { final int CACHE_MAGIC = 0x20140623; final String key = "key"; @@ -162,4 +163,13 @@ public class DiskBasedCacheTest { // the old format doesn't know lastModified assertEquals(cacheHeader.lastModified, 0); } + + @Test + public void publicMethods() throws Exception { + // Catch-all test to find API-breaking changes. + assertNotNull(DiskBasedCache.class.getConstructor(File.class, int.class)); + assertNotNull(DiskBasedCache.class.getConstructor(File.class)); + + assertNotNull(DiskBasedCache.class.getMethod("getFileForKey", String.class)); + } } |