// Path: tests/isolate/IsolatedClass.java
// public class IsolatedClass {
//     static public String val = "a";
// 
//     public static void main(String args[]) {
//         DumpTestHarness th = new DumpTestHarness();
//         val += args[0];
//         if (args.length > 1) {
//           if (args[0].equals("1")) {
//             th.check(val, "a1", "First isolate static value is correct.");
//           } else if (args[0].equals("2")) {
//             th.check(val, "a2", "Second isolate static value is correct.");
//           } else {
//             th.fail("Bad arg value: " + args[0]);
//           }
//         }
//     }
// }
// 
// Path: tests/gnu/testlet/DumpTestHarness.java
// public class DumpTestHarness extends TestHarness {
//     public int pass = 0;
//     public int fail = 0;
//     private String note = "";
// 
//     public void check(boolean ok) {
//         if (ok) {
//             pass++;
//             System.out.println("PASS " + note);
//         } else {
//             fail++;
//             System.out.println("FAIL " + note);
//         }
//         note = "";
//     }
// 
//     public void todo(boolean ok) { throw new UnsupportedOperationException(); }
//     public void debug(String msg) { }
//     public void setNote(String note) {
//         this.note = note;
//     }
// }


import com.sun.cldc.isolate.*;
import tests.isolate.IsolatedClass;
import gnu.testlet.DumpTestHarness;
import java.lang.String;
package tests.isolate;



public class TestIsolate {
    public static void main(String args[]) {
        DumpTestHarness th = new DumpTestHarness();
        th.check(IsolatedClass.val, "a", "Initial IsolatedClass static value is correct.");

        new IsolatedClass().main(new String[] { "b" } );

        th.check(IsolatedClass.val, "ab",  "IsolatedClass static val append works.");

        Isolate myIso = Isolate.currentIsolate();
        int myIsoId = myIso.id();
        th.check(myIsoId > -1, "Valid isolate ID.");

        Isolate[] isolates = Isolate.getIsolates();

        th.check(isolates.length == 1, "Only one isolate exists.");

        th.check(isolates[0].id() == myIso.id(), "Isolate ID is correct.");

        try {
            Isolate iso1 = new Isolate("tests.isolate.IsolatedClass", new String[] { "1", "new isolate" });
            Isolate iso2 = new Isolate("tests.isolate.IsolatedClass", new String[] { "2", "new isolate" });

            int iso1Id = iso1.id();
            th.check(iso1Id > myIsoId, "First isolate id is larger than main isolate id.");
            th.check(iso2.id() > iso1Id, "Second isolate id is larger than first isolate id.");

            th.check(Isolate.getIsolates().length, 1, "1 isolate started.");

            iso1.start();
// Path: tests/isolate/IsolatedClass.java
// public class IsolatedClass {
//     static public String val = "a";
// 
//     public static void main(String args[]) {
//         DumpTestHarness th = new DumpTestHarness();
//         val += args[0];
//         if (args.length > 1) {
//           if (args[0].equals("1")) {
//             th.check(val, "a1", "First isolate static value is correct.");
//           } else if (args[0].equals("2")) {
//             th.check(val, "a2", "Second isolate static value is correct.");
//           } else {
//             th.fail("Bad arg value: " + args[0]);
//           }
//         }
//     }
// }
// 
// Path: tests/gnu/testlet/DumpTestHarness.java
// public class DumpTestHarness extends TestHarness {
//     public int pass = 0;
//     public int fail = 0;
//     private String note = "";
// 
//     public void check(boolean ok) {
//         if (ok) {
//             pass++;
//             System.out.println("PASS " + note);
//         } else {
//             fail++;
//             System.out.println("FAIL " + note);
//         }
//         note = "";
//     }
// 
//     public void todo(boolean ok) { throw new UnsupportedOperationException(); }
//     public void debug(String msg) { }
//     public void setNote(String note) {
//         this.note = note;
//     }
// }


// Path: tests/isolate/TestIsolate.java
import com.sun.cldc.isolate.*;
import tests.isolate.IsolatedClass;
import gnu.testlet.DumpTestHarness;
import java.lang.String;

package tests.isolate;



public class TestIsolate {
    public static void main(String args[]) {
        DumpTestHarness th = new DumpTestHarness();
        th.check(IsolatedClass.val, "a", "Initial IsolatedClass static value is correct.");

        new IsolatedClass().main(new String[] { "b" } );

        th.check(IsolatedClass.val, "ab",  "IsolatedClass static val append works.");

        Isolate myIso = Isolate.currentIsolate();
        int myIsoId = myIso.id();
        th.check(myIsoId > -1, "Valid isolate ID.");

        Isolate[] isolates = Isolate.getIsolates();

        th.check(isolates.length == 1, "Only one isolate exists.");

        th.check(isolates[0].id() == myIso.id(), "Isolate ID is correct.");

        try {
            Isolate iso1 = new Isolate("tests.isolate.IsolatedClass", new String[] { "1", "new isolate" });
            Isolate iso2 = new Isolate("tests.isolate.IsolatedClass", new String[] { "2", "new isolate" });

            int iso1Id = iso1.id();
            th.check(iso1Id > myIsoId, "First isolate id is larger than main isolate id.");
            th.check(iso2.id() > iso1Id, "Second isolate id is larger than first isolate id.");

            th.check(Isolate.getIsolates().length, 1, "1 isolate started.");

            iso1.start();
            th.check(IsolatedClass.val, "ab", "IsolatedClass static value not modified by iso1 starting.");