1*ef39d40dSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*ef39d40dSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*ef39d40dSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*ef39d40dSAndrew Rist  * distributed with this work for additional information
6*ef39d40dSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*ef39d40dSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*ef39d40dSAndrew Rist  * "License"); you may not use this file except in compliance
9*ef39d40dSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*ef39d40dSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*ef39d40dSAndrew Rist  *
13*ef39d40dSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*ef39d40dSAndrew Rist  * software distributed under the License is distributed on an
15*ef39d40dSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*ef39d40dSAndrew Rist  * KIND, either express or implied.  See the License for the
17*ef39d40dSAndrew Rist  * specific language governing permissions and limitations
18*ef39d40dSAndrew Rist  * under the License.
19*ef39d40dSAndrew Rist  *
20*ef39d40dSAndrew Rist  *************************************************************/
21*ef39d40dSAndrew Rist 
22*ef39d40dSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir package graphical;
25cdf0e10cSrcweir 
26cdf0e10cSrcweir 
27cdf0e10cSrcweir /**
28cdf0e10cSrcweir  *
29cdf0e10cSrcweir  * @author ll93751
30cdf0e10cSrcweir  */
31cdf0e10cSrcweir public class PostscriptCreator extends EnhancedComplexTestCase
32cdf0e10cSrcweir {
33cdf0e10cSrcweir 
34cdf0e10cSrcweir     // @Override
getTestMethodNames()35cdf0e10cSrcweir     public String[] getTestMethodNames()
36cdf0e10cSrcweir     {
37cdf0e10cSrcweir         return new String[]{"DocumentToPostscript"};
38cdf0e10cSrcweir     }
39cdf0e10cSrcweir 
40cdf0e10cSrcweir     /**
41cdf0e10cSrcweir      * test function.
42cdf0e10cSrcweir      */
DocumentToPostscript()43cdf0e10cSrcweir     public void DocumentToPostscript()
44cdf0e10cSrcweir     {
45cdf0e10cSrcweir         GlobalLogWriter.set(log);
46cdf0e10cSrcweir         ParameterHelper aParam = new ParameterHelper(param);
47cdf0e10cSrcweir 
48cdf0e10cSrcweir         param.put(util.PropertyName.OFFICE_CLOSE_TIME_OUT, 2000);
49cdf0e10cSrcweir         // run through all documents found in Inputpath
50cdf0e10cSrcweir         foreachDocumentinInputPath(aParam);
51cdf0e10cSrcweir     }
52cdf0e10cSrcweir 
53cdf0e10cSrcweir 
checkOneFile(String _sDocumentName, String _sResult, ParameterHelper _aParams)54cdf0e10cSrcweir     public void checkOneFile(String _sDocumentName, String _sResult, ParameterHelper _aParams) throws OfficeException
55cdf0e10cSrcweir     {
56cdf0e10cSrcweir         GlobalLogWriter.println("  Document: " + _sDocumentName);
57cdf0e10cSrcweir         GlobalLogWriter.println("   results: " + _sResult);
58cdf0e10cSrcweir         IOffice aOffice = new Office(_aParams, _sResult);
59cdf0e10cSrcweir 
60cdf0e10cSrcweir         PerformanceContainer a = new PerformanceContainer();
61cdf0e10cSrcweir         a.startTime(PerformanceContainer.AllTime);
62cdf0e10cSrcweir 
63cdf0e10cSrcweir         // _aParams.getTestParameters().put(util.PropertyName.DEBUG_IS_ACTIVE, Boolean.TRUE);
64cdf0e10cSrcweir         a.startTime(PerformanceContainer.OfficeStart);
65cdf0e10cSrcweir         aOffice.start();
66cdf0e10cSrcweir         a.stopTime(PerformanceContainer.OfficeStart);
67cdf0e10cSrcweir 
68cdf0e10cSrcweir         // _aParams.getTestParameters().put(util.PropertyName.DEBUG_IS_ACTIVE, Boolean.FALSE);
69cdf0e10cSrcweir 
70cdf0e10cSrcweir         // This force an error! _sDocumentName = helper.StringHelper.doubleQuote(_sDocumentName);
71cdf0e10cSrcweir         try
72cdf0e10cSrcweir         {
73cdf0e10cSrcweir             a.startTime(PerformanceContainer.Load);
74cdf0e10cSrcweir             aOffice.load(_sDocumentName);
75cdf0e10cSrcweir             a.stopTime(PerformanceContainer.Load);
76cdf0e10cSrcweir 
77cdf0e10cSrcweir             a.startTime(PerformanceContainer.Print);
78cdf0e10cSrcweir             aOffice.storeAsPostscript();
79cdf0e10cSrcweir             a.stopTime(PerformanceContainer.Print);
80cdf0e10cSrcweir         }
81cdf0e10cSrcweir         finally
82cdf0e10cSrcweir         {
83cdf0e10cSrcweir             a.startTime(PerformanceContainer.OfficeStop);
84cdf0e10cSrcweir             aOffice.close();
85cdf0e10cSrcweir             a.stopTime(PerformanceContainer.OfficeStop);
86cdf0e10cSrcweir 
87cdf0e10cSrcweir             a.stopTime(PerformanceContainer.AllTime);
88cdf0e10cSrcweir 
89cdf0e10cSrcweir             a.print( System.out );
90cdf0e10cSrcweir         }
91cdf0e10cSrcweir     }
92cdf0e10cSrcweir 
93cdf0e10cSrcweir 
94cdf0e10cSrcweir 
95cdf0e10cSrcweir 
96cdf0e10cSrcweir //    public static void main(String [] _args)
97cdf0e10cSrcweir //    {
98cdf0e10cSrcweir //        String args[] = {
99cdf0e10cSrcweir //            "-TimeOut", "3600000",
100cdf0e10cSrcweir //            "-tb", "java_complex",
101cdf0e10cSrcweir //            "-o", "graphical.PostscriptCreator",
102cdf0e10cSrcweir ////            "-DOC_COMPARATOR_INPUT_PATH", "D:\\temp\\input",
103cdf0e10cSrcweir ////            "-DOC_COMPARATOR_OUTPUT_PATH", "D:\\temp\\output",
104cdf0e10cSrcweir ////            "-DOC_COMPARATOR_REFERENCE_PATH", "D:\\temp\\output\\ref",
105cdf0e10cSrcweir ////            "-DOC_COMPARATOR_PRINT_MAX_PAGE", "9999",
106cdf0e10cSrcweir ////            "-DOC_COMPARATOR_GFX_OUTPUT_DPI_RESOLUTION", "180",
107cdf0e10cSrcweir ////            "-DOC_COMPARATOR_HTML_OUTPUT_PREFIX", "http://so-gfxcmp-lin.germany.sun.com/gfxcmp_ui/cw.php?inifile=",
108cdf0e10cSrcweir //////            "-DOC_COMPARATOR_REFERENCE_CREATOR_TYPE", "PDF",      /* default: "OOo" */
109cdf0e10cSrcweir //////            "-DOC_COMPARATOR_REFERENCE_CREATOR_TYPE", "msoffice", /* default: "OOo" */
110cdf0e10cSrcweir //////            "-OFFICE_VIEWABLE", "false",
111cdf0e10cSrcweir ////            "-AppExecutionCommand", "\"C:/home/ll93751/staroffice9_DEV300_m25/Sun/StarOffice 9/program/soffice.exe\"  -norestore -nocrashreport -accept=pipe,name=ll93751;urp;",
112cdf0e10cSrcweir //////            "-NoOffice"
113cdf0e10cSrcweir //            "-DOC_COMPARATOR_PRINT_MAX_PAGE","9999",
114cdf0e10cSrcweir //            "-DOC_COMPARATOR_GFX_OUTPUT_DPI_RESOLUTION","180",
115cdf0e10cSrcweir //            "-DOC_COMPARATOR_HTML_OUTPUT_PREFIX","http://so-gfxcmp.germany.sun.com/gfxcmp_ui/cw.php?inifile=",
116cdf0e10cSrcweir //            "-DOC_COMPARATOR_REFERENCE_CREATOR_TYPE","OOo",
117cdf0e10cSrcweir //            "-DOC_COMPARATOR_DB_INFO_STRING","p:DEV300_m18,c:,d:LLA_test,src:DEV300_m18,dest:,doc:LLA_test,id:34715,distinct:2008-06-27_13-39-09_d6f22d4c-958d-10",
118cdf0e10cSrcweir //            "-DISTINCT","2008-06-27_13-39-09_d6f22d4c-958d-10",
119cdf0e10cSrcweir //            "-TEMPPATH","//so-gfxcmp-lin/gfxcmp-data/wntmsci/temp/2008-06-27_13-39-09_d6f22d4c-958d-10/34715",
120cdf0e10cSrcweir ////            "ConnectionString","socket,host=localhost,port=8101",
121cdf0e10cSrcweir //            "-OFFICE_VIEWABLE","true",
122cdf0e10cSrcweir //            "-wntmsci.DOC_COMPARATOR_INPUT_PATH","\\\\so-gfxcmp-lin\\doc-pool\\LLA_test\\issue_79214.odb",
123cdf0e10cSrcweir //            "-wntmsci.DOC_COMPARATOR_OUTPUT_PATH","\\\\so-gfxcmp-lin\\gfxcmp-data\\wntmsci\\convwatch-output\\LLA_test\\DEV300_m11",
124cdf0e10cSrcweir //            "-wntmsci.AppExecutionCommand","\"C:\\gfxcmp\\programs\\staroffice8_DEV300_m11\\Sun\\StarOffice 9\\program\\soffice.exe\"  -norestore -nocrashreport -accept=pipe,name=ll93751;urp;",
125cdf0e10cSrcweir //            "-wntmsci.AppKillCommand","\"C:\\bin\\pskill.exe soffice.bin;C:\\bin\\pskill.exe winword;C:\\bin\\pskill.exe excel\"",
126cdf0e10cSrcweir //
127cdf0e10cSrcweir //        };
128cdf0e10cSrcweir //
129cdf0e10cSrcweir //        org.openoffice.Runner.main(args);
130cdf0e10cSrcweir //    }
131cdf0e10cSrcweir 
132cdf0e10cSrcweir }
133