use of com.bilibili.boxing.utils.ImageCompressor in project boxing by Bilibili.
the class PickerUtilTest method testCompressTask.
@Test
public void testCompressTask() {
ImageCompressor illegalCompressor = new ImageCompressor(new File("///"));
ImageMedia media = new ImageMedia("123", "44");
ImageCompressor compressor = new ImageCompressor(new File("src/main/res/"));
ImageMedia media1 = new ImageMedia("1223", "../boxing-impl/src/main/res/drawable-hdpi/ic_camera.png");
media1.setSize("233");
boolean result1 = CompressTask.compress(null, null, 0);
assertTrue(!result1);
result1 = CompressTask.compress(null, media, 0);
assertTrue(!result1);
result1 = CompressTask.compress(illegalCompressor, media, 0);
assertTrue(!result1);
result1 = CompressTask.compress(illegalCompressor, media, 1000);
assertTrue(!result1);
result1 = CompressTask.compress(compressor, media1, 1000);
assertTrue(result1);
}
Aggregations