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 (+657 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
		XDocumentProperties xDocPro = getDocumentProperties();		
137
		xDocPro.setAuthor(author);
138
139
		app.saveDocument(m_xSDComponent, m_filePath);
140
		app.closeDocument(m_xSDComponent);
141
		m_xSDComponent = app.loadDocument(m_filePath);
142
		XDocumentProperties xDocPro2 = getDocumentProperties();
143
		assertEquals("Author should be "+ author, author, xDocPro2.getAuthor());		
144
	}
145
		
146
	private boolean DateTimeEquals(DateTime datetime1, DateTime datetime2){
147
		
148
		if(datetime1.Seconds == datetime2.Seconds &&
149
				datetime1.Minutes == datetime2.Minutes &&
150
				datetime1.Hours == datetime2.Hours &&
151
				datetime1.Day == datetime2.Day &&
152
				datetime1.Month == datetime2.Month &&
153
				datetime1.Year == datetime2.Year)
154
			return true;
155
		else
156
			return false;
157
	}
158
	
159
	private boolean DateEquals(Date date1, Date date2){
160
		
161
		if(date1.Day == date2.Day &&
162
		   date1.Month == date2.Month &&
163
			date1.Year == date2.Year)
164
			return true;
165
		else
166
			return false;
167
	}
168
	
169
	private boolean DurationEquals(Duration d1, Duration d2){
170
		
171
		if(d1.Seconds == d2.Seconds &&
172
				d1.Minutes == d2.Minutes &&
173
				d1.Hours == d2.Hours &&
174
				d1.Days == d2.Days &&
175
				d1.Months == d2.Months &&
176
				d1.Years == d2.Years)
177
			return true;
178
		else
179
			return false;
180
	}
181
182
	private DateTime getCurrentDateTime(){
183
		Calendar ca = Calendar.getInstance();		
184
		DateTime currentDateTime = new DateTime();
185
		currentDateTime.Year = (short)ca.get(Calendar.YEAR);
186
		currentDateTime.Month = (short)ca.get(Calendar.MONTH);
187
		currentDateTime.Day = (short)ca.get(Calendar.DATE);
188
		currentDateTime.Minutes = (short)ca.get(Calendar.MINUTE);
189
		currentDateTime.Hours = (short)ca.get(Calendar.HOUR);
190
		currentDateTime.Seconds = (short)ca.get(Calendar.SECOND);
191
		
192
		return currentDateTime;
193
	}
194
	
195
	private Date getCurrentDate(){
196
		Calendar ca = Calendar.getInstance();		
197
		Date currentDate = new Date();
198
		currentDate.Year = (short)ca.get(Calendar.YEAR);
199
		currentDate.Month = (short)ca.get(Calendar.MONTH);
200
		currentDate.Day = (short)ca.get(Calendar.DATE);
201
		
202
		return currentDate;
203
	}
204
	
205
	/*
206
	 * UI entry: File->Properties->General->Created*/
207
	@Test
208
	public void testGeneralCreationDate() throws Exception {			
209
		DateTime creationDate = getCurrentDateTime();	
210
		
211
		XDocumentProperties xDocPro = getDocumentProperties();
212
		
213
		xDocPro.setCreationDate(creationDate);
214
		
215
		app.saveDocument(m_xSDComponent, m_filePath);
216
		app.closeDocument(m_xSDComponent);
217
		m_xSDComponent = app.loadDocument(m_filePath);
218
		XDocumentProperties xDocPro2 = getDocumentProperties();
219
		DateTime result = xDocPro2.getCreationDate();
220
		assertTrue("CreationDate should be the same as set", this.DateTimeEquals(creationDate, result));		
221
	}
222
	
223
	/*
224
	 * UI entry: File->Properties->General->Modified*/
225
	@Test
226
	//ModifiedBy will be set each time the file loaded. The value is the one set in Tools->options->User data->Last name
