mirror of
https://github.com/davidalves04/Trabalho-Pratico-SD.git
synced 2025-12-08 20:43:32 +00:00
shutdown and teardown fixes + incoming connection handler
This commit is contained in:
@@ -97,11 +97,17 @@ public class IntersectionProcessTest {
|
||||
Files.writeString(configFile, configContent);
|
||||
}
|
||||
|
||||
// cleanup after tests
|
||||
@AfterEach
|
||||
public void tearDown() {
|
||||
if (intersectionProcess != null) {
|
||||
intersectionProcess.shutdown();
|
||||
try {
|
||||
// Only shutdown if still running
|
||||
intersectionProcess.shutdown();
|
||||
} catch (Exception e) {
|
||||
System.err.println("Error in tearDown: " + e.getMessage());
|
||||
} finally {
|
||||
intersectionProcess = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user