23 package com.realtime.crossfire.jxclient.scripts;
27 import org.junit.Assert;
28 import org.junit.Ignore;
29 import org.junit.Test;
34 @SuppressWarnings(
"JavaDoc")
49 final Thread thread =
new Thread(process,
"ScriptProcess");
54 }
catch (
final InterruptedException ignored) {
64 Assert.assertEquals(
""+
65 "readFromScript: request map pos\n"+
66 "writeToScript: request map pos 0 0\n"+
67 "readFromScript: @map_scroll 1 -1\n"+
68 "readFromScript: request map pos\n"+
69 "writeToScript: request map pos 1 -1\n"+
70 "readFromScript: @map_scroll -2 3\n"+
71 "readFromScript: request map pos\n"+
72 "writeToScript: request map pos -1 2\n"+
73 "readFromScript: @map_new\n"+
74 "readFromScript: request map pos\n"+
75 "writeToScript: request map pos 0 0\n"+
76 "readFromScript: EOF\n"+
86 "", crossfireServerConnection);
88 final Thread thread =
new Thread(process,
"ScriptProcess");
93 }
catch (
final InterruptedException ignored) {
103 Assert.assertEquals(
""+
104 "readFromScript: issue mark 123\n"+
105 "readFromScript: EOF\n"+
108 Assert.assertEquals(
"mark 123\n", crossfireServerConnection.toString());
115 "issue lock 1 123\n"+
116 "", crossfireServerConnection);
118 final Thread thread =
new Thread(process,
"ScriptProcess");
123 }
catch (
final InterruptedException ignored) {
133 Assert.assertEquals(
""+
134 "readFromScript: issue lock 1 123\n"+
135 "readFromScript: EOF\n"+
138 Assert.assertEquals(
"lock true 123\n", crossfireServerConnection.toString());
141 @Ignore(
"player tag is not known")
147 "", crossfireServerConnection);
149 final Thread thread =
new Thread(process,
"ScriptProcess");
154 }
catch (
final InterruptedException ignored) {
164 Assert.assertEquals(
""+
165 "readFromScript: issue take 123\n"+
166 "readFromScript: EOF\n"+
169 Assert.assertEquals(
"move 123 0\n", crossfireServerConnection.toString());
172 @Ignore(
"player tag is not known")
177 "issue take 123 45\n"+
178 "", crossfireServerConnection);
180 final Thread thread =
new Thread(process,
"ScriptProcess");
185 }
catch (
final InterruptedException ignored) {
195 Assert.assertEquals(
""+
196 "readFromScript: issue take 123 45\n"+
197 "readFromScript: EOF\n"+
200 Assert.assertEquals(
"move 123 45\n", crossfireServerConnection.toString());
208 "", crossfireServerConnection);
210 final Thread thread =
new Thread(process,
"ScriptProcess");
215 }
catch (
final InterruptedException ignored) {
225 Assert.assertEquals(
""+
226 "readFromScript: issue drop 123\n"+
227 "readFromScript: EOF\n"+
230 Assert.assertEquals(
"move 0 123 0\n", crossfireServerConnection.toString());
237 "issue drop 123 45\n"+
238 "", crossfireServerConnection);
240 final Thread thread =
new Thread(process,
"ScriptProcess");
245 }
catch (
final InterruptedException ignored) {
255 Assert.assertEquals(
""+
256 "readFromScript: issue drop 123 45\n"+
257 "readFromScript: EOF\n"+
260 Assert.assertEquals(
"move 0 123 45\n", crossfireServerConnection.toString());
268 "", crossfireServerConnection);
270 final Thread thread =
new Thread(process,
"ScriptProcess");
275 }
catch (
final InterruptedException ignored) {
285 Assert.assertEquals(
""+
286 "readFromScript: issue apply 123\n"+
287 "readFromScript: EOF\n"+
290 Assert.assertEquals(
"apply 123\n", crossfireServerConnection.toString());
298 "", crossfireServerConnection);
300 final Thread thread =
new Thread(process,
"ScriptProcess");
305 }
catch (
final InterruptedException ignored) {
315 Assert.assertEquals(
""+
316 "readFromScript: issue 3 0 north\n"+
317 "readFromScript: EOF\n"+
320 Assert.assertEquals(
"ncom 3 north\n", crossfireServerConnection.toString());
328 "", crossfireServerConnection);
330 final Thread thread =
new Thread(process,
"ScriptProcess");
335 }
catch (
final InterruptedException ignored) {
345 Assert.assertEquals(
""+
346 "readFromScript: issue xyz\n"+
347 "readFromScript: EOF\n"+
350 Assert.assertEquals(
"raw xyz\n", crossfireServerConnection.toString());