server: re-introduce the client/server versions
[fanfix.git] / src / be / nikiroo / utils / test_code / SerialServerTest.java
index 956499a40f3e43cac07998ffa5f9c20764b7bc70..265e96bbaa106f6f945c9e74ec1e878f94a13105 100644 (file)
@@ -2,6 +2,7 @@ package be.nikiroo.utils.test_code;
 
 import java.net.URL;
 
+import be.nikiroo.utils.Version;
 import be.nikiroo.utils.serial.server.ConnectActionClientObject;
 import be.nikiroo.utils.serial.server.ConnectActionClientString;
 import be.nikiroo.utils.serial.server.ConnectActionServerObject;
@@ -81,9 +82,10 @@ class SerialServerTest extends TestLauncher {
 
                                try {
                                        try {
-                                               new ConnectActionClientObject(null, port, key) {
+                                               new ConnectActionClientString(null, port, key) {
                                                        @Override
-                                                       public void action() throws Exception {
+                                                       public void action(Version version)
+                                                                       throws Exception {
                                                                rec[0] = "ok";
                                                        }
                                                }.connect();
@@ -139,7 +141,8 @@ class SerialServerTest extends TestLauncher {
                                        try {
                                                new ConnectActionClientString(null, port, key) {
                                                        @Override
-                                                       public void action() throws Exception {
+                                                       public void action(Version version)
+                                                                       throws Exception {
                                                                recd[0] = send("ping");
                                                        }
                                                }.connect();
@@ -202,7 +205,8 @@ class SerialServerTest extends TestLauncher {
                                        try {
                                                new ConnectActionClientString(null, port, key) {
                                                        @Override
-                                                       public void action() throws Exception {
+                                                       public void action(Version version)
+                                                                       throws Exception {
                                                                recd[0] = send("ping");
                                                                recd[1] = send("ping2");
                                                        }
@@ -266,7 +270,8 @@ class SerialServerTest extends TestLauncher {
                                        try {
                                                new ConnectActionClientString(null, port, key) {
                                                        @Override
-                                                       public void action() throws Exception {
+                                                       public void action(Version version)
+                                                                       throws Exception {
                                                                for (int i = 0; i < 3; i++) {
                                                                        recd[i] = send("" + i);
                                                                }
@@ -337,7 +342,8 @@ class SerialServerTest extends TestLauncher {
                                        try {
                                                new ConnectActionClientObject(null, port, key) {
                                                        @Override
-                                                       public void action() throws Exception {
+                                                       public void action(Version version)
+                                                                       throws Exception {
                                                                rec[0] = true;
                                                        }
 
@@ -397,7 +403,8 @@ class SerialServerTest extends TestLauncher {
                                        try {
                                                new ConnectActionClientObject(null, port, key) {
                                                        @Override
-                                                       public void action() throws Exception {
+                                                       public void action(Version version)
+                                                                       throws Exception {
                                                                recd[0] = send("ping");
                                                        }
                                                }.connect();
@@ -460,7 +467,8 @@ class SerialServerTest extends TestLauncher {
                                        try {
                                                new ConnectActionClientObject(null, port, key) {
                                                        @Override
-                                                       public void action() throws Exception {
+                                                       public void action(Version version)
+                                                                       throws Exception {
                                                                recd[0] = send("ping");
                                                                recd[1] = send("ping2");
                                                        }
@@ -524,7 +532,8 @@ class SerialServerTest extends TestLauncher {
                                        try {
                                                new ConnectActionClientObject(null, port, key) {
                                                        @Override
-                                                       public void action() throws Exception {
+                                                       public void action(Version version)
+                                                                       throws Exception {
                                                                recd[0] = send(new Object[] {
                                                                                "key",
                                                                                new URL(
@@ -595,7 +604,8 @@ class SerialServerTest extends TestLauncher {
                                        try {
                                                new ConnectActionClientObject(null, port, key) {
                                                        @Override
-                                                       public void action() throws Exception {
+                                                       public void action(Version version)
+                                                                       throws Exception {
                                                                for (int i = 0; i < 3; i++) {
                                                                        recd[i] = send(i);
                                                                }