Closes a buffered reader in saveStateTest properly and removes a .close causing server consoles not to display text
This commit is contained in:
parent
44b9bcc960
commit
31d167a8a4
@ -200,7 +200,6 @@ public final class CommonFunctions {
|
|||||||
while (reader.ready() && (line = reader.readLine()) != null) {
|
while (reader.ready() && (line = reader.readLine()) != null) {
|
||||||
text.append(line).append("\n");
|
text.append(line).append("\n");
|
||||||
}
|
}
|
||||||
reader.close();
|
|
||||||
return text.toString().trim();
|
return text.toString().trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ public class ServerVersionContainerTest {
|
|||||||
serverVersionContainer.saveState();
|
serverVersionContainer.saveState();
|
||||||
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(versionFile)));
|
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(versionFile)));
|
||||||
String savedData = CommonFunctions.readBufferedReader(reader);
|
String savedData = CommonFunctions.readBufferedReader(reader);
|
||||||
|
reader.close();
|
||||||
assertEquals(serverVersionContainer.toString(), savedData);
|
assertEquals(serverVersionContainer.toString(), savedData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user