Skip to content

Commit

Permalink
Rename spec directories.
Browse files Browse the repository at this point in the history
  • Loading branch information
drymus committed Jan 10, 2024
1 parent d026b3c commit a4a6b7d
Show file tree
Hide file tree
Showing 11 changed files with 210 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,19 @@ public void shouldEstablishConnection() throws Exception
@Test
@Configuration("server.yaml")
@Specification({
"${net}/data.request",
"${app}/data.response" })
public void shouldEchoData() throws Exception
"${net}/echo.binary.data.request",
"${app}/echo.binary.data.response" })
public void shouldEchoBinaryData() throws Exception
{
k3po.finish();
}

@Test
@Configuration("server.yaml")
@Specification({
"${net}/echo.text.data.request",
"${app}/echo.text.data.response" })
public void shouldEchoTextData() throws Exception
{
k3po.finish();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#
# Copyright 2021-2023 Aklivity Inc.
#
# Aklivity licenses this file to you under the Apache License,
# version 2.0 (the "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#

property writeMask ${http:randomBytes(4)}
property client125 ${http:randomBytes(125)}

connect "zilla://streams/app0"
option zilla:window 8192
option zilla:transmission "duplex"

write zilla:begin.ext ${ws:beginEx()
.typeId(zilla:id("ws"))
.protocol("chat")
.scheme("http")
.authority("localhost:8080")
.path("/chat")
.build()}

connected

# connection established

write ${client125}

read ${client125}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#
# Copyright 2021-2023 Aklivity Inc.
#
# Aklivity licenses this file to you under the Apache License,
# version 2.0 (the "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#

accept "zilla://streams/app0"
option zilla:window 8192
option zilla:transmission "duplex"
accepted

read zilla:begin.ext ${ws:beginEx()
.typeId(zilla:id("ws"))
.protocol("chat")
.scheme("http")
.authority("localhost:8080")
.path("/chat")
.build()}

connected

# connection established

read ([0..125] :server125)

write ${server125}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#
# Copyright 2021-2023 Aklivity Inc.
#
# Aklivity licenses this file to you under the Apache License,
# version 2.0 (the "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#

property writeMask ${http:randomBytes(4)}
property client125 ${http:randomBytes(125)}

connect "zilla://streams/net0"
option zilla:window 8192
option zilla:transmission "duplex"

write zilla:begin.ext ${http:beginEx()
.typeId(zilla:id("http"))
.header(":method", "CONNECT")
.header(":scheme", "http")
.header(":authority", "localhost:8080")
.header(":path", "/chat")
.header(":protocol", "websocket")
.header("sec-websocket-protocol", "chat, superchat")
.header("sec-websocket-version", "13")
.header("origin", "http://www.example.com")
.build()}


read zilla:begin.ext ${http:beginEx()
.typeId(zilla:id("http"))
.header(":status", "200")
.header("sec-websocket-protocol", "chat")
.build()}

connected

write [0x82 0xfd] ${writeMask}
write option mask ${writeMask}
write ${client125}
write option mask [0x00 0x00 0x00 0x00]

read [0x82 0x7d] ${client125}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#
# Copyright 2021-2023 Aklivity Inc.
#
# Aklivity licenses this file to you under the Apache License,
# version 2.0 (the "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#

accept "zilla://streams/net0"
option zilla:window 8192
option zilla:transmission "duplex"
accepted

read zilla:begin.ext ${zilla:id("http")}
[0xc1 0x00 0x00 0x00]
[0x08 0x00 0x00 0x00]
[0x07] ":method" [0x07 0x00] "CONNECT"
[0x07] ":scheme" [0x04 0x00] "http"
[0x0a] ":authority" [0x0e 0x00] "localhost:8080"
[0x05] ":path" [0x05 0x00] "/chat"
[0x09] ":protocol" [0x09 0x00] "websocket"
[0x16] "sec-websocket-protocol" [0x0f 0x00] "chat, superchat"
[0x15] "sec-websocket-version" [0x02 0x00] "13"
[0x06] "origin" [0x16 0x00] "http://www.example.com"

write zilla:begin.ext ${http:beginEx()
.typeId(zilla:id("http"))
.header(":status", "200")
.header("sec-websocket-protocol", "chat")
.build()}

connected

read [0x82 0xfd] ([0..4] :readMask)
read option mask ${readMask}
read ([0..125] :server125)
read option mask [0x00 0x00 0x00 0x00]

write [0x82 0x7d] ${server125}
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ write option mask ${writeMask}
write ${client125}
write option mask [0x00 0x00 0x00 0x00]

read [0x82 0x7d] ${client125}
read [0x81 0x7d] ${client125}
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
# under the License.
#

property writeMask ${http:randomBytes(4)}
property client125 ${http:randomBytesUTF8(125)}

accept "zilla://streams/net0"
option zilla:window 8192
option zilla:transmission "duplex"
Expand Down Expand Up @@ -47,4 +44,4 @@ read option mask ${readMask}
read ([0..125] :server125)
read option mask [0x00 0x00 0x00 0x00]

write [0x82 0x7d] ${server125}
write [0x81 0x7d] ${server125}
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,18 @@ public void shouldEstablishConnection() throws Exception

@Test
@Specification({
"${app}/data.request",
"${app}/data.response" })
public void shouldEchoData() throws Exception
"${app}/echo.binary.data.request",
"${app}/echo.binary.data.response" })
public void shouldEchoBinaryData() throws Exception
{
k3po.finish();
}

@Test
@Specification({
"${app}/echo.text.data.request",
"${app}/echo.text.data.response" })
public void shouldEchoTextData() throws Exception
{
k3po.finish();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,18 @@ public void shouldEstablishConnection() throws Exception

@Test
@Specification({
"${net}/data.request",
"${net}/data.response" })
public void shouldEchoData() throws Exception
"${net}/echo.binary.data.request",
"${net}/echo.binary.data.response" })
public void shouldEchoBinaryData() throws Exception
{
k3po.finish();
}

@Test
@Specification({
"${net}/echo.text.data.request",
"${net}/echo.text.data.response" })
public void shouldEchoTextData() throws Exception
{
k3po.finish();
}
Expand Down

0 comments on commit a4a6b7d

Please sign in to comment.