Code aufräumen
This commit is contained in:
+3
-1
@@ -9,7 +9,9 @@ package de.gecheckt.pdf.umbenenner.bootstrap.singleinstance;
|
||||
*/
|
||||
public class AnotherInstanceRunningException extends RuntimeException {
|
||||
|
||||
/**
|
||||
private static final long serialVersionUID = 159711019801174340L;
|
||||
|
||||
/**
|
||||
* Erstellt eine neue {@code AnotherInstanceRunningException} mit der angegebenen Nachricht.
|
||||
*
|
||||
* @param message die Fehlernachricht; darf {@code null} sein
|
||||
|
||||
+2
-2
@@ -39,10 +39,10 @@ class SingleInstanceGuardTest {
|
||||
@Test
|
||||
void zweiterAcquireWirftAnotherInstanceRunningException() throws Exception {
|
||||
int port = freienPortErmitteln();
|
||||
try (SingleInstanceGuard ersterGuard = new SingleInstanceGuard(port)) {
|
||||
try (SingleInstanceGuard ersterGuard = new SingleInstanceGuard(port);
|
||||
SingleInstanceGuard zweiterGuard = new SingleInstanceGuard(port)) {
|
||||
ersterGuard.acquire();
|
||||
|
||||
SingleInstanceGuard zweiterGuard = new SingleInstanceGuard(port);
|
||||
assertThrows(AnotherInstanceRunningException.class, zweiterGuard::acquire,
|
||||
"Während der erste Guard aktiv ist, soll der zweite acquire() eine "
|
||||
+ "AnotherInstanceRunningException werfen.");
|
||||
|
||||
Reference in New Issue
Block a user