You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2019/07/06 14:51:45 UTC
[commons-bcel] branch master updated: Slightly better test.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-bcel.git
The following commit(s) were added to refs/heads/master by this push:
new f93bb01 Slightly better test.
f93bb01 is described below
commit f93bb013e33d31c628ef60b364d1c5be87ff0ead
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Jul 6 10:51:42 2019 -0400
Slightly better test.
---
.../org/apache/bcel/util/LruCacheClassPathRepositoryTestCase.java | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/test/java/org/apache/bcel/util/LruCacheClassPathRepositoryTestCase.java b/src/test/java/org/apache/bcel/util/LruCacheClassPathRepositoryTestCase.java
index a2d33ed..c64a7e0 100644
--- a/src/test/java/org/apache/bcel/util/LruCacheClassPathRepositoryTestCase.java
+++ b/src/test/java/org/apache/bcel/util/LruCacheClassPathRepositoryTestCase.java
@@ -23,6 +23,7 @@ import static org.junit.Assert.assertNull;
import java.io.IOException;
import org.apache.bcel.classfile.JavaClass;
+import org.junit.Assert;
import org.junit.Test;
/**
@@ -35,8 +36,11 @@ public class LruCacheClassPathRepositoryTestCase {
try (final ClassPath classPath = new ClassPath("")) {
LruCacheClassPathRepository repository = new LruCacheClassPathRepository(classPath, 2);
JavaClass class1 = repository.loadClass("java.lang.String");
+ Assert.assertNotNull(class1);
JavaClass class2 = repository.loadClass("java.lang.Long");
+ Assert.assertNotNull(class2);
JavaClass class3 = repository.loadClass("java.lang.Integer"); // Evicts class1
+ Assert.assertNotNull(class3);
assertNull(repository.findClass("java.lang.String"));
JavaClass cachedClass2 = repository.findClass("java.lang.Long");
@@ -49,9 +53,12 @@ public class LruCacheClassPathRepositoryTestCase {
try (final ClassPath classPath = new ClassPath("")) {
LruCacheClassPathRepository repository = new LruCacheClassPathRepository(classPath, 2);
JavaClass class1 = repository.loadClass("java.lang.String");
+ Assert.assertNotNull(class1);
JavaClass class2 = repository.loadClass("java.lang.Long");
+ Assert.assertNotNull(class2);
repository.findClass("java.lang.String"); // Uses class1
JavaClass class3 = repository.loadClass("java.lang.Integer"); // Evicts class2
+ Assert.assertNotNull(class3);
assertNull(repository.findClass("java.lang.Long"));
JavaClass cachedClass1 = repository.findClass("java.lang.String");