227
	public void testGeneralModifiedBy() throws Exception {
228
		String modifiedBy = this.getUserName();		
229
		XDocumentProperties xDocPro = getDocumentProperties();
230
		xDocPro.setModifiedBy(modifiedBy);
231
		
232
		
233
		app.saveDocument(m_xSDComponent, m_filePath);
234
		app.closeDocument(m_xSDComponent);
235
		m_xSDComponent = app.loadDocument(m_filePath);
236
		XDocumentProperties xDocPro2 = getDocumentProperties();		
237
		assertEquals("The file is modified by "+ modifiedBy, modifiedBy, xDocPro2.getModifiedBy());
238
	}
239
	
240
	/*
241
	 * UI entry: File->Properties->General->Modified*/
242
	@Test
243
	public void testGeneralModificationDate() throws Exception {
244
		//modification date will be set each time the file saved, so I don't save after set.
245
		DateTime modificationDate = getCurrentDateTime();	
246
				
247
		XDocumentProperties xDocPro = getDocumentProperties();
248
		
249
		xDocPro.setModificationDate(modificationDate);
250
			
251
		DateTime result = xDocPro.getModificationDate();
252
		assertTrue("ModificationDate should be the same as set", this.DateTimeEquals(modificationDate, result));		
253
	}
254
	
255
	/*
256
	 * UI entry: File->Properties->General->Last printed*/
257
	@Test
258
	public void testGeneralPrintBy() throws Exception {
259
		String printBy = "PrintBy";
260
		XDocumentProperties xDocPro = getDocumentProperties();
261
		
262
		xDocPro.setPrintedBy(printBy);
263
		
264
		app.saveDocument(m_xSDComponent, m_filePath);
265
		app.closeDocument(m_xSDComponent);
266
		m_xSDComponent = app.loadDocument(m_filePath);
267
		XDocumentProperties xDocPro2 = getDocumentProperties();
268
		assertEquals("This document is printed by "+ printBy, printBy, xDocPro2.getPrintedBy());		
269
	}
270
	
271
	/*
272
	 * UI entry: File->Properties->General->Last printed*/
273
	@Test
274
	public void testGeneralPrintDate() throws Exception {	
275
		DateTime printDate = getCurrentDateTime();	
276
		
277
		XDocumentProperties xDocPro = getDocumentProperties();
278
		
279
		xDocPro.setPrintDate(printDate);
280
		
281
		app.saveDocument(m_xSDComponent, m_filePath);
282
		app.closeDocument(m_xSDComponent);
283
		m_xSDComponent = app.loadDocument(m_filePath);
284
		XDocumentProperties xDocPro2 = getDocumentProperties();
285
		DateTime result = xDocPro2.getPrintDate();
286
		assertTrue("PrintDate should be the same as set", this.DateTimeEquals(printDate, result));		
287
	}
288
	
289
	/*
290
	 * UI entry: File->Properties->General->Total editing time*/
291
	@Test
292
	public void testGeneralEditingDuration() throws Exception {
293
		int editingDuration = 60;
294
		
295
		XDocumentProperties xDocPro = getDocumentProperties();
296
		
297
		xDocPro.setEditingDuration(editingDuration);
298
		
299
		app.saveDocument(m_xSDComponent, m_filePath);
300
		app.closeDocument(m_xSDComponent);
301
		m_xSDComponent = app.loadDocument(m_filePath);
302
		XDocumentProperties xDocPro2 = getDocumentProperties();
303
		assertEquals("Totally editing time should be "+ editingDuration, editingDuration, xDocPro2.getEditingDuration());		
304
	}
305
	
306
	/*
307
	 * UI entry: File->Properties->General->Revision number*/
308
	@Test
