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

(-)testuno/source/testcase/uno/sd/bullet/CheckBuildInBullet.java (+158 lines)
Line 0 Link Here
1
/**
2
 * There are 8 build-in bullets. Verify those bullets can be applied successfully.
3
 * insert text into a SD
4
 * apply the 8 bullets one by one, and check
5
 */
6
package testcase.uno.sd.bullet;
7
8
import static org.junit.Assert.assertEquals;
9
import static testlib.uno.PageUtil.getDrawPageByIndex;
10
import static testlib.uno.ShapeUtil.addPortion;
11
import static testlib.uno.ShapeUtil.getPortion;
12
13
import java.io.File;
14
import java.util.Arrays;
15
import java.util.Collection;
16
17
import org.junit.After;
18
import org.junit.AfterClass;
19
import org.junit.Before;
20
import org.junit.BeforeClass;
21
import org.junit.Test;
22
import org.junit.runner.RunWith;
23
import org.junit.runners.Parameterized;
24
import org.junit.runners.Parameterized.Parameters;
25
import org.openoffice.test.common.FileUtil;
26
import org.openoffice.test.common.Testspace;
27
import org.openoffice.test.uno.UnoApp;
28
29
import testlib.uno.SDUtil;
30
31
import com.sun.star.beans.PropertyValue;
32
import com.sun.star.beans.XPropertySet;
33
import com.sun.star.container.XIndexReplace;
34
import com.sun.star.drawing.XShape;
35
import com.sun.star.lang.XComponent;
36
import com.sun.star.style.NumberingType;
37
import com.sun.star.uno.UnoRuntime;
38
39
40
/**
41
 * @author LouQL
42
 *
43
 */
44
@RunWith(Parameterized.class)
45
public class CheckBuildInBullet {
46
47
	private static final UnoApp app = new UnoApp();	
48
	private XComponent m_xSDComponent = null;
49
	private String m_filePath = null;
50
	private XPropertySet m_xtextProps = null;
51
	private String m_BulletChar = null;
52
	private String m_expectedBulletChar = null;
53
	/**
54
	 * @throws java.lang.Exception
55
	 */
56
	
57
	public CheckBuildInBullet(String BulletChar, String expected) {
58
        this.m_BulletChar = BulletChar;
59
        m_expectedBulletChar = expected;
60
    }
61
	@Parameters
62
    public static Collection<String[]> data() {
63
        String[][] bulletChar = new String[][] {{"\u25cf","\u25cf"}, {"\u2022","\u2022"}, {"\ue00c","\ue00c"},{"\ue00a","\ue00a"},{"\u2794","\u2794"}, {"\u27a2","\u27a2"}, {"\u2717","\u2717"},{"\u2714","\u2714"}};
64
        return Arrays.asList(bulletChar);
65
    }
66
	
67
	@BeforeClass
68
	public static void setUpBeforeClass() throws Exception {
69
		app.start();
70
		File temp = new File(Testspace.getPath("temp"));
71
		temp.mkdirs();
72
	}
73
74
	/**
75
	 * @throws java.lang.Exception
76
	 */
77
	@AfterClass
78
	public static void tearDownAfterClass() throws Exception {
79
		app.close();
80
		//remove the temp file
81
		FileUtil.deleteFile(Testspace.getPath("temp"));
82
	}
83
84
	/**
85
	 * @throws java.lang.Exception
86
	 */
87
	@Before
88
	public void setUp() throws Exception {
89
		m_filePath = Testspace.getPath("temp/CheckBuildInBullet.odt");
90
//		m_filePath = "F:/aa.odp";
91
		if(FileUtil.fileExists(m_filePath))
92
		{	//load
93
			m_xtextProps = load();	  		
94
		}
95
		else{
96
			//create a sd
97
			m_xSDComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, app.newDocument("simpress"));
98
			Object firstPage = getDrawPageByIndex(m_xSDComponent, 0);
99
			Object firstTextBox = SDUtil.getShapeOfPageByIndex(firstPage, 0);
100
			XShape xfirstTextBox = (XShape)UnoRuntime.queryInterface(XShape.class, firstTextBox);
101
			m_xtextProps = addPortion(xfirstTextBox, "test Build-in Bullet", false);
102
		}			
103
	}
104
	
105
	/**
106
	 * @throws java.lang.Exception
107
	 */
108
	@After
109
	public void tearDown() throws Exception {	
110
		app.closeDocument(m_xSDComponent);		
111
	}
112
	private XPropertySet load() throws Exception{
113
		m_xSDComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, 
114
				app.loadDocument(m_filePath));
115
		Object firstPage = getDrawPageByIndex(m_xSDComponent, 0);
116
		Object firstTextBox = SDUtil.getShapeOfPageByIndex(firstPage, 0);
117
		XShape xfirstTextBox = (XShape)UnoRuntime.queryInterface(XShape.class, firstTextBox);
118
		return getPortion(xfirstTextBox, 0);
119
	}
120
			
121
	@Test
122
	public void testBuildInBullet() throws Exception {		
123
		    
124
		Object numberingrules = m_xtextProps.getPropertyValue("NumberingRules");
125
					
126
		XIndexReplace xReplace = (XIndexReplace) UnoRuntime.queryInterface(
127
	             XIndexReplace.class, numberingrules);    
128
						
129
		PropertyValue[] props = new PropertyValue[2];
130
	    props[0] = new PropertyValue();
131
	    props[0].Name = "NumberingType";
132
	    props[0].Value = new Short(NumberingType.CHAR_SPECIAL );
133
	    
134
	    props[1] = new PropertyValue();
135
	    props[1].Name = "BulletChar";
136
	    props[1].Value = this.m_BulletChar;
137
		
138
	    //set numberingType
139
	    xReplace.replaceByIndex(0, props);
140
	    m_xtextProps.setPropertyValue("NumberingRules", numberingrules);
141
	  //set numbering level to 0			
142
	    m_xtextProps.setPropertyValue("NumberingLevel", new Short((short)0));
143
144
		app.saveDocument(m_xSDComponent, m_filePath);
145
		app.closeDocument(m_xSDComponent);
146
		//reopen
147
		m_xtextProps = load();
148
				    
149
		Object numberingrules2 = m_xtextProps.getPropertyValue("NumberingRules");
150
					
151
		XIndexReplace xReplace2 = (XIndexReplace) UnoRuntime.queryInterface(
152
	             XIndexReplace.class, numberingrules2);
153
		
154
		PropertyValue[] proValues2 = (PropertyValue[])xReplace2.getByIndex(0);  
155
		assertEquals("NumberingType should be CHAR_SPECIAL", NumberingType.CHAR_SPECIAL, proValues2[0].Value);
156
		assertEquals("BulletChar should be"+m_expectedBulletChar, m_expectedBulletChar, proValues2[4].Value);
157
	}
