GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Use ParameterizedTest for testDecodeCodeWithNonDigit · netty/netty@6d124f9

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • codec-smtp/src/test/java/io/netty/handler/codec/smtp
    • SmtpResponseDecoderTest.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎codec-smtp/src/test/java/io/netty/handler/codec/smtp/SmtpResponseDecoderTest.java‎

Copy file name to clipboardExpand all lines: codec-smtp/src/test/java/io/netty/handler/codec/smtp/SmtpResponseDecoderTest.java
+14-13Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
import io.netty.util.CharsetUtil;
2424
import org.junit.jupiter.api.Test;
2525
import org.junit.jupiter.api.function.Executable;
26+
import org.junit.jupiter.params.ParameterizedTest;
27+
import org.junit.jupiter.params.provider.ValueSource;
2628

2729
import java.util.List;
2830

@@ -134,20 +136,19 @@ public void execute() {
134136
});
135137
}
136138

137-
@Test
138-
public void testDecodeCodeWithNonDigit() {
139+
@ParameterizedTest
140+
@ValueSource(strings = { "5x0 denied\r\n", "2:0 hm\r\n", "4?1 later\r\n" })
141+
public void testDecodeCodeWithNonDigit(final String line) {
139142
// Each of these used to be decoded as a valid code (490, 190 and 391).
140-
for (final String line : new String[] { "5x0 denied\r\n", "2:0 hm\r\n", "4?1 later\r\n" }) {
141-
final EmbeddedChannel channel = newChannel();
142-
DecoderException exception = assertThrows(DecoderException.class, new Executable() {
143-
@Override
144-
public void execute() {
145-
channel.writeInbound(newBuffer(line));
146-
}
147-
});
148-
assertNull(exception.getCause());
149-
assertFalse(channel.finishAndReleaseAll());
150-
}
143+
final EmbeddedChannel channel = newChannel();
144+
DecoderException exception = assertThrows(DecoderException.class, new Executable() {
145+
@Override
146+
public void execute() {
147+
channel.writeInbound(newBuffer(line));
148+
}
149+
});
150+
assertNull(exception.getCause());
151+
assertFalse(channel.finishAndReleaseAll());
151152
}
152153

153154
@Test

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.