309
	public void testGeneralRevisionNumber() throws Exception {
310
		short revisionNumber = 10;
311
		
312
		XDocumentProperties xDocPro = getDocumentProperties();
313
		
314
		xDocPro.setEditingCycles(revisionNumber);
315
		
316
		app.saveDocument(m_xSDComponent, m_filePath);
317
		app.closeDocument(m_xSDComponent);
318
		m_xSDComponent = app.loadDocument(m_filePath);
319
		XDocumentProperties xDocPro2 = getDocumentProperties();
320
		assertEquals("Revision number should be "+ revisionNumber, revisionNumber, xDocPro2.getEditingCycles());		
321
	}
322
	
323
	/*
324
	 * UI entry: File->Properties->General->template*/
325
	@Test
326
	public void testGeneralTemplateName() throws Exception {
327
		String templateName = "I'm a template";
328
		
329
		XDocumentProperties xDocPro = getDocumentProperties();
330
		
331
		xDocPro.setTemplateName(templateName);
332
		
333
		app.saveDocument(m_xSDComponent, m_filePath);
334
		app.closeDocument(m_xSDComponent);
335
		m_xSDComponent = app.loadDocument(m_filePath);
336
		XDocumentProperties xDocPro2 = getDocumentProperties();
337
		assertEquals("Template name should be "+ templateName, templateName, xDocPro2.getTemplateName());		
338
	}
339
	
340
	/*
341
	 * UI entry: File->Properties->General->Reset*/
342
	@Test
343
	public void testGeneralReset() throws Exception {
344
		String author = "ResetAuthor";
345
		XDocumentProperties xDocPro = getDocumentProperties();
346
		xDocPro.resetUserData(author);
347
			
348
		assertEquals("Author should be "+ author, author, xDocPro.getAuthor());
349
		assertEquals("Modified should be empty", "", xDocPro.getModifiedBy());
350
		assertTrue("ModificationDate should be empty", 
351
				DateTimeEquals(new DateTime(), xDocPro.getModificationDate()));
352
		assertEquals("PrintBy should be empty", "", xDocPro.getPrintedBy());
353
		assertTrue("PrintDate should be empty", 
354
				DateTimeEquals(new DateTime(), xDocPro.getPrintDate()));
355
		assertEquals("Totally editing time should be empty", 0, xDocPro.getEditingDuration());
356
		assertEquals("Revision number should be empty", 1, xDocPro.getEditingCycles());
357
	}
358
	
359
	// UI entry: File->Properties->General->Apply user data
360
	
361
	// UI entry: File->Properties->General->digital signature
362
	
363
	//Description begin
364
	/*
365
	 * UI entry: File->Properties->Description->Title*/
366
	@Test
367
	public void testDescriptionTitle() throws Exception{
368
		String title = "titleForTest";
369
		XDocumentProperties xDocPro = getDocumentProperties();
370
		xDocPro.setTitle(title);
371
		
372
		app.saveDocument(m_xSDComponent, m_filePath);
373
		app.closeDocument(m_xSDComponent);
374
		m_xSDComponent = app.loadDocument(m_filePath);
375
		XDocumentProperties xDocPro2 = getDocumentProperties();
376
		assertEquals("Title should be "+ title, title, xDocPro2.getTitle());
377
	}
378
	
379
	/*
380
	 * UI entry: File->Properties->Description->Subject*/
381
	@Test
382
	public void testDescriptionSubject() throws Exception{
383
		String subject = "subjectForTest";
384
		XDocumentProperties xDocPro = getDocumentProperties();
385
		xDocPro.setSubject(subject);
386
		
387
		app.saveDocument(m_xSDComponent, m_filePath);
388
		app.closeDocument(m_xSDComponent);
389
		m_xSDComponent = app.loadDocument(m_filePath);
390
		XDocumentProperties xDocPro2 = getDocumentProperties();
391
		assertEquals("Subject should be "+ subject, subject, xDocPro2.getSubject());
392
	}
393
	
394
	/*
395
	 * UI entry: File->Properties->Description->Keywords*/
396
	@Test
