1 /*
2  * ************************************************************************
3  *
4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5  *
6  * Copyright 2000, 2010 Oracle and/or its affiliates.
7  *
8  * OpenOffice.org - a multi-platform office productivity suite
9  *
10  * This file is part of OpenOffice.org.
11  *
12  * OpenOffice.org is free software: you can redistribute it and/or modify
13  * it under the terms of the GNU Lesser General Public License version 3
14  * only, as published by the Free Software Foundation.
15  *
16  * OpenOffice.org is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU Lesser General Public License version 3 for more details
20  * (a copy is included in the LICENSE file that accompanied this code).
21  *
22  * You should have received a copy of the GNU Lesser General Public License
23  * version 3 along with OpenOffice.org.  If not, see
24  * <http://www.openoffice.org/license.html>
25  * for a copy of the LGPLv3 License.
26  *
27  * ***********************************************************************
28  */
29 
30 package graphical;
31 
32 
33 /**
34  *
35  * @author ll93751
36  */
37 public class PostscriptCreator extends EnhancedComplexTestCase
38 {
39 
40     // @Override
41     public String[] getTestMethodNames()
42     {
43         return new String[]{"DocumentToPostscript"};
44     }
45 
46     /**
47      * test function.
48      */
49     public void DocumentToPostscript()
50     {
51         GlobalLogWriter.set(log);
52         ParameterHelper aParam = new ParameterHelper(param);
53 
54         param.put(util.PropertyName.OFFICE_CLOSE_TIME_OUT, 2000);
55         // run through all documents found in Inputpath
56         foreachDocumentinInputPath(aParam);
57     }
58 
59 
60     public void checkOneFile(String _sDocumentName, String _sResult, ParameterHelper _aParams) throws OfficeException
61     {
62         GlobalLogWriter.println("  Document: " + _sDocumentName);
63         GlobalLogWriter.println("   results: " + _sResult);
64         IOffice aOffice = new Office(_aParams, _sResult);
65 
66         PerformanceContainer a = new PerformanceContainer();
67         a.startTime(PerformanceContainer.AllTime);
68 
69         // _aParams.getTestParameters().put(util.PropertyName.DEBUG_IS_ACTIVE, Boolean.TRUE);
70         a.startTime(PerformanceContainer.OfficeStart);
71         aOffice.start();
72         a.stopTime(PerformanceContainer.OfficeStart);
73 
74         // _aParams.getTestParameters().put(util.PropertyName.DEBUG_IS_ACTIVE, Boolean.FALSE);
75 
76         // This force an error! _sDocumentName = helper.StringHelper.doubleQuote(_sDocumentName);
77         try
78         {
79             a.startTime(PerformanceContainer.Load);
80             aOffice.load(_sDocumentName);
81             a.stopTime(PerformanceContainer.Load);
82 
83             a.startTime(PerformanceContainer.Print);
84             aOffice.storeAsPostscript();
85             a.stopTime(PerformanceContainer.Print);
86         }
87         finally
88         {
89             a.startTime(PerformanceContainer.OfficeStop);
90             aOffice.close();
91             a.stopTime(PerformanceContainer.OfficeStop);
92 
93             a.stopTime(PerformanceContainer.AllTime);
94 
95             a.print( System.out );
96         }
97     }
98 
99 
100 
101 
102 //    public static void main(String [] _args)
103 //    {
104 //        String args[] = {
105 //            "-TimeOut", "3600000",
106 //            "-tb", "java_complex",
107 //            "-o", "graphical.PostscriptCreator",
108 ////            "-DOC_COMPARATOR_INPUT_PATH", "D:\\temp\\input",
109 ////            "-DOC_COMPARATOR_OUTPUT_PATH", "D:\\temp\\output",
110 ////            "-DOC_COMPARATOR_REFERENCE_PATH", "D:\\temp\\output\\ref",
111 ////            "-DOC_COMPARATOR_PRINT_MAX_PAGE", "9999",
112 ////            "-DOC_COMPARATOR_GFX_OUTPUT_DPI_RESOLUTION", "180",
113 ////            "-DOC_COMPARATOR_HTML_OUTPUT_PREFIX", "http://so-gfxcmp-lin.germany.sun.com/gfxcmp_ui/cw.php?inifile=",
114 //////            "-DOC_COMPARATOR_REFERENCE_CREATOR_TYPE", "PDF",      /* default: "OOo" */
115 //////            "-DOC_COMPARATOR_REFERENCE_CREATOR_TYPE", "msoffice", /* default: "OOo" */
116 //////            "-OFFICE_VIEWABLE", "false",
117 ////            "-AppExecutionCommand", "\"C:/home/ll93751/staroffice9_DEV300_m25/Sun/StarOffice 9/program/soffice.exe\"  -norestore -nocrashreport -accept=pipe,name=ll93751;urp;",
118 //////            "-NoOffice"
119 //            "-DOC_COMPARATOR_PRINT_MAX_PAGE","9999",
120 //            "-DOC_COMPARATOR_GFX_OUTPUT_DPI_RESOLUTION","180",
121 //            "-DOC_COMPARATOR_HTML_OUTPUT_PREFIX","http://so-gfxcmp.germany.sun.com/gfxcmp_ui/cw.php?inifile=",
122 //            "-DOC_COMPARATOR_REFERENCE_CREATOR_TYPE","OOo",
123 //            "-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",
124 //            "-DISTINCT","2008-06-27_13-39-09_d6f22d4c-958d-10",
125 //            "-TEMPPATH","//so-gfxcmp-lin/gfxcmp-data/wntmsci/temp/2008-06-27_13-39-09_d6f22d4c-958d-10/34715",
126 ////            "ConnectionString","socket,host=localhost,port=8101",
127 //            "-OFFICE_VIEWABLE","true",
128 //            "-wntmsci.DOC_COMPARATOR_INPUT_PATH","\\\\so-gfxcmp-lin\\doc-pool\\LLA_test\\issue_79214.odb",
129 //            "-wntmsci.DOC_COMPARATOR_OUTPUT_PATH","\\\\so-gfxcmp-lin\\gfxcmp-data\\wntmsci\\convwatch-output\\LLA_test\\DEV300_m11",
130 //            "-wntmsci.AppExecutionCommand","\"C:\\gfxcmp\\programs\\staroffice8_DEV300_m11\\Sun\\StarOffice 9\\program\\soffice.exe\"  -norestore -nocrashreport -accept=pipe,name=ll93751;urp;",
131 //            "-wntmsci.AppKillCommand","\"C:\\bin\\pskill.exe soffice.bin;C:\\bin\\pskill.exe winword;C:\\bin\\pskill.exe excel\"",
132 //
133 //        };
134 //
135 //        org.openoffice.Runner.main(args);
136 //    }
137 
138 }
139