Menu

[21d594]: / test / java / nginx / clojure / ArrayTest.java  Maximize  Restore  History

Download this file

47 lines (37 with data), 1.1 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package nginx.clojure;
import junit.framework.TestCase;
/**
*
* @author Matthias Mann
*/
public class ArrayTest extends TestCase {
private static final PatchLevel l1 = new PatchLevel();
private static final PatchLevel[] l2 = new PatchLevel[] { l1 };
private static final PatchLevel[][] l3 = new PatchLevel[][] { l2 };
public void testArray() {
Coroutine co = new Coroutine(new Runnable() {
@Override
public void run() throws SuspendExecution {
coExecute();
}
});
co.run();
assertEquals(42, l1.i);
assertTrue(co.getStack().allObjsAreNull());
}
public void coExecute() throws SuspendExecution {
PatchLevel[][] local_patch_levels = l3;
PatchLevel patch_level = local_patch_levels[0][0];
patch_level.setLevel(42);
}
public static class PatchLevel {
int i;
public void setLevel(int value) throws SuspendExecution {
i = value;
}
}
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.