397
	public void testDescriptionKeywords() throws Exception{
398
		String[] keywords = {"keyword1", "keyword2"};
399
		XDocumentProperties xDocPro = getDocumentProperties();
400
		xDocPro.setKeywords(keywords);
401
		
402
		app.saveDocument(m_xSDComponent, m_filePath);
403
		app.closeDocument(m_xSDComponent);
404
		
405
		m_xSDComponent = app.loadDocument(m_filePath);
406
		XDocumentProperties xDocPro2 = getDocumentProperties();
407
		String[] keywordsResult = xDocPro2.getKeywords();
408
		assertEquals("There should be 2 Keywords", 2, keywordsResult.length);
409
		for(int i=0;i<keywordsResult.length;i++)
410
		{
411
			String num = Integer.toString(i+1);
412
			assertEquals("The keywords should be keyword"+num, "keyword"+num, keywordsResult[i]);
413
		}
414
	}
415
	
416
	/*
417
	 * UI entry: File->Properties->Description->Comments*/
418
	@Test
419
	public void testDescriptionComments() throws Exception{
420
		String comments = "This is the comment.";
421
		XDocumentProperties xDocPro = getDocumentProperties();
422
		xDocPro.setDescription(comments);
423
		
424
		app.saveDocument(m_xSDComponent, m_filePath);
425
		app.closeDocument(m_xSDComponent);
426
		
427
		m_xSDComponent = app.loadDocument(m_filePath);
428
		XDocumentProperties xDocPro2 = getDocumentProperties();
429
		
430
		assertEquals("Comments should be "+comments, comments, xDocPro2.getDescription());
431
	}
432
	//Description end
433
	
434
	//custom properties begin
435
	//UI entry: File->Properties->Custom properties
436
		private void addCustomPro(String propertyName, Object value) throws PropertyExistException, IllegalTypeException, IllegalArgumentException{
437
			XDocumentProperties xDocPro = getDocumentProperties();
438
			XPropertyContainer proContainer = xDocPro.getUserDefinedProperties();
439
			proContainer.addProperty(propertyName, PropertyAttribute.REMOVEABLE, value);
440
		}
441
		
442
		private Object getCustomPro(String propertyName) throws UnknownPropertyException, WrappedTargetException{
443
			XDocumentProperties xDocPro = getDocumentProperties();
444
			XPropertyContainer proContainer = xDocPro.getUserDefinedProperties();
445
			XPropertySet xProSet = (XPropertySet)UnoRuntime.queryInterface(
446
					XPropertySet.class, proContainer);
447
			
448
			return xProSet.getPropertyValue(propertyName);
449
		}
450
		
451
		@Test
452
		public void testCustomAddPro_Text() throws Exception{	
453
			String addedProName = "TextPro";
454
			String addedProDefaultValue = "testUser";
455
			
456
			addCustomPro(addedProName, addedProDefaultValue);
457
			
458
			app.saveDocument(m_xSDComponent, m_filePath);
459
			app.closeDocument(m_xSDComponent);
460
			
461
			m_xSDComponent = app.loadDocument(m_filePath);
462
			
463
			String result = (String)getCustomPro(addedProName);
464
					
465
			assertTrue("added Text property \""+addedProName+"\" should exist", result != null);		
466
			assertEquals("value of added property should be "+addedProDefaultValue, 
467
					addedProDefaultValue, result);
468
		}
469
		
470
		@Test
471
		public void testCustomAddPro_DateTime() throws Exception{	
472
			String addedProName = "DateTimePro";
473
			DateTime addedProDefaultValue = getCurrentDateTime();	
474
			
475
			addCustomPro(addedProName, addedProDefaultValue);
476
			
477
			app.saveDocument(m_xSDComponent, m_filePath);
478
			app.closeDocument(m_xSDComponent);
479
			
480
			m_xSDComponent = app.loadDocument(m_filePath);
481
					
482
			DateTime result = (DateTime)getCustomPro(addedProName);
483
			assertTrue("added DateTime property \""+addedProName+"\" should exist", result != null);		
484
			assertTrue("value of added property should be the same as set", 
485
					this.DateTimeEquals(result, addedProDefaultValue));
486
		}
