summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJens Geyer <jensg@apache.org>2022-06-05 11:36:40 +0200
committerJens Geyer <jensg@apache.org>2022-09-05 22:04:21 +0200
commit18564d29cf804e5ab6440c781c99889520656886 (patch)
tree9f0fb5ad2b97a7b967a91264b76bfb81a500cc0f /test
parent4a147ad9db5040b574fd62f7eb1a59e034b8c8ca (diff)
downloadthrift-18564d29cf804e5ab6440c781c99889520656886.tar.gz
THRIFT-5593 Implement uuid for Haxe
Client: hx Patch: Jens Geyer Relies on https://github.com/flashultra/uuid/issues/4 being fixed, thus may require using the most recent uuid package from Github instead of the Haxelib package.
Diffstat (limited to 'test')
-rw-r--r--test/haxe/TestClientServer.hxproj6
-rw-r--r--test/haxe/cpp.hxml6
-rw-r--r--test/haxe/csharp.hxml8
-rw-r--r--test/haxe/flash.hxml8
-rw-r--r--test/haxe/java.hxml8
-rw-r--r--test/haxe/javascript.hxml8
-rw-r--r--test/haxe/neko.hxml8
-rw-r--r--test/haxe/php-web-server.hxml3
-rw-r--r--test/haxe/php.hxml3
-rw-r--r--test/haxe/python.hxml8
-rw-r--r--test/haxe/src/TestClient.hx23
-rw-r--r--test/haxe/src/TestServerHandler.hx14
12 files changed, 67 insertions, 36 deletions
diff --git a/test/haxe/TestClientServer.hxproj b/test/haxe/TestClientServer.hxproj
index 30fecf378..67504159a 100644
--- a/test/haxe/TestClientServer.hxproj
+++ b/test/haxe/TestClientServer.hxproj
@@ -8,9 +8,9 @@
<movie fps="30" />
<movie width="800" />
<movie height="600" />
- <movie version="1" />
+ <movie version="0" />
<movie minorVersion="0" />
- <movie platform="C++" />
+ <movie platform="C#" />
<movie background="#FFFFFF" />
</output>
<!-- Other classes to be compiled into your SWF -->
@@ -30,7 +30,7 @@
</build>
<!-- haxelib libraries -->
<haxelib>
- <!-- example: <library name="..." /> -->
+ <library name="uuid" />
</haxelib>
<!-- Class files to compile (other referenced classes will automatically be included) -->
<compileTargets>
diff --git a/test/haxe/cpp.hxml b/test/haxe/cpp.hxml
index 6adb52d7e..1b581a924 100644
--- a/test/haxe/cpp.hxml
+++ b/test/haxe/cpp.hxml
@@ -31,11 +31,11 @@
#To produce 64 bit binaries the file should define the HXCPP_M64 compile variable:
#-D HXCPP_M64
+# libs
+-lib uuid
+
#Add debug information
-debug
#dead code elimination : remove unused code
-#"-dce no" : do not remove unused code
-#"-dce std" : remove unused code in the std lib (default)
-#"-dce full" : remove all unused code
-dce full \ No newline at end of file
diff --git a/test/haxe/csharp.hxml b/test/haxe/csharp.hxml
index 295c017e7..8dd891c20 100644
--- a/test/haxe/csharp.hxml
+++ b/test/haxe/csharp.hxml
@@ -26,13 +26,13 @@
-main Main
#CSHARP target
--cs bin/Tutorial.exe
+-cs bin/ThriftTest.exe
+
+# libs
+-lib uuid
#Add debug information
-debug
#dead code elimination : remove unused code
-#"-dce no" : do not remove unused code
-#"-dce std" : remove unused code in the std lib (default)
-#"-dce full" : remove all unused code
-dce full \ No newline at end of file
diff --git a/test/haxe/flash.hxml b/test/haxe/flash.hxml
index a1f0568ad..e60515ea5 100644
--- a/test/haxe/flash.hxml
+++ b/test/haxe/flash.hxml
@@ -26,7 +26,10 @@
-main Main
#Flash target
--swf bin/Tutorial.swf
+-swf bin/ThriftTest.swf
+
+# libs
+-lib uuid
#Add debug information
-debug
@@ -35,7 +38,4 @@
# --macro allowPackage("sys")
#dead code elimination : remove unused code
-#"-dce no" : do not remove unused code
-#"-dce std" : remove unused code in the std lib (default)
-#"-dce full" : remove all unused code
-dce full \ No newline at end of file
diff --git a/test/haxe/java.hxml b/test/haxe/java.hxml
index c615565a9..807a92a89 100644
--- a/test/haxe/java.hxml
+++ b/test/haxe/java.hxml
@@ -26,13 +26,13 @@
-main Main
#Java target
--java bin/Tutorial.jar
+-java bin/ThriftTest.jar
+
+# libs
+-lib uuid
#Add debug information
-debug
#dead code elimination : remove unused code
-#"-dce no" : do not remove unused code
-#"-dce std" : remove unused code in the std lib (default)
-#"-dce full" : remove all unused code
-dce full \ No newline at end of file
diff --git a/test/haxe/javascript.hxml b/test/haxe/javascript.hxml
index b2b3876cf..892e84bab 100644
--- a/test/haxe/javascript.hxml
+++ b/test/haxe/javascript.hxml
@@ -26,7 +26,7 @@
-main Main
#JavaScript target
--js bin/Tutorial.js
+-js bin/ThriftTest.js
#You can use -D source-map-content (requires Haxe 3.1+) to have the .hx
#files directly embedded into the map file, this way you only have to
@@ -34,11 +34,11 @@
#you modify your .hx files.
-D source-map-content
+# libs
+-lib uuid
+
#Generate source map and add debug information
-debug
#dead code elimination : remove unused code
-#"-dce no" : do not remove unused code
-#"-dce std" : remove unused code in the std lib (default)
-#"-dce full" : remove all unused code
-dce full \ No newline at end of file
diff --git a/test/haxe/neko.hxml b/test/haxe/neko.hxml
index 6161f6977..20c1ea64a 100644
--- a/test/haxe/neko.hxml
+++ b/test/haxe/neko.hxml
@@ -26,13 +26,13 @@
-main Main
#neko target
--neko bin/Tutorial.n
+-neko bin/ThriftTest.n
+
+# libs
+-lib uuid
#Add debug information
-debug
#dead code elimination : remove unused code
-#"-dce no" : do not remove unused code
-#"-dce std" : remove unused code in the std lib (default)
-#"-dce full" : remove all unused code
-dce full \ No newline at end of file
diff --git a/test/haxe/php-web-server.hxml b/test/haxe/php-web-server.hxml
index 102ae97a3..4c121fb4a 100644
--- a/test/haxe/php-web-server.hxml
+++ b/test/haxe/php-web-server.hxml
@@ -39,7 +39,4 @@
-debug
#dead code elimination : remove unused code
-#"-dce no" : do not remove unused code
-#"-dce std" : remove unused code in the std lib (default)
-#"-dce full" : remove all unused code
-dce full
diff --git a/test/haxe/php.hxml b/test/haxe/php.hxml
index 4edb86cf8..6d4422766 100644
--- a/test/haxe/php.hxml
+++ b/test/haxe/php.hxml
@@ -36,7 +36,4 @@
-debug
#dead code elimination : remove unused code
-#"-dce no" : do not remove unused code
-#"-dce std" : remove unused code in the std lib (default)
-#"-dce full" : remove all unused code
-dce full
diff --git a/test/haxe/python.hxml b/test/haxe/python.hxml
index f2c19fa93..0079fdbe6 100644
--- a/test/haxe/python.hxml
+++ b/test/haxe/python.hxml
@@ -26,13 +26,13 @@
-main Main
#Python target
--python bin/Tutorial.py
+-python bin/ThriftTest.py
+
+# libs
+-lib uuid
#Add debug information
-debug
#dead code elimination : remove unused code
-#"-dce no" : do not remove unused code
-#"-dce std" : remove unused code in the std lib (default)
-#"-dce full" : remove all unused code
-dce full \ No newline at end of file
diff --git a/test/haxe/src/TestClient.hx b/test/haxe/src/TestClient.hx
index 579dc00a1..3a075623c 100644
--- a/test/haxe/src/TestClient.hx
+++ b/test/haxe/src/TestClient.hx
@@ -27,6 +27,8 @@ import haxe.ds.IntMap;
import haxe.ds.StringMap;
import haxe.ds.ObjectMap;
+import uuid.Uuid;
+
import org.apache.thrift.*;
import org.apache.thrift.helper.*;
import org.apache.thrift.protocol.*;
@@ -366,6 +368,14 @@ class TestClient {
rslt.Expect( false, 'ZigZag.UnitTest: $e Test #101');
}
+ try {
+ UuidHelper.UnitTest();
+ rslt.Expect( true, 'UuidHelper.UnitTest Test #102');
+ }
+ catch( e : Dynamic) {
+ rslt.Expect( false, 'UuidHelper.UnitTest: $e Test #102');
+ }
+
#end
}
@@ -537,6 +547,19 @@ class TestClient {
trace(' = $dub');
rslt.Expect(dub == 5.325098235, '$dub == 5.325098235');
+
+ var uuidOut : String = UuidHelper.CanonicalUuid("{00112233-4455-6677-8899-AABBCCDDEEFF}");
+ trace('testUuid(${uuidOut}');
+ try {
+ var uuidIn = client.testUuid(uuidOut);
+ trace('testUuid() = ${uuidIn}');
+ rslt.Expect( uuidIn == uuidOut, '${uuidIn} == ${uuidOut}');
+ }
+ catch (e : TApplicationException) {
+ trace('testUuid(${uuidOut}): '+e.errorMsg); // may not be supported by the server
+ }
+
+
var binOut = PrepareTestData(true);
trace('testBinary('+BytesToHex(binOut)+')');
try {
diff --git a/test/haxe/src/TestServerHandler.hx b/test/haxe/src/TestServerHandler.hx
index 0e1910560..34e471b93 100644
--- a/test/haxe/src/TestServerHandler.hx
+++ b/test/haxe/src/TestServerHandler.hx
@@ -25,6 +25,7 @@ import org.apache.thrift.transport.*;
import org.apache.thrift.server.*;
import org.apache.thrift.meta_data.*;
import org.apache.thrift.helper.*;
+import uuid.Uuid;
import haxe.Int32;
import haxe.Int64;
@@ -147,6 +148,19 @@ class TestServerHandler implements ThriftTest_service {
}
/**
+ * Prints 'testUuid("%s")'
+ * @param Uuid thing - the uuid to print
+ * @return Uuid - returns the uuid 'thing'
+ *
+ * @param thing
+ */
+ public function testUuid(thing : String) : String
+ {
+ trace('testUuid($thing)');
+ return thing;
+ }
+
+ /**
* Prints 'testStruct("{%s}")' where thing has been formatted
* into a string of comma separated values
* @param Xtruct thing - the Xtruct to print