BasicFuncOnImpress.java (739258c9) BasicFuncOnImpress.java (ac2ddd9c)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 49 unchanged lines hidden (view full) ---

58
59 @Rule
60 public TestName testname = new TestName();
61
62 private static DataSheet xmlResult;
63
64 private String pid = null;
65
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 49 unchanged lines hidden (view full) ---

58
59 @Rule
60 public TestName testname = new TestName();
61
62 private static DataSheet xmlResult;
63
64 private String pid = null;
65
66 private static int iterator = 100;
66 private static int iterator = 2;
67
68 private int i = 0;
69
70 /**
71 * @throws java.lang.Exception
72 */
73 @BeforeClass
74 public static void beforeClass() throws Exception {
67
68 private int i = 0;
69
70 /**
71 * @throws java.lang.Exception
72 */
73 @BeforeClass
74 public static void beforeClass() throws Exception {
75
76 xmlResult = new DataSheet(getFile("output/svt_gui_sd.xml"));
77 xmlResult.addRow("BasicFunOnImpress","Method", "Iterator", "Consumed Time(MS)",
78 "Memory(KB)", "CPU(%)");
75 xmlResult = new DataSheet(getFile("output/svt.xml"));
76 xmlResult.addRow("Data", "Method", "No", "Consumed Time(MS)", "Memory(VSZ)", "Memory(RSS)", "Handles(Windows Only)");
79 }
80
81 @AfterClass
82 public static void afterClass() throws Exception {
83 app.stop();
84 }
85
86 @Before

--- 40 unchanged lines hidden (view full) ---

127 }
128
129 @Test
130 public void saveNewSDWithPic() throws Exception {
131 String pic = prepareData("image/blue_256x256.jpg");
132 for (i = 1; i <= iterator; i++) {
133 long start = System.currentTimeMillis();
134 createNewSD();
77 }
78
79 @AfterClass
80 public static void afterClass() throws Exception {
81 app.stop();
82 }
83
84 @Before

--- 40 unchanged lines hidden (view full) ---

125 }
126
127 @Test
128 public void saveNewSDWithPic() throws Exception {
129 String pic = prepareData("image/blue_256x256.jpg");
130 for (i = 1; i <= iterator; i++) {
131 long start = System.currentTimeMillis();
132 createNewSD();
135 impress.menuItem("Insert->Picture->From File...").select();
133 app.dispatch(".uno:InsertGraphic");
134// impress.menuItem("Insert->Picture->From File...").select();
136 sleep(2);
137 filePickerPath.setText(pic);
138 sleep(1);
139 filePickerOpen.click();
140 sleep(5);
141 impress.typeKeys("<esc>");
142 sleep(2);
143 saveAndReopenNewSD(i);

--- 114 unchanged lines hidden (view full) ---

258 sleep(5);
259 saveAndReopenNewSD(i);
260 long end = System.currentTimeMillis();
261 addRecord(i, start, end);
262 }
263 }
264
265 @Test
135 sleep(2);
136 filePickerPath.setText(pic);
137 sleep(1);
138 filePickerOpen.click();
139 sleep(5);
140 impress.typeKeys("<esc>");
141 sleep(2);
142 saveAndReopenNewSD(i);

--- 114 unchanged lines hidden (view full) ---

257 sleep(5);
258 saveAndReopenNewSD(i);
259 long end = System.currentTimeMillis();
260 addRecord(i, start, end);
261 }
262 }
263
264 @Test
265 @Ignore
266 public void opChartOnOpenedSD() throws Exception {
267 String file = prepareData("svt/OLEinODP.odp");
268 for (i = 1; i <= iterator; i++) {
269 long start = System.currentTimeMillis();
270 app.dispatch(".uno:Open");
271 submitOpenDlg(file);
272 impress.waitForExistence(10, 2);
273 sleep(5);

--- 91 unchanged lines hidden (view full) ---

365 private void closeWithoutSaveSD() {
366 impress.menuItem("File->Close").select();
367 if (activeMsgBox.exists()) {
368 activeMsgBox.no();
369 sleep(2);
370 }
371 }
372
266 public void opChartOnOpenedSD() throws Exception {
267 String file = prepareData("svt/OLEinODP.odp");
268 for (i = 1; i <= iterator; i++) {
269 long start = System.currentTimeMillis();
270 app.dispatch(".uno:Open");
271 submitOpenDlg(file);
272 impress.waitForExistence(10, 2);
273 sleep(5);

--- 91 unchanged lines hidden (view full) ---

365 private void closeWithoutSaveSD() {
366 impress.menuItem("File->Close").select();
367 if (activeMsgBox.exists()) {
368 activeMsgBox.no();
369 sleep(2);
370 }
371 }
372
373 private HashMap<String, Object> getPerfData() {
374 HashMap<String, Object> proccessInfo = SystemUtil
375 .findProcess(".*(soffice\\.bin|soffice\\.exe|soffice).*");
376 String pid = (String) proccessInfo.get("pid");
377 return SystemUtil.getProcessPerfData(pid);
378 }
379
380 private void addRecord(int i, long start, long end) {
373 private void addRecord(int i, long start, long end) {
381 HashMap<String, Object> perf = getPerfData();
382 xmlResult.addRow("BasicFuncOnImpress",testname.getMethodName(), i, (end - start),
383 perf.get("rss"), perf.get("pcpu"));
374 HashMap<String, Object> perf = aoo.getPerfData();
375 xmlResult.addRow("Data",testname.getMethodName(), i, (end - start),
376 perf.get("vsz"), perf.get("rss"), perf.get("handles"));
384 }
385}
377 }
378}