158
}
(-)testuno/source/testcase/uno/sd/bullet/CheckBulletStyle.java (+173 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
package testcase.uno.sd.bullet;
25
import static org.junit.Assert.*;
26
import static testlib.uno.PageUtil.getDrawPageByIndex;
27
import static testlib.uno.ShapeUtil.*;
28
29
import org.junit.After;
30
import org.junit.AfterClass;
31
import org.junit.Before;
32
import org.junit.BeforeClass;
33
import org.junit.Test;
34
import org.openoffice.test.common.FileUtil;
35
import org.openoffice.test.common.Testspace;
36
import org.openoffice.test.uno.UnoApp;
37
38
import com.sun.star.beans.PropertyValue;
39
import com.sun.star.beans.XPropertySet;
40
import com.sun.star.container.XIndexReplace;
41
import com.sun.star.drawing.XShape;
42
43
import com.sun.star.lang.XComponent;
44
45
import com.sun.star.style.NumberingType;
46
import com.sun.star.uno.UnoRuntime;
47
import testlib.uno.SDUtil;
48
49
/**
50
 * 1. New a SD
51
2. Insert some text
52
3. Set bullet on
53
4. Change the bullet color and bullet size
54
5. save/close/reopen and then check the bullet color and size
55
 *
56
 */
57
public class CheckBulletStyle {
58
59
	private static final UnoApp app = new UnoApp();
60
61
	private XComponent m_xSDComponent = null;
62
	private String m_filePath = null;
63
//	private XShape m_xsecondTextBox = null;
64
	Object m_numberingRules = null;
65
	XPropertySet m_textProperty = null;
66
	XIndexReplace m_xReplace = null;
67
68
	@Before
69
	public void setUpDocument() throws Exception {
70
		m_filePath = Testspace.getPath("temp/CheckBulletStyle.odt");
71
		if(FileUtil.fileExists(m_filePath))
72
		{	//load			
73
			m_xReplace = load();
74
		}
75
		else{
76
			//create a sd
77
			m_xSDComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, app.newDocument("simpress"));	
78
			Object firstPage = getDrawPageByIndex(m_xSDComponent, 0);
79
			Object secondTextBox = SDUtil.getShapeOfPageByIndex(firstPage, 1);
80
			XShape xsecondTextBox = (XShape)UnoRuntime.queryInterface(XShape.class, secondTextBox);
81
			m_textProperty = addPortion(xsecondTextBox, "Test Bullet Style", false);
82
			
83
			//get numberingRules
84
			m_numberingRules = m_textProperty.getPropertyValue("NumberingRules");
85
			
86
			m_xReplace = (XIndexReplace) UnoRuntime.queryInterface(
87
		             XIndexReplace.class, m_numberingRules);    
88
			
89
			PropertyValue[] props = new PropertyValue[1];
90
		    props[0] = new PropertyValue();
91
		    props[0].Name = "NumberingType";
92
		    props[0].Value = new Short(NumberingType.CHAR_SPECIAL );
93
			
94
		    //set numberingType
95
		    m_xReplace.replaceByIndex(0, props);
96
		    m_textProperty.setPropertyValue("NumberingRules", m_numberingRules);
97
		    //set numbering level to 0			
98
		    m_textProperty.setPropertyValue("NumberingLevel", new Short((short)0));
99
		}		
100
	}
101
	private XIndexReplace load() throws Exception{
102
		m_xSDComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, 
103
				app.loadDocument(m_filePath));
104
		Object firstPage = getDrawPageByIndex(m_xSDComponent, 0);
105
		Object secondTextBox = SDUtil.getShapeOfPageByIndex(firstPage, 1);
106
		XShape xsecondTextBox = (XShape)UnoRuntime.queryInterface(XShape.class, secondTextBox);
107
		m_textProperty = getPortion(xsecondTextBox, 0);
108
	
109
		m_numberingRules = m_textProperty.getPropertyValue("NumberingRules");
110
		
111
		XIndexReplace xReplace = (XIndexReplace) UnoRuntime.queryInterface(
112
	             XIndexReplace.class, m_numberingRules);   
113
		return xReplace;
114
	}
115
116
	@After
117
	public void tearDownDocument() {
118
		app.closeDocument(m_xSDComponent);
119
	}
120
121
	@BeforeClass
122
	public static void setUpConnection() throws Exception {
123
		app.start();
124
	}
125
126
	@AfterClass
127
	public static void tearDownConnection() throws InterruptedException,
128
			Exception {
129
		app.close();
130
		//remove the temp file
131
		FileUtil.deleteFile(Testspace.getPath("temp"));
132
	}
133
134
	@Test
135
	public void testBulletColor() throws Exception {
136
		//BulletColor, Integer
137
		PropertyValue[] props = new PropertyValue[1];
138
	    props[0] = new PropertyValue();
139
	    props[0].Name = "BulletColor";
140
	    props[0].Value = new Integer(255);
141
		
142
	    m_xReplace.replaceByIndex(0, props);
143
	    m_textProperty.setPropertyValue("NumberingRules", m_numberingRules);		
144
	    
145
	    app.saveDocument(m_xSDComponent, m_filePath);
146
		app.closeDocument(m_xSDComponent);
147
		
148
		XIndexReplace xReplace = load();
149
		PropertyValue[] proValues = (PropertyValue[])xReplace.getByIndex(0);
150
		assertEquals("name should be BulletColor", "BulletColor", proValues[11].Name);
151
		assertEquals("BulletColor should be 255(Blue)", new Integer(255), proValues[11].Value);
152
	}
