Skip to content

Commit 721b745

Browse files
committed
[refactor] Forgot to add exception handling
1 parent 43abe23 commit 721b745

File tree

4 files changed

+21
-8
lines changed

4 files changed

+21
-8
lines changed

exist-core/src/main/java/org/exist/test/ExistXmldbEmbeddedServer.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import javax.annotation.Nullable;
4141
import javax.xml.transform.OutputKeys;
4242
import java.io.IOException;
43+
import java.lang.reflect.InvocationTargetException;
4344
import java.nio.file.Path;
4445
import java.util.Map;
4546

@@ -104,7 +105,8 @@ protected void before() throws Throwable {
104105
super.before();
105106
}
106107

107-
private void startDb() throws ClassNotFoundException, IllegalAccessException, InstantiationException, XMLDBException, NoSuchMethodException {
108+
private void startDb() throws ClassNotFoundException, IllegalAccessException, InstantiationException,
109+
XMLDBException, NoSuchMethodException, InvocationTargetException {
108110
try {
109111
existEmbeddedServer.startDb();
110112
} catch (final DatabaseConfigurationException | EXistException | IOException e) {
@@ -113,7 +115,8 @@ private void startDb() throws ClassNotFoundException, IllegalAccessException, In
113115
startXmldb();
114116
}
115117

116-
private void startXmldb() throws ClassNotFoundException, IllegalAccessException, InstantiationException, XMLDBException, NoSuchMethodException {
118+
private void startXmldb() throws ClassNotFoundException, IllegalAccessException, InstantiationException,
119+
XMLDBException, NoSuchMethodException, InvocationTargetException {
117120
if (database == null) {
118121
// initialize driver
119122
final Class<?> cl = Class.forName("org.exist.xmldb.DatabaseImpl");
@@ -131,11 +134,13 @@ private void startXmldb() throws ClassNotFoundException, IllegalAccessException,
131134
}
132135
}
133136

134-
public void restart() throws ClassNotFoundException, InstantiationException, XMLDBException, IllegalAccessException {
137+
public void restart() throws ClassNotFoundException, InstantiationException, XMLDBException, IllegalAccessException,
138+
InvocationTargetException, NoSuchMethodException {
135139
restart(false);
136140
}
137141

138-
public void restart(final boolean clearTemporaryStorage) throws ClassNotFoundException, InstantiationException, XMLDBException, IllegalAccessException {
142+
public void restart(final boolean clearTemporaryStorage) throws ClassNotFoundException, InstantiationException,
143+
XMLDBException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {
139144
stopDb(clearTemporaryStorage);
140145
startDb();
141146
}

exist-core/src/test/java/org/exist/security/LocalSecurityManagerRoundtripTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import org.xmldb.api.base.XMLDBException;
3030

3131
import java.io.IOException;
32+
import java.lang.reflect.InvocationTargetException;
3233

3334
/**
3435
* Security Manager round trip tests against the XML:DB Local API
@@ -49,7 +50,8 @@ protected Collection getRoot() {
4950
protected void restartServer() throws XMLDBException, IOException {
5051
try {
5152
existXmldbEmbeddedServer.restart();
52-
} catch (final ClassNotFoundException | InstantiationException | IllegalAccessException e) {
53+
} catch (final ClassNotFoundException | InstantiationException | IllegalAccessException |
54+
InvocationTargetException | NoSuchMethodException e) {
5355
throw new XMLDBException(ErrorCodes.UNKNOWN_ERROR, e);
5456
}
5557
}

exist-core/src/test/java/org/exist/security/internal/BackupRestoreSecurityPrincipalsTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import org.xmldb.api.modules.XPathQueryService;
4747

4848
import java.io.IOException;
49+
import java.lang.reflect.InvocationTargetException;
4950
import java.nio.file.Files;
5051
import java.nio.file.Path;
5152

@@ -92,7 +93,9 @@ public class BackupRestoreSecurityPrincipalsTest {
9293
* that were owned by them are still correctly owner by them (and not some other user).
9394
*/
9495
@Test
95-
public void restoreConflictingUsername() throws PermissionDeniedException, EXistException, SAXException, IOException, XMLDBException, IllegalAccessException, ClassNotFoundException, InstantiationException {
96+
public void restoreConflictingUsername() throws PermissionDeniedException, EXistException,
97+
SAXException, IOException, XMLDBException, IllegalAccessException, ClassNotFoundException,
98+
InstantiationException, InvocationTargetException, NoSuchMethodException {
9699
// creates a database with new users: 'frank(id=11)', 'joe(id=12)', and 'jack(id=13)'
97100
createInitialUsers(FRANK_USER, JOE_USER, JACK_USER);
98101

exist-core/src/test/java/org/exist/xmldb/DOMTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
package org.exist.xmldb;
2323

2424
import java.io.IOException;
25+
import java.lang.reflect.InvocationTargetException;
2526

2627
import javax.xml.parsers.DocumentBuilder;
2728
import javax.xml.parsers.DocumentBuilderFactory;
@@ -111,7 +112,8 @@ public void test1() throws XMLDBException {
111112
* - simple access via getContentAsDOM()
112113
* */
113114
@Test
114-
public void test2() throws XMLDBException, InstantiationException, IllegalAccessException, ClassNotFoundException, ParserConfigurationException, IOException {
115+
public void test2() throws XMLDBException, InstantiationException, IllegalAccessException, ClassNotFoundException,
116+
ParserConfigurationException, IOException, InvocationTargetException, NoSuchMethodException {
115117
for (int i = 0; i < 2; i++) {
116118
XMLResource resource = (XMLResource) existEmbeddedServer.getRoot().getResource(name);
117119
if (resource == null) {
@@ -145,7 +147,8 @@ public void test2() throws XMLDBException, InstantiationException, IllegalAccess
145147

146148
/** like test 2 but add attribute and text as well */
147149
@Test
148-
public void test3() throws XMLDBException, ParserConfigurationException {
150+
public void test3() throws XMLDBException, ParserConfigurationException,
151+
InvocationTargetException, NoSuchMethodException {
149152
Collection coll = existEmbeddedServer.getRoot();
150153
XMLResource resource =
151154
coll.createResource(

0 commit comments

Comments
 (0)