487
		
488
		@Test
489
		public void testCustomAddPro_Date() throws Exception{	
490
			String addedProName = "DatePro";
491
			Date addedProDefaultValue = getCurrentDate();	
492
493
			addCustomPro(addedProName, addedProDefaultValue);
494
			
495
			app.saveDocument(m_xSDComponent, m_filePath);
496
			app.closeDocument(m_xSDComponent);
497
			
498
			m_xSDComponent = app.loadDocument(m_filePath);
499
					
500
			Date result = (Date)getCustomPro(addedProName);
501
			assertTrue("added Date property \""+addedProName+"\" should exist", result != null);		
502
			assertTrue("value of added property should be the same as set", 
503
					this.DateEquals(result, addedProDefaultValue));
504
		}
505
		
506
		@Test
507
		public void testCustomAddPro_Duration() throws Exception{			
508
			String addedProName = "DurationPro";
509
			Duration addedProDefaultValue = new Duration();	
510
			addedProDefaultValue.Days = 1;
511
512
			addCustomPro(addedProName, addedProDefaultValue);
513
			
514
			app.saveDocument(m_xSDComponent, m_filePath);
515
			app.closeDocument(m_xSDComponent);
516
			
517
			m_xSDComponent = app.loadDocument(m_filePath);
518
					
519
			Duration result = (Duration)getCustomPro(addedProName);
520
			assertTrue("added Date property \""+addedProName+"\" should exist", result != null);		
521
			assertTrue("value of added property should the same as set", DurationEquals(addedProDefaultValue, result));
522
		}
523
		
524
		@Test
525
		public void testCustomAddPro_Number() throws Exception{	
526
			String addedProName = "NumberPro";
527
			Double addedProDefaultValue = (double)10;	
528
			
529
			addCustomPro(addedProName, addedProDefaultValue);
530
			
531
			app.saveDocument(m_xSDComponent, m_filePath);
532
			app.closeDocument(m_xSDComponent);
533
			
534
			m_xSDComponent = app.loadDocument(m_filePath);
535
				
536
			Object oResult = getCustomPro(addedProName);
537
			
538
			Double result = (Double)oResult;
539
			assertTrue("added Number property \""+addedProName+"\" should exist", oResult != null);		
540
			assertEquals("value of added property should be "+Double.toString(addedProDefaultValue), 
541
					addedProDefaultValue, result);
542
		}
543
		
544
		@Test
545
		public void testCustomAddPro_Boolean() throws Exception{	
546
			String addedProName = "BooleanPro";
547
			Boolean addedProDefaultValue = true;	
548
			
549
			addCustomPro(addedProName, addedProDefaultValue);
550
			
551
			app.saveDocument(m_xSDComponent, m_filePath);
552
			app.closeDocument(m_xSDComponent);
553
			
554
			m_xSDComponent = app.loadDocument(m_filePath);
555
				
556
			Object oResult = getCustomPro(addedProName);
557
			
558
			boolean result = (Boolean)oResult;
559
			assertTrue("added Number property \""+addedProName+"\" should exist", oResult != null);		
560
			assertEquals("value of added property should be "+Boolean.toString(addedProDefaultValue), 
561
					addedProDefaultValue, result);
562
		}
563
		
564
		@Test
