From abc2838aac1d278f09771f0703e9ed558823e203 Mon Sep 17 00:00:00 2001 From: kascade Date: Fri, 20 Apr 2007 00:33:48 +0000 Subject: [PATCH] updated ramtune test app git-svn-id: http://svn.3splooges.com/romraider-arch/trunk@643 d2e2e1cd-ba16-0410-be16-b7c4453c7c2d --- .../test/command/executor/CommandExecutorImpl.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/enginuity/ramtune/test/command/executor/CommandExecutorImpl.java b/src/enginuity/ramtune/test/command/executor/CommandExecutorImpl.java index d5acd8c2..22ee0098 100644 --- a/src/enginuity/ramtune/test/command/executor/CommandExecutorImpl.java +++ b/src/enginuity/ramtune/test/command/executor/CommandExecutorImpl.java @@ -10,15 +10,22 @@ import static enginuity.util.ParamChecker.checkNotNull; import static enginuity.util.ParamChecker.checkNotNullOrEmpty; public final class CommandExecutorImpl implements CommandExecutor { - private final EcuConnection ecuConnection; + private final ConnectionProperties connectionProperties; + private final String port; public CommandExecutorImpl(ConnectionProperties connectionProperties, String port) { checkNotNull(connectionProperties); checkNotNullOrEmpty(port, "port"); - this.ecuConnection = new EcuConnectionImpl(connectionProperties, port); + this.connectionProperties = connectionProperties; + this.port = port; } public CommandResult executeCommand(Command command) { - return new CommandResultImpl(ecuConnection.send(command.getBytes())); + EcuConnection ecuConnection = new EcuConnectionImpl(connectionProperties, port); + try { + return new CommandResultImpl(ecuConnection.send(command.getBytes())); + } finally { + ecuConnection.close(); + } } }