BasicFunctionTest.java (80a6f5c5) | BasicFunctionTest.java (91745ed9) |
---|---|
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 --- 17 unchanged lines hidden (view full) --- 26 27import static org.junit.Assert.*; 28import static org.openoffice.test.common.Testspace.*; 29import static org.openoffice.test.vcl.Tester.*; 30import static testlib.gui.AppTool.*; 31import static testlib.gui.UIMap.*; 32 33import java.awt.Rectangle; | 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 --- 17 unchanged lines hidden (view full) --- 26 27import static org.junit.Assert.*; 28import static org.openoffice.test.common.Testspace.*; 29import static org.openoffice.test.vcl.Tester.*; 30import static testlib.gui.AppTool.*; 31import static testlib.gui.UIMap.*; 32 33import java.awt.Rectangle; |
34import java.io.File; |
|
34 | 35 |
36import org.junit.AfterClass; |
|
35import org.junit.Before; 36import org.junit.BeforeClass; 37import org.junit.Rule; 38import org.junit.Test; 39import org.openoffice.test.common.FileUtil; 40import org.openoffice.test.common.GraphicsUtil; 41import org.openoffice.test.common.Logger; 42 --- 7 unchanged lines hidden (view full) --- 50 @Rule 51 public Logger log = Logger.getLogger(this); 52 53 @BeforeClass 54 public static void beforeClass() throws Exception { 55 app.clean(); 56 } 57 | 37import org.junit.Before; 38import org.junit.BeforeClass; 39import org.junit.Rule; 40import org.junit.Test; 41import org.openoffice.test.common.FileUtil; 42import org.openoffice.test.common.GraphicsUtil; 43import org.openoffice.test.common.Logger; 44 --- 7 unchanged lines hidden (view full) --- 52 @Rule 53 public Logger log = Logger.getLogger(this); 54 55 @BeforeClass 56 public static void beforeClass() throws Exception { 57 app.clean(); 58 } 59 |
60 @AfterClass 61 public static void afterClass() throws Exception { 62 app.close(); 63 } 64 |
|
58 @Before 59 public void before() { 60 app.close(); 61 app.start(); 62 } 63 64 @Test | 65 @Before 66 public void before() { 67 app.close(); 68 app.start(); 69 } 70 71 @Test |
72 public void smokeTest() { 73 File smoketestOutput = new File(aoo.getUserInstallation(), "user/temp"); 74 prepareData("TestExtension.oxt"); 75 // Open sample file smoketestdoc.sxw 76 open(prepareData("smoketestdoc.sxw")); 77 writer.waitForEnabled(10, 2); 78 // Run test cases 79 app.dispatch("vnd.sun.star.script:Standard.Global.StartTestWithDefaultOptions?language=Basic&location=document", 120); 80 String smoketestlog = FileUtil.readFileAsString(new File(smoketestOutput, "smoketest.log")); 81 String testclosurelog = FileUtil.readFileAsString(new File(smoketestOutput, "testclosure.log")); 82 log.info(smoketestlog + "\n" + testclosurelog); 83 assertTrue("No Error", !smoketestlog.contains("error") && !testclosurelog.contains("error")); 84 85 } 86 87 @Test |
|
65 public void testExportAsPDF() throws Exception { 66 String file = prepareData("bvt/pdf.odt"); 67 String exportTo1 = getPath("temp/1.pdf"); 68 String exportTo2 = getPath("temp/2.pdf"); 69 deleteFile(exportTo1); 70 deleteFile(exportTo2); 71 open(file); 72 writer.waitForExistence(10, 1); --- 587 unchanged lines hidden --- | 88 public void testExportAsPDF() throws Exception { 89 String file = prepareData("bvt/pdf.odt"); 90 String exportTo1 = getPath("temp/1.pdf"); 91 String exportTo2 = getPath("temp/2.pdf"); 92 deleteFile(exportTo1); 93 deleteFile(exportTo2); 94 open(file); 95 writer.waitForExistence(10, 1); --- 587 unchanged lines hidden --- |