summaryrefslogtreecommitdiff
path: root/test/haxe
diff options
context:
space:
mode:
authorJens Geyer <jensg@apache.org>2021-02-25 09:42:52 +0100
committerJens Geyer <jensg@apache.org>2021-03-17 20:42:29 +0100
commit2dcefadba853c9ad0ab5e908894213826ec3b43a (patch)
tree2b5f791d79d67538dbb7001673b43203fecea339 /test/haxe
parent62beb6751d3c70f8db8fed4a3bb76e4ff3765c22 (diff)
downloadthrift-2dcefadba853c9ad0ab5e908894213826ec3b43a.tar.gz
THRIFT-5370 Haxe 4 compatibility incl TConfiguration & MAX_MESSAGE_SIZE
Client: haxe Patch: Jens Geyer This closes #2349
Diffstat (limited to 'test/haxe')
-rw-r--r--test/haxe/Makefile.am16
-rw-r--r--test/haxe/TestClientServer.hxproj4
-rw-r--r--test/haxe/make_all.bat17
-rw-r--r--test/haxe/php-web-server.hxml4
-rw-r--r--test/haxe/php.hxml4
-rw-r--r--test/haxe/src/Arguments.hx2
-rw-r--r--test/haxe/src/TestClient.hx2
-rw-r--r--test/haxe/src/TestServer.hx26
-rw-r--r--test/haxe/src/TestServerHandler.hx4
9 files changed, 43 insertions, 36 deletions
diff --git a/test/haxe/Makefile.am b/test/haxe/Makefile.am
index 6c0483e9e..d37aaa77a 100644
--- a/test/haxe/Makefile.am
+++ b/test/haxe/Makefile.am
@@ -34,6 +34,13 @@ $(BIN_CPP): \
../../lib/haxe/src/org/apache/thrift/**/*.hx \
gen-haxe/thrift/test/ThriftTest.hx
$(HAXE) --cwd . cpp.hxml
+
+# $(HAXE) --cwd . csharp
+# $(HAXE) --cwd . flash
+# $(HAXE) --cwd . java
+# $(HAXE) --cwd . javascript
+# $(HAXE) --cwd . neko
+# $(HAXE) --cwd . python
$(BIN_PHP): \
src/*.hx \
@@ -49,15 +56,6 @@ $(BIN_PHP_WEB): \
-#TODO: other haxe targets
-# $(HAXE) --cwd . csharp
-# $(HAXE) --cwd . flash
-# $(HAXE) --cwd . java
-# $(HAXE) --cwd . javascript
-# $(HAXE) --cwd . neko
-# $(HAXE) --cwd . python # needs Haxe 3.2.0
-
-
clean-local:
$(RM) -r gen-haxe bin
diff --git a/test/haxe/TestClientServer.hxproj b/test/haxe/TestClientServer.hxproj
index 6696d80c2..44faa37ee 100644
--- a/test/haxe/TestClientServer.hxproj
+++ b/test/haxe/TestClientServer.hxproj
@@ -4,7 +4,7 @@
<output>
<movie outputType="Application" />
<movie input="" />
- <movie path="bin/TestClientServer" />
+ <movie path="bin\TestClientServer" />
<movie fps="30" />
<movie width="800" />
<movie height="600" />
@@ -17,7 +17,7 @@
<classpaths>
<class path="src" />
<class path="gen-haxe" />
- <class path="../../lib/haxe/src" />
+ <class path="..\..\lib\haxe\src" />
</classpaths>
<!-- Build options -->
<build>
diff --git a/test/haxe/make_all.bat b/test/haxe/make_all.bat
index eaeba890d..966bfa530 100644
--- a/test/haxe/make_all.bat
+++ b/test/haxe/make_all.bat
@@ -30,16 +30,19 @@ thrift -r -gen haxe ..\ThriftTest.thrift
if errorlevel 1 goto STOP
rem # invoke Haxe compiler for all targets
+rd .buildtemp /S /Q
for %%a in (*.hxml) do (
- rem * filter Python, as it is not supported by Haxe 3.1.3 (but will be in 3.1.4)
- if not "%%a"=="python.hxml" (
- echo --------------------------
- echo Building %%a ...
- echo --------------------------
- haxe --cwd . %%a
- )
+ echo --------------------------
+ echo Building %%a ...
+ echo --------------------------
+ haxe --cwd . %%a
+ if not exist ".buildtemp" mkdir ".buildtemp"
+ move bin ".buildtemp\%%a"
+ if errorlevel 1 pause
)
+rd bin /S /Q
+rename .buildtemp bin
echo.
echo done.
diff --git a/test/haxe/php-web-server.hxml b/test/haxe/php-web-server.hxml
index 395a8521e..f628c3a51 100644
--- a/test/haxe/php-web-server.hxml
+++ b/test/haxe/php-web-server.hxml
@@ -26,8 +26,8 @@
-main Main
#PHP target
--php bin/php-web-server/
---php-front Main-debug.php
+-php bin/php-web-server
+-D php-front=Main-debug.php
#defines
-D phpwebserver
diff --git a/test/haxe/php.hxml b/test/haxe/php.hxml
index 965189843..c3aa97fb3 100644
--- a/test/haxe/php.hxml
+++ b/test/haxe/php.hxml
@@ -26,8 +26,8 @@
-main Main
#PHP target
--php bin/php/
---php-front Main-debug.php
+-php bin/php
+-D php-front=Main-debug.php
#Add debug information
diff --git a/test/haxe/src/Arguments.hx b/test/haxe/src/Arguments.hx
index 56e525356..023f250fd 100644
--- a/test/haxe/src/Arguments.hx
+++ b/test/haxe/src/Arguments.hx
@@ -92,7 +92,7 @@ class Arguments
#if sys
private static function GetHelp() : String {
- var sProg = Path.withoutDirectory( Sys.executablePath());
+ var sProg = Path.withoutDirectory( Sys.programPath());
return "\n"
+sProg+" [client|server] [options]\n"
+"\n"
diff --git a/test/haxe/src/TestClient.hx b/test/haxe/src/TestClient.hx
index 853319e23..579dc00a1 100644
--- a/test/haxe/src/TestClient.hx
+++ b/test/haxe/src/TestClient.hx
@@ -35,7 +35,7 @@ import org.apache.thrift.server.*;
import org.apache.thrift.meta_data.*;
#if cpp
-import cpp.vm.Thread;
+import sys.thread.Thread;
#else
// no thread support (yet)
#end
diff --git a/test/haxe/src/TestServer.hx b/test/haxe/src/TestServer.hx
index 450c8f28c..d44c68cfa 100644
--- a/test/haxe/src/TestServer.hx
+++ b/test/haxe/src/TestServer.hx
@@ -39,20 +39,24 @@ class TestServer
switch( args.transport) {
case socket:
trace("- socket port "+args.port);
+ #if (flash || html5 || js)
+ throw "Transport not supported on this platform";
+ #else
transport = new TServerSocket( args.port);
+ #end
case http:
trace("- http");
- #if !phpwebserver
- throw "HTTP server not implemented yet";
- //transport = new THttpServer( targetHost);
+ #if phpwebserver
+ transport = new TWrappingServerTransport(
+ new TStreamTransport(
+ new TFileStream("php://input", Read),
+ new TFileStream("php://output", Append),
+ null
+ )
+ );
#else
- transport = new TWrappingServerTransport(
- new TStreamTransport(
- new TFileStream("php://input", Read),
- new TFileStream("php://output", Append)
- )
- );
-
+ throw "Transport not supported on this platform";
+ //transport = new THttpServer( targetHost);
#end
default:
throw "Unhandled transport";
@@ -86,7 +90,7 @@ class TestServer
// Processor
- var handler = new TestServerHandler();
+ var handler : ThriftTest_service = new TestServerHandler();
var processor = new ThriftTestProcessor(handler);
// Simple Server
diff --git a/test/haxe/src/TestServerHandler.hx b/test/haxe/src/TestServerHandler.hx
index b8a2590d5..0e1910560 100644
--- a/test/haxe/src/TestServerHandler.hx
+++ b/test/haxe/src/TestServerHandler.hx
@@ -36,7 +36,7 @@ import haxe.ds.ObjectMap;
import thrift.test.*; // generated code
-class TestServerHandler implements ThriftTest {
+class TestServerHandler implements ThriftTest_service {
public var server:TServer;
@@ -465,8 +465,10 @@ class TestServerHandler implements ThriftTest {
*/
public function testOneway(secondsToSleep:haxe.Int32):Void
{
+ #if sys
trace("testOneway(" + secondsToSleep + "), sleeping...");
Sys.sleep(secondsToSleep);
+ #end
trace("testOneway finished");
}