Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove http pdas communicator from base luax library #56

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Luax.Interpreter.Test/Luax.Interpreter.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
<ItemGroup>
<EmbeddedResource Include="TestSources\ArrayWithInitTest.luax" />
<EmbeddedResource Include="TestSources\HttpCommunicatorTest.luax" />
<EmbeddedResource Include="TestSources\HttpPdasCommunicatorTest.luax" />
<EmbeddedResource Include="TestSources\InnerClass1.luax" />
<EmbeddedResource Include="TestSources\InnerClass2.luax" />
<EmbeddedResource Include="TestSources\InnerClass3.luax" />
Expand Down
18 changes: 0 additions & 18 deletions Luax.Interpreter.Test/TestExecution.cs
Original file line number Diff line number Diff line change
Expand Up @@ -940,24 +940,6 @@ public void TestHttpCommunicator()
r.Should().Be("test content;m1 = m2;local;<some text>");
}

[Fact]
public void TestHttpPdasCommunicator()
{
var app = new LuaXApplication();
app.CompileResource("HttpPdasCommunicatorTest");
app.Pass2();
var typelib = new LuaXTypesLibrary(app);
typelib.SearchClass("test", out var program).Should().BeTrue();

program.SearchMethod("testSendFxmsg", null, out var method).Should().BeTrue();
method.Static.Should().BeTrue();
method.Arguments.Should().HaveCount(0);
method.ReturnType.IsString().Should().BeTrue();
LuaXMethodExecutor.Execute(method, typelib, null, Array.Empty<object>(), out var r);
r.Should().BeOfType<string>();
r.Should().Be("test content;sdas_response-format = 1;sdas_serialization = x;PDAS_HEADER_DEFLATE = deflated('test content');local 200");
}

[Fact]
public void TestSchedulerWithDelayMode()
{
Expand Down
22 changes: 0 additions & 22 deletions Luax.Interpreter.Test/TestSources/HttpPdasCommunicatorTest.luax

This file was deleted.

1 change: 0 additions & 1 deletion Luax.Interpreter/Infrastructure/LuaXTypesLibrary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public LuaXTypesLibrary(LuaXApplication application)
ExternMethods.Add(this, typeof(StdlibStringMap));
ExternMethods.Add(this, typeof(StdlibLogger));
ExternMethods.Add(this, typeof(StdlibHttpCommunicator));
ExternMethods.Add(this, typeof(StdlibHttpPdasCommunicator));
ExternMethods.Add(this, typeof(StdlibScheduler));
}

Expand Down

This file was deleted.

38 changes: 0 additions & 38 deletions Luax.Parser.Test/CompilerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -964,44 +964,6 @@ public void HttpCommunicator()
method.ReturnType.IsVoid().Should().BeTrue();
}

[Fact]
public void PdasHttpCommunicator()
{
var app = new LuaXApplication();
app.Pass2();
app.Classes.Search("httpPdasCommunicator", out var httpPdasCommunicator).Should().BeTrue();
httpPdasCommunicator.Constructor.Should().BeNull();
httpPdasCommunicator.Methods.Should().HaveCount(3);

httpPdasCommunicator.SearchMethod("sendMessage", out var method).Should().BeTrue();
method.Visibility.Should().Be(LuaXVisibility.Public);
method.Static.Should().BeFalse();
method.Extern.Should().BeTrue();
method.Arguments.Should().HaveCount(3);
method.Arguments[0].LuaType.IsString().Should().BeTrue();
method.Arguments[1].LuaType.IsString().Should().BeTrue();
method.Arguments[2].LuaType.IsObject().Should().BeTrue();
method.Arguments[2].LuaType.Class.Should().Be("httpResponseCallback");
method.ReturnType.IsVoid().Should().BeTrue();

httpPdasCommunicator.SearchMethod("create", out method).Should().BeTrue();
method.Visibility.Should().Be(LuaXVisibility.Public);
method.Static.Should().BeTrue();
method.Extern.Should().BeTrue();
method.Arguments.Should().HaveCount(1);
method.Arguments[0].LuaType.IsObject().Should().BeTrue();
method.Arguments[0].LuaType.Class.Should().Be("httpCommunicator");
method.ReturnType.IsObject().Should().BeTrue();
method.ReturnType.Class.Should().Be("httpPdasCommunicator");

httpPdasCommunicator.SearchMethod("cancel", out method).Should().BeTrue();
method.Visibility.Should().Be(LuaXVisibility.Public);
method.Static.Should().BeFalse();
method.Extern.Should().BeTrue();
method.Arguments.Should().HaveCount(0);
method.ReturnType.IsVoid().Should().BeTrue();
}

[Fact]
public void HttpResponseCallback()
{
Expand Down
15 changes: 0 additions & 15 deletions Luax.Parser/Resources/stdlib.luax
Original file line number Diff line number Diff line change
Expand Up @@ -1002,21 +1002,6 @@ class httpCommunicator
public extern httpCommunicator() : void;
end

@DocBrief("HTTP Pdas communication class")
class httpPdasCommunicator
@DocBrief("Send message")
@DocParameter("url", "URL of the server")
@DocParameter("message", "Message to be sent")
@DocParameter("callback", "Callback class instance")
public extern sendMessage(url: string, message: string, callback: httpResponseCallback) : void;

@DocBrief("Cancel message")
public extern cancel() : void;

@DocBrief("Creates a new httpPdasCommunicator")
public static extern create(httpCommunicator : httpCommunicator) : httpPdasCommunicator;
end

@DocBrief("Callback class for processing HTTP response")
class httpResponseCallback
@DocBrief("The action method to be invoked on request finished")
Expand Down
2 changes: 1 addition & 1 deletion nuget/config.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<nuget xmlns="http://www.gehtsoft.com/build/nuget">
<versions>
<version id="0.0.27">- Version of 01/25/24</version>
<version id="0.0.28">- Version of 02/05/24</version>
</versions>
<properties>
<owner>Gehtsoft</owner>
Expand Down
Loading