153
	
154
	@Test
155
	public void testBulletSize() throws Exception {
156
		//BulletRelSize, default 45
157
		PropertyValue[] props = new PropertyValue[1];
158
	    props[0] = new PropertyValue();
159
	    props[0].Name = "BulletRelSize";
160
	    props[0].Value = new Short((short)200);
161
			    
162
	    m_xReplace.replaceByIndex(0, props);
163
	    m_textProperty.setPropertyValue("NumberingRules", m_numberingRules);
164
	    
165
	    app.saveDocument(m_xSDComponent, m_filePath);
166
		app.closeDocument(m_xSDComponent);
167
		
168
		XIndexReplace xReplace = load();
169
		PropertyValue[] proValues = (PropertyValue[])xReplace.getByIndex(0);
170
		assertEquals("name should be BulletRelSize", "BulletRelSize", proValues[12].Name);
171
		assertEquals("BulletRelSize should be 200%", new Short((short)200), proValues[12].Value);		
172
	}
173
}
(-)testuno/source/testcase/uno/sd/character/CheckCharacterStyle.java (+180 lines)
Line 0 Link Here
1
/**
2
 * check character style
3
 * 1. new a impress
4
 * 2. insert one line text in the first textbox
5
 * 3. set the font color to red
6
 * 4. save, close, reopen, then check the font color
7
 * 5. set the underline to single
8
 * 6. save, close, reopen, then check the underline
9
 * 7. set the font size to 12
10
 * 8. save, close, reopen, then check the font size
11
 * 9. set font style to Bold, Italic
12
 * 10. save, close, reopen, then check the font style 
13
 */
14
package testcase.uno.sd.character;
15
16
import static org.junit.Assert.*;
17
18
import java.io.File;
19
import org.junit.After;
20
import org.junit.AfterClass;
21
import org.junit.Before;
22
import org.junit.BeforeClass;
23
import org.junit.Test;
24
import org.openoffice.test.common.FileUtil;
25
import org.openoffice.test.common.Testspace;
26
import org.openoffice.test.uno.UnoApp;
27
28
import testlib.uno.SDUtil;
29
30
import com.sun.star.beans.PropertyValue;
31
import com.sun.star.beans.XPropertySet;
32
import com.sun.star.container.XIndexAccess;
33
import com.sun.star.drawing.XDrawPage;
34
import com.sun.star.drawing.XDrawPages;
35
import com.sun.star.drawing.XDrawPagesSupplier;
36
import com.sun.star.drawing.XShapes;
37
import com.sun.star.frame.XStorable;
38
39
import com.sun.star.lang.XComponent;
40
41
import com.sun.star.text.XText;
42
import com.sun.star.uno.UnoRuntime;
43
44
/**
45
 * @author LouQL
46
 *
47
 */
48
public class CheckCharacterStyle {
49
50
	private static final UnoApp app = new UnoApp();	
51
	private XComponent m_xSDComponent = null;
52
	private XText xShapeText = null;
53
	private String filePath = null;
54
	private XPropertySet xtextProps = null;
55
	/**
56
	 * @throws java.lang.Exception
57
	 */
58
	@BeforeClass
59
	public static void setUpConnection() throws Exception {
60
		app.start();
61
		File temp = new File(Testspace.getPath("temp"));
62
		temp.mkdirs();
63
	}
64
	
65
	@AfterClass
66
	public static void tearDownConnection() throws Exception {
67
		app.close();
68
		//remove the temp file
69
		FileUtil.deleteFile(Testspace.getPath("temp"));
70
	}
71
72
	/**
73
	 * @throws java.lang.Exception
74
	 */
75
	@Before
76
	public void setUp() throws Exception {
77
		filePath = Testspace.getPath("temp/CheckCharacterStyle.odt");
78
		if(FileUtil.fileExists(filePath))
79
		{	//load
80
			m_xSDComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, 
81
						app.loadDocument(filePath));
82
			xShapeText = getFirstTextbox();	  			    
83
		}
84
		else{
85
			//create a sd
86
			m_xSDComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, app.newDocument("simpress"));
87
			xShapeText = getFirstTextbox();	 
88
			xShapeText.setString("test");
89
		}		   	
90
		xtextProps = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xShapeText);
91
	}
92
	
93
	private XText getFirstTextbox() throws Exception
94
	{
95
		Object firstPage = SDUtil.getPageByIndex(m_xSDComponent, 0);
96
		Object firstTextBox = SDUtil.getShapeOfPageByIndex(firstPage, 0);
97
		return (XText)UnoRuntime.queryInterface(XText.class, firstTextBox); 
98
	}
99
	
100
	/**
101
	 * @throws java.lang.Exception
102
	 */
103
	@After
104
	public void tearDown() throws Exception {
105
		//close odp after each test
106
		m_xSDComponent.dispose();
107
	}
108
109
	@Test
110
	public void testFontColor() throws Exception{
111
		//set font color to red
112
		xtextProps.setPropertyValue("CharColor", 0xFF0000);
113
		app.saveDocument(m_xSDComponent, filePath);
114
		m_xSDComponent.dispose();
115
		//reopen
116
		m_xSDComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, 
117
					app.loadDocument(filePath));
118
		xShapeText = getFirstTextbox();	   
119
		xtextProps = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xShapeText);
120
		//check character styles		
121
		assertEquals("character color should be red", 0xFF0000,xtextProps.getPropertyValue("CharColor"));
122
		
123
	}
124
	@Test
125
	public void testFontUnderline() throws Exception{
126
		//set font color to red
127
		xtextProps.setPropertyValue("CharUnderline", com.sun.star.awt.FontUnderline.SINGLE);
128
		app.saveDocument(m_xSDComponent, filePath);
129
		m_xSDComponent.dispose();
130
		//reopen
131
		m_xSDComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, 
132
					app.loadDocument(filePath));
133
		xShapeText = getFirstTextbox();	   
