1 | package test.testSOP.algorithms.multicloud; |
---|
2 | import java.io.File; |
---|
3 | import java.nio.file.Files; |
---|
4 | import java.nio.file.Path; |
---|
5 | |
---|
6 | import org.apache.commons.logging.Log; |
---|
7 | import org.apache.commons.logging.LogFactory; |
---|
8 | |
---|
9 | import simulator.DataCenterWorkloadSimulator; |
---|
10 | import test.testSOP.Utility; |
---|
11 | |
---|
12 | |
---|
13 | |
---|
14 | public class RunExperimentMulticloud { |
---|
15 | static Log log = LogFactory.getLog(RunExperimentMulticloud.class); |
---|
16 | public static void main(String args[]){ |
---|
17 | log.info("EXPERIMENT Multicloud - SOPVP"); |
---|
18 | |
---|
19 | |
---|
20 | Utility.deleteFile(SOPVP.MIGRATION_PATH, log); |
---|
21 | Utility.deleteFile(Utility.HOST_NUMBER_PATH, log); |
---|
22 | Utility.deleteFile(SOPVP.COMPUTATION_TIME, log); |
---|
23 | Utility.deleteFile(SOPVP.TASK_REJECTIONS, log); |
---|
24 | |
---|
25 | // //Delete migration file |
---|
26 | // File file = new File(SOPVP.MIGRATION_PATH); |
---|
27 | // if (file.delete()) { |
---|
28 | // log.debug("Successfully deleted file "+SOPVP.MIGRATION_PATH); |
---|
29 | // } |
---|
30 | // else { |
---|
31 | // log.debug("Failed to delete file "+SOPVP.MIGRATION_PATH); |
---|
32 | // } |
---|
33 | // |
---|
34 | // //Delete expected host number files |
---|
35 | // file = new File(Utility.HOST_NUMBER_PATH); |
---|
36 | // if (file.delete()) { |
---|
37 | // log.debug("Successfully deleted file "+Utility.HOST_NUMBER_PATH); |
---|
38 | // } |
---|
39 | // else { |
---|
40 | // log.debug("Failed to delete file "+Utility.HOST_NUMBER_PATH); |
---|
41 | // } |
---|
42 | // //Delete computatin time files |
---|
43 | // file = new File(SOPVP.COMPUTATION_TIME); |
---|
44 | // if (file.delete()) { |
---|
45 | // log.debug("Successfully deleted file "+SOPVP.COMPUTATION_TIME); |
---|
46 | // } |
---|
47 | // else { |
---|
48 | // log.debug("Failed to delete file "+SOPVP.COMPUTATION_TIME); |
---|
49 | // } |
---|
50 | |
---|
51 | String dcworms_args[] = { |
---|
52 | "src/test/testSOP/algorithms/multicloud/multicloud.properties" |
---|
53 | }; |
---|
54 | DataCenterWorkloadSimulator.main(dcworms_args); |
---|
55 | |
---|
56 | try { |
---|
57 | String expectedHostNbDest = "src/test/testSOP_results/data/multicloud/expectedHostNumber.txt"; |
---|
58 | Utility.deleteFile(expectedHostNbDest, log); |
---|
59 | File afile =new File(Utility.HOST_NUMBER_PATH); |
---|
60 | if(afile.renameTo(new File(expectedHostNbDest))){ |
---|
61 | System.out.println("File is moved successful!"); |
---|
62 | }else{ |
---|
63 | System.out.println("File is failed to move!"); |
---|
64 | } |
---|
65 | |
---|
66 | }catch(Exception e){ |
---|
67 | e.printStackTrace(); |
---|
68 | } |
---|
69 | } |
---|
70 | } |
---|