You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by le...@apache.org on 2019/09/16 22:13:58 UTC
[incubator-datasketches-java] branch Resources updated: Improve
unit test on resources
This is an automated email from the ASF dual-hosted git repository.
leerho pushed a commit to branch Resources
in repository https://gitbox.apache.org/repos/asf/incubator-datasketches-java.git
The following commit(s) were added to refs/heads/Resources by this push:
new ea3f83c Improve unit test on resources
ea3f83c is described below
commit ea3f83c350a936b01396ec1ca1a45f39a568e265
Author: Lee Rhodes <le...@users.noreply.github.com>
AuthorDate: Mon Sep 16 15:13:50 2019 -0700
Improve unit test on resources
---
src/test/java/org/apache/datasketches/UtilTest.java | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/src/test/java/org/apache/datasketches/UtilTest.java b/src/test/java/org/apache/datasketches/UtilTest.java
index c2257d0..f9898c1 100644
--- a/src/test/java/org/apache/datasketches/UtilTest.java
+++ b/src/test/java/org/apache/datasketches/UtilTest.java
@@ -60,7 +60,6 @@ import org.testng.annotations.Test;
public class UtilTest {
private static final String LS = System.getProperty("line.separator");
-
@Test(expectedExceptions = SketchesArgumentException.class)
public void checkPowerOf2() {
checkIfPowerOf2(31, "31");
@@ -330,19 +329,29 @@ public class UtilTest {
//Resources
- @Test(expectedExceptions = IllegalArgumentException.class)
- void resourcesFileTest() {
+ @Test
+ public void resourcefileExists() {
final String shortFileName = "cpc-empty.bin";
final File file = getResourceFile(shortFileName);
assertTrue(file.exists());
- getResourceFile(shortFileName + "123");
}
@Test(expectedExceptions = IllegalArgumentException.class)
- void resourcesBytesTest() {
+ public void resourceFileNotFound() {
+ final String shortFileName = "cpc-empty.bin";
+ getResourceFile(shortFileName + "123");
+ }
+
+ @Test
+ public void resourceBytesCorrect() {
final String shortFileName = "cpc-empty.bin";
final byte[] bytes = getResourceBytes(shortFileName);
assertTrue(bytes.length == 8);
+ }
+
+ @Test(expectedExceptions = IllegalArgumentException.class)
+ public void resourceBytesFileNotFound() {
+ final String shortFileName = "cpc-empty.bin";
getResourceBytes(shortFileName + "123");
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org