SubjectField.java (eba4d44a) | SubjectField.java (3ecf08d2) |
---|---|
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 --- 107 unchanged lines hidden (view full) --- 116 /** 117 * Test Subject Field Can created and Saved in Doc file 118 * 1.launch a doc document 119 * 2.Create a Subject field at end of this page 120 * 3.Save and Reopen this document, check Subject field 121 * 3.Save as odt format and reload 122 * @throws Throwable 123 */ | 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 --- 107 unchanged lines hidden (view full) --- 116 /** 117 * Test Subject Field Can created and Saved in Doc file 118 * 1.launch a doc document 119 * 2.Create a Subject field at end of this page 120 * 3.Save and Reopen this document, check Subject field 121 * 3.Save as odt format and reload 122 * @throws Throwable 123 */ |
124 @Test 125 public void testPageCountFieldDOC() throws Throwable { 126 docDocument = SWUtil.openDocument(Testspace.prepareData(docSample), app); 127 String subjectStr = "Test Subject Field"; 128 SWUtil.setDocumentProperty(docDocument, "Subject", subjectStr); 129 createSubjectFiled(docDocument); 130 131 assertTrue("Verify Subject field is created.", isContainSubjectField(docDocument, subjectStr)); 132 assertTrue("Verify Subject field is created, can get text from document", 133 isContainSubjectText(docDocument, subjectStr)); 134 135 docDocument = SWUtil.saveAndReload(docDocument, app); 136 //verify after save and reload 137 assertTrue("Verify Subject field is created, after save, still exist.", isContainSubjectField(docDocument, subjectStr)); 138 assertTrue("Verify Subject field is created, can get text from document after saved.", 139 isContainSubjectText(docDocument, subjectStr)); 140 SWUtil.saveAsODT(docDocument, Testspace.getUrl(docSaveAsODTSample)); 141 app.closeDocument(docDocument); 142 odtDocument = SWUtil.openDocumentFromURL(Testspace.getUrl(docSaveAsODTSample), app); 143 assertTrue("Verify Subject field is created, after saved to doc format, field still exist.", isContainSubjectField(odtDocument, subjectStr)); 144 assertTrue("Verify Subject field is created, after saved to doc format, can get text from document", 145 isContainSubjectText(odtDocument, subjectStr)); 146 app.closeDocument(odtDocument); 147 } | 124// @Test 125// public void testPageCountFieldDOC() throws Throwable { 126// docDocument = SWUtil.openDocument(Testspace.prepareData(docSample), app); 127// String subjectStr = "Test Subject Field"; 128// SWUtil.setDocumentProperty(docDocument, "Subject", subjectStr); 129// createSubjectFiled(docDocument); 130// 131// assertTrue("Verify Subject field is created.", isContainSubjectField(docDocument, subjectStr)); 132// assertTrue("Verify Subject field is created, can get text from document", 133// isContainSubjectText(docDocument, subjectStr)); 134// 135// docDocument = SWUtil.saveAndReload(docDocument, app); 136// //verify after save and reload 137// assertTrue("Verify Subject field is created, after save, still exist.", isContainSubjectField(docDocument, subjectStr)); 138// assertTrue("Verify Subject field is created, can get text from document after saved.", 139// isContainSubjectText(docDocument, subjectStr)); 140// SWUtil.saveAsODT(docDocument, Testspace.getUrl(docSaveAsODTSample)); 141// app.closeDocument(docDocument); 142// odtDocument = SWUtil.openDocumentFromURL(Testspace.getUrl(docSaveAsODTSample), app); 143// assertTrue("Verify Subject field is created, after saved to doc format, field still exist.", isContainSubjectField(odtDocument, subjectStr)); 144// assertTrue("Verify Subject field is created, after saved to doc format, can get text from document", 145// isContainSubjectText(odtDocument, subjectStr)); 146// app.closeDocument(odtDocument); 147// } |
148 149 150 151 /** 152 * Create a subject field at start of this document 153 * @param document 154 * @throws Exception 155 */ --- 45 unchanged lines hidden --- | 148 149 150 151 /** 152 * Create a subject field at start of this document 153 * @param document 154 * @throws Exception 155 */ --- 45 unchanged lines hidden --- |