134
		xtextProps = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xShapeText);
135
		//check character styles		
136
		assertEquals("character should be underlined", com.sun.star.awt.FontUnderline.SINGLE, xtextProps.getPropertyValue("CharUnderline"));		
137
	}
138
	
139
	@Test
140
	public void testFontSize() throws Exception{
141
		//set font color to red
142
		xtextProps.setPropertyValue("CharHeight", 12);
143
		app.saveDocument(m_xSDComponent, filePath);
144
		m_xSDComponent.dispose();
145
		//reopen
146
		m_xSDComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, 
147
					app.loadDocument(filePath));
148
		xShapeText = getFirstTextbox();	   
149
		xtextProps = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xShapeText);
150
		//check character styles		
151
		assertEquals("font size should be 12.0", "12.0", xtextProps.getPropertyValue("CharHeight").toString());
152
	}
153
	@Test
154
	public void testFontBoldStyle() throws Exception  {	
155
		//change the font style to Bold
156
		xtextProps.setPropertyValue("CharWeight", com.sun.star.awt.FontWeight.BOLD);
157
		app.saveDocument(m_xSDComponent, filePath);
158
		m_xSDComponent.dispose();
159
		//reopen
160
		m_xSDComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, 
161
					app.loadDocument(filePath));
162
		xShapeText = getFirstTextbox();	   
163
		xtextProps = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xShapeText);		
164
		assertEquals("font style should be bold", com.sun.star.awt.FontWeight.BOLD, xtextProps.getPropertyValue("CharWeight"));		
165
	}
166
	
167
	@Test
168
	public void testFontItalicStyle() throws Exception  {	
169
		//change the font style to Bold
170
		xtextProps.setPropertyValue("CharPosture", com.sun.star.awt.FontSlant.ITALIC);
171
		app.saveDocument(m_xSDComponent, filePath);
172
		m_xSDComponent.dispose();
173
		//reopen
174
		m_xSDComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, 
175
					app.loadDocument(filePath));
176
		xShapeText = getFirstTextbox();	   
177
		xtextProps = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xShapeText);		
178
		assertEquals("font style should be bold", com.sun.star.awt.FontSlant.ITALIC, xtextProps.getPropertyValue("CharPosture"));		
179
	}
