< prev index next >

## src/com/sun/javatest/cof/COFTestSuite.java

Print this page

     133                 // version (optional)
     134                 // tests
     135                 out.startTag("tests");
     136
     137                 // might need to wait for workdir to fully load
     138                 if (!legacyMode)
     139                         trt.waitUntilReady();
     140                 for (Iterator iter = trt.getIterator(); iter.hasNext();) {
     141                         TestResult tr = (TestResult) (iter.next());
     142                         out.newLine();
     143                         new COFTest(tr, cofData).write(out);
     144                 }
     145                 out.endTag("tests");
     146                 out.endTag("testsuite");
     147         }
     148
     149     public COFEnvironment[] getCOFEnvironments(COFData data) {
     150         if (!legacyMode) {
     151             trt.waitUntilReady();
     152         }
     153         HashMap map = new HashMap();
     154         String id = cofData.get("environment.id", "env:0").split(":")[0] + ":";
     155         int id_n = 0;
     156         for (Iterator iter = trt.getIterator(); iter.hasNext();) {
     157             TestResult tr = (TestResult) (iter.next());
     158             try {
     159                 String os = tr.getProperty(TestResult.JAVATEST_OS);
     160                 if (!map.containsKey(os) && os != null) {
     161                     try {
     162                         String[] split;
     163                         split = os.split("[()]");
     164                         String arch = split[split.length - 1];
     165                         split = split[0].split(" ", 2);
     166                         String name = split[0];
     167                         String version = split[1].trim();
     168                         data.put("environment.os.arch", arch);
     169                         data.put("environment.os.name", name);
     170                         data.put("environment.os.version", version);
     171
     172                         COFEnvironment e = new COFEnvironment(data, id + id_n++);
     173                         map.put(os, e);
     133                 // version (optional)
     134                 // tests
     135                 out.startTag("tests");
     136
     137                 // might need to wait for workdir to fully load
     138                 if (!legacyMode)
     139                         trt.waitUntilReady();
     140                 for (Iterator iter = trt.getIterator(); iter.hasNext();) {
     141                         TestResult tr = (TestResult) (iter.next());
     142                         out.newLine();
     143                         new COFTest(tr, cofData).write(out);
     144                 }
     145                 out.endTag("tests");
     146                 out.endTag("testsuite");
     147         }
     148
     149     public COFEnvironment[] getCOFEnvironments(COFData data) {
     150         if (!legacyMode) {
     151             trt.waitUntilReady();
     152         }
     153         HashMap<String, COFEnvironment> map = new HashMap<>();
     154         String id = cofData.get("environment.id", "env:0").split(":")[0] + ":";
     155         int id_n = 0;
     156         for (Iterator iter = trt.getIterator(); iter.hasNext();) {
     157             TestResult tr = (TestResult) (iter.next());
     158             try {
     159                 String os = tr.getProperty(TestResult.JAVATEST_OS);
     160                 if (!map.containsKey(os) && os != null) {
     161                     try {
     162                         String[] split;
     163                         split = os.split("[()]");
     164                         String arch = split[split.length - 1];
     165                         split = split[0].split(" ", 2);
     166                         String name = split[0];
     167                         String version = split[1].trim();
     168                         data.put("environment.os.arch", arch);
     169                         data.put("environment.os.name", name);
     170                         data.put("environment.os.version", version);
     171
     172                         COFEnvironment e = new COFEnvironment(data, id + id_n++);
     173                         map.put(os, e);

< prev index next >