Author: tilman
Date: Wed Dec 17 09:10:32 2025
New Revision: 1930659
Log:
PDFBOX-5660: improve coverage, remove useless test, remove unneeded throws
Modified:
pdfbox/trunk/xmpbox/src/test/java/org/apache/xmpbox/type/TestSimpleMetadataProperties.java
Modified:
pdfbox/trunk/xmpbox/src/test/java/org/apache/xmpbox/type/TestSimpleMetadataProperties.java
==============================================================================
---
pdfbox/trunk/xmpbox/src/test/java/org/apache/xmpbox/type/TestSimpleMetadataProperties.java
Wed Dec 17 09:10:27 2025 (r1930658)
+++
pdfbox/trunk/xmpbox/src/test/java/org/apache/xmpbox/type/TestSimpleMetadataProperties.java
Wed Dec 17 09:10:32 2025 (r1930659)
@@ -45,8 +45,6 @@ class TestSimpleMetadataProperties
/**
* Check the detection of a bad type
- *
- * @throws IllegalArgumentException
*/
@Test
void testBooleanBadTypeDetection()
@@ -58,8 +56,6 @@ class TestSimpleMetadataProperties
/**
* Check the detection of a bad type
- *
- * @throws IllegalArgumentException
*/
@Test
void testDateBadTypeDetection()
@@ -67,12 +63,13 @@ class TestSimpleMetadataProperties
assertThrows(IllegalArgumentException.class, () -> {
new DateType(parent, null, "test", "date", "Bad Date");
});
+ DateType date = new DateType(parent, null, "test", "date", "");
+ assertThrows(IllegalArgumentException.class, () ->
date.setValue(null));
+ assertThrows(IllegalArgumentException.class, () -> date.setValue(3));
}
/**
* Check the detection of a bad type
- *
- * @throws IllegalArgumentException
*/
@Test
void testIntegerBadTypeDetection()
@@ -84,8 +81,6 @@ class TestSimpleMetadataProperties
/**
* Check the detection of a bad type
- *
- * @throws IllegalArgumentException
*/
@Test
void testRealBadTypeDetection()
@@ -97,8 +92,6 @@ class TestSimpleMetadataProperties
/**
* Check the detection of a bad type
- *
- * @throws IllegalArgumentException
*/
@Test
void testTextBadTypeDetection()
@@ -179,20 +172,6 @@ class TestSimpleMetadataProperties
}
/**
- * Throw IllegalArgumentException
- *
- * @throws IllegalArgumentException
- */
- @Test
- void testExceptionWithCause()
- {
- Throwable throwable = new Throwable();
- assertThrows(IllegalArgumentException.class, () -> {
- throw new IllegalArgumentException("TEST", throwable);
- });
- }
-
- /**
* Check if attributes management works
*/
@Test