WorkloadFileReader implements WorkloadModel { @Override public ArrayList<Cloudlet> generateWorkload() { if (jobs == null) { jobs = new ArrayList<Cloudlet>(); fieldArray = new String[MAX_FIELD]; try { if (file.getName().endsWith(".gz")) { readGZIPFile(file); } else if (file.getName().endsWith(".zip")) { readZipFile(file); } else { readFile(file); } } catch (final FileNotFoundException e) { } catch (final IOException e) { } } return jobs; } WorkloadFileReader(final String fileName, final int rating); @Override ArrayList<Cloudlet> generateWorkload(); boolean setComment(final String cmt); boolean setField(
                    final int maxField,
                    final int jobNum,
                    final int submitTime,
                    final int runTime,
                    final int numProc);  }
@Test public void read() throws FileNotFoundException { WorkloadModel r = new WorkloadFileReader("src" + File.separator + "test" + File.separator + "LCG.swf.gz", 1); List<Cloudlet> cloudletlist = r.generateWorkload(); assertEquals(188041, cloudletlist.size()); for (Cloudlet cloudlet : cloudletlist) { assertTrue(cloudlet.getCloudletLength() > 0); } }