180
}
(-)testuno/source/testcase/uno/sd/file/CheckFileProperties.java (+663 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
package testcase.uno.sd.file;
25
import static org.junit.Assert.*;
26
27
import org.junit.After;
28
import org.junit.AfterClass;
29
import org.junit.Before;
30
import org.junit.BeforeClass;
31
import org.junit.Test;
32
import org.openoffice.test.uno.UnoApp;
33
import org.openoffice.test.common.FileUtil;
34
import org.openoffice.test.common.Testspace;
35
36
import com.sun.star.beans.IllegalTypeException;
37
import com.sun.star.beans.Property;
38
import com.sun.star.beans.PropertyAttribute;
39
import com.sun.star.beans.PropertyExistException;
40
import com.sun.star.beans.PropertyValue;
41
import com.sun.star.beans.UnknownPropertyException;
42
import com.sun.star.beans.XPropertyContainer;
43
import com.sun.star.beans.XPropertySet;
44
import com.sun.star.beans.XPropertySetInfo;
45
import com.sun.star.container.XNameAccess;
46
import com.sun.star.document.XDocumentProperties;
47
import com.sun.star.document.XDocumentPropertiesSupplier;
48
import java.util.Calendar;
49
import com.sun.star.util.DateTime;
50
import com.sun.star.util.Date;
51
import com.sun.star.util.Duration;
52
import com.sun.star.lang.IllegalArgumentException;
53
import com.sun.star.lang.WrappedTargetException;
54
import com.sun.star.lang.XComponent;
55
import com.sun.star.lang.XMultiServiceFactory;
56
import com.sun.star.uno.UnoRuntime;
57
58
/**
59
 * @author LouQL
60
 *
61
 */
62
public class CheckFileProperties {
63
64
	private static final UnoApp app = new UnoApp();
65
66
	private XComponent m_xSDComponent = null;
67
	private static String m_filePath = null;
68
69
	@Before
70
	public void setUpDocument() throws Exception {
71
		if (FileUtil.fileExists(m_filePath)) {//load
72
			m_xSDComponent = app.loadDocument(m_filePath);
73
		} else {//new
74
			m_xSDComponent = (XComponent) UnoRuntime.queryInterface(
75
					XComponent.class, app.newDocument("simpress"));			
76
		}		
77
	}
78
	
79
	private String getUserName() throws com.sun.star.uno.Exception
80
	{
81
		Object configurationProvider = app.getServiceFactory().
82
				createInstance("com.sun.star.configuration.ConfigurationProvider");
83
		
84
		XMultiServiceFactory msFac = (XMultiServiceFactory)UnoRuntime.queryInterface(
85
				XMultiServiceFactory.class, configurationProvider);
86
		
87
		PropertyValue[] propValue = new PropertyValue[1];
88
		propValue[0] = new PropertyValue();
89
		propValue[0].Name = "nodepath";
90
		propValue[0].Value = "/org.openoffice.UserProfile/Data";
91
		
92
		Object configurationAccess = msFac.createInstanceWithArguments(
93
				"com.sun.star.configuration.ConfigurationAccess", propValue);
94
		XNameAccess nameAcc = (XNameAccess)UnoRuntime.queryInterface(XNameAccess.class, configurationAccess);
95
		String givenname = (String)nameAcc.getByName("givenname");
96
		String sn = (String)nameAcc.getByName("sn");	
97
		String name = null;
98
		if(givenname.length() == 0) name = sn;
99
		else	name = givenname+" "+sn;
100
				
101
		return name;
102
	}
103
	
104
	private XDocumentProperties getDocumentProperties(){
105
		XDocumentPropertiesSupplier xDocumentProSupplier = (XDocumentPropertiesSupplier)UnoRuntime.queryInterface(
106
				XDocumentPropertiesSupplier.class, this.m_xSDComponent);
107
		return xDocumentProSupplier.getDocumentProperties();
108
	}
109
110
	@After
111
	public void tearDownDocument() {
112
		app.closeDocument(m_xSDComponent);
113
114
	}
115
116
	@BeforeClass
117
	public static void setUpConnection() throws Exception {
118
		app.start();
119
		m_filePath = Testspace.getPath("temp/CheckFileProperties.odp");	
120
		FileUtil.deleteFile(m_filePath);
121
	}
122
123
	@AfterClass
124
	public static void tearDownConnection() throws InterruptedException,
125
			Exception {
126
		app.close();
127
		//remove the temp file
128
		FileUtil.deleteFile(Testspace.getPath("temp"));
129
	}
130
131
	/*
132
	 * UI entry: File->Properties->General->Created*/
133
	@Test
134
	public void testGeneralAuthor() throws Exception {
135
//		String author = getUserName();
136
//		if(author.length() == 0)
137
//		{
138
			String author = getUserName();
139
			XDocumentProperties xDocPro = getDocumentProperties();		
140
			xDocPro.setAuthor(author);
141
//		}
142
		app.saveDocument(m_xSDComponent, m_filePath);
143
		app.closeDocument(m_xSDComponent);
144
		m_xSDComponent = app.loadDocument(m_filePath);
145
		XDocumentProperties xDocPro2 = getDocumentProperties();
146
		assertEquals("Author should be "+ author, author, xDocPro2.getAuthor());		
147
	}
148
		
149
	private boolean DateTimeEquals(DateTime datetime1, DateTime datetime2){
150
		
151
		if(datetime1.Seconds == datetime2.Seconds &&
152
				datetime1.Minutes == datetime2.Minutes &&
153
				datetime1.Hours == datetime2.Hours &&
154
				datetime1.Day == datetime2.Day &&
155
				datetime1.Month == datetime2.Month &&
156
				datetime1.Year == datetime2.Year)
157
			return true;
158
		else
159
			return false;
160
	}
161
	
162
	private boolean DateEquals(Date date1, Date date2){
163
		
164
		if(date1.Day == date2.Day &&
165
		   date1.Month == date2.Month &&
166
			date1.Year == date2.Year)
167
			return true;
168
		else
169
			return false;
170
	}
171
	
172
	private boolean DurationEquals(Duration d1, Duration d2){
173
		
174
		if(d1.Seconds == d2.Seconds &&
175
				d1.Minutes == d2.Minutes &&
176
				d1.Hours == d2.Hours &&
177
				d1.Days == d2.Days &&
178
				d1.Months == d2.Months &&
179
				d1.Years == d2.Years)
180
			return true;
181
		else
182
			return false;
183
	}
184
185
	private DateTime getCurrentDateTime(){
186
		Calendar ca = Calendar.getInstance();		
187
		DateTime currentDateTime = new DateTime();
188
		currentDateTime.Year = (short)ca.get(Calendar.YEAR);
189
		currentDateTime.Month = (short)ca.get(Calendar.MONTH);
190
		currentDateTime.Day = (short)ca.get(Calendar.DATE);
191
		currentDateTime.Minutes = (short)ca.get(Calendar.MINUTE);
192
		currentDateTime.Hours = (short)ca.get(Calendar.HOUR);
193
		currentDateTime.Seconds = (short)ca.get(Calendar.SECOND);
194
		
195
		return currentDateTime;
196
	}
197
	
198
	private Date getCurrentDate(){
199
		Calendar ca = Calendar.getInstance();		
200
		Date currentDate = new Date();
201
		currentDate.Year = (short)ca.get(Calendar.YEAR);
202
		currentDate.Month = (short)ca.get(Calendar.MONTH);
203
		currentDate.Day = (short)ca.get(Calendar.DATE);
204
		
205
		return currentDate;
206
	}
207
	
208
	/*
209
	 * UI entry: File->Properties->General->Created*/
210
	@Test
211
	public void testGeneralCreationDate() throws Exception {			
212
		DateTime creationDate = getCurrentDateTime();	
213
		
214
		XDocumentProperties xDocPro = getDocumentProperties();
215
		
216
		xDocPro.setCreationDate(creationDate);
217
		
218
		app.saveDocument(m_xSDComponent, m_filePath);
219
		app.closeDocument(m_xSDComponent);
220
		m_xSDComponent = app.loadDocument(m_filePath);
221
		XDocumentProperties xDocPro2 = getDocumentProperties();
222
		DateTime result = xDocPro2.getCreationDate();
223
		assertTrue("CreationDate should be the same as set", this.DateTimeEquals(creationDate, result));		
224
	}
225
	
226
	/*
227
	 * UI entry: File->Properties->General->Modified*/
228
	@Test
229
	//ModifiedBy will be set each time the file loaded. The value is the one set in Tools->options->User data->Last name
230
	public void testGeneralModifiedBy() throws Exception {
231
		String modifiedBy = this.getUserName();
232
		if(modifiedBy.length() ==0)
233
		{
234
			modifiedBy = "ModifyUser";		
235
			XDocumentProperties xDocPro = getDocumentProperties();
236
			xDocPro.setModifiedBy(modifiedBy);
237
		}
238
		
239
		app.saveDocument(m_xSDComponent, m_filePath);
240
		app.closeDocument(m_xSDComponent);
241
		m_xSDComponent = app.loadDocument(m_filePath);
242
		XDocumentProperties xDocPro2 = getDocumentProperties();		
243
		assertEquals("The file is modified by "+ modifiedBy, modifiedBy, xDocPro2.getModifiedBy());
244
	}
245
	
246
	/*
247
	 * UI entry: File->Properties->General->Modified*/
248
	@Test
249
	public void testGeneralModificationDate() throws Exception {
250
		//modification date will be set each time the file saved, so I don't save after set.
251
		DateTime modificationDate = getCurrentDateTime();	
252
				
253
		XDocumentProperties xDocPro = getDocumentProperties();
254
		
255
		xDocPro.setModificationDate(modificationDate);
256
			
257
		DateTime result = xDocPro.getModificationDate();
258
		assertTrue("ModificationDate should be the same as set", this.DateTimeEquals(modificationDate, result));		
259
	}
260
	
261
	/*
262
	 * UI entry: File->Properties->General->Last printed*/
263
	@Test
264
	public void testGeneralPrintBy() throws Exception {
265
		String printBy = "PrintBy";
266
		XDocumentProperties xDocPro = getDocumentProperties();
267
		
268
		xDocPro.setPrintedBy(printBy);
269
		
270
		app.saveDocument(m_xSDComponent, m_filePath);
271
		app.closeDocument(m_xSDComponent);
272
		m_xSDComponent = app.loadDocument(m_filePath);
273
		XDocumentProperties xDocPro2 = getDocumentProperties();
274
		assertEquals("This document is printed by "+ printBy, printBy, xDocPro2.getPrintedBy());		
275
	}
276
	
277
	/*
278
	 * UI entry: File->Properties->General->Last printed*/
279
	@Test
280
	public void testGeneralPrintDate() throws Exception {	
281
		DateTime printDate = getCurrentDateTime();	
282
		
283
		XDocumentProperties xDocPro = getDocumentProperties();
284
		
285
		xDocPro.setPrintDate(printDate);
286
		
287
		app.saveDocument(m_xSDComponent, m_filePath);
288
		app.closeDocument(m_xSDComponent);
289
		m_xSDComponent = app.loadDocument(m_filePath);
290
		XDocumentProperties xDocPro2 = getDocumentProperties();
291
		DateTime result = xDocPro2.getPrintDate();
292
		assertTrue("PrintDate should be the same as set", this.DateTimeEquals(printDate, result));		
293
	}
294
	
295
	/*
296
	 * UI entry: File->Properties->General->Total editing time*/
297
	@Test
298
	public void testGeneralEditingDuration() throws Exception {
299
		int editingDuration = 60;
300
		
301
		XDocumentProperties xDocPro = getDocumentProperties();
302
		
303
		xDocPro.setEditingDuration(editingDuration);
304
		
305
		app.saveDocument(m_xSDComponent, m_filePath);
306
		app.closeDocument(m_xSDComponent);
307
		m_xSDComponent = app.loadDocument(m_filePath);
308
		XDocumentProperties xDocPro2 = getDocumentProperties();
309
		assertEquals("Totally editing time should be "+ editingDuration, editingDuration, xDocPro2.getEditingDuration());		
310
	}
311
	
312
	/*
313
	 * UI entry: File->Properties->General->Revision number*/
314
	@Test
315
	public void testGeneralRevisionNumber() throws Exception {
316
		short revisionNumber = 10;
317
		
318
		XDocumentProperties xDocPro = getDocumentProperties();
319
		
320
		xDocPro.setEditingCycles(revisionNumber);
321
		
322
		app.saveDocument(m_xSDComponent, m_filePath);
323
		app.closeDocument(m_xSDComponent);
324
		m_xSDComponent = app.loadDocument(m_filePath);
325
		XDocumentProperties xDocPro2 = getDocumentProperties();
326
		assertEquals("Revision number should be "+ revisionNumber, revisionNumber, xDocPro2.getEditingCycles());		
327
	}
328
	
329
	/*
330
	 * UI entry: File->Properties->General->template*/
331
	@Test
332
	public void testGeneralTemplateName() throws Exception {
333
		String templateName = "I'm a template";
334
		
335
		XDocumentProperties xDocPro = getDocumentProperties();
336
		
337
		xDocPro.setTemplateName(templateName);
338
		
339
		app.saveDocument(m_xSDComponent, m_filePath);
340
		app.closeDocument(m_xSDComponent);
341
		m_xSDComponent = app.loadDocument(m_filePath);
342
		XDocumentProperties xDocPro2 = getDocumentProperties();
343
		assertEquals("Template name should be "+ templateName, templateName, xDocPro2.getTemplateName());		
344
	}
345
	
346
	/*
347
	 * UI entry: File->Properties->General->Reset*/
348
	@Test
349
	public void testGeneralReset() throws Exception {
350
		String author = "ResetAuthor";
351
		XDocumentProperties xDocPro = getDocumentProperties();
352
		xDocPro.resetUserData(author);
353
			
354
		assertEquals("Author should be "+ author, author, xDocPro.getAuthor());
355
		assertEquals("Modified should be empty", "", xDocPro.getModifiedBy());
356
		assertTrue("ModificationDate should be empty", 
357
				DateTimeEquals(new DateTime(), xDocPro.getModificationDate()));
358
		assertEquals("PrintBy should be empty", "", xDocPro.getPrintedBy());
359
		assertTrue("PrintDate should be empty", 
360
				DateTimeEquals(new DateTime(), xDocPro.getPrintDate()));
361
		assertEquals("Totally editing time should be empty", 0, xDocPro.getEditingDuration());
362
		assertEquals("Revision number should be empty", 1, xDocPro.getEditingCycles());
363
	}
364
	
365
	// UI entry: File->Properties->General->Apply user data
366
	
367
	// UI entry: File->Properties->General->digital signature
368
	
369
	//Description begin
370
	/*
371
	 * UI entry: File->Properties->Description->Title*/
372
	@Test
373
	public void testDescriptionTitle() throws Exception{
374
		String title = "titleForTest";
375
		XDocumentProperties xDocPro = getDocumentProperties();
376
		xDocPro.setTitle(title);
377
		
378
		app.saveDocument(m_xSDComponent, m_filePath);
379
		app.closeDocument(m_xSDComponent);
380
		m_xSDComponent = app.loadDocument(m_filePath);
381
		XDocumentProperties xDocPro2 = getDocumentProperties();
382
		assertEquals("Title should be "+ title, title, xDocPro2.getTitle());
383
	}
384
	
385
	/*
386
	 * UI entry: File->Properties->Description->Subject*/
387
	@Test
388
	public void testDescriptionSubject() throws Exception{
389
		String subject = "subjectForTest";
390
		XDocumentProperties xDocPro = getDocumentProperties();
391
		xDocPro.setSubject(subject);
392
		
393
		app.saveDocument(m_xSDComponent, m_filePath);
394
		app.closeDocument(m_xSDComponent);
395
		m_xSDComponent = app.loadDocument(m_filePath);
396
		XDocumentProperties xDocPro2 = getDocumentProperties();
397
		assertEquals("Subject should be "+ subject, subject, xDocPro2.getSubject());
398
	}
399
	
400
	/*
401
	 * UI entry: File->Properties->Description->Keywords*/
402
	@Test
403
	public void testDescriptionKeywords() throws Exception{
404
		String[] keywords = {"keyword1", "keyword2"};
405
		XDocumentProperties xDocPro = getDocumentProperties();
406
		xDocPro.setKeywords(keywords);
407
		
408
		app.saveDocument(m_xSDComponent, m_filePath);
409
		app.closeDocument(m_xSDComponent);
410
		
411
		m_xSDComponent = app.loadDocument(m_filePath);
412
		XDocumentProperties xDocPro2 = getDocumentProperties();
413
		String[] keywordsResult = xDocPro2.getKeywords();
414
		assertEquals("There should be 2 Keywords", 2, keywordsResult.length);
415
		for(int i=0;i<keywordsResult.length;i++)
416
		{
417
			String num = Integer.toString(i+1);
418
			assertEquals("The keywords should be keyword"+num, "keyword"+num, keywordsResult[i]);
419
		}
420
	}
421
	
422
	/*
423
	 * UI entry: File->Properties->Description->Comments*/
424
	@Test
425
	public void testDescriptionComments() throws Exception{
426
		String comments = "This is the comment.";
427
		XDocumentProperties xDocPro = getDocumentProperties();
428
		xDocPro.setDescription(comments);
429
		
430
		app.saveDocument(m_xSDComponent, m_filePath);
431
		app.closeDocument(m_xSDComponent);
432
		
433
		m_xSDComponent = app.loadDocument(m_filePath);
434
		XDocumentProperties xDocPro2 = getDocumentProperties();
435
		
436
		assertEquals("Comments should be "+comments, comments, xDocPro2.getDescription());
437
	}
438
	//Description end
439
	
440
	//custom properties begin
441
	//UI entry: File->Properties->Custom properties
442
		private void addCustomPro(String propertyName, Object value) throws PropertyExistException, IllegalTypeException, IllegalArgumentException{
443
			XDocumentProperties xDocPro = getDocumentProperties();
444
			XPropertyContainer proContainer = xDocPro.getUserDefinedProperties();
445
			proContainer.addProperty(propertyName, PropertyAttribute.REMOVEABLE, value);
446
		}
447
		
448
		private Object getCustomPro(String propertyName) throws UnknownPropertyException, WrappedTargetException{
449
			XDocumentProperties xDocPro = getDocumentProperties();
450
			XPropertyContainer proContainer = xDocPro.getUserDefinedProperties();
451
			XPropertySet xProSet = (XPropertySet)UnoRuntime.queryInterface(
452
					XPropertySet.class, proContainer);
453
			
454
			return xProSet.getPropertyValue(propertyName);
455
		}
456
		
457
		@Test
458
		public void testCustomAddPro_Text() throws Exception{	
459
			String addedProName = "TextPro";
460
			String addedProDefaultValue = "testUser";
461
			
462
			addCustomPro(addedProName, addedProDefaultValue);
463
			
464
			app.saveDocument(m_xSDComponent, m_filePath);
465
			app.closeDocument(m_xSDComponent);
466
			
467
			m_xSDComponent = app.loadDocument(m_filePath);
468
			
469
			String result = (String)getCustomPro(addedProName);
470
					
471
			assertTrue("added Text property \""+addedProName+"\" should exist", result != null);		
472
			assertEquals("value of added property should be "+addedProDefaultValue, 
473
					addedProDefaultValue, result);
474
		}
475
		
476
		@Test
477
		public void testCustomAddPro_DateTime() throws Exception{	
478
			String addedProName = "DateTimePro";
479
			DateTime addedProDefaultValue = getCurrentDateTime();	
480
			
481
			addCustomPro(addedProName, addedProDefaultValue);
482
			
483
			app.saveDocument(m_xSDComponent, m_filePath);
484
			app.closeDocument(m_xSDComponent);
485
			
486
			m_xSDComponent = app.loadDocument(m_filePath);
487
					
488
			DateTime result = (DateTime)getCustomPro(addedProName);
489
			assertTrue("added DateTime property \""+addedProName+"\" should exist", result != null);		
490
			assertTrue("value of added property should be the same as set", 
491
					this.DateTimeEquals(result, addedProDefaultValue));
492
		}
493
		
494
		@Test
495
		public void testCustomAddPro_Date() throws Exception{	
496
			String addedProName = "DatePro";
497
			Date addedProDefaultValue = getCurrentDate();	
498
499
			addCustomPro(addedProName, addedProDefaultValue);
500
			
501
			app.saveDocument(m_xSDComponent, m_filePath);
502
			app.closeDocument(m_xSDComponent);
503
			
504
			m_xSDComponent = app.loadDocument(m_filePath);
505
					
506
			Date result = (Date)getCustomPro(addedProName);
507
			assertTrue("added Date property \""+addedProName+"\" should exist", result != null);		
508
			assertTrue("value of added property should be the same as set", 
509
					this.DateEquals(result, addedProDefaultValue));
510
		}
511
		
512
		@Test
513
		public void testCustomAddPro_Duration() throws Exception{			
514
			String addedProName = "DurationPro";
515
			Duration addedProDefaultValue = new Duration();	
516
			addedProDefaultValue.Days = 1;
517
518
			addCustomPro(addedProName, addedProDefaultValue);
519
			
520
			app.saveDocument(m_xSDComponent, m_filePath);
521
			app.closeDocument(m_xSDComponent);
522
			
523
			m_xSDComponent = app.loadDocument(m_filePath);
524
					
525
			Duration result = (Duration)getCustomPro(addedProName);
526
			assertTrue("added Date property \""+addedProName+"\" should exist", result != null);		
527
			assertTrue("value of added property should the same as set", DurationEquals(addedProDefaultValue, result));
528
		}
529
		
530
		@Test
531
		public void testCustomAddPro_Number() throws Exception{	
532
			String addedProName = "NumberPro";
533
			Double addedProDefaultValue = (double)10;	
534
			
535
			addCustomPro(addedProName, addedProDefaultValue);
536
			
537
			app.saveDocument(m_xSDComponent, m_filePath);
538
			app.closeDocument(m_xSDComponent);
539
			
540
			m_xSDComponent = app.loadDocument(m_filePath);
541
				
542
			Object oResult = getCustomPro(addedProName);
543
			
544
			Double result = (Double)oResult;
545
			assertTrue("added Number property \""+addedProName+"\" should exist", oResult != null);		
546
			assertEquals("value of added property should be "+Double.toString(addedProDefaultValue), 
547
					addedProDefaultValue, result);
548
		}
549
		
550
		@Test
551
		public void testCustomAddPro_Boolean() throws Exception{	
552
			String addedProName = "BooleanPro";
553
			Boolean addedProDefaultValue = true;	
554
			
555
			addCustomPro(addedProName, addedProDefaultValue);
556
			
557
			app.saveDocument(m_xSDComponent, m_filePath);
558
			app.closeDocument(m_xSDComponent);
559
			
560
			m_xSDComponent = app.loadDocument(m_filePath);
561
				
562
			Object oResult = getCustomPro(addedProName);
563
			
564
			boolean result = (Boolean)oResult;
565
			assertTrue("added Number property \""+addedProName+"\" should exist", oResult != null);		
566
			assertEquals("value of added property should be "+Boolean.toString(addedProDefaultValue), 
567
					addedProDefaultValue, result);
568
		}
569
		
570
		@Test
571
		public void testCustomRemovePro() throws Exception{					
572
			XDocumentProperties xDocPro = getDocumentProperties();
573
			XPropertyContainer proContainer = xDocPro.getUserDefinedProperties();
574
			XPropertySet xProSet = (XPropertySet)UnoRuntime.queryInterface(
575
					XPropertySet.class, proContainer);
576
			XPropertySetInfo xproSetInfo = xProSet.getPropertySetInfo();
577
			Property[] pros = xproSetInfo.getProperties();
578
			
579
			if(pros.length == 0) //if there is no custom property, add one
580
			{
581
				addCustomPro("testPro", "value");
582
			}
583
			
584
			for(int i=0; i< pros.length;i++)
585
			{
586
				proContainer.removeProperty(pros[i].Name);
587
			}
588
			
589
			app.saveDocument(m_xSDComponent, m_filePath);
590
			app.closeDocument(m_xSDComponent);
591
			
592
			m_xSDComponent = app.loadDocument(m_filePath);
593
				
594
			XDocumentProperties xDocPro2 = getDocumentProperties();
595
			XPropertyContainer proContainer2 = xDocPro2.getUserDefinedProperties();
596
			XPropertySet xProSet2 = (XPropertySet)UnoRuntime.queryInterface(
597
					XPropertySet.class, proContainer2);
598
			XPropertySetInfo xproSetInfo2 = xProSet2.getPropertySetInfo();
599
			Property[] pros2 = xproSetInfo2.getProperties();
600
					
601
			assertEquals("number of custom property should be zero ", 
602
					0, pros2.length);
603
		}	
604
	//custom properties end
605
		
606
		//Internet begin
607
		private void setAutoLoad(String URL, int secs) throws IllegalArgumentException
608
		{
609
			XDocumentProperties xDocPro = getDocumentProperties();
610
			xDocPro.setAutoloadURL(URL);
611
			xDocPro.setAutoloadSecs(secs);
612
			xDocPro.setDefaultTarget("_blank");
613
		}
614
		
615
		@Test
616
		public void testNoRefresh() throws Exception{
617
			String autoLoadURL = "";
618
			int autoLoadSecs = 0;
619
			setAutoLoad(autoLoadURL, autoLoadSecs);
620
			
621
			app.saveDocument(m_xSDComponent, m_filePath);
622
			app.closeDocument(m_xSDComponent);
623
			
624
			m_xSDComponent = app.loadDocument(m_filePath);
625
			XDocumentProperties xDocPro2 = getDocumentProperties();
626
			
627
			assertEquals("AutoLoadURL should be empty", autoLoadURL, xDocPro2.getAutoloadURL());
628
			assertEquals("AutoLoadSecs should be 0", autoLoadSecs, xDocPro2.getAutoloadSecs());
629
		}
630
		
631
		@Test
632
		public void testRefreshEvery60Secs() throws Exception{
633
			String autoLoadURL = "";
634
			int autoLoadSecs = 60;
635
			setAutoLoad(autoLoadURL, autoLoadSecs);
636
			
637
			app.saveDocument(m_xSDComponent, m_filePath);
638
			app.closeDocument(m_xSDComponent);
639
			
640
			m_xSDComponent = app.loadDocument(m_filePath);
641
			XDocumentProperties xDocPro2 = getDocumentProperties();
642
			
643
			assertEquals("AutoLoadURL should be empty", autoLoadURL, xDocPro2.getAutoloadURL());
644
			assertEquals("AutoLoadSecs should be "+Integer.toString(autoLoadSecs), autoLoadSecs, xDocPro2.getAutoloadSecs());
645
		}
646
		
647
		@Test
648
		public void testRedirect() throws Exception{
649
			String autoLoadURL = "http://www.openoffice.com/";
650
			int autoLoadSecs = 5;
651
			setAutoLoad(autoLoadURL, autoLoadSecs);
652
			
653
			app.saveDocument(m_xSDComponent, m_filePath);
654
			app.closeDocument(m_xSDComponent);
655
			
656
			m_xSDComponent = app.loadDocument(m_filePath);
657
			XDocumentProperties xDocPro2 = getDocumentProperties();
658
			
659
			assertEquals("AutoLoadURL should be empty", autoLoadURL, xDocPro2.getAutoloadURL());
660
			assertEquals("AutoLoadSecs should be "+Integer.toString(autoLoadSecs), autoLoadSecs, xDocPro2.getAutoloadSecs());
661
		}
662
		//Internet end
663
}

Return to issue 120840