View | Details | Raw Unified | Return to issue 124279
Collapse All | Expand All

(-)testcommon/.classpath (-7 / +7 lines)
Lines 1-7 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
1
<?xml version="1.0" encoding="UTF-8"?>
2
<classpath>
2
<classpath>
3
	<classpathentry kind="src" path="source"/>
3
	<classpathentry kind="src" path="source"/>
4
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
4
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
5
	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
5
	<classpathentry kind="lib" path="D:/aoo/junit4.10/junit4.10/junit-4.10.jar"/>
6
	<classpathentry kind="output" path="bin"/>
6
	<classpathentry kind="output" path="bin"/>
7
</classpath>
7
</classpath>
(-)testcommon/source/org/openoffice/test/OpenOffice.java (+1 lines)
Lines 48-53 Link Here
48
	private static Logger LOG = Logger.getLogger(OpenOffice.class.getName());
48
	private static Logger LOG = Logger.getLogger(OpenOffice.class.getName());
49
	
49
	
50
	private static final String[] DEFAULT_HOME = new String[] {
50
	private static final String[] DEFAULT_HOME = new String[] {
51
		"C:/Program Files (x86)/OpenOffice 4",
51
		"C:/Program Files/OpenOffice.org 3",
52
		"C:/Program Files/OpenOffice.org 3",
52
		"C:/Program Files (x86)/OpenOffice.org 3",
53
		"C:/Program Files (x86)/OpenOffice.org 3",
53
		"/Applications/OpenOffice.org.app/Contents",
54
		"/Applications/OpenOffice.org.app/Contents",
(-)testgui/source/bvt/gui/OoxmlExport.java (+118 lines)
Line 0 Link Here
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
9
 * with the License.  You may obtain a copy of the License at
10
 * 
11
 *   http://www.apache.org/licenses/LICENSE-2.0
12
 * 
13
 * Unless required by applicable law or agreed to in writing,
14
 * software distributed under the License is distributed on an
15
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
 * KIND, either express or implied.  See the License for the
17
 * specific language governing permissions and limitations
18
 * under the License.
19
 * 
20
 *************************************************************/
21
22
/**
23
 * 
24
 */
25
package bvt.gui;
26
27
28
import static org.openoffice.test.common.Testspace.*;
29
import static org.openoffice.test.vcl.Tester.*;
30
import static testlib.gui.AppTool.*;
31
import static testlib.gui.UIMap.*;
32
33
34
import java.io.File;
35
import java.util.Arrays;
36
37
import org.junit.AfterClass;
38
39
import org.junit.Before;
40
import org.junit.BeforeClass;
41
import org.junit.Rule;
42
import org.junit.Test;
43
44
import org.openoffice.test.common.Logger;
45
import org.openoffice.test.common.Testspace;
46
47
48
49
/**
50
 * 
51
 */
52
public class OoxmlExport {
53
54
	@Rule
55
	public Logger log = Logger.getLogger(this);
56
57
	@BeforeClass
58
	public static void beforeClass() {
59
		app.clean();
60
	}
61
62
	@AfterClass
63
	public static void afterClass() {
64
		app.stop();
65
	}
66
	
67
	@Before
68
	public void before() {
69
		app.stop();
70
		app.start();
71
	}
72
	
73
	
74
	/**
75
	 * Test Open/SaveAs ooxml file by Aoo
76
	 * 
77
	 * @throws Exception
78
	 */
79
80
81
	@Test
82
	public void testSaveAs() throws Exception {
83
		//for example
84
		//the path is "D:\\aoo\\utaoo\\testspace\\ooxmlsamples"
85
		File reportDir = Testspace.getFile("ooxmlsamples");
86
		File[] files = reportDir.listFiles();
87
		Arrays.sort(files);
88
		int nfiles= files.length;
89
		for( int i=0;i<nfiles;i++)
90
		{
91
			File afile = files[i];
92
			String path = afile.getAbsolutePath();
93
			open( path );
94
			sleep(5);
95
			String exportname = "aoo_"+ afile.getName();
96
			saveDocument( exportname );
97
		}
98
	}
99
100
	
101
102
	private void saveDocument(String file) {
103
		
104
		File reportDir = Testspace.getFile("output/exported");
105
		String saveTo =  reportDir + "\\" + file;
106
		// Save the text document
107
		deleteFile(saveTo);
108
		saveAs(saveTo);
109
		close();
110
		open(saveTo);
111
		// Reopen the saved file
112
		sleep(3);
113
		close();
114
		sleep(1);
115
		
116
	}
117
118
}
(-)testuno/source/fvt/uno/ffc/FFCTest.java (-2 / +2 lines)
Lines 102-108 Link Here
102
		OpenOffice defaultOpenOffice = new OpenOffice();
102
		OpenOffice defaultOpenOffice = new OpenOffice();
103
		defaultOpenOffice.addArgs("-nofirststartwizard", "-norestore", "-quickstart=no");
103
		defaultOpenOffice.addArgs("-nofirststartwizard", "-norestore", "-quickstart=no");
104
		defaultOpenOffice.setUnoUrl(OpenOffice.DEFAULT_UNO_URL);
104
		defaultOpenOffice.setUnoUrl(OpenOffice.DEFAULT_UNO_URL);
105
		defaultOpenOffice.addArgs("-invisible", "-conversionmode", "-headless", "-hidemenu");
105
		defaultOpenOffice.addArgs("-invisible", "-conversionmode", "-headless", "-hidemenu", "-enableautomation", "-automationport=12479");
106
		app = new UnoApp(defaultOpenOffice);
106
		app = new UnoApp(defaultOpenOffice);
107
		
107
		
108
		
108
		
Lines 136-142 Link Here
136
	
136
	
137
	
137
	
138
	@Test(timeout=1000*60*10)
138
	@Test(timeout=1000*60*10)
139
	@Ignore
139
	///'@Ignore'
140
	public void exportTest() throws Exception {
140
	public void exportTest() throws Exception {
141
		//MS Office Format ->ODF
141
		//MS Office Format ->ODF
142
		boolean flag = false;
142
		boolean flag = false;
(-)testuno/source/org/openoffice/test/uno/UnoApp.java (-5 / +5 lines)
Lines 64-74 Link Here
64
	
64
	
65
	private static OpenOffice defaultOpenOffice = null;
65
	private static OpenOffice defaultOpenOffice = null;
66
	
66
	
67
	static {
67
	//static {
68
		defaultOpenOffice = new OpenOffice();
68
	//	defaultOpenOffice = new OpenOffice();
69
		defaultOpenOffice.addArgs("-nofirststartwizard", "-norestore", "-quickstart=no");
69
	//	defaultOpenOffice.addArgs("-nofirststartwizard", "-norestore", "-quickstart=no");
70
		defaultOpenOffice.setUnoUrl(OpenOffice.DEFAULT_UNO_URL);
70
	//	defaultOpenOffice.setUnoUrl(OpenOffice.DEFAULT_UNO_URL);
71
	}
71
	//}
72
	
72
	
73
	public UnoApp() {
73
	public UnoApp() {
74
		this.openOffice = defaultOpenOffice;
74
		this.openOffice = defaultOpenOffice;

Return to issue 124279