This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch 1.X in repository https://gitbox.apache.org/repos/asf/commons-beanutils.git
The following commit(s) were added to refs/heads/1.X by this push: new 6f5d1005 Remove support for running tests on Java versions before 1.4 6f5d1005 is described below commit 6f5d10050806831d9a507282bfb68b428d7e328b Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Sat Aug 31 09:22:49 2024 -0400 Remove support for running tests on Java versions before 1.4 --- .../apache/commons/beanutils/BeanMapTestCase.java | 18 -------------- .../commons/beanutils/BeanUtilsTestCase.java | 29 ---------------------- .../commons/beanutils/BeanificationTestCase.java | 11 -------- .../commons/beanutils/PropertyUtilsTestCase.java | 6 ----- .../locale/LocaleBeanificationTestCase.java | 11 -------- 5 files changed, 75 deletions(-) diff --git a/src/test/java/org/apache/commons/beanutils/BeanMapTestCase.java b/src/test/java/org/apache/commons/beanutils/BeanMapTestCase.java index 51809f1b..4c10d820 100644 --- a/src/test/java/org/apache/commons/beanutils/BeanMapTestCase.java +++ b/src/test/java/org/apache/commons/beanutils/BeanMapTestCase.java @@ -369,12 +369,6 @@ public class BeanMapTestCase extends AbstractTestMap { * Test that the cause of exception thrown by clear() is initialised. */ public void testExceptionThrowFromClear() { - - if (BeanUtilsTestCase.isPre14JVM()) { - System.out.println("testExceptionThrowFromClear() skipped on pre 1.4 JVM"); - return; - } - try { final Object bean = Jira87BeanFactory.createMappedPropertyBean(); final BeanMap map = new BeanMap(bean); @@ -396,12 +390,6 @@ public class BeanMapTestCase extends AbstractTestMap { * Test that the cause of exception thrown by a clone() is initialised. */ public void testExceptionThrowFromClone() { - - if (BeanUtilsTestCase.isPre14JVM()) { - System.out.println("testExceptionThrowFromClone() skipped on pre 1.4 JVM"); - return; - } - // Test cloning a non-public bean (instantiation exception) try { final Object bean = Jira87BeanFactory.createMappedPropertyBean(); @@ -440,12 +428,6 @@ public class BeanMapTestCase extends AbstractTestMap { * Test that the cause of exception thrown by put() is initialized. */ public void testExceptionThrowFromPut() { - - if (BeanUtilsTestCase.isPre14JVM()) { - System.out.println("testExceptionThrowFromPut() skipped on pre 1.4 JVM"); - return; - } - try { final Map<Object, Object> map = new BeanMap(new BeanThrowingExceptions()); map.put("valueThrowingException", "value"); diff --git a/src/test/java/org/apache/commons/beanutils/BeanUtilsTestCase.java b/src/test/java/org/apache/commons/beanutils/BeanUtilsTestCase.java index fc49cb7a..d969bf2b 100644 --- a/src/test/java/org/apache/commons/beanutils/BeanUtilsTestCase.java +++ b/src/test/java/org/apache/commons/beanutils/BeanUtilsTestCase.java @@ -62,32 +62,6 @@ import org.apache.commons.beanutils.converters.DateConverter; public class BeanUtilsTestCase extends TestCase { - - /** - * Test for JDK 1.4 - */ - public static boolean isPre14JVM() { - final String version = System.getProperty("java.specification.version"); - final StringTokenizer tokenizer = new StringTokenizer(version,"."); - if (tokenizer.nextToken().equals("1")) { - final String minorVersion = tokenizer.nextToken(); - if (minorVersion.equals("0")) { - return true; - } - if (minorVersion.equals("1")) { - return true; - } - if (minorVersion.equals("2")) { - return true; - } - if (minorVersion.equals("3")) { - return true; - } - } - return false; - } - - /** * Return the tests included in this test suite. */ @@ -1019,9 +993,6 @@ public class BeanUtilsTestCase extends TestCase { * Test for {@link BeanUtilsBean#initCause(Throwable, Throwable)} method. */ public void testInitCause() { - if (isPre14JVM()) { - return; - } final String parentMsg = "PARENT-THROWABLE"; final String causeMsg = "THROWABLE-CAUSE"; try { diff --git a/src/test/java/org/apache/commons/beanutils/BeanificationTestCase.java b/src/test/java/org/apache/commons/beanutils/BeanificationTestCase.java index 8108db68..be3f0e66 100644 --- a/src/test/java/org/apache/commons/beanutils/BeanificationTestCase.java +++ b/src/test/java/org/apache/commons/beanutils/BeanificationTestCase.java @@ -367,11 +367,6 @@ public class BeanificationTestCase extends TestCase { /** Tests whether classloaders and beans are released from memory */ public void testMemoryLeak() throws Exception { - if (BeanUtilsTestCase.isPre14JVM()) { - System.out.println("WARNING: CANNOT TEST MEMORY LEAK ON PRE1.4 JVM"); - return; - } - // many thanks to Juozas Baliuka for suggesting this methodology TestClassLoader loader = new TestClassLoader(); final WeakReference<ClassLoader> loaderReference = new WeakReference<>(loader); @@ -454,12 +449,6 @@ public class BeanificationTestCase extends TestCase { /** Tests whether classloaders and beans are released from memory by the map used by beanutils */ public void testMemoryLeak2() throws Exception { // tests when the map used by beanutils has the right behaviour - - if (BeanUtilsTestCase.isPre14JVM()) { - System.out.println("WARNING: CANNOT TEST MEMORY LEAK ON PRE1.4 JVM"); - return; - } - // many thanks to Juozas Baliuka for suggesting this methodology TestClassLoader loader = new TestClassLoader(); final ReferenceQueue<Object> queue = new ReferenceQueue<>(); diff --git a/src/test/java/org/apache/commons/beanutils/PropertyUtilsTestCase.java b/src/test/java/org/apache/commons/beanutils/PropertyUtilsTestCase.java index 77ab68e4..1050ca51 100644 --- a/src/test/java/org/apache/commons/beanutils/PropertyUtilsTestCase.java +++ b/src/test/java/org/apache/commons/beanutils/PropertyUtilsTestCase.java @@ -69,9 +69,6 @@ import org.apache.commons.beanutils.priv.PublicSubBean; public class PropertyUtilsTestCase extends TestCase { - - - /** * The fully qualified class name of our private directly * implemented interface. @@ -451,9 +448,6 @@ public class PropertyUtilsTestCase extends TestCase { * See BEANUTILS-266 for changes and reason for test */ public void testExceptionFromInvoke() throws Exception { - if (BeanUtilsTestCase.isPre14JVM()) { - return; - } try { PropertyUtils.setSimpleProperty(bean, "intProperty","XXX"); } catch(final IllegalArgumentException t) { diff --git a/src/test/java/org/apache/commons/beanutils/locale/LocaleBeanificationTestCase.java b/src/test/java/org/apache/commons/beanutils/locale/LocaleBeanificationTestCase.java index 98b3a517..932444ea 100644 --- a/src/test/java/org/apache/commons/beanutils/locale/LocaleBeanificationTestCase.java +++ b/src/test/java/org/apache/commons/beanutils/locale/LocaleBeanificationTestCase.java @@ -416,11 +416,6 @@ public class LocaleBeanificationTestCase extends TestCase { /** Tests whether classloaders and beans are released from memory */ public void testMemoryLeak() throws Exception { - if (BeanUtilsTestCase.isPre14JVM()) { - System.out.println("WARNING: CANNOT TEST MEMORY LEAK ON PRE1.4 JVM"); - return; - } - // many thanks to Juozas Baliuka for suggesting this methodology TestClassLoader loader = new TestClassLoader(); final WeakReference<TestClassLoader> loaderReference = new WeakReference<>(loader); @@ -494,12 +489,6 @@ public class LocaleBeanificationTestCase extends TestCase { /** Tests whether classloaders and beans are released from memory by the map used by beanutils */ public void testMemoryLeak2() throws Exception { // tests when the map used by beanutils has the right behaviour - - if (BeanUtilsTestCase.isPre14JVM()) { - System.out.println("WARNING: CANNOT TEST MEMORY LEAK ON PRE1.4 JVM"); - return; - } - // many thanks to Juozas Baliuka for suggesting this methodology TestClassLoader loader = new TestClassLoader(); final ReferenceQueue<Object> queue = new ReferenceQueue<>();