/test/kilim/test/TestYieldJSR.java
http://github.com/kilim/kilim · Java · 45 lines · 16 code · 8 blank · 21 comment · 0 complexity · 1095d1dd581fcdb4aa6d9b14b1154662 MD5 · raw file
- /* Copyright (c) 2006, Sriram Srinivasan
- *
- * You may distribute this software under the terms of the license
- * specified in the file "License"
- */
- package kilim.test;
- import junit.framework.TestCase;
- public class TestYieldJSR extends TestCase {
-
- /*
- * Ordinary jsr call. No inlining should happen
- */
- public void testNonPausableJSR() throws Exception {
- TestYield.runTask("kilim.test.ex.ExYieldSub", 0);
- }
- /*
- * Single jsr call to a subroutine that calls Task.sleep.
- */
- public void testSinglePausableJSR() throws Exception {
- TestYield.runTask("kilim.test.ex.ExYieldSub", 1);
- }
- /*
- * jsr sub1, jsr sub2 , jsr sub1 in sequence. Tests inlining
- * (because sub1 is called twice), and tests whether stack
- * and locals are preserved.
- */
- public void testMultiplePausableJSRs() throws Exception {
- TestYield.runTask("kilim.test.ex.ExYieldSub", 2);
- }
-
- /* jsr sub1, jsr sub2, jsr sub1, jsr sub2, where sub2 is pausable
- * and sub1 is not. Only calls to sub2 should be inlined. We have
- * no automated way of checking this, but the behavior can certainly
- * be tested.
- */
- public void testMixedJSRs() throws Exception {
- TestYield.runTask("kilim.test.ex.ExYieldSub", 3);
- }
- }