From ee867c9b1d3e8f9efd96fab3d44e2a30ebaa79fc Mon Sep 17 00:00:00 2001 From: Maximilien LEDOUX Date: Sat, 26 Feb 2022 15:07:46 +0100 Subject: [PATCH] =?UTF-8?q?SignoutRule=20cr=C3=A9=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../protocol/rules/{ => reader}/HelloRule.java | 2 +- .../protocol/rules/writer/SignoutRule.java | 14 ++++++++++++++ .../protocol/rules/HelloRuleTest.java | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) rename app/src/main/java/lightcontainer/protocol/rules/{ => reader}/HelloRule.java (93%) create mode 100644 app/src/main/java/lightcontainer/protocol/rules/writer/SignoutRule.java diff --git a/app/src/main/java/lightcontainer/protocol/rules/HelloRule.java b/app/src/main/java/lightcontainer/protocol/rules/reader/HelloRule.java similarity index 93% rename from app/src/main/java/lightcontainer/protocol/rules/HelloRule.java rename to app/src/main/java/lightcontainer/protocol/rules/reader/HelloRule.java index 30acdb9..a39019b 100644 --- a/app/src/main/java/lightcontainer/protocol/rules/HelloRule.java +++ b/app/src/main/java/lightcontainer/protocol/rules/reader/HelloRule.java @@ -1,4 +1,4 @@ -package lightcontainer.protocol.rules; +package lightcontainer.protocol.rules.reader; import lightcontainer.protocol.ProtocolReader; diff --git a/app/src/main/java/lightcontainer/protocol/rules/writer/SignoutRule.java b/app/src/main/java/lightcontainer/protocol/rules/writer/SignoutRule.java new file mode 100644 index 0000000..ff42d2c --- /dev/null +++ b/app/src/main/java/lightcontainer/protocol/rules/writer/SignoutRule.java @@ -0,0 +1,14 @@ +package lightcontainer.protocol.rules.writer; + +import lightcontainer.protocol.ProtocolWriter; + +public class SignoutRule extends ProtocolWriter { + + private static final String PATTERN = "^SIGNOUT\r\n$"; + + public static final String NAME = "SIGNOUT"; + + public SignoutRule() { + super(NAME, PATTERN); + } +} diff --git a/app/src/test/java/lightcontainer/protocol/rules/HelloRuleTest.java b/app/src/test/java/lightcontainer/protocol/rules/HelloRuleTest.java index 8305c90..55517f4 100644 --- a/app/src/test/java/lightcontainer/protocol/rules/HelloRuleTest.java +++ b/app/src/test/java/lightcontainer/protocol/rules/HelloRuleTest.java @@ -1,6 +1,7 @@ package lightcontainer.protocol.rules; import lightcontainer.protocol.ProtocolReader; +import lightcontainer.protocol.rules.reader.HelloRule; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.*;