Search in sources :

Example 46 with Executable

use of org.junit.jupiter.api.function.Executable in project netty by netty.

the class HpackDynamicTableTest method testGetEntryExceptionally.

@Test
public void testGetEntryExceptionally() {
    final HpackDynamicTable table = new HpackDynamicTable(1);
    assertThrows(IndexOutOfBoundsException.class, new Executable() {

        @Override
        public void execute() throws Throwable {
            table.getEntry(1);
        }
    });
}
Also used : Executable(org.junit.jupiter.api.function.Executable) Test(org.junit.jupiter.api.Test)

Example 47 with Executable

use of org.junit.jupiter.api.function.Executable in project netty by netty.

the class HpackHuffmanTest method testDecodeExtraPadding.

@Test
public void testDecodeExtraPadding() throws Http2Exception {
    // '1', 'EOS'
    final byte[] buf = makeBuf(0x0f, 0xFF);
    assertThrows(Http2Exception.class, new Executable() {

        @Override
        public void execute() throws Throwable {
            decode(buf);
        }
    });
}
Also used : Executable(org.junit.jupiter.api.function.Executable) Test(org.junit.jupiter.api.Test)

Example 48 with Executable

use of org.junit.jupiter.api.function.Executable in project netty by netty.

the class HpackHuffmanTest method testDecodeExtraPadding4byte.

@Test
public void testDecodeExtraPadding4byte() throws Http2Exception {
    // 'a'
    final byte[] buf = makeBuf(0x1F, 0xFF, 0xFF, 0xFF);
    assertThrows(Http2Exception.class, new Executable() {

        @Override
        public void execute() throws Throwable {
            decode(buf);
        }
    });
}
Also used : Executable(org.junit.jupiter.api.function.Executable) Test(org.junit.jupiter.api.Test)

Example 49 with Executable

use of org.junit.jupiter.api.function.Executable in project netty by netty.

the class HpackHuffmanTest method testDecodePartialSymbol.

@Test
public void testDecodePartialSymbol() throws Http2Exception {
    final byte[] buf = // " pFA\x00", 31 bits of padding, a.k.a. EOS
    makeBuf(0x52, 0xBC, 0x30, 0xFF, 0xFF, 0xFF, 0xFF);
    assertThrows(Http2Exception.class, new Executable() {

        @Override
        public void execute() throws Throwable {
            decode(buf);
        }
    });
}
Also used : Executable(org.junit.jupiter.api.function.Executable) Test(org.junit.jupiter.api.Test)

Example 50 with Executable

use of org.junit.jupiter.api.function.Executable in project netty by netty.

the class HpackHuffmanTest method testDecodeExtraPadding29bit.

@Test
public void testDecodeExtraPadding29bit() throws Http2Exception {
    // '|'
    final byte[] buf = makeBuf(0xFF, 0x9F, 0xFF, 0xFF, 0xFF);
    assertThrows(Http2Exception.class, new Executable() {

        @Override
        public void execute() throws Throwable {
            decode(buf);
        }
    });
}
Also used : Executable(org.junit.jupiter.api.function.Executable) Test(org.junit.jupiter.api.Test)

Aggregations

Executable (org.junit.jupiter.api.function.Executable)476 Test (org.junit.jupiter.api.Test)434 lombok.val (lombok.val)112 ByteBuf (io.netty.buffer.ByteBuf)83 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)42 EmbeddedChannel (io.netty.channel.embedded.EmbeddedChannel)36 CucumberException (io.cucumber.core.exception.CucumberException)20 MockHttpServletRequest (org.springframework.mock.web.MockHttpServletRequest)19 StubStepDefinition (io.cucumber.core.backend.StubStepDefinition)15 Feature (io.cucumber.core.gherkin.Feature)15 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)15 StepDefinition (io.cucumber.core.backend.StepDefinition)14 Step (io.cucumber.core.gherkin.Step)14 Argument (io.cucumber.core.stepexpression.Argument)14 MockHttpServletResponse (org.springframework.mock.web.MockHttpServletResponse)13 LocalChannel (io.netty.channel.local.LocalChannel)12 CucumberBackendException (io.cucumber.core.backend.CucumberBackendException)11 StepExpression (io.cucumber.core.stepexpression.StepExpression)11 SSLEngine (javax.net.ssl.SSLEngine)11 Bootstrap (io.netty.bootstrap.Bootstrap)10