Skip to content

Commit 5439dea

Browse files
committed
PDFBOX-5660: improve coverage, remove useless test, remove unneeded throws
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1930659 13f79535-47bb-0310-9956-ffa450edef68
1 parent f96615f commit 5439dea

File tree

1 file changed

+3
-24
lines changed

1 file changed

+3
-24
lines changed

xmpbox/src/test/java/org/apache/xmpbox/type/TestSimpleMetadataProperties.java

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ class TestSimpleMetadataProperties
4545

4646
/**
4747
* Check the detection of a bad type
48-
*
49-
* @throws IllegalArgumentException
5048
*/
5149
@Test
5250
void testBooleanBadTypeDetection()
@@ -58,21 +56,20 @@ void testBooleanBadTypeDetection()
5856

5957
/**
6058
* Check the detection of a bad type
61-
*
62-
* @throws IllegalArgumentException
6359
*/
6460
@Test
6561
void testDateBadTypeDetection()
6662
{
6763
assertThrows(IllegalArgumentException.class, () -> {
6864
new DateType(parent, null, "test", "date", "Bad Date");
6965
});
66+
DateType date = new DateType(parent, null, "test", "date", "");
67+
assertThrows(IllegalArgumentException.class, () -> date.setValue(null));
68+
assertThrows(IllegalArgumentException.class, () -> date.setValue(3));
7069
}
7170

7271
/**
7372
* Check the detection of a bad type
74-
*
75-
* @throws IllegalArgumentException
7673
*/
7774
@Test
7875
void testIntegerBadTypeDetection()
@@ -84,8 +81,6 @@ void testIntegerBadTypeDetection()
8481

8582
/**
8683
* Check the detection of a bad type
87-
*
88-
* @throws IllegalArgumentException
8984
*/
9085
@Test
9186
void testRealBadTypeDetection()
@@ -97,8 +92,6 @@ void testRealBadTypeDetection()
9792

9893
/**
9994
* Check the detection of a bad type
100-
*
101-
* @throws IllegalArgumentException
10295
*/
10396
@Test
10497
void testTextBadTypeDetection()
@@ -178,20 +171,6 @@ void testObjectCreationWithNamespace()
178171
assertEquals(ns, text.getNamespace());
179172
}
180173

181-
/**
182-
* Throw IllegalArgumentException
183-
*
184-
* @throws IllegalArgumentException
185-
*/
186-
@Test
187-
void testExceptionWithCause()
188-
{
189-
Throwable throwable = new Throwable();
190-
assertThrows(IllegalArgumentException.class, () -> {
191-
throw new IllegalArgumentException("TEST", throwable);
192-
});
193-
}
194-
195174
/**
196175
* Check if attributes management works
197176
*/

0 commit comments

Comments
 (0)