565
		public void testCustomRemovePro() throws Exception{					
566
			XDocumentProperties xDocPro = getDocumentProperties();
567
			XPropertyContainer proContainer = xDocPro.getUserDefinedProperties();
568
			XPropertySet xProSet = (XPropertySet)UnoRuntime.queryInterface(
569
					XPropertySet.class, proContainer);
570
			XPropertySetInfo xproSetInfo = xProSet.getPropertySetInfo();
571
			Property[] pros = xproSetInfo.getProperties();
572
			
573
			if(pros.length == 0) //if there is no custom property, add one
574
			{
575
				addCustomPro("testPro", "value");
576
			}
577
			
578
			for(int i=0; i< pros.length;i++)
579
			{
580
				proContainer.removeProperty(pros[i].Name);
581
			}
582
			
583
			app.saveDocument(m_xSDComponent, m_filePath);
584
			app.closeDocument(m_xSDComponent);
585
			
586
			m_xSDComponent = app.loadDocument(m_filePath);
587
				
588
			XDocumentProperties xDocPro2 = getDocumentProperties();
589
			XPropertyContainer proContainer2 = xDocPro2.getUserDefinedProperties();
590
			XPropertySet xProSet2 = (XPropertySet)UnoRuntime.queryInterface(
591
					XPropertySet.class, proContainer2);
592
			XPropertySetInfo xproSetInfo2 = xProSet2.getPropertySetInfo();
593
			Property[] pros2 = xproSetInfo2.getProperties();
594
					
595
			assertEquals("number of custom property should be zero ", 
596
					0, pros2.length);
597
		}	
598
	//custom properties end
599
		
600
		//Internet begin
601
		private void setAutoLoad(String URL, int secs) throws IllegalArgumentException
602
		{
603
			XDocumentProperties xDocPro = getDocumentProperties();
604
			xDocPro.setAutoloadURL(URL);
605
			xDocPro.setAutoloadSecs(secs);
606
			xDocPro.setDefaultTarget("_blank");
607
		}
608
		
609
		@Test
610
		public void testNoRefresh() throws Exception{
611
			String autoLoadURL = "";
612
			int autoLoadSecs = 0;
613
			setAutoLoad(autoLoadURL, autoLoadSecs);
614
			
615
			app.saveDocument(m_xSDComponent, m_filePath);
616
			app.closeDocument(m_xSDComponent);
617
			
618
			m_xSDComponent = app.loadDocument(m_filePath);
619
			XDocumentProperties xDocPro2 = getDocumentProperties();
620
			
621
			assertEquals("AutoLoadURL should be empty", autoLoadURL, xDocPro2.getAutoloadURL());
622
			assertEquals("AutoLoadSecs should be 0", autoLoadSecs, xDocPro2.getAutoloadSecs());
623
		}
624
		
625
		@Test
626
		public void testRefreshEvery60Secs() throws Exception{
627
			String autoLoadURL = "";
628
			int autoLoadSecs = 60;
629
			setAutoLoad(autoLoadURL, autoLoadSecs);
630
			
631
			app.saveDocument(m_xSDComponent, m_filePath);
632
			app.closeDocument(m_xSDComponent);
633
			
634
			m_xSDComponent = app.loadDocument(m_filePath);
635
			XDocumentProperties xDocPro2 = getDocumentProperties();
636
			
637
			assertEquals("AutoLoadURL should be empty", autoLoadURL, xDocPro2.getAutoloadURL());
638
			assertEquals("AutoLoadSecs should be "+Integer.toString(autoLoadSecs), autoLoadSecs, xDocPro2.getAutoloadSecs());
639
		}
640
		
641
		@Test
642
		public void testRedirect() throws Exception{
643
			String autoLoadURL = "http://www.openoffice.com/";
644
			int autoLoadSecs = 5;
645
			setAutoLoad(autoLoadURL, autoLoadSecs);
646
			
647
			app.saveDocument(m_xSDComponent, m_filePath);
648
			app.closeDocument(m_xSDComponent);
649
			
650
			m_xSDComponent = app.loadDocument(m_filePath);
651
			XDocumentProperties xDocPro2 = getDocumentProperties();
652
			
653
			assertEquals("AutoLoadURL should be empty", autoLoadURL, xDocPro2.getAutoloadURL());
654
			assertEquals("AutoLoadSecs should be "+Integer.toString(autoLoadSecs), autoLoadSecs, xDocPro2.getAutoloadSecs());
655
		}
656
		//Internet end
657
}

Return to issue 120840